ARP is the protocol that bridges IP addresses and MAC addresses on a local network. Without ARP, no device on a LAN could actually deliver packets to its neighbours, and understanding how ARP works is essential for both network engineers and ethical hackers targeting Layer 2 attacks.
When a device on a local network wants to send data to an IP address, it faces a fundamental problem: the network hardware, such as switches and network interface cards, does not understand IP addresses. Hardware operates at the MAC address level. The Address Resolution Protocol (ARP) solves this by maintaining a mapping between IP addresses and MAC addresses, allowing Layer 3 (IP) to communicate with Layer 2 (Ethernet). ARP operates directly on the Ethernet frame and has no port number; it is its own protocol type (EtherType 0x0806).
How ARP works, the request and reply process
Whenever a device needs to send a packet to a local IP address it does not yet know the MAC address for, it initiates an ARP exchange, a two-step broadcast and reply process that resolves the IP to MAC mapping and caches it locally.
ARP request and reply, resolving 192.168.1.1 to its MAC address
| ARP request Broadcast Device A (192.168.1.10) broadcasts to FF:FF:FF:FF:FF:FF, the all-hosts MAC address: “Who has 192.168.1.1? Tell 192.168.1.10.” Every device on the LAN segment receives this frame. | ARP reply Unicast The device with IP 192.168.1.1 (the router) responds directly to Device A with a unicast ARP reply: “192.168.1.1 is at AA:BB:CC:DD:EE:FF.” Only the requester receives this reply. |
| Cache stored ARP table Device A stores the mapping 192.168.1.1 → AA:BB:CC:DD:EE:FF in its ARP cache (also called ARP table) for a short period, typically 60–120 seconds, avoiding repeated broadcasts for the same address. | Packet delivered Ethernet frame Device A wraps the IP packet in an Ethernet frame using the resolved MAC address as the destination and delivers it directly at Layer 2 without any further ARP requests until the cache entry expires. |
The ARP cache can be viewed on any device: arp -a on Linux, macOS, or Windows displays all currently cached IP to MAC mappings. On a compromised machine, the ARP cache reveals every device the host has recently communicated with, a valuable network topology enumeration tool in post-exploitation.
The ARP cache, live view
ARP cache output — arp -a

Notice the gateway IP 192.168.1.1 appearing twice with different MAC addresses — a clear indicator of an active ARP spoofing attack. The attacker has poisoned the ARP cache with their own MAC address for the gateway IP, redirecting all outbound traffic through their machine for interception.
ARP-based attacks and defenses
| Attack ARP spoofing (poisoning) An attacker sends unsolicited ARP replies — called gratuitous ARP — associating their MAC address with the gateway’s IP. Victims update their ARP cache with the false mapping, routing all traffic through the attacker — enabling a man-in-the-middle position. Tool: arpspoof, Ettercap, Bettercap. | Attack ARP cache poisoning + MitM Once the attacker holds a MitM position via ARP spoofing, they can intercept, read, and modify all traffic between the victim and the gateway — capturing credentials, session tokens, and plaintext HTTP data in real time using tools like Wireshark or mitmproxy. |
| Defense Dynamic ARP Inspection (DAI) A managed switch feature that validates ARP packets against a trusted DHCP snooping binding table. ARP replies that do not match a known IP-to-MAC-to-port binding are dropped — blocking spoofed ARP packets at the switch level before they reach any host. | Defense Static ARP entries Manually adding critical IP-to-MAC mappings (gateways, servers) as static ARP entries using arp -s prevents those entries from being overwritten by gratuitous ARP packets — though this is only practical for a small number of critical hosts. |
| Defense ARP monitoring tools Tools like arpwatch monitor ARP traffic and alert on unexpected IP-to-MAC mapping changes — detecting ARP spoofing attempts in real time by flagging duplicate IP entries with different MACs in the ARP cache. | Defense Encrypt all traffic (TLS/VPN) Even if an attacker achieves a MitM position via ARP spoofing, end-to-end encryption (HTTPS/TLS, VPN tunnels) renders the intercepted traffic unreadable — making ARP poisoning a much less impactful attack when encryption is enforced everywhere. |
ARP spoofing is one of the most commonly demonstrated techniques in internal penetration testing because it requires only local network access — no credentials or exploits needed. Finding a network without Dynamic ARP Inspection (DAI) configured is a critical internal finding. It means any device on the network can silently intercept traffic from any other device on the same subnet.

