Network Bytes · Episode 29 · CCNA 1.13
ARP: finding a MAC from an IP
Your computer knows the IP address it wants to reach, but on the local network it needs a MAC address. ARP asks the whole subnet, and only the owner of that IP answers.
Knows the IP, needs the MAC
Your computer addresses packets with IP addresses. But on the local network, frames are delivered by MAC address: the switch forwards a frame by its destination MAC, and a network card only picks up frames meant for its own MAC (or for everyone).
So before your computer can send anything to a neighbor, it has to fill in the destination MAC. Usually it only knows the IP. ARP is the protocol that connects the two.
The ARP request: a shout to everyone
Your computer sends an ARP request as a broadcast: a frame addressed to ff:ff:ff:ff:ff:ff, which the switch floods out of every port in the subnet (the VLAN). The message is simple: "Who has 192.168.1.1? Tell me your MAC."
Every device on the subnet hears the request. The printer, the other laptops and the phone all read it, see that the IP isn't theirs, and ignore it.
The ARP reply: only the owner answers
The one device that owns that IP sends back an ARP reply: "That's me, here's my MAC." The reply is normally unicast, straight back to the computer that asked, not to everyone.
Why ask for 192.168.1.1, the router? Because for anything on another network, like a website, your computer delivers the frame to its default gateway (see EP24). So the MAC it needs is the router's, while the IP destination stays the far-away server.
The ARP cache
Your computer saves the answer in its ARP cache, a small table of IP → MAC pairs. Next time, it looks there first and sends the frame straight out, no shouting. Entries expire after a while, so the table stays fresh if a device changes. How long depends on the system: Cisco IOS keeps entries for 4 hours by default, while computers and phones usually keep them for much less, from seconds to minutes.
Try it yourself
Look at your own ARP cache:
- Windows: open Command Prompt and run
arp -a. - Mac or Linux: run
arp -ain Terminal. On Linux,ip neighshows the same table.
You'll almost always see your default gateway's IP in the list, with its MAC next to it.
Good to know
- ARP (RFC 826) is for IPv4. IPv6 uses Neighbor Discovery instead.
- The request is a broadcast; the reply is normally unicast.
- For destinations on another subnet, the computer ARPs for its default gateway's MAC, not the far server's.
- Cache timeouts vary by OS (Cisco IOS keeps entries 4 hours by default).
For CCNA learners
This lines up with CCNA 200-301 exam topic 1.13, describe switching concepts: know that an ARP request is a broadcast the switch floods to every port in the VLAN, while the reply comes back as a unicast frame.
Answer to the comment question
No. The request is a broadcast because your PC doesn't yet know who has the IP, but the owner does know who asked: the request carries your PC's IP and MAC. So the ARP reply is normally unicast, sent straight back to the PC that asked, not to everyone.
Test your knowledge
Quick quiz: ARP: finding a MAC from an IP
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- IETF, "RFC 826, An Ethernet Address Resolution Protocol": maps an IP address to a 48-bit Ethernet address with a broadcast request and a reply from the owner; results kept in a table
- Cloudflare Learning Center, "What is the network layer?": ARP maps IP addresses to MAC addresses within the local network
- Cisco, "Configuring MAC Address Table" (Catalyst 9000): switches flood broadcasts such as ARP requests to all ports in the VLAN
- Cisco, CCNA 200-301 v1.1 exam topics: 1.13 describe switching concepts
Video transcript
How does your PC find a device's MAC address when all it knows is the IP?
To send anything on the local network, your PC needs the other device's MAC address. ARP, the Address Resolution Protocol, connects the two.
So it shouts. It broadcasts an ARP request to the whole subnet: "Who has 192.168.1.1? Tell me your MAC."
Every device hears it, but only the one with that IP answers, straight back: "That's me. Here's my MAC."
Your PC saves the answer in its ARP cache, so it doesn't have to shout again for a while. Next time, the frame goes straight out.
The request went out to everyone. Does the reply go to everyone too? Comment your answer below!
That's your byte.