< Home

VRRP Router Priority and Preemption

In the VRRP redundancy scheme, the priority and preemption of VRRP routers determine the role that each VRRP router plays and what happens if the master fails.
  • Preemption

    Devices in a VRRP operate in either of the following modes:

    • Preemption mode: If the priority of a backup is higher than the priority of the current master, the backup automatically becomes the master. To enable the device with a higher priority in a VRRP group to be the master, set the preemption mode on the device.

    • Non-preemption mode: If the master is working properly, the backup with a higher priority cannot become the master.

  • Priority

    VRRP determines the device role in the virtual router based on device priorities and IP address.

    The VRRP-enabled device in a VRRP group initially works in Initialize state. After receiving an interface Up message, the VRRP-enabled device with priority 255 directly becomes the master. The VRRP-enabled device with the priority less than 255 switches to the Backup state, and then reverts to the Master state after the Master_Down_Interval timer expires. The device that first switches to the Master state obtains the priorities of other devices in the group by exchanging VRRP Advertisement packets. Then the master is selected according to the following conditions:
    • If the master priority in VRRP Advertisement packets is higher than or equal to the priority of the device, the backup remains in Backup state.

    • If the master priority in VRRP Advertisement packets is lower than the priority of the device, the backup switches to the Master state in preemption mode and remains in Backup state in non-preemption mode.

    • If multiple devices in the VRRP group switch to the master, the devices with a lower priority switch to the Backup state and the device with the highest priority becomes the master after these devices exchange VRRP Advertisement packets. If multiple devices have the same priority, the device where the interface with the largest IP address resides is the master.

    • If the device is the IP address owner, it switches to the Master state immediately after receiving an interface Up message.

  • Advertising the master status

    The master periodically sends VRRP Advertisement packets to all backups in the VRRP group to advertise its configuration (for example, priority) and running status. The backup determines whether the master works properly based on the received VRRP Advertisement packets.
    • When the master does not remain in Master state, for example, the master leaves the group, it sends a VRRP Advertisement packet with priority 0. In this manner, a backup can switch to the master immediately without waiting for the Master_Down_Interval timer to time out. The switchover period is called the Skew time and is measured in seconds. The value is calculated using the following formula:

      Skew time = (256 - Backup priority)/256

    • If the master cannot send VRRP Advertisement packets due to network faults, the backups cannot learn the running status of the master immediately. The backups consider the master faulty only after the Master_Down_Interval timer expires. Then a backup switches to the Master state. The Master_Down_Interval is calculated using the following formula:

      Master_Down_Interval = 3 x Advertisement_Interval + Skew_time (in seconds)

    If congestion occurs on a network, the backup may not receive VRRP Advertisement packets from the master within the period of Master_Down_Interval. A backup then switches to the Master state. If a VRRP Advertisement packet from the original master reaches the backup (new master), the new master reverts to the Backup state. In this case, the VRRP group status changes frequently, which may interrupt services. To solve the problem, the preemption delay is used. When the Master_Down_Interval timer expires, the backup waits for the preemption delay. If the backup does not receive a VRRP Advertisement packet within the preemption delay, it switches to the Master state.

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