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
- Wireshark filter
arp- Encrypted
- no
Packet structure
Select a field to see what it does.
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.
| Variant | What it looks like | Used for |
|---|---|---|
| Request | Opcode 1, target MAC 00:00:00:00:00:00, broadcast | Normal resolution |
| Reply | Opcode 2, unicast | Normal answer |
| Gratuitous ARP | Sender IP = target IP, often broadcast | Announce an address or a MAC change (failover, VRRP/HSRP) |
| ARP probe | Sender IP 0.0.0.0 | Check whether an address is free before using it (RFC 5227) |
In Wireshark
| Filter | Shows |
|---|---|
arp | All ARP |
arp.opcode == 1 / arp.opcode == 2 | Requests / replies |
arp.duplicate-address-detected | Two MACs claim the same IP: spoofing or a conflict |
arp.isgratuitous == 1 | Gratuitous ARP |
arp.src.proto_ipv4 == 10.0.0.1 | Who claims to be the gateway |
arp.opcode == 2 && eth.dst == ff:ff:ff:ff:ff:ff | Broadcast 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
- ARP spoofing / poisoning: the attacker sends forged replies (“10.0.0.1 is at my MAC”) to the victim and the gateway, and becomes man-in-the-middle (
arpspoof,ettercap,bettercap). Defences: Dynamic ARP Inspection on switches (with DHCP snooping), static entries for critical hosts, detection witharpwatch. - Denial of service: poisoning with a non-existent MAC blackholes traffic.
- Reconnaissance: ARP scans find every live host on a segment, even ones that drop ICMP.
- Scope: ARP never crosses a router, so all of this needs a foothold on the same layer-2 segment.
Versions and related
- IPv6 has no ARP: Neighbor Discovery (ICMPv6 types 135/136) does the job, with the same trust problems (fix: RA Guard, SEND).
- Proxy ARP: a router answers for addresses behind it.
- RARP / InARP: reverse lookups, obsolete or niche (Frame Relay).