ARP

       ARP (Address Resolution Protocol) is used to resolve the hardware address used at the data link layer from the IP address used at the network layer. Solve the problem of mapping the IP address and hardware address of the host or router in the same LAN.

       Each host is provided with an ARP cache (ARP cache), which contains the mapping table from the IP addresses of the hosts and routers on the local area network to the hardware addresses. These are some addresses that the host currently knows. And this mapping table will be updated frequently (add or delete over time).

       The following example illustrates how the ARP protocol works:

      When host A wants to send IP data to a host B on the local area network, it first checks whether there is the IP address of host B in its ARP cache. If so, find out the corresponding hardware address in the ARP cache, write the hardware address into the MAC frame, and then send the MAC frame to the hardware address through the LAN.

      There is also a possibility that the IP address of host B cannot be found. This may be that host B has just entered the network, or it may be that host A has just powered up and its cache is still empty. In this case, host A will automatically run ARP, and then follow this procedure to find out the hardware address of host B.

       (1) The ARP process broadcasts and sends an ARP request packet on the local area network.  The main content of the ARP request packet is: "My IP address is... and the hardware address is.... I want to know the hardware address of the host with IP address...."

       (2) The ARP process running on all hosts on the local area network receives this ARP request packet.

       (3) Host B accepts the ARP request, writes the address mapping of host A into host B's own cache, sends an ARP response packet (unicast transmission), and writes its own hardware address. The rest of the hosts in the local area network are ignored.

       (4) After host A receives the ARP response packet from host B , it writes the mapping from the IP address of host B to the hardware address in its ARP cache .

timg.jpg

       ARP sets a time-to-live for every mapping stored in the cache. Items that exceed the time-to-live are removed from the cache.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325857341&siteId=291194637
ARP