Protocol notes for this page (click to expand)

ARP (Address Resolution Protocol)

What it is for

The upper layer says "send to 192.168.1.11", but Ethernet knows only MACs -- a translation step is missing.

ARP is that step: given an IP, find the MAC. The method is plain -- broadcast "who has 192.168.1.11?" locally and let that host answer.

Two rules

★★★ The question is broadcast; the answer is unicast.

★★★ Who you ARP for depends on the next hop, not the final destination:

· Destination on my subnet -> ARP that host;
· Destination elsewhere -> ARP the gateway, while the packet's destination IP stays the far host.

★★ Hence: layer-2 addresses change every hop, layer-3 addresses do not (scenario 3 on the right).

★ Common misconceptions

★★★ "My ARP table should show the server I am reaching" -- across subnets it never will; you only see the gateway's MAC. The number-one misconception.

★★ "ARP broadcasts periodically" -- it does not; only on a cache miss or expiry.

★★ "ARP has some security" -- none. Anyone can claim any IP and receivers update their cache without checking (that is ARP spoofing).