ARP – Address Resolution Protocol
Address Resolution Protocol is a network layer protocol used to map an IP address to a hardware address (aka MAC address or Physical address) of a system. To send a data packet destined for a particular host on a network, the gateway must know the physical address of the receiving system.
How does ARP works
When an incoming packet arrives at the gateway of local area network for which the packet is destined, the gateway asks the ARP program to find the physical address of the system with matching IP address. The ARP program looks into the ARP cache and if found returns it to the gateway.
If it doesn’t locate the corresponding physical address, the ARP program broadcasts a request packet to all the machines in the network to look for a machine with that particular IP address. A machine that recognizes the IP address as its own returns its physical address to the gateway. This address is saved in the ARP cache of gateway for future references.