Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
ARP, Reverse ARP, Inverse ARP, Proxy ARP, and Gratuitous ARP
Address Resolution Protocol (ARP) is a communication protocol that works on the TCP/IP Layer 2, mapping IP addresses to MAC addresses within a local network segment.
ARP helps to get the MAC address of the connected router or gateway from the IP address.
ARP is a request-response protocol in which one device sends a request to another device asking for some information, and the other device responds with the required information.
ARP packets are encapsulated by a link-layer and are distributed only in a specific network. ARP is considered a link-layer protocol.
How Does ARP Work?
The ARP process follows these steps:
Before sending an IP packet, the sender must know the destination MAC address.
If the MAC address is not known, the sender broadcasts an ARP request packet, asking for the MAC address of the intended destination.
Every host inside that network will receive the message, but only the intended receiver host whose IP address matches will accept the packet; all others will discard it.
The receiver will send back a unicast ARP reply packet with its MAC address to the sender.
The sender will receive the ARP reply, update its ARP table, and start sending unicast messages to the destination.
Format of an ARP Packet
An ARP packet contains the following fields:
| Field | Size | Description |
|---|---|---|
| Hardware Type | 16 bits | Defines the network type (e.g., Ethernet = 1) |
| Protocol Type | 16 bits | Protocol being resolved (e.g., IPv4 = 0x0800) |
| Hardware Length | 8 bits | Length of MAC address in bytes (6 for Ethernet) |
| Protocol Length | 8 bits | Length of IP address in bytes (4 for IPv4) |
| Operation | 16 bits | Request (1) or Reply (2) |
| Sender Hardware Address | Variable | MAC address of sender |
| Sender Protocol Address | Variable | IP address of sender |
| Target Hardware Address | Variable | MAC address of target (empty in request) |
| Target Protocol Address | Variable | IP address of target |
Reverse Address Resolution Protocol (RARP)
RARP is used by devices that know their MAC address but need to discover their IP address, typically diskless workstations during boot.
A network administrator creates a mapping table in a RARP server that maps MAC addresses to IP addresses.
When a device boots up, its RARP client broadcasts a request containing its MAC address.
The RARP server responds with the corresponding IP address, which the device stores for future use.
RARP has largely been replaced by more sophisticated protocols like DHCP (Dynamic Host Configuration Protocol).
Inverse Address Resolution Protocol (InARP)
Inverse ARP works opposite to regular ARP − it uses a known MAC address to discover the corresponding IP address.
InARP is primarily used in Frame Relay and ATM networks to map Data Link Connection Identifiers (DLCI) to IP addresses. When a router establishes a Permanent Virtual Circuit (PVC), it uses InARP to discover the IP address of the remote endpoint.
Proxy ARP
Proxy ARP allows a router to answer ARP requests on behalf of devices on different network segments, effectively extending the apparent size of the broadcast domain.
When a host sends an ARP request for an IP address not on its local subnet, a proxy ARP−enabled router can respond with its own MAC address.
The router then forwards traffic destined for that IP address to the appropriate network segment.
This technique can help with network misconfiguration issues but may also mask network design problems.
Gratuitous ARP
Gratuitous ARP is an unsolicited ARP packet sent by a device to announce its presence on the network or update ARP tables.
Key characteristics of Gratuitous ARP:
Both source and destination IP addresses are set to the sender's IP address
Destination MAC address is set to broadcast (FF:FF:FF:FF:FF:FF)
Used for duplicate IP detection, network interface failover, and ARP table updates
No response is expected or sent for gratuitous ARP packets
Conclusion
ARP and its variants provide essential address resolution services in IP networks. While standard ARP maps IP to MAC addresses, RARP, InARP, Proxy ARP, and Gratuitous ARP serve specialized functions for network discovery, failover, and connectivity in various network scenarios.
