Address Resolution Protocol (ARP), its need, and its working

Address Resolution Protocol (ARP), its need, and its working

ARP

Address Resolution Protocol (ARP) is an IPv4 protocol used to resolve the MAC address of a specific destination host when its logical address (IP address) is known. This is necessary because the MAC address is needed to send frames to the correct destination device on a local Ethernet network.

In simple terms, ARP connects an ever-changing IP address to a fixed physical address, also known as a media access control (MAC) address, in a local area network.

On a local Ethernet network, a network interface card (NIC) only accepts a frame if the destination address is either a broadcast MAC address or corresponds to the MAC address of the NIC.

A logical address (IP address) is used to identify the destination server or clients, as well as other types of network devices like routers and switches.

However, these logical addresses are not enough to deliver the packets to the desired destination hosts. These addresses are used by the network layer to route packets to the correct destination network, while physical addresses are used by the data link layer to deliver packets to the correct destination host within that network.

Need of ARP

To deliver packets to the correct destination device, the network layer relies on ARP to map the IP address to the corresponding MAC address. This is because the network layer does not know about MAC addresses. ARP sends a broadcast message to the network to ask which device has the IP address being sought, and the device with that IP address responds with its MAC address.

Therefore, ARP is a crucial protocol for allowing devices on a local network to communicate with each other using logical addresses (IP addresses) and physical addresses (MAC addresses).

Working

ARP has three main steps for discovering and storing the MAC address of a destination host:

  1. The sending host broadcasts a frame to the broadcast MAC address of the local network. This frame contains the logical address (IPv4 address) of the destination host.

  2. Each host on the network receives the broadcast frame and checks if the IPv4 address inside the frame matches its own configured IPv4 address. Only the host with a matching IPv4 address responds to the original sending device with its MAC address.

  3. The original sending host receives the message containing the MAC address of the destination host and stores this information in an ARP table for future use.

If the sending host already has the MAC address of the destination host in its ARP table, it can directly send frames to that host without sending an ARP request. It is important to note that ARP messages rely on broadcast frames, so all hosts must be in the same broadcast domain for ARP to work properly.

The following video shows a simulation of the procedure mentioned above.


I hope you now understand how ARP works and why ARP is necessary. This is primarily for my notes, but I thought I'd post it online in case anyone is confused. If I'm mistaken somewhere, please correct me.

Adios, Amigos. Hasta La Vista.