ARP (Address Resolution Protocol)
What it is for
ARP (Address Resolution Protocol) finds the MAC address for an IP address: given an IP, find the MAC.
The upper layer sends to 192.168.1.11, but an Ethernet frame needs a destination MAC. ARP broadcasts a request "who has 192.168.1.11?" on the local network, and the host that owns that IP replies with its MAC.
Two rules
An ARP request is broadcast; an ARP reply is unicast.
ARP resolves the MAC of the next hop:
· Destination on the same subnet: resolve the destination host's MAC;
· Destination on another subnet: resolve the gateway's MAC; the packet's destination IP stays the far host.
So layer-2 addresses change at every hop; layer-3 addresses stay the same end to end.
Common misconceptions
Servers on other subnets never appear in the ARP table. When reaching a host on another subnet, the ARP table holds only the gateway's MAC.
ARP does not broadcast periodically. It sends a request only on a cache miss or when an entry expires.
ARP has no authentication. Any host can claim to own any IP, and receivers update their cache without checking; that is how ARP spoofing works.