Tags:ARP Clustering High-Availability ip IP-Conflict Linux
Gratuitous ARP is a feature of the Address Resolution Protocol wherein the host broadcasts an ARP request for its own hardware address.
A Gratuitous ARP could be a request or a reply. A Gratuitous ARP Request is the one where the Source and Destination IP address will be of the host itself which issues the request and is broadcast to the subnet and normally there will not be a reply.
A Gratuitious ARP reply is again the one where there was no request.
Some of the common usage of Gratuitous ARP are
Avoid/Resolve IP Conflicts
Gratuitous ARP is primarily used to resolve IP conflict issues (another system using the same IP address). When a system gets a ARP request with the Source IP address same as its own then it knows there is IP conflict and alerts accordingly. In Solaris Operating System, this occurs at the boot time to detect if there is an IP conflict.
Update Hardware changes
Gratuitous ARP is also used to send updated hardware address information. Systems that receive gratuitous ARP reply packets will automatically update the ARP table with the IP address with the new MAC Address. For example, the switch to which the device is connected can update its MAC Address table against the switch port.
Clustering & High Availability Solutions
Gratuitous ARP is used in Clustering and High Availability Solution. This could be a simple NIC resilience on the same system or a High Availability between two systems. When the active interface goes down, the IP gets reconfigured to the secondary NIC or to the secondary device. When this change happens, a Gratuitous ARP reply is send to all the devices in the network announcing the MAC change so they can update their ARP tables. The Linux HA project uses Gratuitous ARP for failover process.