🌍 Introduction to ARP

When applications send or receive data, they usually deal with IP addresses. But under the hood, actual communication over a local network (LAN) requires MAC addresses. Think of it like this.

So, to communicate correctly, devices must know the MAC address of the destination device. This is where ARP comes in—it converts IP addresses into MAC addresses.

❓ What is Address Resolution Protocol (ARP)?

ARP stands for Address Resolution Protocol , a protocol defined in RFC 826 (1982) . It belongs to the Data Link Layer (Layer 2) of the OSI model. Its primary function is to determine the hardware address (MAC address) of a device based on its IP address.

👉 In short: ARP = IP → MAC Mapping.

Note: ARP is mainly used in IPv4 networks. In IPv6, ARP is replaced by the Neighbor Discovery Protocol (NDP).

🔎 How ARP Works (Step-by-Step)

  1. ARP Request (Broadcast)

    • The sender broadcasts: “Who has IP 192.168.1.5?”

    • This message is sent to all devices on the LAN.

  2. ARP Reply (Unicast)

    • The device with that IP responds: “192.168.1.5 is at AA:BB:CC:DD:EE: FF.”

    • This reply is sent directly to the requester.

  3. Cache Mapping

    • The sender saves this mapping in the ARP cache for future use.

  4. Communication

    • Now the sender can send packets directly to the MAC address.

⚡ Example: Your laptop (192.168.1.10) wants to send data to a printer (192.168.1.20). Laptop asks the network, “Who has 192.168.1.20?” → Printer replies with its MAC → Laptop stores it → Communication begins.

🛠️ ARP Cases in Networking

Case 1: Same Network Communication

Sender and receiver are in the same LAN → ARP finds the receiver’s MAC.

Case 2: Different Networks (via Router)

If the destination is outside the LAN → ARP finds the MAC of the next-hop router .

Case 3: Router to Router

A router forwarding packets uses ARP to find the MAC of the next router.

Case 4: Router to Host in Same Network

A router uses ARP to find the final host’s MAC.

Note: ARP request is always a broadcast , ARP reply is always a unicast .

🖥️ ARP Cache & Commands

When an IP is mapped to a MAC, ARP saves it in a table called the ARP Cache. This avoids repeated broadcasts.

🔍 To check ARP cache on your computer.

  
    arp -a
  

This will list IP addresses and their associated MAC addresses.

🔄 Types of ARP

1. 🔁 Reverse ARP (RARP)

Used when a device knows only its MAC address but needs its IP address. Example: A new device requests its IP from the router’s ARP table.

2. 🧑‍💻 Proxy ARP

A router answers ARP requests on behalf of another device. This helps devices on different segments communicate as if they are on the same LAN.

3. 🔃 Inverse ARP (InARP)

The opposite of ARP—it finds the IP address of a device when its MAC is already known. Common in ATM and Frame Relay networks.

4. 📢 Gratuitous ARP

A device sends an ARP message about its own IP-to-MAC mapping. This is often used for updating caches or preventing duplicate IP issues.

🔗 Relationship Between ARP, DNS, and DHCP

👉 Complete flow: Domain → DNS → IP → ARP → MAC → Communication

⚠️ ARP Security Concerns

ARP is simple, but it’s also insecure. It can be exploited in attacks.

📜 History and Future of ARP

✅ Advantages of ARP

❌ Disadvantages of ARP

📝 Summary

ARP (Address Resolution Protocol) is like a translator that ensures smooth communication in networks. It maps IP addresses (logical) to MAC addresses (physical). Without ARP, devices would not know how to deliver data packets over a LAN. Though efficient, ARP has weaknesses like spoofing, which makes security measures necessary. In IPv6, ARP is replaced by NDP, but for IPv4 networks, ARP remains a fundamental and widely used protocol.