Virtual Router Redundancy Protocol
Well I’ve just got a basic understanding of the VRRP protocol and thought I’d write about it. So here goes!
Virtual Router Redundancy Protocol or VRRP is network layer protocol designed to increase the availability of default gateway in a subnet. This is achieved by advertising the default gateway as a virtual router. VRRP is restricted to one network-it can’t advertise IP routes beyond the subnet or affect routing in anyway.
Why is VRRP needed?
There are several ways in which an end host can determine the first hop router to a particular destination. Few of them are
- Running a dynamic routing protocol such as RIP or OSPF
- Using an ICMP based discovery protocol
- Statically configuring the route
The former two methods have several disadvantages associated with them such as
- Processing overhead
- Lack of protocol implementation
- Neighbour/router discovery would require all hosts to participate leading to longer delays.
- If a neighbour dies, it’d lead to very long “black hole” periods.
Statically configuring the route eliminates all of the above disadvantages(except maybe 4) but introduces a major disadvantage in the process-single point of failure. This can be a major catastrophe which end up isolating hosts in a network.
To overcome these difficulties, VRRP was introduced by the IETF. An insight into the working of VRRP would make it clear how it does so.
A few terms that need to be explained before proceeding.
- VRRP Router: A physical router participating in VRRP. It may be part of one or more virtual routers.
- Virtual Router: An abstract object managed by VRRP, which acts as the default router for hosts in a LAN. It consists of a Virtual Router ID and a set of associated IP address.
- IP Address Owner: The physical router that has the virtual IP(associated with a virtual router) as it’s interface address.
- Virtual Router Master: The physical router that is responsible for forwarding the packets send to the virtual router’s IP address. If the IP address owner is active, it becomes the master automatically.
- Virtual Router Backup: The set of backup routers, one of which will take over if the master fails.
Note: A virtual router must use 00-00-5E-00-01-XX as its (MAC) address. The last byte of the address (XX) is the Virtual Router IDentifier (VRID), which is different for each virtual router in the network. This address is used by only one physical router at a time, and it will reply with this MAC address when an ARP request is sent for the virtual router’s IP address. Physical routers within the virtual router must communicate within themselves using packets with multi-cast IP address 22.214.171.124 and IP protocol number 112.
The Master router sends out VRRP messages(physical routers communicate over multi-cast packets only) once every advertisement interval. When a multi-cast packet is not received for a period greater than thrice the advertisement interval, the Master is deemed to have gone down. When the master goes down/when the owner of the virtual IP returns, the Master router changes and a new master is decided(in the former case only).
VRRP provides an election protocol, using which the Master is decided. All routers have a configured priority and the router with highest priority is the one that becomes the Master. This priority is configured manually and can be done by taking various into account such as link usage, router performance etc.
Only during the election process do the backup routers transmit packets. Of course, when a backup router finds that it has higher priority than the master router/the virtual IP owner returns, it initiates the process to become the Master router.