Destination address and the source address in the ARP address answer

Source: Internet
Author: User

Address Resolution Protocol ARP: 1. Why Address Resolution Protocol is required. usually a host to the B host to send data, a host generally know the IP address of Host B, light has an IP address can send data. No, in the network interface layer, the host located inside the LAN is communicating through the MAC address, so we should be able to turn the given IP address into a MAC address, address Resolution Protocol is to solve this problem. 2. How to obtain the MAC address of the other host by the address Resolution protocol based on the IP address of the other host. In fact, the Address Resolution Protocol ARP is for the network interface layer service, because the network interface layer to transmit data when the other's MAC address. However, we must complete the address Resolution Protocol at the network level, because the IP address is visible only to the network layer and the above layers, which are transparent to the layers below the network layer. format of the ARP datagram:
Some people say that the source address, destination address, and ARP address of the Ethernet header are duplicated in the source address and destination address. The answer is. If the link layer is not Ethernet, the header is still needed. For example, the ARP Address Resolution Protocol: A host sends data to Host B, the IP address of a host is ip1, the hardware address (MAC address) is the IP address of the M1,B host is IP2, and the hardware address is m2 (unknown). Get the hardware address of Host B through the IP address of Host B. The datagram format for the ARP request is:



Tomson Times Jian Shen http://bulo.hujiang.com/u/69068576/Tomson http://www.juexiang.com/diaryBook.php?uid=1076920
Tomson Times Jian Shen http://www.juexiang.com/detail/60955994497.html
Tomson Times Jian Shen bulo.hujiang.com/u/69068576/
Tomson Times Jian Shen www.juexiang.com/diaryBook.php?uid=1076920

Dogwood powder such as www.juexiang.com/detail/60955994497.html


at this point, the two hosts can communicate with each other. Then the problem again, the next time a host and B host to communicate (or other host to the B host to send data), or need to make the ARP protocol to obtain the MAC address of Host B. Therefore, in the network layer, there will be a cache, used to store the host's IP address to the hardware address mapping, so the next time you need to communicate with the Host B, you just have to look in the ARP cache for the hardware address of B. However, the hardware address of B is always the same. If once the network adapter of B suddenly broke down, B changed one immediately, then the hardware address of B changed, so the data in the ARP cache is invalid data, so the data in the ARP cache needs to be updated constantly.
The current ARP cache can be viewed through the arp-a command, or the IP address and hardware address of the current machine can be viewed through the ifconfig command.
note: ARP resolves a mapping problem for the same LAN internal IP address and hardware address. If the source host and destination host is not within the same LAN, the address can not be converted (at the time of the ARP request, only all hosts inside the LAN can receive the request, so the destination host is unable to receive the ARP request), the workaround: Router: is a device that works on the network layer and has the function of a switch. Assume that only one router R is required between the source and destination hosts. The source host sends to the destination host's datagram through the router R to forward, the source host needs to resolve the router's IP address to the hardware address, then sends the IP datagram to the router R, at this time the router r resolves the destination host's IP address to the hardware address, thus also realizes the address conversion.
several typical scenarios for using ARP: (1) The sender is the host, the receiver is the same LAN inside the other host, at this time the host of the sender in the form of broadcast in the sender's local area network issued ARP request, directly find the destination host hardware address; (2) The sender is the host, the receiver is the other host in different networks, at this time, the sender host through the router to convert; (3) The sender is a router (R1), the receiver is the router R1 directly connected to a network host, then R1 through the ARP Request packet, find the receiver host; (4) The sender is the router R1, the recipient is not directly connected with the R1 network, then R1 send a request, in turn, by reaching the receiver host of all routers, find the hardware address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.