TCP/IP protocol family architecture and its main protocols

1. Main four-layer protocol system

Note: The order is from bottom to top

Existing in kernel space:

  1. data link layer
  2. Network layer
  3. transport layer

Existing in user space:

  1. List content

2. A simple understanding of the four-layer protocol system

1. Data link layer

(1) The commonly used protocols are ARP and RARP, where RAP obtains a physical address based on an IP address, while RARP is the opposite, obtaining an IP address through a physical address.

(2) ARP purpose: The data link layer finds a machine through a physical address, such as a MAC address. Therefore, the network needs to convert the destination IP address into a physical address in order to be able to use the services provided by the data link layer.

(3) RARP use: In some workstations without storage devices, because they cannot record their own IP addresses, they can only apply for and query their own IP addresses through their own physical addresses.

2. Network layer

(1) The main protocols used in the network layer are the IP protocol and the ICMP protocol. The IP protocol is the Internet protocol, the core protocol of the network layer, followed by the Internet Control Message Protocol, which is an important supplement to the IP protocol and is mainly used to detect network connections. Implement routing and forwarding of data packets.

ICMP message format

8-bit type 8-digit code 16-bit checksum

Note: The content of the message mainly depends on the type of the message

(2) The 8-bit type is mainly used to distinguish the type of the message, and the ICMP message is divided into two categories. One of them is an error message, which is responsible for responding to network errors; the other is a query message, which is used to query network information (such as Ping), and some ICMP messages also use 8-bit codes to subdivide different conditions. The ICMP message uses a 16-bit checksum field to perform cyclic redundancy check to see if the message is damaged during transmission.

Note: The ICMP protocol is not a network layer protocol in the true sense, just because it uses the services provided by the IP protocol at the same layer


transport layer

The transport layer provides communication between two machines from one end to the other, and only concerns its origin and destination. Unlike the network layer, the network layer is concerned with how data packets are transferred.

(1) The main protocols of the transport layer are TCP protocol, UDP protocol, SCTP protocol. The TCP protocol is a stream-based protocol with no size limit, and is a reliable face-to-face connection service. It can say that data flows continuously from one end of the data to the other, without limitation, by writing things into the data stream byte by byte. However, UDP is the opposite of TCP. UDP is a connectionless, unreliable, packet-based service. Its sending method is limited, each UDP data packet has a limited length, and the receiving end can only read it once, otherwise the data will be lost.

(2) SCTP protocol is a relatively new protocol, designed for the transmission of telephone signals on the Internet.


application layer

(1) The application layer is responsible for processing the logic of the application. The difference is that the data link layer, the network layer, and the transport layer are all responsible for dealing with network details, which are done in the kernel, and only the application layer is implemented in user space. The reason is: if the application layer is also implemented in the kernel, it will make the kernel huge, only a few server programs are implemented in the kernel, and such code does not need to switch back and forth between user space and kernel space.

(2) There are many application layer protocols, such as ping, telnet, OSPE, DNS

Note: Application layer protocols or programs may sometimes skip the transport layer and use the services provided by the network layer directly

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326362501&siteId=291194637