ARP protocol

Address Resolution Protocol (English: AddressR strong>esolution Protocol, abbreviation: ARP) is a network transmission protocol that resolves the network layer address to find the data link layer address .

It is stipulated in the Ethernet protocol that if a host in the same LAN communicates directly with another host, the MAC of the target host must be known address. In the TCP/IP protocol, the network layer and the transport layer only care about the IP address of the target host. This results in that when the IP protocol is used in the Ethernet, the Ethernet protocol of the data link layer is connected to the data provided by the upper IP protocol, and only contains the IP address of the destination host. Therefore, a method is needed to obtain the MAC address of the destination host based on its IP address. This is what the ARP protocol does. The so-called address resolution is the process by which the host converts the target IP address into the target MAC address before sending the frame.

There is an ARP cache table in every computer or router with TCP/IP protocol installed. The IP address in the table corresponds to the MAC address, as shown in the following table.

share picture

Use host A (192.168.38.10 ) Send data to host B (192.168.38.11) as an example.
1. When sending data, host A will look for the target IP address in its ARP cache table. If you find it, you know that the target MAC address is (00-BB-00-62-C2-02), and you can directly write the target MAC address into the frame and send it.
2. If the corresponding IP address is not found in the ARP cache table, host A will send a broadcast (ARP request) on the network, and the target MAC address is “FF.FF.FF.FF.FF.FF” “, which means to send such a query to all hosts in the same network segment: “What is the MAC address of 192.168.38.11?”

3. Other hosts on the network do not respond to ARP queries, only host B Upon receiving this frame, it will respond to host A (ARP response): “The MAC address of 192.168.38.11 is 00-BB-00-62-C2-02”, and this response is in unicast mode. In this way, host A knows the MAC address of host B, and it can send information to host B. At the same time, it also updates its own ARP cache, and next time it sends information to host B, it can directly look it up in the ARP cache table.

The ARP cache table uses an aging mechanism. If a row in the table is not used for a period of time, it will be deleted, which can reduce the length of the cache table and speed up the query.

Leave a Comment

Your email address will not be published.