In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
The content of this article mainly focuses on how the encapsulation process of the packet forwarded by the router is narrated. The content of the article is clear and clear. It is very suitable for beginners to learn and is worth reading. Interested friends can follow the editor to read together. I hope you can get something through this article!
Suppose two users connect for the first time and do not know each other's MAC address, and the router is also new.
1: now Host A wants to send data to Host B, but only knows the IP address of the other party, so it sends out the arp broadcast packet. The four elements are:
Ource IP 192.168.1.1 Universe 24
Target IP 192.168.2.2 Universe 24
Source MAC 00-11-12-21-11-11
Target MAC ff-ff-ff-ff-ff-ff
2: after receiving the RA, record the MAC address of HostA and the corresponding interface in the routing table of R1, and then reply to HostA with unicast. The four elements are
Ource IP 192.168.1.1 Universe 24
Target IP 192.168.1.2 Universe 24
Source MAC 00-11-12-21-22-22
Target MAC 00-11-12-21-11-11
3: after receiving the HostA, record the MAC address and interface number of the gateway in the arp cache table, and re-send the data frame to HostB. The four elements are:
Source IP 192.168.1.2 Universe 24
Target IP 192.168.2.2 Universe 24
Source MAC 00-11-12-21-11-11
Target MAC 00-11-12-21-22-22
4: the E0 port of RA receives the data frame to confirm that the MAC is unencapsulated for itself, and queries the routing table at the IP layer to find that the destination network segment of the packet is forwarded from the E1 port, so the packet is transferred to the E1 port, and the arp broadcast is sent on E1. The four elements are:
Source IP 10.1.1.1 Compact 24
Target IP 192.168.2.2 Universe 24
Source MAC 00-11-12-21-33-33
Target MAC ff-ff-ff-ff-ff-ff
The E1 port of 5.RB receives a broadcast to RA unicast response arp packet. The four elements are:
Ource IP 10.10.1.2 Universe 24
Target IP 10.1.1.1 Compact 24
Source MAC 00-11-12-21-44-44
Target MAC 00-11-12-21-33-33
After receiving it, 6.RA confirms the mac address and confirms that it is sent to itself, so it unencapsulates it, records the RB MAC address and interface number in the routing table, and re-encapsulates it and sends it to HOSTB. The four elements are:
Ource IP 192.168.1.1 Universe 24
Target IP 192.168.2.2 Universe 24
Source MAC 00-11-12-21-33-33
Target MAC 00-11-12-21-44-44
After receiving it, 7.RB confirms that the MAC address is itself, then unencapsulates it and transfers it to port E0. The port E0 looks up the routing table, does not find the MAc address corresponding to the destination IP, discards the packet, and sends out arp broadcasts:
Ource IP 192.168.2.1 Universe 24
Target IP 192.168.2.2 Universe 24
Source MAC 00-11-12-21-44-55
Target MAC ff-ff-ff-ff-ff-ff
8. HostB receives the broadcast, records the MAC address of RB, and unicast the response to RB:
Ource IP 192.168.2.2 Universe 24
Target IP 192.168.2.1 Universe 24
Source MAC 00-11-12-21-55-55
Target MAC 00-11-12-21-44-44
9. RB receives the arp packet, re-encapsulates the packet and sends it to HostB as a data frame:
Ource IP 192.168.1.1 Universe 24
Target IP 192.168.2.2 Universe 24
Source MAC 00-11-12-21-44-44
Target MAC 00-11-12-21-55-55
10. After receiving the data frame, HostB acknowledges the MAC and unencapsulates the received packet. At the same time, a reply packet is sent to the original address, which is similar to the process above (because HOSTB also does not know the MAC address of the HOST1).
However, because each device has recorded the connected MAC address and the corresponding port number in the previous transmission process, the program of ARP broadcast is reduced.
Thank you for your reading. I believe you have a certain understanding of "how the encapsulation process of packets forwarded by routers is". Go to practice quickly. If you want to know more about it, you can follow the website! The editor will continue to bring you better articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.