What Is ARP? — Resolving a MAC Address from an IP Address

⏱ approx. 10 min views 155 likes 0 LOG_DATE:2026-06-10
TOC

ARP (Address Resolution Protocol) asks, within the same network (one subnet), "what is the MAC address of the host that owns this IP?". IP is the L3 logical address and MAC is the L2 physical address, and Ethernet can only deliver frames by MAC address. So every IP conversation triggers ARP behind the scenes to translate the destination IP into a MAC. This article covers why ARP is needed, the resolution flow, the cache, why it stays inside one subnet, gratuitous ARP, and how the lack of authentication enables ARP spoofing — plus the defenses.

01

What ARP is — the bridge between L3 and L2 #

Each layer uses a different kind of address: apps use a hostname, the IP layer uses an IP address, and the Ethernet layer uses a MAC address. DNS resolves hostname -> IP, but the final step of IP -> MAC is filled in, on the spot, by ARP.

▸ In plain terms — "you know the room number, but not which desk"

An IP address is the "room number"; a MAC address is the actual "desk". Mail (a frame) only arrives once it lands on a desk. Shouting across the floor "whose desk handles room 301?" (Request) and having that person raise their hand "this is my desk" (Reply) — that is ARP.

02

Why it is needed — Ethernet only delivers by MAC #

When you send data, the IP packet is wrapped in an Ethernet frame (encapsulation) before it hits the wire. That frame header has a field for the destination MAC address, and if it is blank the switch has no idea which port to send the frame out of.

LayerAddress usedHow it is resolved
L7 AppHostname (example.com)DNS
L3 NetworkIP address (192.168.1.1)Routing
L2 Data LinkMAC address (aa:bb:cc:..)ARP

So ARP exists to fill the one last blank: "I know the IP, but the MAC is empty."

03

The flow — Request is broadcast, Reply is unicast #

It is simple: "ask everyone, only the owner answers" — one round trip.

1. ARP Request (broadcast)
The sender sets the destination MAC to ff:ff:ff:ff:ff:ff (everyone) and asks "who has 192.168.1.1? tell 192.168.1.5 (= me)" across the whole segment. Every device under the same switch receives it.
2. ARP Reply (unicast)
Only the host that owns that IP answers, directly to the asker: "192.168.1.1 is at aa:bb:cc:dd:ee:ff". Everyone else stays silent.
3. Cache and send
The IP<->MAC mapping is stored in the ARP table and reused from then on. The frame's destination MAC field is now filled in, and the conversation can finally start.
04

The ARP cache — don't ask every time #

Broadcasting every time would be wasteful, so results are cached for tens of seconds to a few minutes. You can inspect it.

Viewing the ARP table
# Windows / older Linux $ arp -a ? (192.168.1.1) at aa:bb:cc:dd:ee:ff [ether] on eth0 ? (192.168.1.20) at 11:22:33:44:55:66 [ether] on eth0

# Modern Linux (iproute2) $ ip neigh 192.168.1.1 dev eth0 lladdr aa:bb:cc:dd:ee:ff REACHABLE

States like REACHABLE / STALE indicate whether the entry was recently used and is still alive. When an entry goes stale, ARP re-confirms it.

05

Only within one subnet — for remote hosts, resolve the gateway's MAC #

The single most important point: ARP is broadcast, so it cannot cross a router (it only works within the same subnet). So how do you talk to a host on another network?

The answer: you ARP not for the destination itself but for the MAC of the default gateway (router). Like "mail going far away goes to the local post office first", the frame is handed to the router, which forwards it toward the next hop.

▸ This is why ARP is suspect when ping fails

When you can't reach a host on the same segment, first check with ip neigh whether its MAC resolved. FAILED or INCOMPLETE means L2 delivery failed (cable, switch, VLAN mismatch, etc.). If everything remote is dead, check whether the gateway's ARP resolved.

06

Gratuitous ARP — answering when nobody asked #

Gratuitous ARP (GARP) is a special ARP that broadcasts your own "IP<->MAC" unsolicited. It has three main uses.

  • Duplicate IP detection — at boot, announce "I'm using this IP"; if another host has it, the conflict is detected.
  • Failover — in a redundant setup, when a standby is promoted it announces "the MAC for this virtual IP has changed" so switches update their forwarding (VRRP / keepalived, etc.).
  • ARP cache update — refresh the tables around you.

Handy — but this "first to speak wins" nature is exactly what the next attack builds on.

07

ARP spoofing — the weakness of an unauthenticated design #

ARP has no mechanism to verify the sender. A host that receives a Reply overwrites its cache without checking authenticity. That is what ARP spoofing / ARP poisoning exploits.

1. Flood fake Replies
The attacker keeps telling the victim "the gateway (192.168.1.1) is at my MAC" and tells the gateway "the victim is at my MAC".
2. The path runs through the attacker
Both caches are poisoned, so traffic that should go directly now passes through the attacker (man-in-the-middle).
3. Eavesdrop / tamper
Read plaintext, hijack sessions, and so on. arpspoof / ettercap / bettercap are the classic tools.
▸ Why HTTPS still protects you

Even if ARP spoofing steals the path, if the traffic is encrypted with TLS the contents can't be read and tampering is rejected by certificate validation. The assumption "you can't trust a host just because it's on the same LAN" (a zero-trust mindset) is exactly why HTTPS is mandatory even on a café or corporate LAN.

08

Defenses — reject fake ARP on the network side #

DefenseHow it worksWhere
DAI (Dynamic ARP Inspection)The switch checks ARP against the DHCP-snooping ledger and drops mismatched IP<->MACEnterprise switches (best)
Static ARPHard-code IP<->MAC for critical hosts and forbid overwritesServers / gateways
Port securityLimit the number/value of MACs learned per portAccess switches
Detection (arpwatch, etc.)Watch for IP<->MAC changes and alertMonitoring host

Fundamentally, a two-pronged approach is realistic: segmentation so untrusted devices aren't on the same segment (VLANs, [[vlan]]), plus upper-layer encryption (TLS).

09

Summary — five things to remember #

  • ARP resolves IP -> MAC and is foundational to IPv4. It's indispensable because Ethernet only delivers by MAC.
  • The flow is Request (broadcast) -> Reply (unicast) -> cache.
  • It works only within one subnet. For remote hosts, ARP for the gateway's MAC.
  • With no authentication, ARP spoofing enables MITM.
  • Defenses are DAI / static ARP / port security plus upper-layer TLS encryption.
  • IPv6 has no ARP; NDP (Neighbor Discovery over ICMPv6) plays the same role.
𝕏 Post B! Hatena