DEV Community

Naval Kishor Upadhyay
Naval Kishor Upadhyay

Posted on

ARP Explained: The Translator Between IP and MAC

When devices talk on a network, they use two very different kinds of addresses:

  • IP addresses → Logical addresses used to identify devices across networks
  • MAC addresses → Physical hardware addresses used inside a local network

The problem? One device might know the IP address it wants to reach, but the actual communication inside the LAN happens using MAC addresses.

Enter ARP (Address Resolution Protocol) — the translator that bridges the gap.


Why Do We Need ARP?

Imagine you want to send a letter. You know your friend’s name (IP address), but the postman only delivers to street addresses (MAC addresses). You need a directory that maps names to addresses.

That’s exactly what ARP does for networks.


How ARP Works (Step by Step)

  1. Device creates a packet

    Your computer knows the IP address it wants to reach.

  2. Check subnet mask

    • If the destination is in the same network, ARP will find the MAC address of that device.
    • If it’s in a different network, ARP will instead find the MAC address of the default gateway (router).
  3. Send ARP request (broadcast)

    • The device broadcasts a message across the LAN: “Who has IP 192.168.1.25? Tell 192.168.1.10.”
  4. Receive ARP reply

    • The target device responds with its MAC address.
    • Example: “192.168.1.25 is at MAC AA:BB:CC:DD:EE:FF.”
  5. Update ARP cache

    • The sender stores this mapping in its ARP table (cache) so it doesn’t have to ask again immediately.

ARP in Action: Same Network vs Different Network

  • Same LAN:

    If your laptop wants to ping the printer at 192.168.1.50, it uses ARP to discover the printer’s MAC address, then sends frames directly.

  • Different LAN:

    If your laptop wants to reach 8.8.8.8 (Google DNS), it uses ARP to discover the MAC address of your router (default gateway). The router then forwards the packet onward.


Limitations of ARP

While ARP is simple and elegant, it has some weaknesses:

  • Broadcast traffic → Each ARP request is sent to all devices on the LAN, which can create noise on large networks
  • No authentication → Attackers can send fake replies (ARP spoofing), tricking devices into sending traffic to the wrong destination
  • Local scope → ARP only works inside a single LAN; routers don’t forward ARP broadcasts

Quick Analogy: Phone Book Lookups

Think of ARP like a phone book:

  • You know someone’s name (IP address)
  • You look it up in the phone book to find their phone number (MAC address)
  • Once you know the number, you can call them directly (send frames)

Without ARP, devices would have no way of connecting IP-level communication to actual hardware on the network.


Final Thoughts

ARP is one of those protocols you never think about — but it’s quietly working behind the scenes every time your device communicates on a local network.

It’s the translator between the logical world of IP addresses and the physical world of MAC addresses.

So, the next time you open a website or print a document, remember: before anything else happens, ARP has already whispered in the background: “This IP belongs to that MAC — here’s where to send it.”

Top comments (0)