How is the active HSRP router selected?

Redundancy protocol for virtual routers - Virtual Router Redundancy Protocol

Inter-router protocol that automatically assigns routers to hosts

The Virtual Router Redundancy Protocol ( VRRP ) is a computer network protocol that enables the automatic assignment of available Internet Protocol (IP) routers to participating hosts. This increases the availability and reliability of routing paths via the automatic standard gateway selection in an IP subnet.

The protocol accomplishes this by creating virtual routers, which are an abstract representation of multiple routers, that is, primary / active and secondary / standby routers that function as a group. Instead of a physical router, the virtual router is assigned as the default gateway of the participating hosts. If the physical router, routing packets on behalf of the virtual router fails, another physical router is selected to automatically replace it. The physical router that forwards packets at a given point in time is called the primary / active router.

VRRP provides information about the status of a router, not the routes processed and exchanged by that router. Each VRRP instance is limited in scope to a single subnet. No IP routes outside of this subnet are announced or the routing table is influenced in any way. VRRP can be used in Ethernet, MPLS and Token Ring networks with Internet Protocol Version 4 (IPv4) and IPv6.

The protocol is described in Internet Engineering Task Force (IETF) publication RFC 5798, which is an open standard. However, Cisco claims that a similar protocol is patented and licensed with essentially the same facility. In 2001, Cisco's Robert Barr responded to a direct query that no patent claims would be made unless someone tried to make a claim against Cisco. IBM also claims to cover patents and their statement can be read on the IETF website.


A virtual router must use 00-00-5E-00-01-XX as the MAC address (Media Access Control). The last byte of the address (XX) is the VRID (Virtual Router IDentifier), which is different for each virtual router in the network. This address is only used by one physical router at a time and will respond with this MAC address when an ARP request is sent for the virtual router IP address.

Physical routers within the virtual router must communicate within themselves using packets with the multicast IP address and the IP protocol number 112.

Routers have a priority between 1 and 254 and the router with the highest priority becomes the primary / active router. The default priority is 100; For the MAC address owner, the priority is always 255.

Choice of primary / active routers

If a multicast packet is not received by the primary / active router for more than three times the advertisement timer, the secondary / standby routers assume that the primary / active router is dead. The virtual router then goes into a transient state and a voting process is initiated to select the next primary / active router from the secondary / standby routers. This is achieved through the use of multicast packets.

Secondary / standby routers should only send multicast packets during a dialing process. The exception to this rule is that a physical router is configured with a higher priority than the current primary / active router. This means that when connected to the network, the primary / active status is excluded. This allows a system administrator to set a physical router to primary / active status immediately after booting, e.g. B. if that particular router is more powerful than others in the virtual router. The secondary / standby router with the highest priority becomes the primary / active router by increasing its priority over the current primary / active router. It then takes responsibility for forwarding packets that are sent to the MAC address of the virtual gateway. In cases where the secondary / standby routers all have the same priority, the secondary / standby router with the highest IP address becomes the primary / active router.

All physical routers must act as virtual routers in the same local area network (LAN) segment. Communication within the virtual router takes place regularly. This period can be adjusted by changing the display interval timers. The shorter the advertising interval, the shorter the black hole period, but at the expense of more traffic in the network. Security is achieved by only responding to first-hop packets, although other mechanisms are provided to reinforce this, especially against local attacks. The voting process is properly performed using the offset time, which is derived from a router's priority, and is designed to reduce the likelihood of the roaring flock problem occurring during the election. The offset time is given by the formula (256 - priority ) / 256 (expressed in milliseconds).

The utilization of the secondary / standby router can be improved by distributing the load.


VRRP is based on Cisco's proprietary HSRP (Hot Standby Router Protocol) concepts. Although conceptually similar, the protocols are not compatible.


Mellanox implements MAGP, a proprietary protocol based on VRRP that enables active-active operation.

See also


External links