CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

Every time a device on your network sends data to another device using its IP address, something has to figure out which specific piece of hardware that IP actually belongs to — and that job falls to the Address Resolution Protocol, or ARP. It’s one of the quieter protocols in networking, working in the background of nearly every local connection without most people ever needing to think about it. This article covers ARP’s core function, how the request-and-reply process actually works, how to inspect and manage the cache it builds, how it compares to related protocols like RARP and Proxy ARP, and the security risks that come with a protocol that, by design, trusts almost everything it’s told.

The Main Function of ARP: Mapping IP Addresses to MAC Addresses

The core function of ARP is to resolve a Layer 3 IP address to its corresponding Layer 2 MAC address on a local network segment, allowing devices to actually deliver data to one another at the hardware level.

  1. IP addresses and MAC addresses serve different purposes. An IP address is a logical address used for routing data across networks, while a MAC address is a physical hardware address burned into a device’s network adapter, used for delivering data across a single local network segment. Software and applications generally work with IP addresses, but the actual delivery of data on a local network happens using MAC addresses.
  2. Something has to bridge the two. When a device wants to send data to another device on the same local network, it knows the destination’s IP address (for example, from a DNS lookup or manual configuration) — but the actual Ethernet frame carrying that data needs to be addressed to a specific MAC address, not an IP address.
  3. ARP fills that gap. ARP’s function is to ask, in effect, “which device on this network has this IP address, and what is its MAC address?” — and to receive an answer that lets the sending device correctly address its outgoing frames.
  4. This mapping is scoped to the local network. ARP only operates within a single local network segment (the same broadcast domain) — it isn’t used to resolve addresses across different networks or over the internet, since a router at the boundary of the local network handles forwarding to other subnets instead.

Understanding that core function — turning a known IP address into an actionable MAC address — is the foundation for everything else about ARP, starting with the actual message exchange that makes this resolution happen.

How ARP Works: The Request and Reply Process

ARP resolves an IP address to a MAC address through a simple two-step exchange: a broadcast request, and a direct reply.

  1. A device needs to send data to a known IP address on the local network. Before it can construct the Ethernet frame, it checks its local ARP cache (covered in more detail in the next section) to see if it already knows the corresponding MAC address from a previous lookup.
  2. If the MAC address isn’t already cached, the device sends an ARP request. This request is broadcast to every device on the local network segment, essentially asking, “Who has this IP address? Tell me your MAC address.”
  3. Every device on the network receives the broadcast. Because it’s a broadcast, all devices on the local segment process the request, but only the device whose IP address actually matches the one being asked about needs to respond.
  4. The matching device sends an ARP reply. Unlike the request, the reply is sent directly (unicast) back to the device that asked, containing the responding device’s MAC address.
  5. The requesting device stores the mapping in its ARP cache. This mapping is saved locally so that future communication with the same IP address doesn’t require repeating the broadcast request — a performance optimization that’s central to how the cache, discussed next, actually works.
  6. The device constructs and sends the Ethernet frame. With the MAC address now known, the original data can be properly addressed at Layer 2 and delivered to the correct device.

This entire exchange typically happens in milliseconds and is invisible during normal use — but because ARP entries are cached rather than looked up fresh every time, understanding how to view and manage that cache becomes useful both for troubleshooting and for the security considerations covered later in this article.

Viewing and Clearing the ARP Cache

Since ARP results are stored locally to avoid repeating the broadcast process described above, it’s often useful — especially for troubleshooting — to inspect or reset that cache directly.

To view the ARP cache on Windows: Open Command Prompt and run:

arp -a

This displays a table of known IP addresses, their corresponding MAC (physical) addresses, and the interface each entry was learned on.

To view the ARP cache on macOS or Linux: Open Terminal and run the same command:

arp -a

The output format is similar, listing hostname (if resolvable), IP address, and MAC address for each cached entry.

To clear the ARP cache on Windows: Open Command Prompt as Administrator and run:

netsh interface ip delete arpcache

Alternatively, on older Windows versions:

arp -d *

To clear the ARP cache on macOS: Run the following in Terminal:

sudo arp -a -d

To clear the ARP cache on Linux: Run:

sudo ip -s -s neigh flush all

When to clear the ARP cache: Clearing the cache is a common troubleshooting step when a device’s IP address has recently changed (for example, after a DHCP reassignment) but other devices on the network are still trying to reach it using a stale MAC address associated with its old IP. Flushing the cache forces a fresh ARP request the next time that IP address needs to be reached, resolving the mismatch.

With the basic mechanics and cache management covered, it’s worth understanding that “ARP” isn’t a single monolithic protocol — several related variants exist to handle related but distinct resolution scenarios.

ARP vs. RARP vs. Proxy ARP vs. Gratuitous ARP

Standard ARP handles the most common case — resolving a known IP to its MAC address — but several related protocols and variants exist to handle other resolution scenarios.

ProtocolDirection of ResolutionPrimary Use Case
ARP (Address Resolution Protocol)IP address → MAC addressStandard local network communication, as detailed above
RARP (Reverse ARP)MAC address → IP addressLegacy protocol allowing a device to learn its own IP address at boot, based on its known MAC address (largely superseded by DHCP)
Proxy ARPIP address → MAC address (of a router, on behalf of another device)Allows a router to answer ARP requests on behalf of devices on a different network segment, making two physically separate segments appear to be on the same local network
Gratuitous ARPIP address → MAC address (unsolicited announcement)A device broadcasts its own IP-to-MAC mapping without being asked, typically used to announce a new device joining the network, detect IP conflicts, or update other devices’ ARP caches after a MAC address change (such as during a failover event)

Key distinction: RARP flips the direction of standard ARP’s resolution and has been almost entirely replaced by DHCP for assigning IP addresses at boot. Proxy ARP and Gratuitous ARP, by contrast, are still standard ARP in terms of resolution direction, but differ in who responds and why — a router answering on someone else’s behalf in the case of Proxy ARP, or a device proactively announcing itself in the case of Gratuitous ARP. That same trusting, unsolicited nature of Gratuitous ARP, unfortunately, is also part of what makes ARP vulnerable to the kind of attack covered next.

ARP Spoofing: What It Is and How to Prevent It

Because ARP was designed without any built-in authentication, it trusts replies at face value — a design gap that a well-known attack called ARP spoofing (or ARP poisoning) takes direct advantage of.

What is ARP spoofing? ARP spoofing is an attack where a malicious device sends falsified ARP replies onto a local network, associating its own MAC address with the IP address of another device — often a default gateway or another important host. As covered in the request/reply process earlier, since ARP doesn’t verify that a reply is legitimate, other devices on the network simply update their ARP cache with the falsified mapping.

Why is this dangerous? Once other devices’ ARP caches are poisoned with the attacker’s MAC address, traffic that was meant for the legitimate device (such as the router) gets sent to the attacker’s device instead. This enables a man-in-the-middle attack, where the attacker can intercept, inspect, or even modify traffic before optionally forwarding it on to its real destination, all while the affected devices remain unaware anything is wrong.

Is Gratuitous ARP related to this vulnerability? Yes — the same unsolicited-announcement mechanism used legitimately by Gratuitous ARP (covered in the comparison above) is exactly what an attacker abuses to push a falsified mapping onto the network without needing to wait for anyone to send a request first.

How can ARP spoofing be prevented or detected? Several mitigations are commonly used: Dynamic ARP Inspection (DAI), a feature available on many managed switches, validates ARP packets against a trusted binding table (often built from DHCP snooping records) and drops any that don’t match; static ARP entries can be manually configured for critical devices like default gateways, though this doesn’t scale well on larger networks; network segmentation with VLANs limits the broadcast domain an attacker can poison in the first place; and dedicated ARP-monitoring software can alert administrators when a MAC-to-IP mapping changes unexpectedly, which is often the first sign of an active spoofing attempt.

Is there a permanent fix built into ARP itself? No — the underlying protocol still doesn’t include authentication. The mitigations above work by adding trust and verification at the network infrastructure level (switches, monitoring tools) rather than by changing how ARP itself operates, which is why defending against spoofing remains a matter of network configuration and monitoring rather than a setting within ARP.

From its core function of mapping IP addresses to MAC addresses, through the request-and-reply exchange that makes that mapping possible, to managing the cache it builds, understanding its related variants, and defending against the spoofing attacks its trusting design enables, ARP turns out to be a small protocol with an outsized role in how every local network actually delivers data — and an equally outsized set of security considerations worth taking seriously.

Please follow and like us:
Last modified: September 7, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.