L2 · addressing · reviewed
ARP
Address Resolution Protocol
Finds the MAC address behind an IPv4 address on the local segment, by asking everyone and trusting whoever answers.
Presenter modeEmbed this figure
Why it exists
An Ethernet frame is addressed to a MAC address. An application is addressed to an IP address. Nothing connects the two, and there is no directory that maps one to the other, so a host with a packet to send and no matching cache entry cannot construct a frame at all.
ARP fills the gap with the only mechanism available on a shared segment: ask everyone, and let the owner answer. It is nineteen paragraphs long, has no version field, no authentication and no sections, and it has been unchanged since 1982. An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet HardwareRFC 826 · INTERNET STANDARD · November 1982
The absence of authentication is not an oversight so much as a period assumption. The protocol was written for a network where everyone attached to the cable was entitled to be there.
Asking the whole segment one question
A host has an IPv4 address and needs the MAC address behind it. There is no directory, so it broadcasts and waits.
PC-A wants to send an IP packet to its gateway at 192.168.4.1. It knows the address; it has no idea what MAC address to put in the Ethernet header, and a frame cannot be sent without one. PC-A · .44: Needs MAC for 192.168.4.1. Switch. Gateway · .1. PC-B · .55.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| PC-A · .44 | host | Needs: MAC for 192.168.4.1 |
| Switch | switch | — |
| Gateway · .1 | router | — |
| PC-B · .55 | host | — |
| PC-A · .44 — Switch | link | up |
| Switch — Gateway · .1 | link | up |
| Switch — PC-B · .55 | link | up |
PC-A wants to send an IP packet to its gateway at 192.168.4.1. It knows the address; it has no idea what MAC address to put in the Ethernet header, and a frame cannot be sent without one.
What changed
- PC-A · .44: Needs → MAC for 192.168.4.1
- Emphasis on PC-A · .44
How it works
A host with an unresolved address broadcasts a 28-octet request naming the address it wants. Every device on the segment receives it; the one that owns the address replies directly to the asker. An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet HardwareRFC 826 · INTERNET STANDARD · November 1982
Both ends learn from the exchange. The request carries the asker’s own address and MAC, so the responder — and anyone else with an existing entry — updates from it. This is why one request populates caches all over the segment. An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet HardwareRFC 826 · INTERNET STANDARD · November 1982
Entries are cached with a timeout, typically four hours on a Cisco router and rather less on a host. A stale entry is not an error state; it is simply how long the protocol is willing to believe something without rechecking.
The packet has no IP header. It cannot be routed, cannot cross a subnet boundary and cannot be given a TTL — so ARP is confined to one broadcast domain, and each subnet resolves its own addresses independently. An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet HardwareRFC 826 · INTERNET STANDARD · November 1982
On the wire
Constructed examples, encoded from the field table below them — not captured traffic.
- Ethernet frame
- EtherType 0x0806. A request goes to the broadcast address ff:ff:ff:ff:ff:ff; a reply is unicast back to the asker. RFC 826
Configure it
ip dhcp snooping ip dhcp snooping vlan 10,20Builds the binding table of which MAC address holds which IP address. Dynamic ARP inspection validates against this table, so snooping has to come first.
Common mistake: Enabling inspection without snooping. There are no bindings to check against, so every ARP packet on an untrusted port is dropped and the VLAN stops working.
interface GigabitEthernet1/0/24 ip dhcp snooping trustThe uplink toward the DHCP server is trusted. Everything else is untrusted, which is the correct default — a server reply arriving from an access port is what snooping exists to catch.
ip arp inspection vlan 10,20 interface GigabitEthernet1/0/24 ip arp inspection trustEvery ARP packet on an untrusted port is checked against the snooping table and dropped if it claims an address the sender was not given. This is the control ARP itself cannot provide.
RFC 826
arp access-list STATIC-HOSTS permit ip host 192.168.4.10 mac host 0011.2233.4455 ip arp inspection filter STATIC-HOSTS vlan 10Statically addressed devices never appear in the snooping table, so they need an explicit binding. Printers and hypervisors are the usual candidates.
interface Vlan10 arp timeout 900The default is four hours. Shortening it bounds how long a stale or poisoned entry survives, at the cost of more ARP traffic.
interface Vlan10 no ip proxy-arpProxy ARP is on by default on IOS. It masks host misconfiguration and enlarges the ARP table, and almost nothing built this decade needs it.
Common mistake: Disabling it on a live segment without checking. Hosts that have been relying on it — usually ones with a wrong mask — all break at once.
Verify
show ip arp inspection statistics- Forwarded and dropped counts per VLAN.
show ip dhcp snooping binding- The bindings inspection validates against.
show ip arp- The resolved cache, with age.
Caveats
- Inspection is per VLAN and does nothing on a VLAN it was not enabled for.
- Rate limiting is applied per port by default and will err-disable a port that exceeds it, including a legitimately busy uplink that was left untrusted.
When it breaks
Symptom first, because that is what you have when it happens.
Connectivity to one host is intermittent and alternates in bursts. Both a server and a workstation are reachable at different moments on the same address.
Narrow it down
- Watch the ARP cache entry for that address and see whether the MAC changes.
- Check the switch for the MAC address moving between ports.
- Look for duplicate-address log messages on hosts and routers on the segment.
Cause
Two devices hold the same IP address. Each answers ARP for it, and whichever answered most recently wins every cache on the segment until the other one answers.
Fix
Find both devices by MAC address through the switch, and remove the static configuration or fix the overlapping DHCP scope that produced it.
Ongoing Address Conflict Detection and Address DefenseRFC 5227 · PROPOSED STANDARD · July 2008Traffic is being intercepted or blackholed, with correct IP configuration everywhere and no routing change.
Narrow it down
- Compare the MAC address in the gateway cache entry against the router’s real MAC address.
- Look for a host sending ARP replies for addresses it does not own.
- Check whether dynamic ARP inspection is enabled on access ports.
Cause
A host on the segment is sending unsolicited replies. ARP accepts them because it has no way to tell them from solicited ones.
Fix
Enable DHCP snooping and dynamic ARP inspection. Static entries protect one host; DAI protects the segment.
A host with a clearly wrong subnet mask works fine, and only breaks when a router is replaced or reconfigured.
Narrow it down
- Compare the host mask against the subnet it is on.
- Check whether the router answers ARP for addresses outside the local subnet.
- Look at how many distinct addresses resolve to the router’s MAC address.
Cause
Proxy ARP. The router answers on behalf of anything it can reach, so a host that believes the whole world is local gets the router’s MAC address for everything and works by accident.
Fix
Disable proxy ARP and fix the mask. Expect to find several hosts that were relying on it — turning it off on a live segment finds them all at once.
Using ARP to implement transparent subnet gatewaysRFC 1027 · UNKNOWN · October 1987After a failover, traffic keeps going to the failed device for several minutes and then recovers on its own.
Narrow it down
- Check whether the new active device sent a gratuitous ARP.
- Compare the cache timeout on the affected hosts against how long the outage lasted.
- Check whether the switch relearned the MAC address on the new port.
Cause
Nothing announced the change, so every cache holds the old binding until it ages out. Recovery on its own after a few minutes is the timeout expiring, not anything being fixed.
Fix
Ensure the failover mechanism sends a gratuitous ARP. If the virtual MAC moves with the address, the announcement is what updates the switch; if the MAC changes, it is what updates every host.
Why Are ARP Announcements Performed Using ARP Request Packets andRFC 5227 · PROPOSED STANDARD · July 2008CPU on switches and low-powered devices climbs, and a large flat subnet becomes slow for everyone at once.
Narrow it down
- Measure broadcast rate on the segment.
- Check for a scanning host resolving every address in the subnet.
- Look for a loop, which multiplies every broadcast.
Cause
Every ARP request is a broadcast that every device must process. A /16 of hosts, a scanner, or a forwarding loop each turn that cost into a denial of service without any single device misbehaving.
Fix
Split the broadcast domain, rate-limit ARP where the platform supports it, and fix the loop if there is one. Storm control caps the damage but does not address the cause.
Design notes
Enable DHCP snooping and dynamic ARP inspection together on access ports. DAI validates ARP against the snooping binding table, so it needs snooping to be running first — enabling DAI alone drops legitimate traffic on ports whose bindings were never recorded.
A large flat subnet is an ARP problem before it is anything else. Every host broadcasts to resolve, every host processes every broadcast, and the cost is borne by the slowest device on the segment. This is a reason to size subnets, not just to segment for policy.
Proxy ARP hides routing problems rather than solving them. A router answering for addresses it can reach lets a host with a wrong mask or no default gateway work anyway — until the day the router stops, and a fault that was masked for years surfaces as an outage nobody can attribute.
IPv6 replaced ARP with neighbour discovery over ICMPv6 for exactly the reasons above: it lives inside an IP packet, so it has a hop limit, can be secured, and can be filtered by the same tools as everything else.
Misconceptions
- “ARP requests are forwarded by routers to find hosts on other subnets.”
- An ARP packet has no IP header. It cannot be routed at all. A host reaching a remote subnet resolves its own gateway’s MAC address and sends the frame there; the gateway then resolves the next hop on its own segment. An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet HardwareRFC 826 · INTERNET STANDARD · November 1982
- “A host only accepts an ARP reply if it sent a matching request.”
- Classic ARP has no such correlation. Unsolicited replies are accepted, which is exactly what makes gratuitous ARP useful for failover and what makes spoofing trivial. The two are the same packet used with different intent.
- “A gratuitous ARP after failover is what tells hosts where to send traffic.”
- Usually it is telling the switch. When the virtual MAC moves with the address — as it does in VRRP — every host cache is already correct, and what was stale was the switch’s forwarding entry for that MAC. Why Are ARP Announcements Performed Using ARP Request Packets andRFC 5227 · PROPOSED STANDARD · July 2008
- “Static ARP entries secure a network against spoofing.”
- They protect the one host you configured, for the one address you pinned, and they have to be maintained by hand on every host. Dynamic ARP inspection enforces the same thing at the switch, for everyone, from a binding table that is already being maintained.
More walkthroughs
Answering a question nobody askedfailure
ARP has no authentication and accepts unsolicited replies. An attacker on the segment redirects traffic by simply asserting an address.
The victim has a correct cache entry: the gateway at 192.168.4.1 is reachable at the router’s MAC address. Everything works. Victim · .44: Cache .1 00:1a:2b:00:00:01. Switch. Gateway · .1. Attacker · .66.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| Victim · .44 | host | Cache .1: 00:1a:2b:00:00:01 |
| Switch | switch | — |
| Gateway · .1 | router | — |
| Attacker · .66 | host | — |
| Victim · .44 — Switch | link | up |
| Switch — Gateway · .1 | link | up |
| Switch — Attacker · .66 | link | up |
The victim has a correct cache entry: the gateway at 192.168.4.1 is reachable at the router’s MAC address. Everything works.
What changed
- Victim · .44: Cache .1 → 00:1a:2b:00:00:01
- Emphasis on Victim · .44 ↔ Switch
- Emphasis on Switch ↔ Gateway · .1
Announcing rather than askingdesign-choice
The same packet that redirects traffic maliciously is also how a failover completes and how a host checks an address is free.
R1 holds the virtual address. The host has it cached against the virtual MAC address, and traffic follows that entry to R1. R1 · master: Role Master. R2 · backup. Switch. Host: Cache .1 virtual MAC.
- Link
- Blocking
- Packet in flight
- Discarded
- Emphasis
Text equivalent of this diagram
| Element | Kind | State |
|---|---|---|
| R1 · master | router | Role: Master |
| R2 · backup | router | — |
| Switch | switch | — |
| Host | host | Cache .1: virtual MAC |
| R1 · master — Switch | link | up |
| R2 · backup — Switch | link | up |
| Switch — Host | link | up |
R1 holds the virtual address. The host has it cached against the virtual MAC address, and traffic follows that entry to R1.
What changed
- R1 · master: Role → Master
- Host: Cache .1 → virtual MAC
- Emphasis on R1 · master ↔ Switch
Terms
- ARP cache
- A host’s table of IPv4-to-MAC bindings, filled from replies and from any request that carries a binding it already holds. Entries age out rather than being revoked, so a wrong entry survives until its timer expires.
- Gratuitous ARP
- An ARP packet whose sender and target protocol addresses are the same. Nobody asked for it: it announces where an address now lives, which is how failover completes and how spoofing works.
- Proxy ARP
- A router answering ARP for addresses it can reach but does not own, so a host with a wrong mask or no gateway still works. It hides the misconfiguration rather than fixing it.