networking, updated

ARP

The Address Resolution Protocol finds the MAC address that belongs to an IPv4 address on the local network. It trusts every answer, which makes it the classic man-in-the-middle tool.

OSI layer
2 Data link, 3 Network
Carried in
Ethernet
Identified by
EtherType 0x0806
Specs
RFC 826, RFC 5227
Wireshark filter
arp
Encrypted
no

Packet structure

ARP packet (Ethernet + IPv4)28 bytes

Select a field to see what it does.

RFC 826. 28 bytes when resolving IPv4 addresses on Ethernet, carried directly in an Ethernet frame (EtherType 0x0806).

ARP has no IP header: it sits directly in the Ethernet frame. Requests are broadcast, replies are unicast. The frame is padded to the Ethernet minimum, so Wireshark shows 42 bytes on the sending host and 60 on others.

How it works

Before a host sends an IPv4 packet to an address on its own subnet (or to its default gateway), it needs that address’s MAC:

sequenceDiagram
    participant A as Host A 10.0.0.5
    participant N as Everyone on the LAN
    participant G as Gateway 10.0.0.1
    A->>N: Broadcast: Who has 10.0.0.1? Tell 10.0.0.5
    G-->>A: Unicast: 10.0.0.1 is at 00:11:22:33:44:55
    Note over A: Caches the mapping (typically 1–20 min)

Every host keeps an ARP cache (ip neigh on Linux, arp -a on Windows). ARP is stateless: a host accepts replies it never asked for and updates its cache, which is the root of ARP spoofing.

VariantWhat it looks likeUsed for
RequestOpcode 1, target MAC 00:00:00:00:00:00, broadcastNormal resolution
ReplyOpcode 2, unicastNormal answer
Gratuitous ARPSender IP = target IP, often broadcastAnnounce an address or a MAC change (failover, VRRP/HSRP)
ARP probeSender IP 0.0.0.0Check whether an address is free before using it (RFC 5227)

In Wireshark

FilterShows
arpAll ARP
arp.opcode == 1 / arp.opcode == 2Requests / replies
arp.duplicate-address-detectedTwo MACs claim the same IP: spoofing or a conflict
arp.isgratuitous == 1Gratuitous ARP
arp.src.proto_ipv4 == 10.0.0.1Who claims to be the gateway
arp.opcode == 2 && eth.dst == ff:ff:ff:ff:ff:ffBroadcast replies (unusual, often tools)

What normal looks like: a request, one reply, then silence until the cache entry expires. Bursts of requests for every address in a subnet are an ARP scan (arp-scan, netdiscover, nmap host discovery).

Signs of ARP spoofing: a stream of unsolicited replies, the gateway’s IP mapped to a new MAC, or one MAC claiming several IPs. Wireshark’s Expert Info flags duplicate IP addresses.

Security notes

References

§ home
~/knubertus/home/
1,1 Top