Gratuitous ARP

Principles

Gratuitous ARP allows a device to broadcast gratuitous ARP messages that carry the local IP address as both the source and destination IP addresses to notify the other devices on the same network segment of its address information. Gratuitous ARP is used in the following scenarios to ensure the stability and reliability of network communication:

  • You need to check whether the IP address of a device conflicts with the IP address of another device on the same network segment. The IP address of each device must be unique to ensure the stability of network communication.
  • After the MAC address of a host changes after its network adapter is replaced, the host must quickly notify other devices on the same network segment of the MAC address change before the ARP entry is aged. This ensures the reliability of network communication.
  • When a master/backup switchover occurs in a VRRP group, the new master device must notify other devices on the same network segment of its status change.

Related Concepts

Gratuitous ARP uses gratuitous ARP messages. A gratuitous ARP message is a special ARP message that carries the sender's IP address as both the source and destination IP addresses.

Implementation

Gratuitous ARP is implemented as follows:

  • If a device finds that the source IP address in a received gratuitous ARP message is the same as its own IP address, the device sends a gratuitous ARP message to notify the sender of the address conflict.
  • If a device finds that the source IP address in a received gratuitous ARP message is different from its own IP address, the device updates the corresponding ARP entry with the sender's IP and MAC addresses carried in the gratuitous ARP message.
Figure 1 illustrates how gratuitous ARP is implemented.
Figure 1 Gratuitous ARP implementation

As shown in Figure 1, the IP address of Interface 1 on PE1 is 10.1.1.1, and the IP address of Interface 2 on PE2 is 10.1.1.1.
  1. Interface 1 broadcasts an ARP request message. Interface 2 receives the ARP request message and finds that the source IP address in the message conflicts with its own IP address. Interface 2 then performs the following operations:
    1. Sends a gratuitous ARP message to notify Interface 1 of its IP address.
    2. Generates a conflict node on its conflict link and then sends gratuitous ARP messages to Interface 1 at an interval of 5 seconds.
  2. Interface 1 receives the gratuitous ARP messages from Interface 2 and finds that the source IP address in the messages conflicts with its own IP address. Interface 1 then performs the following operations:
    1. Sends a gratuitous ARP message to notify Interface 2 of its IP address.
    2. Generates a conflict node on its conflict link and then sends gratuitous ARP messages to Interface 2 at an interval of 5 seconds.

Interface 1 and Interface 2 send gratuitous ARP messages to each other at an interval of 5 seconds until the address conflict is rectified.

If one interface does not receive a gratuitous ARP message from the other interface within 8 seconds, the interface considers the address conflict rectified. The interface deletes the conflict node on its conflict link and stops sending gratuitous ARP messages to the other interface.

Functions

Gratuitous ARP has the following functions:
  • Checks for IP address conflicts. If a device receives a gratuitous ARP message from another device, the IP addresses of the two devices conflict.

  • Notifies MAC address changes. When the MAC address of a host changes after its network adapter is replaced, the host sends a gratuitous ARP message to notify other devices of the MAC address change before the ARP entry is aged. This ensures the reliability of network communication. After receiving the gratuitous ARP message, other devices maintain the corresponding ARP entry in their ARP tables based on the address information carried in the message.

  • Notifies status changes. When a master/backup switchover occurs in a VRRP backup group, the new master device sends a gratuitous ARP message to notify other devices on the network of its status change.

Benefits

Gratuitous ARP reveals address conflict on a network so that ARP tables of devices can be quickly updated. This feature ensures the stability and reliability of network communication.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >