Skip to content
We areTOP 1%

How does ARP find the MAC address for an IP address?

MediumConceptARP, DHCP & NAT
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

ARP (Address Resolution Protocol) finds the MAC address that belongs to an IPv4 address on the same local network. It is needed because Ethernet and Wi-Fi deliver frames by MAC address, while IP knows only IP addresses.

  • The sender first checks its ARP cache, a table of recent IP-to-MAC mappings. On a miss, it broadcasts an ARP request to FF:FF:FF:FF:FF:FF asking who owns the target IP address; only the owner sends back a unicast ARP reply, and the sender caches the answer for a short time.
  • For a destination on another network, the host does not ARP for the remote IP. It ARPs for its default gateway (the router) and sends the frame there.
  • ARP has no authentication, so an attacker can send fake replies (ARP spoofing) to intercept traffic. IPv6 replaces ARP with Neighbor Discovery.

Example: Host A (192.168.1.10) wants to send to host B (192.168.1.20) on the same LAN:

A -> broadcast : "Who has 192.168.1.20? Tell 192.168.1.10"
B -> A         : "192.168.1.20 is at AA:BB:CC:11:22:33"
A caches 192.168.1.20 -> AA:BB:CC:11:22:33 and sends its frame to B

More in ARP, DHCP & NAT

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account