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 3-4 shows the VRRP state transition.
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:
|
Backup |
The VRRP device in Backup state performs the following operations:
|
VRRP Working Process
The VRRP working process is as follows:
- 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.
- The master periodically sends VRRP Advertisement packets to all backups in the VRRP group to advertise its configuration (for example, priority) and running status.
- If the master fails, the backup with the highest priority becomes the master.
- 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.
- 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.