What is Address Resolution Protocol (ARP)?
- Akash Shinde
- Aug 30, 2024
- 3 min read
ARP is a protocol use to map IP addresses to MAC Addresses in computer based networks. ARP operates at the Layer 2 i.e. Data Link layer and is essential for proper functioning of IP Based Networks. When a device wants to send data to a remote device in the same network it needs to know the MAC address of the destination device. ARP helps in this process by sending a broadcast request within the network, requesting for the MAC address associated with the IP addresses.

Below is a basic explanation of the functioning of ARP in a local network.
Topology

Let's walk through the detailed step-by-step process on how CE1 in the above topology resolves the MAC address of CE2 using ARP packets. Currently, SWTH1 and SWTH2 have no information about the MAC addresses connected to their ports. We are starting fresh and connecting these two CE devices to SWTH1 and SWTH2. The link between SWTHs is a trunk link with all VLAN's passed.
1. CE1 Initiates ARP Request
Purpose: CE1 wants to communicate with CE2 and needs to find out CE2's MAC address corresponding to IP 10.10.10.2. CE1 checks its ARP cache to see if it already knows CE2’s MAC address. If it doesn't have an entry, it generates an ARP request.
Details: Source IP: 10.10.10.1, Destination IP: 10.10.10.2, Source MAC: AA:AA:AA:AA:AA:AA, Destination MAC: Broadcast (FF:FF:FF:FF:FF:FF)
The ARP request essentially asks: “Who has IP 10.10.10.2? Tell 10.10.10.1 (AA)”.
This ARP request is broadcast to all devices on the local network segment.
Step 2: ARP request at SWTH1
Switch 1 (SWTH1) receives the ARP request. As this is a broadcast frame, SWTH1 does not need to look up its MAC address table; instead, it will forward the ARP request out of all its ports except the one it received the request from (flooding the frame).
Additionally SWTH1 will update the source information received from the ARP Request packet. which it intends to use in future.
SWTH 1 MAC Table looks like below :-
IP 10.10.10.1 MAC AA:AA:AA:AA:AA:AA Port 2
Step 3: ARP request at SWTH2
Switch 2 (SWTH2) receives the ARP request. As this is a broadcast frame, SWTH2 does not need to look up its MAC address table; instead, it will forward the ARP request out of all its ports except the one it received the request from (flooding the frame).
Additionally SWTH2 will update the source information received from the ARP Request packet. which it intends to use in future.
SWTH 2 MAC Table looks like below :-
IP 10.10.10.1 MAC AA:AA:AA:AA:AA:AA Port 1
Step 4: ARP request reaches CE2.
CE2 (10.10.10.2) receives the ARP request. Since the ARP request is asking for its own IP address, CE2 knows it should respond.
CE2 constructs an ARP reply:
ARP Reply (unicast): Source IP: 10.10.10.2, Source MAC: BB:BB:BB:BB:BB:BB,
Destination IP: 10.10.10.1, Destination MAC: AA:AA:AA:AA:AA:AA
The ARP reply says: “I am 10.10.10.2, and my MAC address is BB:BB:BB:BB:BB:BB”.
Step 5: ARP reply at SWTH2
Switch 2 (SWTH2) receives a unicast ARP reply from CE2, as CE2 already knows CE1’s MAC address (AA:AA:AA:AA:AA:AA) from the ARP request packet. SWTH2 examines the source MAC address (BB:BB:BB:BB:BB:BB) and then updates its MAC address table, indicating that MAC address BB:BB:BB:BB:BB:BB can be reached through the port towards CE2.
SWTH 2 MAC Table looks like below :-
IP 10.10.10.1 MAC AA:AA:AA:AA:AA:AA Port 1
IP 10.10.10.2 MAC BB:BB:BB:BB:BB:BB Port 2
SWTH2 then forwards the ARP reply toward SWTH1, using its MAC address table to direct the frame.
Step 6: ARP reply at SWTH1
Switch 1 (SWTH1) receives the ARP reply from SWTH2. Similarly, SWTH1 learns the MAC address of CE2 (BB:BB:BB:BB:BB:BB) and the port towards SWTH2.
SWTH1 updates its MAC address table and forwards the ARP reply to CE1.
SWTH 1 MAC Table looks like below :-
IP 10.10.10.1 MAC AA:AA:AA:AA:AA:AA Port 2
IP 10.10.10.2 MAC BB:BB:BB:BB:BB:BB Port 1
Step 7: ARP reply reaches CE1
CE1 receives the ARP reply from CE2. Now, CE1 knows that the MAC address of the device with IP address 10.10.10.2 (CE2) is BB:BB:BB:BB:BB:BB.
CE1 updates its ARP cache with the new entry: 10.10.10.2 → BB:BB:BB:BB:BB:BB.
At the end of this process, both switches have updated their MAC address tables for CE2, and CE1 has resolved the MAC address for CE2 in its ARP cache.
Comentarios