ARP: How Devices Find Each Other on a Network


INTRODUCTION
To communicate over a local network or the internet, a device needs both an IP address and a MAC address. In our previous discussion on the OSI Model, we established that the MAC address is responsible for hop-to-hop delivery, while the IP address ensures end-to-end delivery. The MAC address operates at Layer 2 of the OSI Model, whereas the IP address functions at Layer 3.
ARP stands for Address Resolution Protocol.
Typically, when two devices communicate, they already know each other's IP addresses. This information can be obtained in various ways, such as manual configuration, DNS resolution, or a simple ping command. However, what they usually don’t know is each other's MAC addresses. This is where ARP (Address Resolution Protocol) comes in.
ARP helps a device discover the MAC address that corresponds to a known IP address. Once found, this mapping is stored in an ARP table—a record of IP addresses and their corresponding MAC addresses.
Let's break down how ARP works by exploring two scenarios:
When a device communicates with another device on the same network.
When a device communicates with another device on a different network.
COMMUNICATION WITHIN THE SAME NETWORK
The Client (in the illustration above) needs to communicate with a Purple Server within the same local network. The Client already knows the Purple Server’s IP address and determines that it belongs to the same network(through a process known as subnetting). To establish a connection and send data, the Client needs the Purple Server’s MAC address.
To get this, the Client sends an ARP request—a broadcast message sent to all devices on the network. This message includes:
The Client’s own IP address
The Client’s MAC address
The IP address of the destination (Purple Server)
A request for the destination’s MAC address
Once the Purple Server receives this request, it responds with its MAC address. The Client then updates its ARP table with the IP-MAC mapping. From that point forward, it can communicate directly without needing another ARP request.
COMMUNICATION ACROSS DIFFERENT NETWORKS
Now, suppose the Client wants to communicate with the Gray Server, which is in a different network. The Client knows the Gray Server’s IP address but cannot reach it directly. Instead, it must first send the packet to the nearest router, also known as the Default Gateway.
Since the Client needs to send the packet through the Default Gateway (R1 in this case), it must first determine the MAC address of R1. It does this by issuing an ARP request, just like in the previous scenario. The router (R1) then responds with its MAC address, which the Client stores in its ARP table.
From there, the packet is forwarded to R1, which then routes it toward its final destination.
KEY TAKEAWAYS ABOUT ARP
When communicating within the same network, a device uses ARP to find the MAC address of the target device.
When communicating across different networks, a device uses ARP to find the MAC address of the Default Gateway.
Packet delivery at Layer 2 (MAC address) is hop-to-hop, while Layer 3 (IP address) ensures end-to-end delivery.
Any device that forwards packets using IP addresses must also use ARP to determine the next hop's MAC address.
Layer 3 devices, such as routers, maintain an ARP table to store MAC address mappings for efficient packet forwarding.
CONCLUSION
ARP is essential for network communication because it bridges Layer 2 and Layer 3 by mapping IP addresses to MAC addresses. Without ARP, devices wouldn’t be able to determine where to send packets at the data link layer, making efficient network communication impossible.
Subscribe to my newsletter
Read articles from Tanimola Miracle directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
