Loading learning content...
Every time your computer communicates with another device on the local network, an elegant dance of discovery occurs—often completed in mere milliseconds, entirely invisible to users. This dance is ARP operation: the sequence of events that transforms an IP address question into a MAC address answer.
Understanding ARP's operational mechanics is essential for network troubleshooting. When network communication fails at the local level, the problem often traces back to ARP—failed resolutions, stale cache entries, or misconfigured addresses. Mastering ARP operation transforms mysterious failures into diagnosable, fixable issues.
By the end of this page, you will understand the complete ARP operation lifecycle: when ARP is triggered, how requests are constructed and broadcast, how replies are generated and delivered, how hosts process incoming ARP messages, and the optimizations that make ARP efficient despite its broadcast nature.
ARP is a reactive protocol—it doesn't continuously run or poll; it activates only when specific conditions are met. Understanding these trigger conditions helps diagnose when and why ARP traffic appears on a network.
Primary Trigger: Outbound Packet Requires Unknown MAC
The fundamental trigger occurs when the IP layer hands a packet to the data link layer for transmission, but the required destination MAC address is unknown. The IP layer has determined the next-hop IP address (either the final destination for local delivery or a gateway for remote destinations), but this IP must be mapped to a MAC before the frame can be constructed.
ARP does not proactively discover neighbors, does not periodically verify cached entries, and does not run as a background daemon. It is entirely on-demand. A host with cached entries might not send any ARP traffic for extended periods. This demand-driven design minimizes network overhead.
Let's trace through a complete ARP operation from start to finish. Consider this scenario:
192.168.1.100, MAC AA:AA:AA:AA:AA:AA192.168.1.200, MAC BB:BB:BB:BB:BB:BBStep-by-Step Sequence:
Detailed Step Breakdown:
Step 1: Application initiates communication An application on Host A (e.g., a web browser) attempts to connect to 192.168.1.200. The socket call descends through the TCP/UDP layer to IP.
Step 2: IP layer routing decision The IP layer compares 192.168.1.200 against A's subnet mask (say, 255.255.255.0). Result: same subnet as 192.168.1.100. Conclusion: direct delivery to 192.168.1.200 (not via gateway).
Step 3: Data link layer receives packet IP passes the packet to the data link layer with instruction: "deliver to 192.168.1.200." The data link layer needs B's MAC to construct the Ethernet frame.
Step 4: ARP cache lookup The system checks its ARP cache for an entry mapping 192.168.1.200 → MAC. No entry found.
Step 5: ARP Request construction The system builds an ARP request packet:
Step 6: Ethernet frame construction for broadcast
Step 7: Network transmission Frame is transmitted. All switches flood it to all ports in the broadcast domain. Every host receives the frame.
Step 8: Host processing (non-target hosts) Host C and others receive the frame, see EtherType 0x0806, parse the ARP request. They check: is 192.168.1.200 my IP? No. They discard the request. (Note: They may optionally cache A's mapping for future use.)
Step 9: Host B processing (target) Host B receives the frame. Same parsing. Check: is 192.168.1.200 my IP? YES.
Host B:
Step 10: ARP Reply construction
Step 11: Ethernet frame construction for unicast reply
Step 12: Host A receives reply Host A receives the frame, parses the ARP reply, extracts B's MAC address, and adds the entry to its cache: 192.168.1.200 → BB:BB:BB:BB:BB:BB
Step 13: Original packet can now be sent The data link layer can now construct the original Ethernet frame with B's MAC address and transmit the queued data.
Let's examine the exact byte-level construction of ARP packets. Understanding this level of detail is essential for packet capture analysis and security research.
ARP Request Packet (Hexadecimal Representation)
12345678910111213141516171819
# Ethernet Frame Header (14 bytes)FF FF FF FF FF FF # Destination MAC: BroadcastAA AA AA AA AA AA # Source MAC: Host A08 06 # EtherType: ARP (0x0806) # ARP Packet (28 bytes for IPv4 over Ethernet)00 01 # Hardware Type: Ethernet (1)08 00 # Protocol Type: IPv4 (0x0800)06 # Hardware Address Length: 6 bytes04 # Protocol Address Length: 4 bytes00 01 # Operation: Request (1)AA AA AA AA AA AA # Sender Hardware Address (Host A's MAC)C0 A8 01 64 # Sender Protocol Address: 192.168.1.10000 00 00 00 00 00 # Target Hardware Address: Unknown (zeros)C0 A8 01 C8 # Target Protocol Address: 192.168.1.200 # Ethernet Padding (if any) + FCS (4 bytes)# Minimum Ethernet payload is 46 bytes; ARP is 28 bytes# 18 bytes of padding may be addedARP Reply Packet (Hexadecimal Representation)
1234567891011121314151617
# Ethernet Frame Header (14 bytes)AA AA AA AA AA AA # Destination MAC: Host A (unicast)BB BB BB BB BB BB # Source MAC: Host B08 06 # EtherType: ARP (0x0806) # ARP Packet (28 bytes)00 01 # Hardware Type: Ethernet (1)08 00 # Protocol Type: IPv4 (0x0800)06 # Hardware Address Length: 604 # Protocol Address Length: 400 02 # Operation: Reply (2)BB BB BB BB BB BB # Sender Hardware Address (Host B's MAC)C0 A8 01 C8 # Sender Protocol Address: 192.168.1.200AA AA AA AA AA AA # Target Hardware Address (Host A's MAC)C0 A8 01 64 # Target Protocol Address: 192.168.1.100 # Padding + FCSWireshark's display filter 'arp' shows only ARP traffic. The 'arp.opcode == 1' filter shows only requests; 'arp.opcode == 2' shows replies. This is invaluable for troubleshooting. Excessive ARP requests for the same target often indicate the target is offline or misconfigured.
When a host receives an ARP message (request or reply), it follows a specific processing algorithm. RFC 826 specifies this logic, and operating systems follow it with minor variations.
ARP Message Processing Algorithm:
Key Insights from the Algorithm:
1. Merge Before Check: The RFC specifies that the Sender's address pair should be used to update existing cache entries before checking if the target is the local host. This optimization means that if Host A already has Host B cached and receives an ARP from B (for any target), A's cache for B gets refreshed. This 'eager update' reduces future ARP traffic.
2. Cache on Request Processing: When a host receives an ARP request for its own IP, it always caches the sender's mapping—even if it wasn't already cached. This makes sense: if someone is asking for my MAC, they probably want to communicate with me, so I should cache them to prepare for the response.
3. Never Reply to Replies: A host does not generate an ARP reply in response to receiving an ARP reply. Replies are terminal—they conclude the exchange.
4. Unsolicited Cache Updates: The algorithm allows updating cache entries based on replies the host didn't request. This is the foundation of both Gratuitous ARP (benign) and ARP Spoofing (malicious).
The 'Merge Before Check' behavior means a host can have its ARP cache poisoned by any host that sends ARP traffic, even if that traffic wasn't solicited. Modern operating systems implement various mitigations, but the fundamental protocol is trusting by design.
Gratuitous ARP (GARP) is an ARP packet where:
This might seem useless—why ask for your own MAC? But GARP serves several important purposes:
Gratuitous ARP Packet Structure:
Operation: 1 (Request) or 2 (Reply)
Sender IP: 192.168.1.100 (Same as Target)
Sender MAC: AA:AA:AA:AA:AA:AA
Target IP: 192.168.1.100 (Same as Sender)
Target MAC: 00:00:00:00:00:00 (ignored) or sender's MAC
Both GARP requests and GARP replies exist. The distinction: some older implementations only update cache on seeing requests (operation=1), others update on any ARP. Sending both request-style and reply-style GARP maximizes compatibility. RFC 5227 (IPv4 Address Conflict Detection) standardizes the request form for DAD.
ARP involves several timing parameters that affect network behavior. Understanding these is crucial for performance tuning and troubleshooting.
Key ARP Timers:
| Timer | Linux Default | Windows Default | Purpose |
|---|---|---|---|
| Cache Timeout (complete entry) | ~60 seconds base + reachability confirmation | 15-45 seconds (dynamic) | How long a resolved entry stays valid |
| Cache Timeout (incomplete entry) | 3 seconds | 3 seconds | How long to keep entry while waiting for reply |
| Retransmit Interval | 1 second | 1 second | Time between retry transmissions |
| Maximum Retries | 3 attempts | 3 attempts | How many requests before giving up |
| Stale Entry Grace Period | Varies | Varies | Time to keep using stale entry while refreshing |
The Incomplete Entry Problem
When Host A sends an ARP request but receives no reply, the entry is marked 'incomplete.' Operating systems handle this differently:
Linux ARP State Machine:
Linux implements a sophisticated ARP state machine (actually part of the Neighbor Discovery subsystem shared with IPv6):
On Linux, ARP parameters are tunable via sysctl (net.ipv4.neigh.default.*). Longer timeouts reduce ARP traffic but slow failover detection. Shorter timeouts speed recovery but increase broadcast overhead. Data center environments often tune these aggressively for fast failure detection.
Proxy ARP is a technique where a router or gateway answers ARP requests on behalf of hosts located on different networks. This allows hosts to communicate across network boundaries as if they were on the same subnet—without explicit routing configuration on the hosts.
How Proxy ARP Works:
Scenario Walkthrough:
When Proxy ARP Is Useful:
Proxy ARP has significant drawbacks: it increases ARP table size on routers, obscures real network topology, complicates troubleshooting, can enable ARP spoofing attacks, and generally represents a 'hack' rather than proper network design. Most modern networks disable Proxy ARP in favor of correct routing configuration.
Modern Ethernet networks use switches rather than hubs. Understanding how switches handle ARP traffic is essential for network design.
Switch Behavior with ARP:
The ARP Broadcast Problem at Scale
In large Layer 2 domains (thousands of hosts), ARP broadcasts become problematic:
This is why large networks:
Modern data center fabrics use ARP suppression: leaf switches cache ARP bindings and respond to requests locally, rather than flooding them across the fabric. This dramatically reduces east-west broadcast traffic in large-scale deployments.
We've explored the complete operational lifecycle of ARP—from trigger conditions through request/reply exchange to cache population. Let's consolidate the key takeaways:
What's Next:
With ARP operation fully understood, we'll examine the ARP cache in depth—how it's organized, managed, and tuned. We'll explore cache data structures, aging policies, and the various cache states that operating systems maintain.
You now understand the complete ARP operational sequence. From the trigger condition through cache population, you can trace exactly how hosts discover each other's MAC addresses. Next, we'll examine the ARP cache that stores these hard-won mappings.