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

An Ethernet Address Resolution Protocol: Or Converting Network Protocol Addresses to 48.bit Ethernet Address for Transmission on Ethernet HardwareRFC 826 · INTERNET STANDARD · November 1982Probing an AddressRFC 5227 · PROPOSED STANDARD · July 2008Using ARP to implement transparent subnet gatewaysRFC 1027 · UNKNOWN · October 1987

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.

PC-A · .44Needs: MAC for 192.168.4.1SwitchGateway · .1PC-B · .55
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
PC-A · .44hostNeeds: MAC for 192.168.4.1
Switchswitch
Gateway · .1router
PC-B · .55host
PC-A · .44Switchlinkup
SwitchGateway · .1linkup
SwitchPC-B · .55linkup
1 / 6

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.

A request, broadcast to the whole segment. The target hardware address is zeros because that is the question; everyone receives it and only the owner answers.

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

Stop a host on the segment from answering for addresses it does not own.

Cisco IOS-XE 17.12 · Catalyst 9300, Catalyst 9500draft

  1. ip dhcp snooping
    ip dhcp snooping vlan 10,20

    Builds 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.

  2. interface GigabitEthernet1/0/24
     ip dhcp snooping trust

    The 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.

  3. ip arp inspection vlan 10,20
    interface GigabitEthernet1/0/24
     ip arp inspection trust

    Every 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

  4. arp access-list STATIC-HOSTS
     permit ip host 192.168.4.10 mac host 0011.2233.4455
    ip arp inspection filter STATIC-HOSTS vlan 10

    Statically addressed devices never appear in the snooping table, so they need an explicit binding. Printers and hypervisors are the usual candidates.

  5. interface Vlan10
     arp timeout 900

    The default is four hours. Shortening it bounds how long a stale or poisoned entry survives, at the cost of more ARP traffic.

  6. interface Vlan10
     no ip proxy-arp

    Proxy 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.

  1. 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

    1. Watch the ARP cache entry for that address and see whether the MAC changes.
    2. Check the switch for the MAC address moving between ports.
    3. 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 2008
  2. Traffic is being intercepted or blackholed, with correct IP configuration everywhere and no routing change.

    Narrow it down

    1. Compare the MAC address in the gateway cache entry against the router’s real MAC address.
    2. Look for a host sending ARP replies for addresses it does not own.
    3. 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.

  3. A host with a clearly wrong subnet mask works fine, and only breaks when a router is replaced or reconfigured.

    Narrow it down

    1. Compare the host mask against the subnet it is on.
    2. Check whether the router answers ARP for addresses outside the local subnet.
    3. 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 1987
  4. After a failover, traffic keeps going to the failed device for several minutes and then recovers on its own.

    Narrow it down

    1. Check whether the new active device sent a gratuitous ARP.
    2. Compare the cache timeout on the affected hosts against how long the outage lasted.
    3. 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 2008
  5. CPU on switches and low-powered devices climbs, and a large flat subnet becomes slow for everyone at once.

    Narrow it down

    1. Measure broadcast rate on the segment.
    2. Check for a scanning host resolving every address in the subnet.
    3. 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.

Victim · .44Cache .1: 00:1a:2b:00:00:01SwitchGateway · .1Attacker · .66
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
Victim · .44hostCache .1: 00:1a:2b:00:00:01
Switchswitch
Gateway · .1router
Attacker · .66host
Victim · .44Switchlinkup
SwitchGateway · .1linkup
SwitchAttacker · .66linkup
1 / 5

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.

R1 · masterRole: MasterR2 · backupSwitchHostCache .1: virtual MAC
  • Link
  • Blocking
  • Packet in flight
  • Discarded
  • Emphasis
Select a device to read its state. Arrow keys walk the topology.
Text equivalent of this diagram
Devices and links at this step
ElementKindState
R1 · masterrouterRole: Master
R2 · backuprouter
Switchswitch
HosthostCache .1: virtual MAC
R1 · masterSwitchlinkup
R2 · backupSwitchlinkup
SwitchHostlinkup
1 / 6

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.

Check yourself

  • A host needs to reach a server on a different subnet. Whose MAC address does it resolve?
  • What does a host do with an ARP reply it never requested?
  • After a VRRP failover the virtual MAC moves with the address. What does the gratuitous ARP actually fix?
  • Why does an RFC 5227 ARP probe set the sender protocol address to 0.0.0.0?
  • A host with a /8 mask on a /24 subnet works normally. What is most likely happening?
  • What does IPv6 use instead of ARP?
  • Why does a very large layer-two segment become a problem even when nothing is wrong?
  • Must a host have sent a request before it will accept a reply?