01Overview The term Ethernet generally refers to a standard jointly announced by Digital Equipment Corp., Intel Corp., and Xerox in 1982. It is the main local area network technology used by TCP/IP today. A few years later, the IEEE (Institute of Electrical and Electronics Engineers) 802 committee announced a slightly different set of standards, with 802.3 for the entire CSMA/CD network, 802.4 for the token bus network, and 802.5 for the token ring network. In the early days of the Internet, the NCP protocol was used to interconnect hosts. This protocol itself has many defects, such as: it cannot interconnect different hosts, cannot interconnect different operating systems, and has no error correction function. In order to improve this shortcoming, the big guys came up with the TCP/IP protocol. Now almost all operating systems have implemented the TCP/IP protocol stack. TCP/IP is not a single protocol, but a general term for a protocol family. It includes the IP protocol, IMCP protocol, TCP protocol, and the more familiar HTTP and FHP protocols. First, let's look at the Ethernet data structure Note that the data length is 46~1500 From the physical layer point of view, a complete Ethernet frame has 7 fields. In fact, the first two fields (preamble and SFD) are not real Ethernet data frames. They are added by the network card when sending Ethernet data on the physical layer in order to achieve correct transmission at the bottom layer. The destination address, source address, and length/type in the figure above belong to the Ethernet header. Special note: The destination address and source address above are MAC, not IP!!!! About the OSI seven-layer model: application layer, presentation layer, session layer, transport layer, network layer, data link layer, and physical layer, as shown below 02TCP/IP four-layer model The OSI reference model developed by ISO is too large and complex, which has attracted many criticisms. In contrast, the TCP/IP protocol stack developed by technicians has been more widely used. The following figure is a comparison diagram of the TCP/IP reference model and the OSI reference model. The TCP/IP reference model is divided into four layers: application layer, transport layer, network interconnection layer and host to network layer In the TCP/IP reference model, the session layer and presentation layer in the OSI reference model are removed (the functions of these two layers are merged into the application layer). At the same time, the data link layer and physical layer in the OSI reference model are merged into the host-to-network layer. The following introduces the main functions of each layer. 1. Host to network layer In fact, the TCP/IP reference model does not really describe the implementation of this layer, but only requires that an access interface be provided to its upper layer, the network interconnection layer, so that IP packets can be transmitted on it. Since this layer is not defined, its specific implementation method will vary depending on the network type. 2. Network interconnection layer The Internetworking layer is the core of the TCP/IP protocol stack. Its function is to send packets to the target network or host. At the same time, in order to send packets as quickly as possible, it may be necessary to transmit packets along different paths at the same time. Therefore, the order in which packets arrive may be different from the order in which they are sent, which requires the upper layer to sort the packets. The Internet layer defines the packet format and protocol, namely the IP protocol (Internet Protocol). In addition to completing the routing function, the network interconnection layer can also complete the task of interconnecting different types of networks (heterogeneous networks). In addition, the network interconnection layer also needs to complete the congestion control function. 3. Transport layer In the TCP/IP model, the function of the transport layer is to enable peer entities on the source host and the target host to conduct conversations. Two protocols with different service qualities are defined in the transport layer, namely: Transmission Control Protocol TCP (transmission control protocol) and User Datagram Protocol UDP (user datagram protocol). The TCP protocol is a connection-oriented, reliable protocol. It sends the byte stream sent by a host to other hosts on the Internet without error. At the sending end, it is responsible for dividing the byte stream sent from the upper layer into message segments and passing them to the lower layer. At the receiving end, it is responsible for reassembling the received message and submitting it to the upper layer. The TCP protocol also handles end-to-end flow control to prevent the slow receiving end from not having enough buffer to receive the large amount of data sent by the sender. The UDP protocol is an unreliable, connectionless protocol, which is mainly suitable for situations where message sorting and flow control are not required. 4. Application layer The TCP/IP model merges the functions of the session layer and presentation layer in the OSI reference model into the application layer. The application layer introduces different application layer protocols for different network applications, including those based on TCP, such as File Transfer Protocol (FTP), Virtual Terminal Protocol (TELNET), Hypertext Transfer Protocol (HTTP), and those based on UDP. The information of each row is: Frame: Overview of the data frame at the physical layer Ethernet II: Data link layer Ethernet frame header information Internet Protocol Version 4: Internet layer IP packet header information Transmission Control Protocol: The data segment header information of the transport layer T, here is TCP Hypertext Transfer Protocol: application layer information, We will use a graphic representation to illustrate the functions of several commonly used protocols. IP:I want to send data to 192.168.0.127 UDP:I want to send a datagram on the port N TCP:I want to send data in a reliable way on the port N (reliable: reliable) ARP:who knows 192.168.0.127's MAC address? RARP:who knows 21.21.12.21.21.12's IP address? ICMP:I send or receive queries or error message DHCP: I want to get an IP address DNS:what is the IP address of www.baidu.com? This article is reprinted from the WeChat public account "Zhixiao Programming", which can be followed through the following QR code. To reprint this article, please contact the WeChat public account "Zhixiao Programming". |
>>: How to redirect HTTP to HTTPS in Nginx
In the era of globalization, airports have become...
[51CTO.com original article] A financial client o...
According to Mobile World Live, Deutsche Telekom ...
[[337542]] On August 11, 2020, the DevRun Develop...
According to the latest statistics from Omdia, th...
On September 28, hackers used Facebook's secu...
[51CTO.com original article] On August 7, 2017, N...
[[433205]] Suppose you are climbing a staircase. ...
A data center is a complex organization with many...
As early as this year's "Two Sessions&qu...
HostXen sent the latest information, the platform...
5G provides a large number of new applications fo...
In modern IT environments, data backup is a vital...
The 2022 Winter Olympics will allow everyone to e...
In the development history of China's ICT mar...