The gap ARP fills
To send an IP packet over Ethernet, a host must put it in a frame, and a frame needs a destination MAC address. The host knows the destination's IP address (you typed it, or DNS provided it), but not its MAC address. ARP (Address Resolution Protocol) asks the local network: "Who has this IP address? Tell me your MAC address."
💡 In simple terms: you know a colleague's name but not where they sit, so you stand up and call out across the office: "Who is Sam? Please wave!" Everyone hears you, but only Sam waves back, and now you remember where Sam sits. The shout is the ARP request, the wave is the reply, and your memory is the ARP cache.
Why ARP exists
Every network device has two addresses that do different jobs:
- The IP address is a logical address used end to end. Applications and people use it.
- The MAC address is a hardware address that only has meaning on one local link. Switches and network cards use it.
Learn more: What Is an IP Address?MAC Addresses
Nothing in the IP address tells you the MAC address. They are set independently: the IP address by DHCP or an administrator, and the MAC address by the manufacturer (or randomly by the operating system, on many phones and laptops). So something has to look up the MAC address at the moment it is needed. On IPv4 networks, that is ARP.
Where ARP sits
ARP works on the local subnet only. Its messages are carried directly in an Ethernet frame with EtherType 0x0806 (normal IPv4 traffic uses 0x0800). There is no IP header in an ARP message, so a router has no destination IP address to route it with, and it does not forward ARP messages to other networks.
The important parts
ARP Request
“Who has 192.168.10.20? Tell 192.168.10.10.” It is sent as a broadcast, because the sender doesn't know the target's MAC address yet. Every device on the subnet receives it.
ARP Reply
“192.168.10.20 is at 02:00:00:00:00:bb.” It is sent as a unicast directly back to the sender of the request, whose MAC address was in the request.
ARP cache
A small table in every host and router that remembers IP address → MAC address answers for a while, so ARP isn't needed for every packet.
Next-hop IP
The IP address that ARP resolves: the destination itself if it is on the local subnet, or the default gateway if it is remote.
The example network
| Device | IP address | MAC address |
|---|---|---|
| PC-A | 192.168.10.10/24 | 02:00:00:00:00:aa |
| PC-B | 192.168.10.20/24 | 02:00:00:00:00:bb |
| Default gateway (router R1) | 192.168.10.1/24 | 02:00:00:00:00:01 |
Request and reply
- 1. Request: broadcast. PC-A doesn't know PC-B's MAC address, so it sends an ARP request to the broadcast address ff:ff:ff:ff:ff:ff.
- 2. Everyone receives it. The switch floods the broadcast out of every other port. The router sees that the request is not for its IP address and ignores it. It does not forward the request to other networks.
- 3. Reply: unicast. Only PC-B answers. It sends its own MAC address directly to PC-A's MAC address. PC-B also saves PC-A's IP and MAC addresses from the request.
- 4. Cached and sent. PC-A stores the answer in its ARP cache and sends the actual traffic. Later packets skip ARP until the entry expires.
Step by step
The same exchange as a message flow
- 192.168.10.20:
- 02:00:00:00:00:bb (dynamic)
Inside an ARP message
An ARP message for IPv4 over Ethernet is 28 bytes long. It is padded to the Ethernet minimum frame size, so on the wire it fills a 64-byte frame.
| Field | In the request | In the reply |
|---|---|---|
| Operation | 1 (request) | 2 (reply) |
| Sender MAC | 02:00:00:00:00:aa (PC-A) | 02:00:00:00:00:bb (PC-B) |
| Sender IP | 192.168.10.10 | 192.168.10.20 |
| Target MAC | 00:00:00:00:00:00 (unknown) | 02:00:00:00:00:aa (PC-A) |
| Target IP | 192.168.10.20 | 192.168.10.10 |
The frames that carry them
ARP Request frame
Broadcast
ARP Reply frame
Unicast
Notice that there is no IP header in either frame: the IP addresses are fields inside the ARP message. IPv6 doesn't use ARP at all. It uses Neighbor Discovery instead.
Local or remote?
A host only sends ARP requests for addresses on its own subnet. For any other destination, it sends an ARP request for its default gateway and sends the frame to the gateway's MAC address. The packet inside keeps the remote destination IP address. This is why the most used entry in most PCs' ARP caches is the router. The topic is important enough to have its own lesson.
Learn more: ARP for Local and Remote Destinations
The ARP cache
Answers are cached so that ARP isn't needed for every packet. Entries expire after seconds to minutes on most PCs, and after 4 hours by default on Cisco routers. If a device's MAC address changes (for example, after a network card is replaced or a failover), stale entries can send traffic to the old MAC address for a while.
Before PC-A has talked to anyone, its cache is nearly empty:
C:\> arp -a Interface: 192.168.10.10 --- 0xb Internet Address Physical Address Type 192.168.10.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 255.255.255.255 ff-ff-ff-ff-ff-ff static
After PC-A has talked to PC-B and to the internet:
C:\> arp -a Interface: 192.168.10.10 --- 0xb Internet Address Physical Address Type 192.168.10.1 02-00-00-00-00-01 dynamic 192.168.10.20 02-00-00-00-00-bb dynamic 192.168.10.255 ff-ff-ff-ff-ff-ff static 224.0.0.22 01-00-5e-00-00-16 static 255.255.255.255 ff-ff-ff-ff-ff-ff static
192.168.10.1) and PC-B. They were learned with ARP and will expire. Windows writes MAC addresses with dashes.$ ip neigh 192.168.10.1 dev eth0 lladdr 02:00:00:00:00:01 REACHABLE 192.168.10.20 dev eth0 lladdr 02:00:00:00:00:bb STALE
REACHABLE means the entry was confirmed recently. STALE means it can still be used, but Linux will confirm it again the next time it sends traffic to that address. On older Linux systems and on macOS, use arp -a.R1#show ip arp Protocol Address Age (min) Hardware Addr Type Interface Internet 192.168.10.1 - 0200.0000.0001 ARPA GigabitEthernet0/0 Internet 192.168.10.10 12 0200.0000.00aa ARPA GigabitEthernet0/0 Internet 192.168.10.20 3 0200.0000.00bb ARPA GigabitEthernet0/0
arp -d *Clear the ARP cache on Windows (run as administrator). On Linux, use sudo ip neigh flush all. On a Cisco router, use clear arp-cache.
What happens when ARP fails
| Situation | What you see | Why |
|---|---|---|
| The target is off or unplugged, or the IP address is wrong | Ping: "Reply from 192.168.10.10: Destination host unreachable"; Linux neighbour state FAILED or INCOMPLETE | Nobody answered the ARP request, so no frame can be built. The message comes from your own PC, not from the target. |
| Two devices with the same IP address | Connections that work and then drop; an "IP address conflict" warning | Both devices answer ARP requests, and caches switch between the two MAC addresses. |
| Stale entry after a device is replaced | The new device is unreachable for a few minutes | Others still send to the old MAC until the entry expires. Clearing the cache fixes it. |
| Wrong default gateway address | Local destinations work; remote ones fail | The PC sends ARP requests for an address that no router uses (see The Default Gateway). |
ARP has no built-in security: any device can answer, and hosts believe the answer. Attackers abuse this with ARP spoofing. The ARP Security lesson (CCNA track) explains how networks defend against it. Special ARP messages, such as gratuitous ARP, have their own lesson.
Learn more: ARP SecurityGratuitous ARP, Probes and Proxy ARP
Troubleshooting ARP
- Ping the address you can't reach. This triggers an ARP request if there is no cache entry.
- Look at the ARP cache with
arp -aorip neigh. Is there an entry for the next hop (the host itself, or the default gateway for remote traffic)? - No entry, or FAILED: the target didn't answer. Check that it is powered on, connected, in the same VLAN, and has the IP address you expect.
- An entry with an unexpected MAC address: there is a duplicate IP address or an old cache entry. Compare it with the MAC address on the device itself (
ipconfig /all), then clear the cache.
Common mistakes
- Thinking a PC sends ARP requests for remote IP addresses, such as a web server on the internet. The remote server can't receive the broadcast, so the PC sends an ARP request for its default gateway instead.
- Thinking the reply is a broadcast. Only the request is a broadcast. The reply is a unicast, because the target already knows the sender's MAC address from the request.
- Confusing the ARP cache with a switch's MAC address table. The ARP cache on hosts and routers maps IP address → MAC address; a switch's table maps MAC address → port (see How a Switch Learns MAC Addresses).
- Expecting ARP to cross a router. ARP requests are broadcasts, and broadcasts stay in their own subnet.
- ARP finds the MAC address that belongs to an IPv4 address on the local subnet.
- The request is a broadcast to ff:ff:ff:ff:ff:ff; the reply is a unicast back to the sender.
- ARP is carried directly in Ethernet frames (EtherType 0x0806), with operation, sender MAC/IP and target MAC/IP fields.
- Answers are kept in the ARP cache. View it with arp -a or ip neigh.
- Hosts send ARP requests for local destinations directly, and for the default gateway for everything else.
Check yourself
PC-A (192.168.10.10/24) wants to reach a server at 203.0.113.20. Whose MAC address does it ask for with ARP?
You capture the traffic while PC-A resolves PC-B's MAC address. How are the ARP request and reply delivered?
In PC-A's ARP request for 192.168.10.20, what is in the Target MAC field?
PC-A pings 192.168.10.30, which is switched off. What does Windows show?