VRRP Overview

VRRP (Virtual Router Redundancy Protocol) is a default gateway redundancy protocol standardized in RFC3768. The concept and mechanism of operation are almost the same as Cisco’s HSRP. Multiple routers are grouped together to form a virtual router. A virtual router has an IP address and a MAC address.

IP address of the virtual router : Specified in the configuration or IP address of the master router
Virtual router MAC address : 00-00-5e-00-01-XX (XX: virtual router ID)

In VRRP, the IP address of the real router can also be specified as the IP address of the virtual router. The real routers then share the roles of master router and backup router. The master router forwards packets destined for the virtual router. The backup router is the router that becomes the new master router when the master router goes down.

When using the IP address of a real router as a virtual router, the priority of the router with that IP address is 255 and it automatically becomes the master router.

The IP address of the virtual router is configured as the default gateway IP address for PCs and servers. Even if the master router goes down, the PCs and servers can continue to communicate to other networks without being aware of it.


VRRP IP address and port number

HSRP messages are encapsulated in UDP, but VRRP messages are encapsulated and forwarded directly in IP. Use 224.0.0.18 as the destination IP address. This is a multicast address reserved for VRRP and received only on VRRP-enabled interfaces. Also, the protocol number in the IP header is 112.

Figure Encapsulation of VRRP messages

How VRRP works

We will look at how it works when a distinct IP address is specified as the virtual router for VRRP, instead of the IP address of the real router.

When VRRP is enabled, VRRP Advertisement is sent; VRRP Advertisement allows multiple routers to recognize virtual router IDs and virtual IP addresses and determine the master router by priority. The master router is determined by priority as in HSRP. The router with the highest priority is the master router. If the priority is the same, the router with the larger IP address is the master router.

Once the master router is determined, VRRP Advertisement will be sent periodically only from the master router. The default VRRP Advertisement sending interval is 1 second. Then, when the periodic VRRP Advertisement from the master router is not received for a certain period of time, the master router is considered to be down. The time that the master router is considered down is called the master down interval and is determined as follows.

Master Down Interval = (VRRP Advertisement transmission interval) × 3 + (256-Priority)/256 (seconds)

If the VRRP Advertisement transmission interval is 1 second and the master router priority is 100, the master down interval is 1 x 3 + (256-100)/256 ≈ 3.61 seconds.

In the following figure, VRRP is enabled on Fa0/0 of R1 and R2; R1 and R2 exchange VRRP Advertisement on Fa0/0 to recognize the IP address 192.168.1.4 of the virtual router. Also, R1 with higher priority becomes the master router; R2 becomes the backup router and will not send VRRP Advertisement.

Figure How VRRP works, Part 1

The VRRP master router, like the HSRP active router, will have the IP/MAC address of the virtual router in addition to the actual IP/MAC address. For example, R1, the master router in the above figure, has a virtual router IP address of 192.168.1.4 and a virtual MAC address of 00-00-5e-00-01-01 in addition to its actual IP/MAC address.

Figure How VRRP works, Part 2

Just as when using HSRP, the PC’s default gateway is configured with the IP address of the virtual router; when the PC attempts to send a packet to other networks, an ARP request is performed to resolve the default gateway’s IP address. The master router responds to the ARP request for the virtual router’s IP address with a virtual MAC address.

The above is the behavior when there is no information on the virtual router’s IP address in the PC’s ARP cache.

When a PC specifies a virtual MAC address in the destination MAC address of the Ethernet header, it is forwarded to the master router, which then routes it.

Figure How VRRP works, Part 3

When the master router goes down, the backup router will not receive periodic VRRP Advertisement. This causes the backup router to recognize that the master router is down and become the new master router. In the figure, when R1 goes down, R2 becomes the new master router and takes over the virtual IP address/MAC address.

Figure How VRRP works, Part 4

As with HSRP, the PC is not aware that the default gateway has switched. Packets destined for other networks are simply encapsulated with an Ethernet header that specifies the virtual MAC address as the destination. It is then forwarded to the new master router, R2, which routes it.

Figure How VRRP works, Part 5

VRRP Tracking

Tracking can be configured in VRRP as in HSRP. Flexibly switch master routers as the network topology changes, except on VRRP-enabled interfaces.

However, Cisco routers do not support VRRP interface tracking configuration, only extended object tracking. If you want the same behavior as interface tracking, you can configure extended object tracking to monitor the state of the local interface.

And in VRRP, preempt is also enabled by default.