본문 바로가기

나의 FE피봇이야기/Dev_Knowledge

[Lecture]컴퓨터 네트워크 5강 : Message, Layer Detail

5 Layer Internet Protocol Stack

  • 각 계층은 아래 계층의 서비를 제공받는 Service User / 윗 계층에게 서비를 제공하는 Service Provider.
  • PDU(Protoco Data Unit)은 각  Protocol이 처리하는 기본 단위. 단 모든 층의 데이터 단위가 다름

 

Application (Message)

Transpor (Segment)

Network(Packet, Datagram) : 출발지로부터 도착지까지   Routing 수행

Link (Frame) : 한   Hop을 지나가는 일 수행

Physical :

 

 

Oracle

 

 

 

4 : Application Layer: Where a Communication Originates

The packet's history begins when a user on one system sends a message or issues a command that must access a remote system. The application protocol formats the packet so that the appropriate transport layer protocol, TCP or UDP, can handle the packet.

Suppose the user issues an rlogin command to log in to the remote system, as shown in Figure 1-1. The rlogin command uses the TCP transport layer protocol. TCP expects to receive data in the form of a stream of bytes that contain the information in the command. Therefore, rlogin sends this data as a TCP stream.

3 : Transport Layer: Where Data Encapsulation Begins(Port, Reliable)

When the data arrives at the transport layer, the protocols at the layer start the process of data encapsulation. The transport layer encapsulates the application data into transport protocol data units.

The transport layer protocol creates a virtual flow of data between the sending and receiving application, differentiated by the transport port number. The port number identifies a port, a dedicated location in memory for receiving or sending data. In addition, the transport protocol layer might provide other services, such as reliable, in order data delivery. The end result depends on whether TCP, SCTP, or UDP handles the information.

1-1) TCP Segmentation

TCP is often called a “connection-oriented” protocol because TCP ensures the successful delivery of data to the receiving host. Figure 1-1 shows how the TCP protocol receives the stream from the rlogin command. TCP then divides the data that is received from the application layer into segments and attaches a header to each segment.

Segment headers contain sending and receiving ports, segment ordering information, and a data field that is known as a checksum*. The TCP protocols on both hosts use the checksum data to determine if the data transfers without error.

checksum:  데이터 중복 체크

1-2) Establishing a TCP Connection

TCP uses segments to determine whether the receiving system is ready to receive the data. When the sending TCP wants to establish connections, TCP sends a segment that is called a SYN (Synchronize)to the TCP protocol on the receiving host. The receiving TCP returns a segment that is called an ACK (Acknowledge) to acknowledge the successful receipt of the segment. The sending TCP sends another ACK segment, then proceeds to send the data. This exchange of control information is referred to as a three-way handshake.

 

2) UDP Packets

UDP is a “connectionless” protocol. Unlike TCP, UDP does not check that data arrived at the receiving host. Instead, UDP formats the message that is received from the application layer into UDP packets. UDP attaches a header to each packet. The header contains the sending and receiving ports, a field with the length of the packet, and a checksum.

The sending UDP process attempts to send the packet to its peer UDP process on the receiving host. The application layer determines whether the receiving UDP process acknowledges the reception of the packet. UDP requires no notification of receipt. UDP does not use the three-way handshake.

 

2 : Internet Layer: Where Packets Are Prepared for Delivery

The transport protocols TCP, UDP, and SCTP pass their segments and packets down to the Internet layer, where the IP protocol handles the segments and packets. IP prepares them for delivery by formatting them into units called IP datagrams. IP then determines the IP addresses for the datagrams, so that they can be delivered effectively to the receiving host.

IP Datagrams

IP attaches an IP header to the segment or packet's header, in addition to the information that is added by TCP or UDP. Information in the IP header includes the IP addresses of the sending and receiving hosts, the datagram length, and the datagram sequence order. This information is provided if the datagram exceeds the allowable byte size for network packets and must be fragmented.

 

1 -2 : Data-Link Layer(Network Layer): Where Framing Takes Place

Data-link layer protocols, such as PPP, format the IP datagram into a frame. These protocols attach a third header and a footer to “frame” the datagram. The frame header includes a cyclic redundancy check (CRC) field that checks for errors as the frame travels over the network media. Then, the data-link layer passes the frame to the physical layer.

 

1-1 : Physical Network Layer: Where Frames Are Sent and Received

The physical network layer on the sending host receives the frames and converts the IP addresses into the hardware addresses appropriate to the network media. The physical network layer then sends the frame out over the network media.

 

참조

  •  1 Hop 의 뜻 : '사용자 디바이스(End devices)와 라우터' or '라우터와 라우터' 사이 이동
  • 2계층에서 주로 Mac address사용, 3계층에서 주로 IP 사용
  • 사용자와 라우터 사이에 존재하는 2계층 스위치는 같은 네트워크에 포함되므로 하나의 Hop에 포함

 

 

 

Connection : Keep-alive == persistent TCP

 

Method types

HTTP/1.0

- get

- Post

- head : asks server to leave requested objact out of response

 

HTPP/1.1

- get, post, head

- Put : upload file in entity body to path specified un URL field.

- Delete : deletes file specified in the URL field.

 

HTTP Response message