< Home

VRRP Implementation

VRRP State Machine

VRRP defines three states: Initialize, Master, and Backup. Only the device in Master state can forward packets destined for the virtual IP address. Figure 1 shows the VRRP state transition.

Figure 1 VRRP state transition

Table 1 VRRP states

State

Description

Initialize

VRRP is unavailable. The device in Initialize state cannot process VRRP Advertisement packets.

When VRRP is configured on the device or the device detects a fault, it enters the Initialize state.

After receiving an interface Up message, the VRRP-enabled device whose priority is 255 becomes the master. The VRRP-enabled device whose priority is less than 255 switches to the Backup state.

Master

The VRRP device in Master state performs the following operations:
  • Periodically sends VRRP Advertisement packets.
  • Uses the virtual MAC address to respond to ARP Request packets destined for the virtual IP address.
  • Forwards IP packets destined for the virtual MAC address.
  • Processes the IP packets destined for the virtual IP address if the device is the IP address owner.
  • Becomes the backup if the device receives a VRRP Advertisement packet with a higher priority than its VRRP priority.
  • Becomes the backup if the device receives a VRRP Advertisement packet with the same priority as its VRRP priority and the IP address of the local interface is smaller than that of the connected interface on the remote device.
  • Transitions to the Initialize state when the interface is shut down.

Backup

The VRRP device in Backup state performs the following operations:
  • Receives VRRP Advertisement packets from the master and determines whether the master is working properly.

  • Does not respond to ARP Request packets destined for the virtual IP address.

  • Processes the IP packets destined for the virtual IP address based on the Layer 2 forwarding process.

  • When receiving a packet of a lower priority, it immediately switches to the Master state by default. If non-preemption is configured, the device resets the timer. If a preemption delay is configured, the device resets the timer and switches to the Master state after the preemption delay expires. When receiving a packet of a higher priority, the device resets the timer. When receiving a packet of equal priority, the device resets the timer but does not compare IP addresses.

    Master_Down_Interval timer: If the backup does not receive Advertisement packets after the timer expires, the backup becomes the master. The calculation formula is as follows:
    • Master_Down_Interval = 3 x Advertisement_Interval + Skew_time (offset time)
    • Skew_Time = (256 – Priority)/256
  • If the device receives a VRRP Advertisement packet whose priority is not 0 and lower than its own VRRP priority, the device discards the packet and becomes the master immediately. If the device receives a VRRP Advertisement packet whose priority is 0, the device sets the Skew_time (offset time).
  • Transitions to the master device when receiving the message that MASTER_DOWN_TIMER times out.

  • Transitions to the Initialize state when the interface is shut down.

VRRP Working Process

The VRRP working process is as follows:

  1. Devices in a VRRP group select the master based on their priorities. The master sends gratuitous ARP packets to notify the connected network devices or hosts of the virtual MAC address of the VRRP group.
  2. The master periodically sends VRRP Advertisement packets to all backups in the VRRP group to advertise its configuration (for example, priority) and running status.
  3. If the master fails, the backup with the highest priority becomes the master.
  4. If the original master is replaced by another device in the group, the new master sends gratuitous ARP packets carrying the virtual MAC address and virtual IP address of the virtual router. The new master uses these packets to update the MAC address entry on the connected network devices or hosts. User traffic is then switched to the new master. This process is transparent to users.
  5. When the original master recovers and is the IP address owner (with priority 255), the original master reverts to the Master state. If the priority of the original master is smaller than 255, the device switches to the Backup state. The priority of the device is then restored to its original value before the failure.
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >