Address Resolution Protocol

Address Resolution Protocol – Everything you need to know

What is ARP(Address Resolution Protocol)?

Address Resolution Protocol is a layer 2 protocol that finds MAC address of unknown host from its known IP address. The IP address as well as the MAC address is required for this communication. The Data link layer is responsible for MAC address furthermore the Network layer is responsible for IP address. ARP can also be considered as conversion from logical address to physical address. The ARP Protocol is especially used in IPv4 environment.

ARP chiefly has two process ARP request and ARP response. The ARP request is Broadcast, but the ARP response is Unicast. ARP request is sent when the host want to know about the destination mac address. ARP response is the reply to ARP request sending the MAC details. One unique feature of ARP is that it is never generated for the device of other network regardless.

Types of ARP :

  • ARP
  • Proxy ARP
  • Reverse ARP
  • Gratituous ARP

Format of ARP Packet :

ARP Packer

In the above ARP Request we have 9 fields, Hardware type is 16 bit field. This field defines the network type that the local network needs to transmit the ARP message. For example ethernet, IEEE 802 Network, HDLC, Fibre channel, etc. The protocol type is a 16-bit field used to specify the type of protocol.

The size of the hardware length field is 8-bit. Moreover this field specifies the length of the physical address in bytes. The size of the protocol length field is 8-bit long. Consequently It defines the length of the IP address in bytes. It is a 16-bit field that determines the type of ARP packet. Mainly there are two types of packets, i.e., ARP request and ARP reply.If it is a ARP request the opcode is 1 and if it is ARP reply then the opcode is 2.

ARP Message Type:

Following are some of the other messages types of ARP and their respective opcode.

ARP Message Type

Senders MAC Address field is set explicitly with the MAC address of the sender device. The Senders IP contains the information about the IP address of the ARP request generating device. For the ARP request packet, receivers MAC address field contains all zeros because the sender does not know the physical address of the receiver.

Connected Devices

So, let us consider 3 devices with IP address and mac address. The devices are likewise connected to a switch as shown in the figure. If PCA wants to talk to PCC, PCA only knows the IP address of PCC but not the MAC address. Switch has its own CAM(Content Addressable Memory) table mapping ip addresses to MAC address as shown below.

Now PCA generates a ARP request specifically as shown below:

ARP Request

The Source IP, destination IP, source MAC are all in all included along with the ARP request. The destination MAC is set to broadcast because the destination is unknown. This message then broadcasted. The PCB and PCC both check these message. PCB rejects the message as it checks the destination IP is not it’s IP so it drops that message. Now as PCC receives the message it responses PCA with ARP reply.

ARP reply

ARP reply is unicast. The reply message sends ARP reply to PCA and then the CAM table of switch is updated and PCA and PCC can communicate with each other.

AuthorsShashank Ghimire and Subin Shrestha

To read more from us do read our additional blog posts.