What Is ARP Used For and How Does It Work?

Every time your laptop sends something to your printer or your router, it first has to work out which physical device on the local network actually owns the address it is aiming at. ARP is the small protocol that does that lookup. It works like calling out a name in a crowded room and waiting for the right person to answer, turning a network address into a hardware address so data can be delivered. The same simplicity that makes ARP quick also means it believes whoever answers, which is why it shows up both in reliable backup systems and in classic network attacks.

Why Devices Need Two Kinds of Address

A device on a local network has two addresses doing different jobs. An IP address is the logical address software uses to say where data should go, and on most networks today it is an IPv4 address made of 32 bits, like 192.168.1.10.1Computer Networks. SmartARP: merging IP and MAC addressing for low-cost gigabit Ethernet networks A MAC address is a 48-bit hardware address built into each network adapter, usually written as six pairs of characters like 3c:22:fb:1a:09:7e.1Computer Networks. SmartARP: merging IP and MAC addressing for low-cost gigabit Ethernet networks

Ethernet and Wi-Fi deliver frames using the MAC address, not the IP address. So before a device can send an IPv4 packet to a neighbor, it needs that neighbor’s MAC address.2Wikipedia. Address Resolution Protocol Discovering the hardware address that goes with an IP address on the same local network is ARP’s whole job.2Wikipedia. Address Resolution Protocol IP addresses are assigned by the network and change when you join a new one, while MAC addresses come with the hardware and stay with the adapter.

ARP is used on local area networks, the devices connected to the same switch or Wi-Fi access point.1Computer Networks. SmartARP: merging IP and MAC addressing for low-cost gigabit Ethernet networks When you reach a website, your device uses ARP to find your router’s MAC address, not the distant server’s. The router then repeats the process on each network along the path.

How an ARP Request and Reply Work

The asking device broadcasts a request, a message every device on the local network receives, containing the IP address it is looking for.2Wikipedia. Address Resolution Protocol The broadcast goes to the special hardware address ff:ff:ff:ff:ff:ff, which means “everyone.”3State University of New York at New Paltz. Address Resolution Protocol Every device reads the request, but only the one with that IP address answers.2Wikipedia. Address Resolution Protocol The owner replies directly to the asker with its MAC address.2Wikipedia. Address Resolution Protocol The asker includes its own addresses so the target learns the asker’s MAC from the request itself and can reply directly. The asker can now wrap its data in a frame addressed to that MAC and send it.

Here is how that plays out at home. Your laptop at 192.168.1.20 wants to print to 192.168.1.50. It broadcasts the question: who has 192.168.1.50? Tell 192.168.1.20. The printer replies with its MAC address, and the laptop then sends the print job.

Each ARP message carries four addresses and a code saying whether it is a question or an answer:

  • Operation code: 1 marks a request and 2 marks a reply.2Wikipedia. Address Resolution Protocol
  • Sender: the sender’s hardware address and IP address are included so the receiver knows who is asking.2Wikipedia. Address Resolution Protocol
  • Target: the target’s IP address is included, and the target’s hardware address is left blank or set to the broadcast value in a request.3State University of New York at New Paltz. Address Resolution Protocol
  • Sizes: on Ethernet with IPv4, hardware addresses take 6 bytes and IP addresses take 4 bytes.3State University of New York at New Paltz. Address Resolution Protocol
  • Header fields: small fields state the network type and the protocol type, which is 0x0800 for IPv4.3State University of New York at New Paltz. Address Resolution Protocol

The ARP Cache and How to View It

Devices don’t ask every time. Each one keeps an ARP cache, a table of IP addresses and the hardware addresses they matched.4Microsoft Learn. arp The device checks this table first and only broadcasts when it has no entry, which keeps the network from filling up with repeated questions.

Each entry has a state and a timeout, and the operating system adds entries when replies arrive and removes stale ones over time.5Oracle Linux Blog. ARP Internals: an in-depth exploration of how ARP functions That means if a device changes its network card, others may briefly hold the old address until the entry expires. On Linux, administrators can adjust settings that control how long entries last.5Oracle Linux Blog. ARP Internals: an in-depth exploration of how ARP functions

An entry isn’t simply present or gone. Operating systems typically move it through states such as reachable, stale, and a probe stage, and the exact names and timings differ by system. When a stale entry is still needed, many systems, Linux for example, send a quick unicast probe to confirm the neighbor is still there rather than broadcasting to everyone again. If the probe gets no answer, the entry is dropped and the device falls back to a fresh broadcast request, so a missing neighbor eventually shows up as a failed or incomplete entry.

Seeing the table takes one command. Typing arp -a in a Windows command prompt or a Linux or macOS terminal shows it.6Auvik. What is an ARP (Address Resolution Protocol) Table? The arp command can also add or delete entries, not only display them.4Microsoft Learn. arp

Each line of the output pairs an IP address with a physical address. Entries marked dynamic were learned automatically, while static ones were typed in by hand. Your router’s IP usually appears near the top since you talk to it constantly. An “incomplete” entry means a request went out but nobody answered.

The table is handy for troubleshooting. If two IPs show the same MAC, one device may be impersonating another, but often it is simply a router answering for others, so this is a clue to investigate rather than proof. Clearing the cache with arp -d forces fresh lookups after a hardware swap. A missing entry for a device you can’t reach suggests it is off or on a different network.

Gratuitous ARP Announcements

Some ARP messages are announcements nobody asked for. A gratuitous ARP is an unsolicited message a device sends to announce its own IP-to-MAC pairing.7NHI Mgmt Group. What Is ARP Used For and How Does It Work? Neighbors update their ARP tables without waiting for old entries to expire.7NHI Mgmt Group. What Is ARP Used For and How Does It Work? If another device answers, or tables keep flipping between two addresses, it can reveal two devices using the same IP address.7NHI Mgmt Group. What Is ARP Used For and How Does It Work?

Many operating systems send a special ARP check when they receive an address, asking in effect whether anyone already uses it before they begin using it. If another device answers, the newcomer typically refuses the address and may show a warning such as an IP address conflict message. A conflict that appears only now and then often traces to two devices fighting over the same address, commonly a manually set IP that overlaps with the range the router hands out. The fix is to give one device a different address, or to reserve addresses in the router so manual and automatic ones don’t overlap.

Backup routers rely on gratuitous ARP to take over smoothly. In redundant setups, two devices often share one IP address, either with separate MAC addresses or with a shared MAC.8Practical Networking.net. Gratuitous ARP – Definition and Use Cases – Practical Networking.net When one router fails, the backup sends a gratuitous ARP saying the gateway IP is now at its MAC address, and hosts update their tables.8Practical Networking.net. Gratuitous ARP – Definition and Use Cases – Practical Networking.net When both IP and MAC are shared, the announcement instead tells switches which port the shared MAC now sits behind.8Practical Networking.net. Gratuitous ARP – Definition and Use Cases – Practical Networking.net Virtual machine migration and replacing a network card create the same stale-address risk that gratuitous ARP shortens.7NHI Mgmt Group. What Is ARP Used For and How Does It Work?

The downside is trust. Any device can send a gratuitous ARP claiming any IP, which is the same trick attackers use. Networks that rely on announcements need ways to tell real ones from fake.

Proxy ARP and Devices That Answer for Others

In proxy ARP, a router answers an ARP request meant for another machine with its own MAC address and then forwards the traffic.9Cisco. Understand Proxy ARP Devices can then reach other subnets without having a default gateway configured.9Cisco. Understand Proxy ARP It is used for clients that can’t set a gateway or have a wrong subnet mask.10NetBeez. Proxy ARP: An insidious default setting Because it is often on by default, it can also hide misconfigurations that later cause hard-to-trace problems.

The telltale sign is a device that reaches another subnet even though its gateway is missing or its subnet mask is too wide, with the router answering requests for addresses that aren’t on its own segment. In the ARP table, several different IP addresses then share the router’s MAC address, which is expected here and not by itself evidence of an attack. Since the device believes remote machines are local, it sends an ARP request for each one, so a network relying on proxy ARP can generate more ARP traffic and larger tables than one with proper gateway settings.

Wireless and data-center gear answers for others to save effort. Newer Wi-Fi access points can reply to ARP requests for sleeping devices, so phones and sensors wake up less and the air carries less broadcast traffic.11MaxLinear. Wi-Fi CERTIFIED 6 Release 2: Better Wireless Connectivity for IoT Many laptop network adapters offer ARP offload, answering requests without waking the computer.12Intel. Advanced Intel Wireless Adapter Settings In Windows, you may see “ARP Offload” under an adapter’s Advanced properties. Leaving it on helps a sleeping laptop stay reachable without draining the battery, and turning it off can help when troubleshooting wake-on-LAN or sleep issues.

In large data-center networks, switches can answer from their own cache instead of flooding a request across the whole network.13NetworkLessons. What Is ARP Used For and How Does It Work In Kubernetes, tools like MetalLB answer ARP requests for a service IP so traffic lands on one node.14Cisco. A Comprehensive Guide to Kubernetes Networking with the Intersight Kubernetes Service

ARP Spoofing and Why ARP Is Easy to Fool

Devices cache ARP replies even when they never asked, and new replies overwrite entries that haven’t expired.15Wikipedia. ARP spoofing ARP has no method to verify who sent a message.15Wikipedia. ARP spoofing So an attacker on the same network can send replies claiming the router’s IP belongs to the attacker’s MAC.16Computer Networks. Collaborative approach to mitigating ARP poisoning-based Man-in-the-Middle attacks This is called ARP spoofing. The victim’s traffic then flows through the attacker, who can read it, alter it, or hijack the connection.16Computer Networks. Collaborative approach to mitigating ARP poisoning-based Man-in-the-Middle attacks The same trick can cut devices off entirely, a denial of service.16Computer Networks. Collaborative approach to mitigating ARP poisoning-based Man-in-the-Middle attacks

The attacker tells your laptop that the router’s IP is at the attacker’s MAC, and tells the router that your IP is at the attacker’s MAC. Both sides now send everything through the attacker, who passes it along so nothing seems wrong. Your connection keeps working, which is why the attack is hard to notice.

The attacker must be connected to the same network as the victim, since ARP only works locally. That limits the risk without removing it: shared networks like cafés, hotels, and open offices are where it is most real. Floods of ARP messages can also be used to overwhelm devices.17IEEE Xplore. Detection and mitigation of ARP storm attacks using software defined networks

A home user can take a few steps. Prefer sites and apps that use HTTPS, which keeps intercepted data unreadable. Use a VPN on public Wi-Fi so local interception only sees encrypted traffic. If something feels off, check arp -a for another IP sharing your router’s MAC, keeping in mind this is one clue rather than proof.

How Networks Block ARP Attacks

Dynamic ARP Inspection (DAI) is a switch feature that intercepts, logs, and discards ARP messages with invalid IP-to-MAC pairings.18Cisco IOS XE. Configuring Dynamic ARP Inspection It relies on DHCP snooping, which watches devices receive their addresses and records each valid MAC, IP, and network segment.19NETGEAR KB. What is Dynamic ARP inspection (DAI) and how does it work with my managed switch? When a device sends an ARP message whose addresses don’t match that record, the switch drops it.19NETGEAR KB. What is Dynamic ARP inspection (DAI) and how does it work with my managed switch? That also means DAI can’t work unless DHCP snooping is turned on.20CCNA® Security Study Guide. Preventing Layer 2 Attacks Improved versions of ARP have also been proposed to block these attacks on wired and wireless networks.21EURASIP Journal on Wireless Communications and Networking. Mitigating ARP poisoning-based man-in-the-middle attacks in wired or wireless LAN

Administrators mark each switch port as trusted or untrusted. Ports facing ordinary computers are untrusted and get checked, while ports linking to other switches or the DHCP server are trusted. On an untrusted port, each message’s sender IP and MAC are compared with the snooping record for that port, and a mismatch means the message is dropped and logged. Choosing trusted ports carelessly weakens protection, since ARP arriving on a trusted port isn’t inspected, so an attacker plugged into one could still spoof.

DAI is found on business-grade managed switches, not typical home routers. Devices with manually set IPs need static entries or they will be blocked. It protects the local segment but doesn’t encrypt anything.

Other defenses help too. Static ARP entries for critical devices like the gateway can’t be overwritten. Monitoring tools can alert when a known IP suddenly changes MAC. Splitting networks into smaller segments limits who can spoof whom.

ARP Relatives RARP and IPv6 Neighbor Discovery

RARP mapped a MAC address to an IP address, the reverse of ARP.22eureka.patsnap.com. What Is ARP Used For and How Does It Work? Diskless workstations couldn’t store their own IP, so at boot they asked a RARP server what it was.23Packet Coders. ARP, RARP, Proxy ARP and GARP Explained RARP was replaced by BOOTP and then DHCP, which is how devices get addresses today.23Packet Coders. ARP, RARP, Proxy ARP and GARP Explained

RARP could only hand back an IP address, with no gateway or other settings. BOOTP and later DHCP supplied the IP address along with the gateway, subnet mask, and DNS server in one exchange.

IPv6 networks use the Neighbor Discovery Protocol, a version of ARP tailored to IPv6.24Lund University. Efficient IPv6 Neighbor Discovery in Wireless Environment Wi-Fi and Kubernetes features that answer ARP for IPv4 have matching Neighbor Discovery versions for IPv6.11MaxLinear. Wi-Fi CERTIFIED 6 Release 2: Better Wireless Connectivity for IoT Most home and office networks still run IPv4 alongside IPv6, so ARP stays in daily use.

In practice, Neighbor Discovery sends its questions to a targeted group address rather than every device. It also handles finding routers, which IPv4 does with separate settings. On a computer, you view its table with commands like ip -6 neigh instead of arp -a.