Address Resolution Protocol
1. The Fundamental Problem: Mapping Addresses
The text explains that while every machine on the Internet has an IP address (Network Layer), these addresses are not sufficient for actually sending packets.
-
Hardware Reality: Network Interface Cards (NICs), such as Ethernet cards, do not understand IP addresses. They only understand hardware addresses (MAC addresses), which are 48 bits long.
-
The Disconnect: The OS builds a packet with an IP destination, but the NIC needs a MAC destination to put in the frame header.
-
The Goal: The system needs a way to map a known IP address (e.g.,
192.32.65.5) to an unknown Ethernet address (e.g.,E2).
2. How ARP Works (The Protocol)
The solution is the Address Resolution Protocol (ARP), defined in RFC 826. The process described in the text involves the following steps:
-
Broadcast Request: The sender outputs a broadcast packet onto the Ethernet asking, "Who owns IP address
192.32.65.5?".- Because it is a broadcast (destination
FF:FF:FF:FF:FF:FF), every machine on the LAN receives it.
- Because it is a broadcast (destination
-
Verification: Each machine checks the IP address in the packet against its own.
-
Unicast Reply: The machine with the matching IP address responds directly to the sender with its Ethernet address (e.g., "I am
192.32.65.5and my Ethernet address isE2"). -
Data Transmission: The sender now has the mapping and can build the Ethernet frame to send the IP packet.
Optimizations
To prevent the network from being flooded with ARP broadcasts for every single packet, the text highlights several optimizations:
-
Caching: Once a machine runs ARP, it stores the result in a cache. For subsequent packets to the same destination, it looks up the mapping in the cache instead of broadcasting.
-
Information Sharing (Optimization): When machine A broadcasts a request for machine B, it includes its own IP-to-Ethernet mapping in the request.
-
This allows B to add A to its cache immediately, saving B from having to send a separate ARP request for A later.
-
Other machines on the LAN can also learn A's mapping from this broadcast.
-
-
Soft State: Entries in the ARP cache are usually set to time out (age out) after a few minutes. This ensures that if a machine's network card is replaced (changing its Ethernet address), the incorrect mapping doesn't persist forever.
Gratuitous ARP
The text describes a specific variation called Gratuitous ARP.
-
Definition: When a machine boots up, it broadcasts an ARP request looking for its own IP address.
-
Purpose 1 (Conflict Detection): Normally, no one should answer. If a response arrives, it means two machines have been assigned the same IP address, alerting the network administrator to the error.
-
Purpose 2 (Cache Update): As a side effect, this broadcast allows all other machines on the LAN to update their caches with the sender's new mapping.
Communication Off-Network (The Default Gateway)
If host 1 wants to send a packet to a host on a different network (e.g., the EE network in the text's example), it cannot ARP for the destination directly because routers do not forward Ethernet broadcasts.
-
The Solution: The host sees that the destination IP is remote and instead sends the packet to the Default Gateway (router).
-
The Process:
-
The host performs an ARP request for the Router's IP address.
-
It sends the frame to the Router's Ethernet address.
-
The Router extracts the packet and forwards it to the next network.
-
Summary Checklist for Exam
-
Protocol: ARP (RFC 826).
-
Function: Maps IP addresses (32-bit) to MAC addresses (48-bit).
-
Operation: Broadcast Request → Unicast Reply.
-
Gratuitous ARP: Broadcasting for your own IP to check conflicts and update neighbors' caches.
-
Proxy ARP: A router answering for a remote host to attract traffic destined for it.
Tip
In IPV6, we use Network Discovery Protocol instead of ARP due to different frame size