Analysis of TCP/IP protocol stack (1) 1. layer: TCP/IP is divided into four layers: link layer, network layer, transmission layer, and application layer. The most critical two layers are the network layer and transmission layer. The network layer provides point-to-point services for IP addressing, the Transport Layer implements end-to-end services for reliable TCP data transmission and UDP data transmission. Www.2cto.com 2. encapsulation and sub-use: the application layer data is transmitted through the Protocol Stack and encapsulated at different layers. Each layer adds the header information of this layer to the data as follows:
Sub-Use: when the target machine receives an Ethernet data token, it will transmit the data layer by layer and remove the header of each layer of the Protocol, each layer determines the Protocol that the data is transmitted to the upper layer based on the protocol fields in its header. For example, the protocol fields in ip datagram are of four types: TCP, UDP, ICMP, IGMP, there is an 8-bit protocol domain in the ip header. 1 indicates ICMP, 2 indicates IGMP, 6 indicates TCP, and 17 indicates UDP. ip data decides to pass the data to ICMP based on the value in the Protocol domain, IGMP, TCP, and UDP. The other layers have similar Protocol domains. When the transport layer transmits data to the application layer, it determines the application layer software to be transmitted Based on the port number in the header. The sub-Use of the ethereum, for example:
3. RFC: All official Internet standards are published in the Request For Comment document. For more information about the protocol standards, see the RFC documentation. Www.2cto.com 4. Port Number: both TCP and UDP use 16-bit port numbers to identify applications. The well-known port numbers range from 1 ~ Between 255, 256 ~ The port number between 1023 and 1024 is occupied by the UNIX system, and the temporary port number allocated to the client by TCP/IP is between and ~ In the range of 5000. An interface on the internet is identified by an IP address. The domain name system provides a ing between the host name and the IP address. The port number is used to identify the applications that communicate with each other. The server uses a well-known port number, and the client uses a temporary port number. References: TCP/IP (Volume 1)