How the ARP Protocol Works: From IP to MAC
To deliver a frame to a host on the same local network you need its MAC address, but the application layer usually hands you only an IP address. ARP, the Address Resolution Protocol, fills that gap. How the two kinds of address divide the work is covered in MAC addresses versus IP addresses.
One full resolution
Suppose 192.168.1.10 wants to reach 192.168.1.20 and has no cache entry for it:
- Send the request. The host broadcasts an ARP request with destination MAC
FF:FF:FF:FF:FF:FF, asking who owns 192.168.1.20 and to tell 192.168.1.10. Every device in the broadcast domain receives it. - Only the owner answers. 192.168.1.20 sees the question is about itself and replies by unicast with its MAC address. Everyone else drops the request.
- Both sides record the mapping. The requester writes the answer to its ARP cache. The responder, while processing the request, also records the requester's mapping, because the request itself carried the sender's IP and MAC.
- Later frames go direct. With a cache entry in place no further broadcasts are needed.
Step three is an important property: any device that sends an ARP request announces its own mapping to the whole network. That improves efficiency and is also the root of the security problem.
Inspecting and managing the cache
# Linux
ip neigh show
# macOS / BSD
arp -a
# Windows
arp -a
Entries have a timeout, typically from tens of seconds to a few minutes on Linux, after which resolution repeats. To drop a single entry:
sudo ip neigh del 192.168.1.20 dev eth0
When troubleshooting connectivity, ip neigh output is genuinely useful. A FAILED state means the peer never answered, usually because it is offline or a firewall dropped the request. A STALE state only means the entry is due for revalidation and does not indicate a fault.
Three common variants
Gratuitous ARP. A device broadcasts its own IP-to-MAC mapping unprompted, to announce rather than to ask. It is sent when an interface comes up, an IP changes, or a failover occurs, so that caches across the network update quickly. It is also the mechanism behind address conflict detection.
ARP probe. Before committing to an IP, a host sends a probe with the sender IP set to all zeros. Any reply means the address is already taken.
Proxy ARP. A router answers ARP on behalf of hosts that are not on the local segment, so hosts on both sides believe they share a subnet. It survives mainly in particular VPN and wireless designs. Enabling it on an ordinary network is discouraged because it produces forwarding oddities that are hard to diagnose.
ARP has no authentication
This is the starting point for every ARP security discussion. The protocol was designed for trusted networks, so a reply updates the cache without any check on its origin. Anyone can claim to own the gateway's IP and pull traffic onto their own machine. That is ARP spoofing, and defences are covered in ARP spoofing and how to defend against it.
Capturing ARP is the most direct way to understand layer 2 behaviour; filter syntax is in filtering captures by MAC address in Wireshark. If a reply carries a MAC with no matching vendor, check it on the lookup page. That usually means a virtual interface or an address-randomising client.