Introduction
Address Resolution Protocol (ARP) is a process of mapping a dynamic IP address to a permanent physical machine (MAC)address in a local area network. The job of ARP is essentially to translate 32-bit addresses to 48-bit addresses and vice versa. This is necessary because IP addresses in IP version 4 (IPv4) are 32 bits, but MAC addresses are 48 bits.
The MAC address exists in Layer 2 of the OSI model, the data link layer. The IP address exists in Layer 3, the network layer. Thus, ARP works between Layers 2 and 3 of the OSI Model.
Also read, Basic Networking Commands
Working of ARP
- The IP address locates a device on a local area network. Suppose a host wants to send a packet to another host in the LAN, it needs a MAC address to identify the actual device. At first, it checks its ARP cache to find if the IP to MAC address mapping already exists. If it does, then a new ARP request is not sent. If the translation does not exist, the request for network addresses is sent.
- ARP broadcasts a request packet to all the nodes on the LAN, asks if any of the nodes are using that particular IP address, and asks for the MAC address of that particular device.
- When a node identifies the IP address as its own, it sends a reply so ARP can update the cache for future use and proceed with the communication.
- ARP cache size is limited, and it cleans all entries periodically to free up space. Addresses try to stay in the cache for only a few minutes. Frequent updates enable other devices in the network to see when a physical host changes their requested IP addresses. In the cleaning process, unused entries are deleted and any unsuccessful attempts to communicate with computers that are not currently powered on.
ARP Terms
- ARP Cache: After resolving the MAC address, the ARP sends it to the cache stored in a table to use in the future. The following communications can use the MAC address from the table.
- ARP Cache Timeout: The time for which the MAC address in the ARP cache can reside.
- ARP request: The broadcasting of a packet over the network to validate whether it reaches to the destination MAC address or not. The broadcasting of the packet is called an ARP request.
- ARP response/reply: The MAC address response that the source receives from the destination aids in further communication of the data. This response is called the ARP response.