This article is reprinted from the WeChat public account "Feitian Veal", written by Feitian Veal. Please contact Feitian Veal public account for reprinting this article. A postman brought a letter with a detailed address to the classroom. The recipient was Xiao Ming. There was no one with the same name in the classroom. The postman asked, "What is Xiao Ming's student number?" Xiao Ming stood up and answered "12345". Then Xiao Ming sat down. Then the postman said, "Student number 12345, come and get the letter." Xiao Ming stood up and went to get the letter. It seems a bit redundant? question: When a data packet arrives at the LAN, it can be directly sent to the corresponding IP address host. Why do we need to ask for the MAC address of the corresponding IP host? Or to ask it another way: Since we have an IP address to uniquely identify the computer, why do we need a MAC address? First, let me briefly explain the purpose of the data link layer to which the MAC address belongs and the network layer to which the IP address belongs: When two computers communicate in a computer network, it is impossible for there to be only one data link, right? It will go through many data links and may also go through many communication subnets. Then the task of the network layer is to select appropriate inter-network routing and switching nodes to ensure timely transmission of data. Then, it is important to understand that when a computer communicates with another computer on the network, it actually needs to know three addresses:
The IP address is responsible for the starting address and the end address, and the MAC address is responsible for the next hop address. Combining these two points, let's summarize the relationship between the data link layer and the network layer: In layman's terms, the role of the data link layer is very simple. It is brainless and is only responsible for transmitting data between two adjacent nodes. It does not know the final destination of the data it transmits. The network layer is its brain. The network layer is responsible for specifying the starting address and destination address, and telling the data link layer which route to take. As shown in the figure below, the network layer tells the 1-2-3 route, then the data link layer will find 1, 2, and 3 in sequence according to the MAC address and transmit data between them: 1) The network layer specifies which host ("source IP address") the data is sent from and to which host ("destination IP address"). The source IP address and destination IP address will not change during the transmission process. 2) The data link layer transmits data in intervals based on the MAC address. The starting address in each interval is the "source MAC address", and the destination address in each interval is the "destination MAC address". Obviously, as data is transmitted, the source MAC address and the destination MAC address will continue to change. Here is another vivid example: We regard the data link layer as a passenger (a robot without a brain) who takes a high-speed train from Suzhou to Nanjing, transfers to Beijing in Nanjing, and then transfers to Tibet in Beijing. The network layer is equivalent to the staff at each station. Every time the robot without a brain at the data link layer transfers, the network layer will buy a ticket with the next MAC address for it. Therefore, even if the data link layer (passenger) does not know where to go, it does not matter. The staff (network layer) will give you guidance: If there is no MAC address, only the IP address, can these things be accomplished? Theoretically, if there are enough IP addresses and the switch supports forwarding based on IP addresses, we only need to add a "next hop IP address" field in the IP datagram, and the MAC address is indeed not necessary. But, from a macro perspective, IP addresses only manage the superstructure, i.e., route planning, and the underlying specific logic is left to the MAC address. This is actually in line with the layered concept of the TCP/IP protocol system! Therefore, this design is not a one-shot deal, but is designed to meet the most fundamental design concept. |
<<: HTML page basic structure and loading process
>>: Why is your broadband speed never as fast as your operator says?
At present, my country's 5G development is ac...
January 17, 2018? F5 Networks (NASDAQ: FFIV) toda...
[[387801]] This article is reprinted from the WeC...
Nowadays, the number of 5G package users and 5G m...
Digital-vm has released a 40% discount code that ...
[[421462]] The convergence of IoT and 5G is a gam...
[[416546]] The formation of computer network arch...
Another year has passed, winter has gone and spri...
Many friends are sensitive to traffic and feel th...
Last week, the Ministry of Industry and Informati...
Some time ago, I was busy with a robot communicat...
Just a few years ago, a global mobile private net...
RAKsmart is a Chinese-owned computer room, provid...
Data released by the Ministry of Industry and Inf...