ARP – Address Resolution Protocol is a tcp ip protocol which works at the tcp/ip layer 1. The protocol is used to find the mac-address of a device , from an IP address. Refer the below diagram -
Assume that PC1 with IP address 192.168.1.4 pings PC2 with IP address 192.168.1.2
The following are the sequence of events which would happen on 192.168.1.4
1. The ping request initiated by PC1 would be encapsulated in an ethernet frame to be sent to PC2.
2. For constructing the ethernet frame, the source and destination mac-address would be required.
3. The source mac-address would be PC1′s mac-address and the destination mac-address would be PC2′s mac-address.
4. Initially, the ARP cache, on PC1 would be looked into , to check if the mac-address corresponding to the IP address of PC2 is available. If not, an ARP request would be sent. If yes, the ARP request would not be sent.
5. Assuming that the ARP cache does not have the necessary information, an ARP request is sent . The ARP request is a broadcast frame.
Observe the destintaion mac-address of the ARP Request frame (Dst: ). FF-FF-FF-FF-FF-FF signifies broadcast
The target mac-address field is empty. The target IP address is 192.168.1.2, the mac-address of which is to be known.
6. Once, 192.168.1.2 receives the ARP request, it would process the ARP Reply and sent it to the mac-address which has requested for it, which is PC1′s mac-address (Dst:). This is not broadcast. PC2′s mac-address is updated in the sender mac-address field in the ARP Reply
7. Once the mac-address of PC2 is known , the ping request from PC1 to PC2 can be sent in the ethernet frame. This is shown in frame no 25 in the above diagram.