2024/03/26(4)
-
전송 계층: UDP, TCP
전송 계층전송 계층은 어플리케이션 계층 바로 아래에 위치하며, 좀 더 구체화된 개념이다. 전송 계층에서의 전송 단위는 세그먼트이며, 세그먼트는 데이터와 헤더 부분으로 나뉜다. 애플리케이션 계층으로부터 받은 메시지가 데이터 부분에 들어가고, 부가 정보가 헤더 부분에 들어간다. 전송 계층의 대표적인 프로토콜로 TCP와 UDP가 있다. UDPUDP는 비연결형 통신 방법으로, TCP와 달리 신뢰성을 보장하지 않는다. 이때 비연결형이라는 것은 다음 사진과 같이 소켓과 소켓 간의 일대일 매핑이 이뤄지지 않는 것은 말한다.즉, 송신지 소켓과 수신지 소켓이 연결되었는지 확인하지 않고 보낸다(connectionless). 그리고 TCP와 달리 전송된 세그먼트에 대한 ACK 응답을 받는 과정이 없다. 따라서 데이터가 제대..
2024.03.26 -
소켓(Socket)
소켓(Socket)소켓은 네트워크에서 프로세스 간 통신을 가능하게 하는 연결부이다. 그리고 네트워크에 연결하기 위해 정해진 규약, 즉 프로토콜에 맞게 여러 종류의 소켓이 있다(TCP 소켓, UDP 소켓 등). 운영체제는 소켓 API를 제공한다. 소켓 API는 네트워크 통신을 처리하기 위해 운영체제에서 제공하는 표준화된 함수의 집합이다. 즉, 애플리케이션이 네트워크 통신을 할 때는 반드시 소켓 API를 사용하게 된다. 애플리케이션에서 socket(), bind() 등의 소켓 API를 호출하면 해당 함수들은 내부적으로 시스템 콜을 통해 운영체제 커널에서 처리된다. 소켓을 맥락에서 이해하면 다음과 같다.소켓은 네트워크 통신을 위한 인터페이스로, 애플리케이션 계층에서 TCP 프로토콜 스택에 접근하기 위해 추..
2024.03.26 -
애플리케이션 계층: DNS
DNS, 네임서버DNS는 Domain Name System의 약자로 도메인 이름과 IP 주소를 변환하는 역할을 하는 시스템이다. DNS가 필요한 이유는 무엇일까? 사용자가 복잡한 IP 주소를 기억하는 것은 어렵기 때문이다. 따라서 사용자가 도메인 이름을 입력하면, DNS를 통해 그에 해당하는 IP 주소를 알아오는 것이다.네임서버는 도메인 이름과 그에 상응하는 IP 주소 간의 매핑 정보를 저장하고 관리하는 서버이다. 계층 구조그런데 만약 DNS를 운영하는 네임서버가 1개라면? 모든 트래픽이 하나의 서버로 몰려 IP 주소 반환 과정이 느릴 것이고, 이 서버가 다운되면 전세계 사람들이 이용하지 못하게 될 것이다. 따라서 DNS를 운영하는 네임서버는 여러 개로 구성되고, 이 서버들은 계층적인 구조로 되어 있다...
2024.03.26 -
애플리케이션 계층: HTTP
HTTP(Hypertext Transfer Protocol) 전 세계의 웹브라우저, 서버, 웹 애플리케이션은 모두 HTTP(Hypertext Transfer Protocol)를 통해 서로 통신한다. HTTP는 전 세계의 웹 서버로부터 대량의 정보를 사람들의 PC에 설치된 웹브라우저로 옮겨준다. HTTP는 Hypertext Transfer Protocol의 약자이다. 이때 하이퍼텍스트란, 텍스트인데 링크들을 포함한 텍스트를 의미한다(ex, 이미지 참조 링크, 동영상 참조 링크). 따라서 HTTP는 여러 링크들이 포함된 하이퍼텍스트를 전송하는 프로토콜이다. HTTP의 특징 TCP/IP 따라서 신뢰성 있는 데이터 전송이 보장된다. 클라이언트-서버 구조 클라이언트는 서버에게 필요한 데이터를 요청하고, 서버는 요..
2024.03.26