🌍 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.
IP Address: Apartment Number (logical, easy for humans)
MAC Address: Street Address (physical, unique identifier for devices)
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)
ARP Request (Broadcast)
The sender broadcasts: “Who has IP 192.168.1.5?”
This message is sent to all devices on the LAN.
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.
Cache Mapping
The sender saves this mapping in the ARP cache for future use.
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 .
Join the conversation! Your thoughts help the community grow.