RFC 5798

Virtual Router Redundancy Protocol (VRRP) Version 3 for IPv4 and IPv6

๐Ÿ“… published March 2010, from ietf

RFC 5798: Virtual Router Redundancy Protocol (VRRP) Version 3 for IPv4 and IPv6 ๐Ÿฆ‹

okay bestie, let's get into it ๐Ÿ’– This is RFC 5798 from the IETF, written by S. Nadas, Ed. at Ericsson. It's dated March 2010, and it's a Standards Track document, so it's an actual official Internet standard ๐Ÿ”ฅ It obsoletes RFC 3768, which means this version replaces that older one, and it's ISSN 2070-1721 if you're keeping track ๐Ÿงš (this is Part 1 of 8, so more is coming!)


Abstract โœจ

okay so this memo defines the Virtual Router Redundancy Protocol (VRRP) for IPv4 and IPv6 ๐ŸŒธ it's version three of the protocol, and it builds on the VRRP version 2 for IPv4 from RFC 3768 and on "Virtual Router Redundancy Protocol for IPv6" ๐Ÿ’… VRRP is an election protocol, which means the routers on a LAN vote (kinda) to decide who's in charge of a virtual router ๐Ÿ‘‘ the one that wins is called the Master, and it forwards the packets sent to that virtual router's IPv4 or IPv6 addresses ๐Ÿฆ‹

the Master gets configured with the virtual IPv4 or IPv6 addresses, and the Backup routers figure out which address family they're dealing with based on the transport protocol ๐Ÿซถ inside a single VRRP router, the IPv4 virtual routers and the IPv6 virtual routers are their own separate little worlds and never overlap ๐ŸŒˆ if the Master goes down, the election gives you dynamic failover, so forwarding just moves to someone else โœจ

for IPv4, the big win is a higher-availability default path, and you don't have to configure dynamic routing or router discovery protocols on every single end host ๐Ÿ’– for IPv6, the win is a quicker switchover to Backup routers than you'd get from the standard IPv6 Neighbor Discovery mechanisms ๐Ÿ”ฅ ngl that's a huge deal.


Status of This Memo โœจ

This is an Internet Standards Track document. ๐ŸŽ€

This document is a product of the Internet Engineering Task Force (IETF) ๐ŸŒธ it represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication ๐Ÿ’… if you want more info on Internet Standards, check out Section 2 of RFC 5741 ๐Ÿงš

info about this document's current status, any errata, and how to send feedback lives at http://www.rfc-editor.org/info/rfc5798 ๐Ÿซถ


Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved. ๐ŸŽ€

this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as they stand on the publication date ๐Ÿ’– please actually read these, because they spell out your rights and restrictions for this document ๐Ÿ™ˆ any Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as the Simplified BSD License describes ๐Ÿฆ‹

this document may include material from IETF Documents or IETF Contributions that were published or made publicly available before November 10, 2008 ๐ŸŒˆ the people controlling the copyright in some of that material may not have given the IETF Trust permission to allow modifications outside the IETF Standards Process ๐Ÿ˜ญ so unless you get an adequate license from whoever controls that copyright, this document may not be modified outside the IETF Standards Process, and derivative works may not be created outside it either. the only exceptions are formatting it for publication as an RFC or translating it into languages other than English ๐Ÿ’…


Table of Contents โœจ

   1. Introduction ....................................................4
      1.1. A Note on Terminology ......................................4
      1.2. IPv4 .......................................................5
      1.3. IPv6 .......................................................6
      1.4. Requirements Language ......................................6
      1.5. Scope ......................................................7
      1.6. Definitions ................................................7
   2. Required Features ...............................................8
      2.1. IPvX Address Backup ........................................8
      2.2. Preferred Path Indication ..................................8
      2.3. Minimization of Unnecessary Service Disruptions ............9
      2.4. Efficient Operation over Extended LANs .....................9
      2.5. Sub-Second Operation for IPv4 and IPv6 .....................9
   3. VRRP Overview ..................................................10
   4. Sample Configurations ..........................................11
      4.1. Sample Configuration 1 ....................................11
      4.2. Sample Configuration 2 ....................................13

   5. Protocol .......................................................14
      5.1. VRRP Packet Format ........................................15
           5.1.1. IPv4 Field Descriptions ............................15
                  5.1.1.1. Source Address ............................15
                  5.1.1.2. Destination Address .......................15
                  5.1.1.3. TTL .......................................16
                  5.1.1.4. Protocol ..................................16
           5.1.2. IPv6 Field Descriptions ............................16
                  5.1.2.1. Source Address ............................16
                  5.1.2.2. Destination Address .......................16
                  5.1.2.3. Hop Limit .................................16
                  5.1.2.4. Next Header ...............................16
      5.2. VRRP Field Descriptions ...................................16
           5.2.1. Version ............................................16
           5.2.2. Type ...............................................17
           5.2.3. Virtual Rtr ID (VRID) ..............................17
           5.2.4. Priority ...........................................17
           5.2.5. Count IPvX Addr ....................................17
           5.2.6. Rsvd ...............................................17
           5.2.7. Maximum Advertisement Interval (Max Adver Int) .....17
           5.2.8. Checksum ...........................................18
           5.2.9. IPvX Address(es) ...................................18
   6. Protocol State Machine .........................................18
      6.1. Parameters Per Virtual Router .............................18
      6.2. Timers ....................................................20
      6.3. State Transition Diagram ..................................21
      6.4. State Descriptions ........................................21
           6.4.1. Initialize .........................................21
           6.4.2. Backup .............................................22
           6.4.3. Master .............................................24
   7. Sending and Receiving VRRP Packets .............................26
      7.1. Receiving VRRP Packets ....................................26
      7.2. Transmitting VRRP Packets .................................27
      7.3. Virtual Router MAC Address ................................28
      7.4. IPv6 Interface Identifiers ................................28
   8. Operational Issues .............................................29
      8.1. IPv4 ......................................................29
           8.1.1. ICMP Redirects .....................................29
           8.1.2. Host ARP Requests ..................................29
           8.1.3. Proxy ARP ..........................................30
      8.2. IPv6 ......................................................30
           8.2.1. ICMPv6 Redirects ...................................30
           8.2.2. ND Neighbor Solicitation ...........................30
           8.2.3. Router Advertisements ..............................31
      8.3. IPvX ......................................................31
           8.3.1. Potential Forwarding Loop ..........................31
           8.3.2. Recommendations Regarding Setting Priority Values ..32

      8.4. VRRPv3 and VRRPv2 Interoperation ..........................32
           8.4.1. Assumptions ........................................32
           8.4.2. VRRPv3 Support of VRRPv2 ...........................32
           8.4.3. VRRPv3 Support of VRRPv2 Considerations ............33
                  8.4.3.1. Slow, High-Priority Masters ...............33
                  8.4.3.2. Overwhelming VRRPv2 Backups ...............33
   9. Security Considerations ........................................33
   10. Contributors and Acknowledgments ..............................34
   11. IANA Considerations ...........................................35
   12. References ....................................................35
      12.1. Normative References .....................................35
      12.2. Informative References ...................................36
   Appendix A. Operation over FDDI, Token Ring, and ATM LANE .........38
      A.1. Operation over FDDI .......................................38
      A.2. Operation over Token Ring .................................38
      A.3. Operation over ATM LANE ...................................40

1. Introduction โœจ

okay so this memo defines VRRP for IPv4 and IPv6, and it's version three of the protocol ๐ŸŽ€ it's based on VRRP version 2 for IPv4, which is defined in [RFC3768], and on [VRRP-IPv6] ๐Ÿ’– VRRP is an election protocol that dynamically assigns responsibility for a virtual router to one of the VRRP routers on a LAN ๐Ÿ‘‘ the VRRP router that controls the IPv4 or IPv6 address(es) tied to a virtual router is called the Master, and it forwards packets sent to those addresses ๐Ÿฆ‹ VRRP Master routers get configured with virtual IPv4 or IPv6 addresses, and VRRP Backup routers infer the address family of the virtual addresses being carried from the transport protocol ๐Ÿซถ inside a VRRP router, the virtual routers for IPv4 and IPv6 are a domain unto themselves and don't overlap ๐ŸŒˆ and the election process gives you dynamic failover in forwarding responsibility if the Master becomes unavailable โœจ

VRRP does a similar job to the proprietary protocols "Hot Standby Router Protocol (HSRP)" [RFC2281] and "IP Standby Protocol" [IPSTB] ๐Ÿ’…

1.1. A Note on Terminology ๐Ÿงš

this document covers both IPv4 and IPv6 operation, and a lot of the VRRP descriptions and procedures are the same for both ๐ŸŒธ it would be less wordy to just say "IP" to mean "IPv4 or IPv6," but historically the term "IP" usually means IPv4 ๐Ÿ™ˆ so in this specification, the term "IPvX" (where X is 4 or 6) is introduced to mean either "IPv4" or "IPv6" ๐Ÿ’– wherever the IP version actually matters, the document uses the right term and avoids saying "IP" ๐Ÿซถ

1.2. IPv4 โœจ

Okay so there are a bunch of ways an IPv4 end-host can figure out its first-hop router toward a particular IPv4 destination ๐Ÿงญ. It can run (or snoop on) a dynamic routing protocol like Routing Information Protocol [RFC2453] or OSPF version 2 [RFC2328], run an ICMP router discovery client [RFC1256], or just use a statically configured default route ๐Ÿ’….

Running a dynamic routing protocol on every end-host might be infeasible for a bunch of reasons ๐Ÿ˜ญ: admin overhead, processing overhead, security issues, or no protocol implementation for some platforms. Neighbor or router discovery protocols may need every host on a network to actively participate, which means big timer values so the overhead doesn't explode when there are tons of hosts ๐Ÿ™ˆ. That can cause a seriously long delay in noticing a lost (aka dead) neighbor, and that delay can introduce unacceptably long "black hole" periods ๐Ÿ’€.

The static default route is super popular ๐Ÿ’–. It keeps configuration and processing overhead on the end-host super low, and basically every IPv4 implementation supports it. This mode will probably stick around as dynamic host configuration protocols [RFC2131] get deployed, since those usually hand out an end-host IPv4 address and default gateway. BUT this creates a single point of failure ๐Ÿšจ. Losing the default router is a catastrophic event, isolating every end-host that can't detect any alternate path that might be available ๐Ÿ’€.

VRRP is designed to eliminate that single point of failure in the static default-routed environment ๐Ÿฆ‹. It has an election protocol that dynamically assigns responsibility for a virtual router to one of the VRRP routers on a LAN. The VRRP router controlling the IPv4 address(es) associated with a virtual router is called the Master, and it forwards packets sent to those IPv4 addresses. If the Master becomes unavailable, the election process gives you dynamic failover in forwarding responsibility ๐Ÿ‘‘. Any of the virtual router's IPv4 addresses on a LAN can then be used as the default first hop router by end-hosts. The big win with VRRP is a higher-availability default path without needing dynamic routing or router discovery protocols on every end-host ๐ŸŽ€.

1.3. IPv6 ๐ŸŒธ

IPv6 hosts on a LAN will usually learn about one or more default routers by receiving Router Advertisements sent using the IPv6 Neighbor Discovery (ND) protocol [RFC4861]. The Router Advertisements are multicast periodically, at a rate where the hosts will learn about the default routers in a few minutes. They aren't sent frequently enough to rely on a missing Router Advertisement to detect router failures โณ.

ND includes a mechanism called Neighbor Unreachability Detection, which detects the failure of a neighbor node (router or host) or the forwarding path to a neighbor ๐Ÿ”. It does this by sending unicast ND Neighbor Solicitation messages to the neighbor node. To reduce the overhead of sending Neighbor Solicitations, they only go to neighbors the node is actively sending traffic to, and only after there's been no positive indication that the router is up for a period of time. With the default ND parameters, it takes a host about 38 seconds to learn that a router is unreachable before it switches to another default router ๐Ÿ˜ฌ. That delay would be super noticeable to users and could make some transport protocol implementations time out ๐Ÿ™ˆ.

Could ND unreachability detection be made quicker by changing the parameters to be more aggressive? Sure, the current lower limit for this is 5 seconds ๐Ÿ“‰. But that would significantly increase the overhead of ND traffic, especially when there are many hosts all trying to determine the reachability of one or more routers ๐Ÿ“ˆ.

VRRP for IPv6 gives a much faster switchover to an alternate default router than standard ND procedures can ๐Ÿƒโ€โ™€๏ธ. With VRRP, a Backup router can take over for a failed default router in around three seconds (using VRRP default parameters) โšก. This happens without any interaction with the hosts and with a minimum amount of VRRP traffic ๐Ÿงš.

1.4. Requirements Language ๐Ÿ’œ

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

1.5. Scope ๐Ÿ”ญ

The rest of this document describes the features, design goals, and theory of operation of VRRP. It presents the message formats, protocol processing rules, and state machine that guarantee convergence to a single Virtual Router Master. Finally, it covers operational issues related to MAC address mapping, handling of ARP requests, generation of ICMP redirect messages, and security issues ๐Ÿ›ก๏ธ.

1.6. Definitions ๐Ÿ“–

Here's the glossary, bestie. Read these before anything else, because they're used everywhere:

   VRRP Router             A router running the Virtual Router
                           Redundancy Protocol.  It may participate as
                           one or more virtual routers.

   Virtual Router          An abstract object managed by VRRP that acts
                           as a default router for hosts on a shared
                           LAN.  It consists of a Virtual Router
                           Identifier and either a set of associated
                           IPv4 addresses or a set of associated IPv6
                           addresses across a common LAN.  A VRRP Router
                           may back up one or more virtual routers.

   IP Address Owner        The VRRP router that has the virtual router's
                           IPvX address(es) as real interface
                           address(es).  This is the router that, when
                           up, will respond to packets addressed to one
                           of these IPvX addresses for ICMP pings, TCP
                           connections, etc.

   Primary IP Address      In IPv4, an IPv4 address selected from the
                           set of real interface addresses.  One
                           possible selection algorithm is to always
                           select the first address.  In IPv4 mode, VRRP
                           advertisements are always sent using the
                           primary IPv4 address as the source of the
                           IPv4 packet.  In IPv6, the link-local address
                           of the interface over which the packet is
                           transmitted is used.

   Virtual Router Master   The VRRP router that is assuming the
                           responsibility of forwarding packets sent to
                           the IPvX address(es) associated with the
                           virtual router, answering ARP requests
                           for the IPv4 address(es), and answering ND
                           requests for the IPv6 address(es).  Note that
                           if the IPvX address owner is available, then
                           it will always become the Master.

   Virtual Router Backup   The set of VRRP routers available to assume
                           forwarding responsibility for a virtual
                           router should the current Master fail.

2. Required Features ๐ŸŽ€

This section outlines the set of features that were considered mandatory and that guided the design of VRRP ๐Ÿงฉ.

2.1. IPvX Address Backup ๐Ÿซถ

Backup of an IPvX address or addresses is the primary function of VRRP. While providing election of a Virtual Router Master and the additional functionality described below, the protocol should strive to:

  • Minimize the duration of black holes.
  • Minimize the steady-state bandwidth overhead and processing complexity.
  • Function over a wide variety of multiaccess LAN technologies capable of supporting IPvX traffic.
  • Allow multiple virtual routers on a network for load balancing.
  • Support multiple logical IPvX subnets on a single LAN segment.

2.2. Preferred Path Indication ๐Ÿ‘‘

A simple model of Master election among a set of redundant routers is to treat each router with equal preference and claim victory after converging to any router as Master. However, there are likely to be many environments where there is a distinct preference (or range of preferences) among the set of redundant routers. For example, this preference may be based upon access link cost or speed, router performance or reliability, or other policy considerations. The protocol should allow the expression of this relative path preference in an intuitive manner and guarantee Master convergence to the most preferential router currently available ๐Ÿ†.

2.3. Minimization of Unnecessary Service Disruptions ๐ŸŒˆ

Once Master election has been performed, any unnecessary transitions between Master and Backup routers can result in a disruption in service ๐Ÿ˜ฌ. The protocol should ensure after Master election that no state transition is triggered by any Backup router of equal or lower preference as long as the Master continues to function properly.

Some environments may find it beneficial to avoid the state transition triggered when a router that is preferred over the current Master becomes available. It may be useful to support an override of the immediate convergence to the preferred path ๐Ÿฆ‹.

2.4. Efficient Operation over Extended LANs ๐Ÿงš

Sending IPvX packets (that is, sending either IPv4 or IPv6) on a multiaccess LAN requires mapping from an IPvX address to a MAC address. The use of the virtual router MAC address in an extended LAN employing learning bridges can have a significant effect on the bandwidth overhead of packets sent to the virtual router. If the virtual router MAC address is never used as the source address in a link-level frame, then the station location is never learned, resulting in flooding of all packets sent to the virtual router ๐ŸŒŠ. To improve the efficiency in this environment, the protocol should: 1) use the virtual router MAC address as the source in a packet sent by the Master to trigger station learning; 2) trigger a message immediately after transitioning to the Master to update the station learning; and 3) trigger periodic messages from the Master to maintain the station learning cache ๐Ÿ’–.

2.5. Sub-Second Operation for IPv4 and IPv6 โšก

okay so sub-second detection of a failed Master VRRP router is needed in BOTH IPv4 and IPv6 environments, no cap ๐Ÿซถ. The earlier work came up with this idea for IPv6, and this spec is basically like, let's borrow that same approach for IPv4 and IPv6 ๐Ÿ’….

bestie, here's a sneaky problem ๐Ÿ˜ญ. When you use small VRRP_Advertisement_Intervals, and a router is shoving more packets onto the LAN than the LAN can handle, a queue starts piling up inside the router. Packets going onto the VRRP-protected LAN could then see more queueing delay than the smallest VRRP Advertisement_Interval. At that point the Master_Down_Interval is so small that normal queuing delays might make a VRRP Backup think the Master is down, so it promotes itself to Master ๐Ÿ™ˆ. Right after, the delayed VRRP packets from the Master show up and flip things back to Backup status. And ngl, this can repeat many times per second, which is seriously disruptive to traffic ๐Ÿ’€.

To deal with this, priority forwarding of VRRP packets should be considered ๐ŸŽ€. It should also be possible for a VRRP Master to notice when this is happening a lot, and at least log the problem ๐Ÿ“. main character logging energy โœจ.


3. VRRP Overview ๐Ÿฆ‹

VRRP is an election protocol that gives you the virtual router function we talked about earlier ๐Ÿ’–. All of the protocol messaging happens using either IPv4 or IPv6 multicast datagrams, so it can run over a whole bunch of multiaccess LAN technologies that support IPvX multicast ๐ŸŒˆ. Each link of a VRRP virtual router gets one well-known MAC address. This document currently only details the mapping to networks that use the IEEE 802 48-bit MAC address. The virtual router MAC address is used as the source in all periodic VRRP messages sent by the Master router, which helps bridge learning in an extended LAN ๐Ÿง .

A virtual router is defined by its virtual router identifier (VRID) and a set of either IPv4 or IPv6 address(es). A VRRP router can link a virtual router with its real address on an interface ๐ŸŽ€. The scope of each virtual router is limited to a single LAN. A VRRP router can also be set up with extra virtual router mappings and priorities for the virtual routers it's willing to back up. The mapping between the VRID and its IPvX address(es) must be coordinated among all VRRP routers on a LAN, so everyone's on the same page ๐Ÿซถ.

There is no restriction on reusing a VRID with a different address mapping on different LANs. There's also no restriction on using the same VRID number for a set of IPv4 addresses and a set of IPv6 addresses. Just know that those are two different virtual routers ๐Ÿ‘ฏ.

To keep network traffic low, only the Master for each virtual router sends periodic VRRP Advertisement messages ๐Ÿคซ. A Backup router will not attempt to preempt the Master unless it has higher priority. This avoids service disruption unless a more preferred path becomes available ๐ŸŒธ. It's also possible to administratively prohibit all preemption attempts. The one exception is that a VRRP router will always become Master of any virtual router associated with addresses it owns ๐Ÿ‘‘. If the Master becomes unavailable, the highest-priority Backup transitions to Master after a short delay. That gives a controlled handoff of the virtual router responsibility with minimal service interruption ๐Ÿ’….

The VRRP protocol design gives a rapid transition from Backup to Master to keep service interruption to a minimum. It also has optimizations that cut down protocol complexity while still guaranteeing a controlled Master transition for typical operational scenarios ๐Ÿงš. Those optimizations give you an election protocol with minimal runtime state requirements, minimal active protocol states, and a single message type and sender. The typical operational scenarios are defined as two redundant routers and/or distinct path preferences among each router. A side effect when these assumptions are violated (i.e., more than two redundant paths, all with equal preference) is that duplicate packets may be forwarded for a brief period during Master election ๐Ÿ˜ฌ. Still, the typical scenario assumptions are likely to cover the vast majority of deployments, loss of the Master router is infrequent, and the expected duration of Master election convergence is quite small ( << 1 second ). So the VRRP optimizations are a huge simplification of the protocol design, while only risking a tiny chance of brief network degradation ๐Ÿซง.


4. Sample Configurations ๐Ÿงš

4.1. Sample Configuration 1

okay so the figure below shows a simple network with two VRRP routers implementing one virtual router ๐ŸŽ€.

     +-----------+ +-----------+
     |   Rtr1    | |   Rtr2    |
     |(MR VRID=1)| |(BR VRID=1)|
     |           | |           |
VRID=1  +-----------+ +-----------+
IPvX A--------->*            *<---------IPvX B
                |            |
                |            |
----------------+------------+-----+----------+----------+----------+--
                                   ^          ^          ^          ^
                                   |          |          |          |
default rtr IPvX addrs-------> (IPvX A)   (IPvX A)   (IPvX A)   (IPvX A)
                                   |          |          |          |
                          IPvX H1->* IpvX H2->* IPvX H3->* IpvX H4->*
                                +--+--+    +--+--+    +--+--+    +--+--+
                                |  H1 |    |  H2 |    |  H3 |    |  H4 |
                                +-----+    +-----+    +--+--+    +--+--+

Legend:

      --+---+---+-- = Ethernet, Token Ring, or FDDI
                  H = Host computer
                 MR = Master Router
                 BR = Backup Router
                 *  =  IPvX Address; X is 4 everywhere in IPv4 case
                                     X is 6 everywhere in IPv6 case
                 (IPvX) = default router for hosts

fun fact ๐Ÿค“: if you erase every mention of VRRP (VRID=1) from the figure above, what's left is a typical deployment ๐ŸŒˆ.

In the IPv4 case (IPvX is IPv4 everywhere in the figure), each router is permanently assigned an IPv4 address on the LAN interface. Rtr1 gets IPv4 A and Rtr2 gets IPv4 B. Each host installs a static default route through one of the routers (in this example they all use Rtr1's IPv4 A) ๐Ÿ“.

In the IPv6 case (IPvX is IPv6 everywhere in the figure), each router has a link-local IPv6 address on the LAN interface. Rtr1 is assigned IPv6 Link-Local A and Rtr2 is assigned IPv6 Link-Local B. Each host learns a default route from Router Advertisements through one of the routers (in this example, they all use Rtr1's IPv6 Link-Local A) โœจ.

Moving to an IPv4 VRRP environment, each router has the exact same permanently assigned IPv4 address. Rtr1 is said to be the IPv4 address owner of IPv4 A, and Rtr2 is the IPv4 address owner of IPv4 B. A virtual router is then defined by associating a unique identifier (the virtual router ID) with the address owned by a router ๐Ÿ’œ.

Moving to an IPv6 VRRP environment, each router has the exact same Link-Local IPv6 address. Rtr1 is said to be the IPv6 address owner of IPv6 A, and Rtr2 is the IPv6 address owner of IPv6 B. A virtual router is then defined by associating a unique identifier (the virtual router ID) with the address owned by a router ๐Ÿฆ‹.

Finally, in both the IPv4 and IPv6 cases, the VRRP protocol manages virtual router failover to a Backup router ๐Ÿ”ฅ.

The IPv4 example above shows a virtual router configured to cover the IPv4 address owned by Rtr1 (VRID=1, IPv4_Address=A). When VRRP is enabled on Rtr1 for VRID=1, it asserts itself as Master, with priority = 255, since it's the IP address owner for the virtual router IP address ๐Ÿ‘‘. When VRRP is enabled on Rtr2 for VRID=1, it transitions to Backup, with priority = 100 (the default priority is 100), since it's not the IPv4 address owner. If Rtr1 fails, the VRRP protocol transitions Rtr2 to Master, temporarily taking over forwarding responsibility for IPv4 A so the hosts get uninterrupted service ๐Ÿซถ. When Rtr1 comes back to service, it re-asserts itself as Master ๐Ÿ’….

The IPv6 example above shows a virtual router configured to cover the IPv6 address owned by Rtr1 (VRID=1, IPv6_Address=A). When VRRP is enabled on Rtr1 for VRID=1, it asserts itself as Master, with priority = 255, since it's the IPv6 address owner for the virtual router IPv6 address ๐ŸŽ€. When VRRP is enabled on Rtr2 for VRID=1, it transitions to Backup, with priority = 100 (the default priority is 100), since it's not the IPv6 address owner. If Rtr1 fails, the VRRP protocol transitions Rtr2 to Master, temporarily taking over forwarding responsibility for IPv6 A to provide uninterrupted service to the hosts ๐Ÿงš.

Note that in both cases, in this example IPvX B is not backed up. It's only used by Rtr2 as its interface address ๐Ÿ™ˆ. To back up IPvX B, you need to configure a second virtual router. That's shown in the next section ๐Ÿ‘€.

4.2. Sample Configuration 2

the figure below shows a configuration with two virtual routers, and the hosts split their traffic between them ๐ŸŒธ.

        +-----------+      +-----------+
        |   Rtr1    |      |   Rtr2    |
        |(MR VRID=1)|      |(BR VRID=1)|
        |(BR VRID=2)|      |(MR VRID=2)|
VRID=1  +-----------+      +-----------+  VRID=2
IPvX A -------->*            *<---------- IPvX B
                |            |
                |            |
                                   ^          ^          ^          ^
                                   |          |          |          |
default rtr IPvX addrs -----> (IPvX A)   (IPvX A)   (IPvX B)   (IPvX B)
                                   |          |          |          |
                          IPvX H1->* IpvX H2->* IPvX H3->* IpvX H4->*
                                +--+--+    +--+--+    +--+--+    +--+--+
                                |  H1 |    |  H2 |    |  H3 |    |  H4 |
                                +-----+    +-----+    +--+--+    +--+--+
   Legend:
        ---+---+---+--  =  Ethernet, Token Ring, or FDDI
                     H  =  Host computer
                    MR  =  Master Router
                    BR  =  Backup Router
                     *  =  IPvX Address; X is 4 everywhere in IPv4 case
                                         X is 6 everywhere in IPv6 case
                (IPvX)  =  default router for hosts

Okay so in the IPv4 version of this picture (IPvX is IPv4 everywhere, no cap ๐ŸŒธ), half the hosts have a static route going through Rtr1's IPv4 A, and the other half are using Rtr2's IPv4 B. VRID=1 is set up exactly the same as in the first example (see Section 4.1) ๐Ÿ’–, and then we add a second virtual router to cover the IPv4 address Rtr2 owns (VRID=2, IPv4_Address=B). So here Rtr2 declares itself Master for VRID=2 while Rtr1 chills as the Backup ๐Ÿซถ. This setup is giving load splitting when both routers are up, AND full redundancy for robustness. Iconic, honestly ๐Ÿ‘‘.

The IPv6 version is the same vibe ๐Ÿฆ‹. Half the hosts learned a default route through Rtr1's IPv6 A, and the other half are on Rtr2's IPv6 B. VRID=1 is configured exactly like the first example (see Section 4.1) โœจ, and a second virtual router covers the IPv6 address Rtr2 owns (VRID=2, IPv6_Address=B). Rtr2 becomes Master for VRID=2 and Rtr1 is the Backup. Same load splitting when both are available, same full redundancy for robustness. The main character energy is consistent ๐Ÿ’….

Quick note ๐Ÿ™ˆ: the details of load balancing are totally out of scope for this doc. BUT if the servers need different weights, it may not make sense to rely on router advertisements alone to balance the host load between the routers. Just something to keep in mind, bestie ๐Ÿ“.

5. Protocol โœจ

The whole point of the VRRP packet is to tell every VRRP router what the priority and state of the Master router for the VRID is ๐ŸŽ€.

When VRRP is protecting an IPv4 address, VRRP packets get wrapped up in IPv4 packets and sent to the IPv4 multicast address assigned to VRRP ๐ŸŒˆ.

When VRRP is protecting an IPv6 address, VRRP packets get wrapped up in IPv6 packets and sent to the IPv6 multicast address assigned to VRRP ๐Ÿ’œ.

5.1. VRRP Packet Format

This section is where we define the VRRP packet format and the relevant fields in the IP header. Let's get into it ๐Ÿงš.

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    IPv4 Fields or IPv6 Fields                 |
...                                                             ...
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Version| Type  | Virtual Rtr ID|   Priority    |Count IPvX Addr|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|(rsvd) |     Max Adver Int     |          Checksum             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                       IPvX Address(es)                        |
+                                                               +
+                                                               +
+                                                               +
+                                                               +
|                                                               |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

5.1.1. IPv4 Field Descriptions

5.1.1.1. Source Address

This is the primary IPv4 address of the interface the packet is being sent from ๐Ÿฆ‹.

5.1.1.2. Destination Address

The IPv4 multicast address that IANA assigned for VRRP is:

224.0.0.18

This is a link-local scope multicast address. Routers MUST NOT forward a datagram with this destination address, regardless of its TTL. Not forwarding it is non-negotiable, periodt ๐Ÿšซ๐Ÿ’….

5.1.1.3. TTL

The TTL MUST be set to 255. A VRRP router that gets a packet with a TTL not equal to 255 MUST discard the packet. Bye bye, packet ๐Ÿ‘‹๐Ÿ’€.

5.1.1.4. Protocol

The IPv4 protocol number IANA assigned for VRRP is 112 (decimal) ๐Ÿ”ข๐ŸŒธ.

5.1.2. IPv6 Field Descriptions

5.1.2.1. Source Address

This is the IPv6 link-local address of the interface the packet is being sent from ๐Ÿ’œ.

5.1.2.2. Destination Address

The IPv6 multicast address assigned by IANA for VRRP is:

FF02:0:0:0:0:0:0:12

This is a link-local scope multicast address. Routers MUST NOT forward a datagram with this destination address, regardless of its Hop Limit. Same energy as the IPv4 one, no forwarding allowed ๐Ÿ™…โ€โ™€๏ธ.

5.1.2.3. Hop Limit

The Hop Limit MUST be set to 255. A VRRP router that receives a packet with a Hop Limit not equal to 255 MUST discard the packet ๐Ÿ—‘๏ธโœจ.

5.1.2.4. Next Header

The IPv6 Next Header protocol IANA assigned for VRRP is 112 (decimal) ๐ŸŒˆ.

5.2. VRRP Field Descriptions

5.2.1. Version

The Version field tells you which VRRP protocol version this packet is using. This document defines version 3 ๐ŸŽ€.

5.2.2. Type

The Type field says what kind of VRRP packet this is. The only packet type defined in this version of the protocol is:

1 ADVERTISEMENT

A packet with an unknown type MUST be discarded. No mystery packets allowed ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ’….

5.2.3. Virtual Rtr ID (VRID)

The Virtual Rtr ID field identifies the virtual router this packet is reporting status for ๐Ÿงš.

5.2.4. Priority

The Priority field is the sending VRRP router's priority for the virtual router. Higher values mean higher priority ๐Ÿ‘‘. This is an 8-bit unsigned integer field.

The priority value for the VRRP router that owns the IPvX address associated with the virtual router MUST be 255 (decimal). That's the VIP of the group ๐Ÿ’–.

VRRP routers backing up a virtual router MUST use priority values between 1-254 (decimal). The default priority for a backup VRRP router is 100 (decimal) ๐Ÿ“.

The priority value zero (0) is extra special. It means the current Master has stopped participating in VRRP. This is what tells Backup routers to quickly flip to Master without waiting for the current Master to time out. Major plot twist energy ๐Ÿ˜ญ๐Ÿ”ฅ.

5.2.5. Count IPvX Addr

This is the number of either IPv4 addresses or IPv6 addresses contained in this VRRP advertisement. The minimum value is 1 ๐ŸŒธ.

5.2.6. Rsvd

This field MUST be set to zero on transmission and ignored on reception. Zero going out, nothing to see coming in ๐Ÿค.

5.2.7. Maximum Advertisement Interval (Max Adver Int)

The Maximum Advertisement Interval is a 12-bit field that shows the time interval (in centiseconds) between ADVERTISEMENTS. The default is 100 centiseconds (1 second) โฐ๐Ÿ’œ.

Okay, this part is lowkey important ๐Ÿซถ. Higher-priority Master routers that send slower than their Backup routers are unstable. Why? Low-priority nodes set to faster rates could come online and decide they should be Masters before they've heard anything from the higher-priority Master with its slower rate. When that happens it's only temporary, though. Once the lower-priority node hears from the higher-priority Master, it gives up mastership. Drama, but it resolves ๐ŸŽญโœจ.

5.2.8. Checksum

The Checksum field is used to detect data corruption in the VRRP message ๐Ÿ”๐Ÿฆ‹.

The checksum is the 16-bit one's complement of the one's complement sum of the entire VRRP message, starting with the Version field, plus a "pseudo-header" as defined in Section 8.1 of [RFC2460]. The next header field in the "pseudo-header" should be set to 112 (decimal) for VRRP. When computing the checksum, the Checksum field is set to zero. See RFC1071 for more detail [RFC1071] ๐Ÿงฎ๐ŸŒˆ.

5.2.9. IPvX Address(es)

This refers to one or more IPvX addresses associated with the virtual router. The number of addresses included is specified in the "Count IP Addr" field. These fields are used for troubleshooting misconfigured routers ๐Ÿ•ต๏ธโ€โ™€๏ธ๐Ÿ”ง. If more than one address is sent, it is recommended that all routers send these addresses in the same order, so comparing them is easier. Consistency is everything, bestie ๐Ÿ’….

For IPv4 addresses, this refers to one or more IPv4 addresses that are backed up by the virtual router ๐ŸŒธ.

For IPv6, the first address must be the IPv6 link-local address associated with the virtual router ๐Ÿ’œ.

This field contains either one or more IPv4 addresses, or one or more IPv6 addresses. In other words, IPv4 and IPv6 MUST NOT both be carried in one IPvX Address field. Pick a lane, babe ๐Ÿ›ฃ๏ธ๐Ÿ™…โ€โ™€๏ธ.

6. Protocol State Machine โœจ

6.1. Parameters Per Virtual Router โœจ

okay bestie, this is the settings list ๐ŸŽ€ every virtual router keeps its own little stash of parameters, and the way they all interact is honestly iconic ๐Ÿ’…

VRID                        Virtual Router Identifier.  Configurable
                            item in the range 1-255 (decimal).  There
                            is no default.

Priority                    Priority value to be used by this VRRP
                            router in Master election for this
                            virtual router.  The value of 255
                            (decimal) is reserved for the router that
                            owns the IPvX address associated with the
                            virtual router.  The value of 0 (zero) is
                            reserved for the Master router to
                            indicate it is releasing responsibility
                            for the virtual router.  The range 1-254
                            (decimal) is available for VRRP routers
                            backing up the virtual router.  Higher
                            values indicate higher priorities.  The
                            default value is 100 (decimal).

IPv4_Addresses              One or more IPv4 addresses associated
                            with this virtual router.  Configured
                            item with no default.

IPv6_Addresses              One or more IPv6 addresses associated
                            with this virtual router.  Configured
                            item with no default.  The first address
                            must be the Link-Local address associated
                            with the virtual router.

Advertisement_Interval      Time interval between ADVERTISEMENTS
                            (centiseconds).  Default is 100
                            centiseconds (1 second).

Master_Adver_Interval       Advertisement interval contained in
                            ADVERTISEMENTS received from the Master
                            (centiseconds).  This value is saved by
                            virtual routers in the Backup state and
                            used to compute Skew_Time and
                            Master_Down_Interval.  The initial value
                            is the same as Advertisement_Interval.

Skew_Time                   Time to skew Master_Down_Interval in
                            centiseconds.  Calculated as

                (((256 - priority) * Master_Adver_Interval) / 256)

Master_Down_Interval        Time interval for Backup to declare
                            Master down (centiseconds).
                            Calculated as

                            (3 * Master_Adver_Interval) + Skew_time

Preempt_Mode                Controls whether a (starting or
                            restarting) higher-priority Backup router
                            preempts a lower-priority Master router.
                            Values are True to allow preemption and
                            False to prohibit preemption.  Default is
                            True.

                            Note: The exception is that the router
                            that owns the IPvX address associated with
                            the virtual router always preempts,
                            independent of the setting of this flag.

Accept_Mode                 Controls whether a virtual router in
                            Master state will accept packets
                            addressed to the address owner's IPvX
                            address as its own if it is not the IPvX
                            address owner.  The default is False.
                            Deployments that rely on, for example,
                            pinging the address owner's IPvX address
                            may wish to configure Accept_Mode to
                            True.

                            Note: IPv6 Neighbor Solicitations and
                            Neighbor Advertisements MUST NOT be
                            dropped when Accept_Mode is False.

Virtual_Router_MAC_Address  The MAC address used for the source MAC
                            address in VRRP advertisements and
                            advertised in ARP responses as the MAC
                            address to use for IP_Addresses.

6.2. Timers โฐ

here are the two timers that keep everything on schedule, no cap ๐Ÿซถ

Master_Down_Timer        Timer that fires when ADVERTISEMENT has not
                         been heard for Master_Down_Interval.

Adver_Timer              Timer that fires to trigger sending of
                         ADVERTISEMENT based on
                         Advertisement_Interval.

6.3. State Transition Diagram ๐Ÿฆ‹

okay, the vibe check here is that the states bounce between each other like a group chat that never stops ๐Ÿ’ฌ

                             +---------------+
                  +--------->|               |<-------------+
                  |          |  Initialize   |              |
                  |   +------|               |----------+   |
                  |   |      +---------------+          |   |
                  |   |                                 |   |
                  |   V                                 V   |
          +---------------+                       +---------------+
          |               |---------------------->|               |
          |    Master     |                       |    Backup     |
          |               |<----------------------|               |
          +---------------+                       +---------------+

6.4. State Descriptions ๐ŸŒธ

so when we talk about the state descriptions, the state names get wrapped in curly braces like {state-name}, and the packets are written in ALL CAPS so you can spot them instantly ๐Ÿ‘€

every VRRP router runs its own instance of the state machine for each virtual router election it's part of. literally one per election, the commitment is unreal ๐Ÿ˜ญ

6.4.1. Initialize ๐Ÿงš

this is the waiting room. the whole point of this state is to sit tight until a Startup event shows up. a Startup event is an implementation-defined mechanism that kicks off the protocol once the router has been configured. how the configuration actually happens is out of scope for this spec, so that's a whole other vibe ๐Ÿ™ˆ

(100) If a Startup event is received, then:

   (105) - If the Priority = 255 (i.e., the router owns the IPvX
   address associated with the virtual router), then:

      (110) + Send an ADVERTISEMENT

      (115) + If the protected IPvX address is an IPv4 address, then:

         (120) * Broadcast a gratuitous ARP request containing the
         virtual router MAC address for each IP address associated
         with the virtual router.

      (125) + else // IPv6

         (130) * For each IPv6 address associated with the virtual
         router, send an unsolicited ND Neighbor Advertisement with
         the Router Flag (R) set, the Solicited Flag (S) unset, the
         Override flag (O) set, the target address set to the IPv6
         address of the virtual router, and the target link-layer
         address set to the virtual router MAC address.

      (135) +endif // was protected addr IPv4?

      (140) + Set the Adver_Timer to Advertisement_Interval

      (145) + Transition to the {Master} state

   (150) - else // rtr does not own virt addr

      (155) + Set Master_Adver_Interval to Advertisement_Interval

      (160) + Set the Master_Down_Timer to Master_Down_Interval

      (165) + Transition to the {Backup} state

   (170) -endif // priority was not 255

   (175) endif // startup event was recv

6.4.2. Backup ๐Ÿ‘‘

this is the watchful state. while a router is in {Backup}, its whole job is keeping an eye on the Master and making sure it's still alive and well ๐Ÿ‘€โœจ here's the full list of what it has to do, and yes, those capitalised MUSTs are not a suggestion ๐Ÿ’…

(300) While in this state, a VRRP router MUST do the following:

   (305) - If the protected IPvX address is an IPv4 address, then:

      (310) + MUST NOT respond to ARP requests for the IPv4
      address(es) associated with the virtual router.

   (315) - else // protected addr is IPv6

      (320) + MUST NOT respond to ND Neighbor Solicitation messages
      for the IPv6 address(es) associated with the virtual router.

      (325) + MUST NOT send ND Router Advertisement messages for the
      virtual router.

   (330) -endif // was protected addr IPv4?

   (335) - MUST discard packets with a destination link-layer MAC
   address equal to the virtual router MAC address.

   (340) - MUST NOT accept packets addressed to the IPvX address(es)
   associated with the virtual router.

   (345) - If a Shutdown event is received, then:

      (350) + Cancel the Master_Down_Timer

      (355) + Transition to the {Initialize} state

   (360) -endif // shutdown recv

   (365) - If the Master_Down_Timer fires, then:

      (370) + Send an ADVERTISEMENT

      (375) + If the protected IPvX address is an IPv4 address, then:

         (380) * Broadcast a gratuitous ARP request on that interface
         containing the virtual router MAC address for each IPv4
         address associated with the virtual router.

      (385) + else // ipv6

         (390) * Compute and join the Solicited-Node multicast
         address [RFC4291] for the IPv6 address(es) associated with
         the virtual router.

         (395) * For each IPv6 address associated with the virtual
         router, send an unsolicited ND Neighbor Advertisement with
         the Router Flag (R) set, the Solicited Flag (S) unset, the
         Override flag (O) set, the target address set to the IPv6
         address of the virtual router, and the target link-layer
         address set to the virtual router MAC address.

      (400) +endif // was protected addr ipv4?

      (405) + Set the Adver_Timer to Advertisement_Interval

      (410) + Transition to the {Master} state

   (415) -endif // Master_Down_Timer fired

   (420) - If an ADVERTISEMENT is received, then:

      (425) + If the Priority in the ADVERTISEMENT is zero, then:

         (430) * Set the Master_Down_Timer to Skew_Time

      (440) + else // priority non-zero

         (445) * If Preempt_Mode is False, or if the Priority in the
         ADVERTISEMENT is greater than or equal to the local
         Priority, then:

            (450) @ Set Master_Adver_Interval to Adver Interval
            contained in the ADVERTISEMENT

            (455) @ Recompute the Master_Down_Interval

            (460) @ Reset the Master_Down_Timer to
            Master_Down_Interval

         (465) * else // preempt was true or priority was less

            (470) @ Discard the ADVERTISEMENT

         (475) *endif // preempt test

      (480) +endif // was priority zero?

   (485) -endif // was advertisement recv?

(490) endwhile // Backup state

6.4.3. Master โœจ

Okay bestie, the Master state is where the main character energy lives ๐Ÿ‘‘ While in the {Master} state, the router is the forwarding router for the IPvX address(es) tied to the virtual router ๐Ÿฆ‹

Note that in the Master state, the Preempt_Mode Flag is not considered ๐Ÿ’…

Here's the whole Master checklist, pseudocode and all ๐Ÿงš (the spec is giving maze energy, not my fault):

(600) While in this state, a VRRP router MUST do the following:

   (605) - If the protected IPvX address is an IPv4 address, then:

      (610) + MUST respond to ARP requests for the IPv4 address(es)
      associated with the virtual router.

   (615) - else // ipv6

      (620) + MUST be a member of the Solicited-Node multicast
      address for the IPv6 address(es) associated with the virtual
      router.

      (625) + MUST respond to ND Neighbor Solicitation message for
      the IPv6 address(es) associated with the virtual router.

      (630) ++ MUST send ND Router Advertisements for the virtual
      router.

      (635) ++ If Accept_Mode is False:  MUST NOT drop IPv6 Neighbor
      Solicitations and Neighbor Advertisements.

   (640) +-endif // ipv4?

   (645) - MUST forward packets with a destination link-layer MAC
   address equal to the virtual router MAC address.

   (650) - MUST accept packets addressed to the IPvX address(es)
   associated with the virtual router if it is the IPvX address owner
   or if Accept_Mode is True.  Otherwise, MUST NOT accept these
   packets.

   (655) - If a Shutdown event is received, then:

      (660) + Cancel the Adver_Timer

      (665) + Send an ADVERTISEMENT with Priority = 0

      (670) + Transition to the {Initialize} state

   (675) -endif // shutdown recv

   (680) - If the Adver_Timer fires, then:

      (685) + Send an ADVERTISEMENT

      (690) + Reset the Adver_Timer to Advertisement_Interval

   (695) -endif // advertisement timer fired

   (700) - If an ADVERTISEMENT is received, then:

      (705) -+ If the Priority in the ADVERTISEMENT is zero, then:

         (710) -* Send an ADVERTISEMENT

         (715) -* Reset the Adver_Timer to Advertisement_Interval

      (720) -+ else // priority was non-zero

         (725) -* If the Priority in the ADVERTISEMENT is greater
         than the local Priority,

         (730) -* or

         (735) -* If the Priority in the ADVERTISEMENT is equal to
         the local Priority and the primary IPvX Address of the
         sender is greater than the local primary IPvX Address, then:

            (740) -@ Cancel Adver_Timer

            (745) -@ Set Master_Adver_Interval to Adver Interval
            contained in the ADVERTISEMENT

            (750) -@ Recompute the Skew_Time

            (755) @ Recompute the Master_Down_Interval

            (760) @ Set Master_Down_Timer to Master_Down_Interval

            (765) @ Transition to the {Backup} state

         (770) * else // new Master logic

            (775) @ Discard ADVERTISEMENT

         (780) *endif // new Master detected

      (785) +endif // was priority zero?

   (790) -endif // advert recv

(795) endwhile // in Master

That's the entire Master checklist, periodt ๐Ÿ’–

7. Sending and Receiving VRRP Packets ๐ŸŒˆ

7.1. Receiving VRRP Packets ๐Ÿ“ฅ

Okay so when a VRRP packet shows up, these are the functions that get run ๐Ÿ”

- If the received packet is an IPv4 packet, then:
   + MUST verify that the IPv4 TTL is 255.
- else // ipv6 recv
   + MUST verify that the IPv6 Hop Limit is 255.
-endif
- MUST verify that the VRRP version is 3.
- MUST verify that the received packet contains the complete VRRP
  packet (including fixed fields, and IPvX address).
- MUST verify the VRRP checksum.
- MUST verify that the VRID is configured on the receiving
  interface and the local router is not the IPvX address owner
  (Priority = 255 (decimal)).

If any one of the above checks fails, the receiver MUST discard the packet, SHOULD log the event, and MAY indicate via network management that an error occurred ๐Ÿšซ

There's also this one, which the spec lets you do ๐Ÿ’…

- MAY verify that "Count IPvX Addrs" and the list of IPvX
  address(es) match the IPvX Address(es) configured for the VRID.

If the above check fails, the receiver SHOULD log the event and MAY indicate via network management that a misconfiguration was detected ๐Ÿ™ˆ

7.2. Transmitting VRRP Packets ๐Ÿ“ค

When you transmit a VRRP packet, the following operations MUST be performed ๐ŸŽ€

- Fill in the VRRP packet fields with the appropriate virtual
  router configuration state
- Compute the VRRP checksum
- If the protected address is an IPv4 address, then:
   + Set the source MAC address to virtual router MAC Address
   + Set the source IPv4 address to interface primary IPv4 address
- else // ipv6
   + Set the source MAC address to virtual router MAC Address
   + Set the source IPv6 address to interface link-local IPv6
     address
   -endif
- Set the IPvX protocol to VRRP
- Send the VRRP packet to the VRRP IPvX multicast group

Note: VRRP packets are transmitted with the virtual router MAC address as the source MAC address to ensure that learning bridges correctly determine the LAN segment the virtual router is attached to ๐ŸŒธ

7.3. Virtual Router MAC Address ๐Ÿ“

Every virtual router gets an IEEE 802 MAC Address in the following format ๐Ÿ’œ

IPv4 case: 00-00-5E-00-01-{VRID} (in hex, in Internet-standard bit-order)

The first three octets are derived from the IANA's Organizational Unique Identifier (OUI). The next two octets (00-01) indicate the address block assigned to the VRRP for IPv4 protocol. {VRID} is the VRRP Virtual Router Identifier. This mapping provides for up to 255 IPv4 VRRP routers on a network.

IPv6 case: 00-00-5E-00-02-{VRID} (in hex, in Internet-standard bit-order)

The first three octets are derived from the IANA's OUI. The next two octets (00-02) indicate the address block assigned to the VRRP for IPv6 protocol. {VRID} is the VRRP Virtual Router Identifier. This mapping provides for up to 255 IPv6 VRRP routers on a network.

7.4. IPv6 Interface Identifiers ๐Ÿช„

IPv6 routers running VRRP MUST create their Interface Identifiers in the normal manner (e.g., "Transmission of IPv6 Packets over Ethernet Networks" [RFC2464]). They MUST NOT use the virtual router MAC address to create the Modified Extended Unique Identifier (EUI)-64 identifiers.

This VRRP specification describes how to advertise and resolve the VRRP router's IPv6 link-local address and other associated IPv6 addresses into the virtual router MAC address ๐Ÿซถ

8. Operational Issues ๐Ÿ› ๏ธ

8.1. IPv4 ๐ŸŒท

8.1.1. ICMP Redirects ๐Ÿ”€

ICMP redirects may be used normally when VRRP is running between a group of routers. This allows VRRP to be used in environments where the topology is not symmetric.

The IPv4 source address of an ICMP redirect should be the address that the end-host used when making its next-hop routing decision. If a VRRP router is acting as Master for virtual router(s) containing addresses it does not own, then it must determine which virtual router the packet was sent to when selecting the redirect source address. One method to deduce the virtual router used is to examine the destination MAC address in the packet that triggered the redirect.

It may be useful to disable redirects for specific cases where VRRP is being used to load-share traffic between a number of routers in a symmetric topology.

8.1.2. Host ARP Requests ๐Ÿน

When a host sends an ARP request for one of the virtual router IPv4 addresses, the Virtual Router Master MUST respond to the ARP request with an ARP response that indicates the virtual MAC address for the virtual router. Note that the source address of the Ethernet frame of this ARP response is the physical MAC address of the physical router. The Virtual Router Master MUST NOT respond with its physical MAC address in the ARP response. This allows the client to always use the same MAC address regardless of the current Master router.

When a VRRP router restarts or boots, it SHOULD NOT send any ARP messages using its physical MAC address for the IPv4 address it owns; it should only send ARP messages that include virtual MAC addresses.

This may entail the following:

  • When configuring an interface, Virtual Router Master routers should broadcast a gratuitous ARP request containing the virtual router MAC address for each IPv4 address on that interface.
  • At system boot, when initializing interfaces for VRRP operation, delay gratuitous ARP requests and ARP responses until both the IPv4 address and the virtual router MAC address are configured.
  • When, for example, ssh access to a particular VRRP router is required, an IP address known to belong to that router must be used.

8.1.3. Proxy ARP ๐ŸŽญ

If Proxy ARP is to be used on a VRRP router, then the VRRP router must advertise the virtual router MAC address in the Proxy ARP message. Doing otherwise could cause hosts to learn the real MAC address of the VRRP router.

8.2. IPv6 ๐ŸŒบ

8.2.1. ICMPv6 Redirects ๐Ÿ”

ICMPv6 redirects may be used normally when VRRP is running between a group of routers [RFC4443]. This allows VRRP to be used in environments where the topology is not symmetric (e.g., the VRRP routers do not connect to the same destinations).

The IPv6 source address of an ICMPv6 redirect should be the address that the end-host used when making its next-hop routing decision. If a VRRP router is acting as Master for virtual router(s) containing addresses it does not own, then it must determine which virtual router the packet was sent to when selecting the redirect source address. A method to deduce the virtual router used is to examine the destination MAC address in the packet that triggered the redirect.

8.2.2. ND Neighbor Solicitation ๐Ÿ’ซ

When a host sends an ND Neighbor Solicitation message for the virtual router IPv6 address, the Virtual Router Master MUST respond to the ND Neighbor Solicitation message with the virtual MAC address for the virtual router. The Virtual Router Master MUST NOT respond with its physical MAC address. This allows the client to always use the same MAC address regardless of the current Master router.

When a Virtual Router Master sends an ND Neighbor Solicitation message for a host's IPv6 address, the Virtual Router Master MUST include the virtual MAC address for the virtual router if it sends a source link-layer address option in the neighbor solicitation message. It MUST NOT use its physical MAC address in the source link-layer address option.

When a VRRP router restarts or boots, it SHOULD NOT send any ND messages with its physical MAC address for the IPv6 address it owns; it should only send ND messages that include virtual MAC addresses.

This may entail the following:

  • When configuring an interface, Virtual Router Master routers should send an unsolicited ND Neighbor Advertisement message containing the virtual router MAC address for the IPv6 address on that interface.
  • At system boot, when initializing interfaces for VRRP operation, all ND Router and Neighbor Advertisements and Solicitation messages must be delayed until both the IPv6 address and the virtual router MAC address are configured.

Note that on a restarting Master router where the VRRP protected address is the interface address, (that is, priority 255) duplicate address detection (DAD) may fail, as the Backup router may answer that it owns the address. One solution is to not run DAD in this case.

8.2.3. Router Advertisements โœจ

okay so bestie, when a Backup VRRP router becomes Master for a virtual router, it's officially on the hook for sending Router Advertisements for that virtual router, just like Section 6.4.3 says ๐Ÿ’… The Backup routers must be configured to send the same Router Advertisement options as the address owner, so everyone's serving the same look ๐ŸŽ€

Now, the special-service options (like the Home Agent Information Option, e.g., ๐Ÿ ) that the address owner has? The address owner should not be sending those unless the Backup routers are ready to take over those services completely and have a complete, synchronized database for them. Otherwise it's a whole mess ๐Ÿ™ˆ


8.3. IPvX ๐Ÿฆ‹

8.3.1. Potential Forwarding Loop

bestie, if a VRRP router is NOT the address owner, it SHOULD NOT forward packets addressed to the IPvX address it just became Master for ๐Ÿ™…โ€โ™€๏ธ Forwarding those would be unnecessary traffic, and on LANs that receive the packets they transmit (Token Ring is the example), it can turn into a forwarding loop that only ends when the IPvX TTL runs out. Literally a loop of doom ๐Ÿ’€

One way VRRP routers can handle this is by adding and deleting a reject host route for each adopted IPvX address when they transition to or from MASTER state ๐Ÿงš

8.3.2. Recommendations Regarding Setting Priority Values

so a priority value of 255 is the special one. It designates a router as the "IPvX address owner" ๐Ÿ‘‘ Care must be taken not to configure more than one router on the link like that for a single VRID, bc that's chaos ๐Ÿ˜ญ

Routers with priority 255 will preempt all lower-priority routers as soon as they start up. So no more than one router on the link should be set to priority 255, especially if preemption is set. And if nobody has this priority and preemption is disabled, then no preemption happens at all ๐ŸŒธ

when there are multiple Backup routers, their priority values should be uniformly distributed โœจ For example, if one Backup router has the default priority of 100 and you add another Backup Router, a priority of 50 is a better pick than 99 or 100, in order to help things converge faster. Spacing is everything, bestie ๐Ÿ’–


8.4. VRRPv3 and VRRPv2 Interoperation ๐ŸŒˆ

8.4.1. Assumptions

  1. VRRPv2 and VRRPv3 interoperation is optional. ๐Ÿซถ
  2. Mixing VRRPv2 and VRRPv3 should only be done when transitioning from VRRPv2 to VRRPv3. Mixing the two versions should not be considered a permanent solution, periodt ๐Ÿ’…

8.4.2. VRRPv3 Support of VRRPv2

okay so as I said above, this support is meant for upgrade scenarios and is NOT RECOMMENDED for permanent deployments โณ

An implementation MAY implement a configuration flag that tells it to listen for and send both VRRPv2 and VRRPv3 advertisements โœจ

When a virtual router is configured this way and it's the Master, it MUST send both types at the configured rate, even if that rate is sub-second. No skipping, no exceptions ๐Ÿ”ฅ

When a virtual router is configured this way and it's the Backup, it should time out based on the rate advertised by the Master. If the Master is VRRPv2, the Backup has to translate the timeout value it receives (in seconds) into centiseconds, which is a whole conversion moment ๐Ÿงฎ Also, a Backup should ignore VRRPv2 advertisements from the current Master if it's also receiving VRRPv3 packets from that same Master ๐Ÿ™ˆ It MAY report when a VRRPv3 Master is not sending VRRPv2 packets, bc that suggests they don't agree on whether they're supporting VRRPv2 routers. Tea spilled โ˜•

8.4.3. VRRPv3 Support of VRRPv2 Considerations

8.4.3.1. Slow, High-Priority Masters

see also Section 5.2.7, "Maximum Advertisement Interval (Max Adver Int)" ๐Ÿ‘€

the VRRPv2 Master router interacting with a sub-second VRRPv3 Backup router is the most important example of this, so pay attention ๐Ÿšจ

A VRRPv2 implementation should not be given a higher priority than a VRRPv2/VRRPv3 implementation it's interacting with if the VRRPv2/VRRPv3 rate is sub-second ๐Ÿ™…โ€โ™€๏ธ

8.4.3.2. Overwhelming VRRPv2 Backups

it seems possible that a VRRPv3 Master router sending at centisecond rates could potentially overwhelm a VRRPv2 Backup router, with potentially unclear results ๐Ÿ˜ตโ€๐Ÿ’ซ

so in this upgrade case, a deployment should initially run the VRRPv3 Master routers at lower frequencies (e.g., 100 centiseconds) until the VRRPv2 routers are upgraded ๐Ÿข Then, once the deployment has convinced itself that VRRPv3 is working properly, the VRRPv2 support may be unconfigured and then the desired sub-second rates can be configured. Glow-up complete ๐Ÿฆ‹


9. Security Considerations ๐Ÿ”

ngl this section is SERIOUS, so let's gooo ๐Ÿ˜ค

VRRP for IPvX does not currently include any type of authentication. Earlier versions of the VRRP (for IPv4) specification did include several types of authentication, ranging from none to strong. Operational experience and further analysis showed that these did not provide sufficient security to overcome the vulnerability of misconfigured secrets, which could cause multiple Masters to be elected ๐Ÿ’€ Because of how the VRRP protocol works, even if VRRP messages are cryptographically protected, that still doesn't stop hostile nodes from acting like a VRRP Master and creating multiple Masters. Authentication of VRRP messages could have prevented a hostile node from forcing all properly functioning routers into Backup state. However, having multiple Masters can cause as much disruption as having no routers at all, and authentication can't prevent that. Also, even if a hostile node couldn't disrupt VRRP, it can still disrupt ARP and create the same effect as having all routers go into Backup. Yikes ๐Ÿ™ˆ

Some L2 switches can filter out things like ARP and/or ND messages from end-hosts on a switch-port basis. This mechanism could also filter VRRP messages from switch ports that are associated with end-hosts, and it can be considered for deployments with untrusted hosts ๐Ÿ›ก๏ธ

It should be noted that these attacks are not worse, and they're a subset of the attacks that any node attached to a LAN can do independently of VRRP. The kinds of attacks a malicious node on a LAN can do include: promiscuously receiving packets for any router's MAC address; sending packets with the router's MAC address as the source MAC address in the L2 header to tell the L2 switches to send packets addressed to the router to the malicious node instead of the router; sending redirects to tell hosts to send their traffic somewhere else; sending unsolicited ND replies; answering ND requests; and so on. All of this can be done independently of implementing VRRP. VRRP does not add to these vulnerabilities, so no blame on VRRP ๐Ÿ™…โ€โ™€๏ธ

Independent of any authentication type, VRRP includes a mechanism (setting TTL = 255, and checking on receipt) that protects against VRRP packets being injected from another remote network. This limits most vulnerabilities to local attacks ๐Ÿ”’

VRRP does not provide any confidentiality. Confidentiality is not necessary for the correct operation of VRRP, and there is no information in the VRRP messages that must be kept secret from other nodes on the LAN ๐Ÿคทโ€โ™€๏ธ

In the context of IPv6 operation, if SEcure Neighbor Discovery (SEND) is deployed, VRRP is compatible with the "trust anchor" and "trust anchor or cga" modes of SEND [RFC3971]. The SEND configuration needs to give the Master and Backup routers the same prefix delegation in the certificates, so that the Master and Backup routers advertise the same set of subnet prefixes. However, the Master and Backup routers should have their own key pairs to avoid private key sharing ๐Ÿ”‘


10. Contributors and Acknowledgments ๐ŸŽ€

the editor would like to thank V. Ullanatt for their review of an early version ๐Ÿซถ This document consists of very little new material (there is some new text in Appendix A) and was created by merging and "xml-izing" [VRRP-IPv6] and [RFC3768], and then adding in the changes discussed recently on the Virtual Router Redundancy Protocol working group's mailing list. R. Hinden is the author and J. Cruz the editor of the former. The contributors for the latter appear below ๐Ÿ“

The IPv6 text in this specification is based on [RFC2338]. The authors of RFC2338 are S. Knight, D. Weaver, D. Whipple, R. Hinden, D. Mitzel, P. Hunt, P. Higginson, M. Shand, and A. Lindem ๐ŸŒŸ

The author of [VRRP-IPv6] would also like to thank Erik Nordmark, Thomas Narten, Steve Deering, Radia Perlman, Danny Mitzel, Mukesh Gupta, Don Provan, Mark Hollinger, John Cruz, and Melissa Johnson for their helpful suggestions ๐Ÿ’œ

The IPv4 text in this specification is based on [RFC3768]. The authors of that specification would like to thank Glen Zorn, Michael Lane, Clark Bremer, Hal Peterson, Tony Li, Barbara Denny, Joel Halpern, Steve Bellovin, Thomas Narten, Rob Montgomery, Rob Coltun, Radia Perlman, Russ Housley, Harald Alvestrand, Steve Bellovin, Ned Freed, Ted Hardie, Russ Housley, Bert Wijnen, Bill Fenner, and Alex Zinin for their comments and suggestions ๐ŸŒธ


11. IANA Considerations ๐Ÿฆ‹

IANA has assigned an IPv6 link-local scope multicast address for VRRP for IPv6. The IPv6 multicast address is as follows:

FF02:0:0:0:0:0:0:12

The values assigned address should be entered into Section 5.1.2.2 ๐Ÿ“Œ

The IANA has also reserved a block of IANA Ethernet unicast addresses for VRRP for IPv6, in the range:

00-00-5E-00-02-00 to 00-00-5E-00-02-FF (in hex)

Similar assignments are documented at:

http://www.iana.org

12. References ๐Ÿ“š

12.1. Normative References

  • [ISO.10038.1993] International Organization for Standardization, "Information technology - Telecommunications and information exchange between systems - Local area networks - Media access control (MAC) bridges", ISO Standard 10038, 1993. ๐ŸŒ
  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. ๐Ÿ”‘
  • [RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998. ๐ŸŒŠ
  • [RFC3768] Hinden, R., "Virtual Router Redundancy Protocol (VRRP)", RFC 3768, April 2004. ๐Ÿฆ‹
  • [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing Architecture", RFC 4291, February 2006. ๐Ÿก
  • [RFC4443] Conta, A., Deering, S., and M. Gupta, Ed., "Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification", RFC 4443, March 2006. ๐Ÿ’Œ
  • [RFC4861] Narten, T., Nordmark, E., Simpson, W., and H. Soliman, "Neighbor Discovery for IP version 6 (IPv6)", RFC 4861, September 2007. ๐Ÿงš

12.2. Informative References

Okay bestie, these are the extra reads that help you see where VRRP came from ๐Ÿ“š๐Ÿฆ‹

[VRRP-IPv6]: Hinden, R. and J. Cruz, "Virtual Router Redundancy Protocol for IPv6", Work in Progress, March 2007.

[IPSTB]: Higginson, P. and M. Shand, "Development of Router Clusters to Provide Fast Failover in IP Networks", Digital Technical Journal, Volume 9 Number 3, Winter 1997.

[IPX]: Novell Incorporated, "IPX Router Specification Version 1.10", October 1992.

[RFC1071]: Braden, R., Borman, D., Partridge, C., and W. Plummer, "Computing the Internet checksum", RFC 1071, September 1988.

[RFC1256]: Deering, S., Ed., "ICMP Router Discovery Messages", RFC 1256, September 1991.

[RFC1469]: Pusateri, T., "IP Multicast over Token-Ring Local Area Networks", RFC 1469, June 1993.

[RFC2131]: Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997.

[RFC2281]: Li, T., Cole, B., Morton, P., and D. Li, "Cisco Hot Standby Router Protocol (HSRP)", RFC 2281, March 1998.

[RFC2328]: Moy, J., "OSPF Version 2", STD 54, RFC 2328, April 1998.

[RFC2338]: Knight, S., Weaver, D., Whipple, D., Hinden, R., Mitzel, D., Hunt, P., Higginson, P., Shand, M., and A. Lindem, "Virtual Router Redundancy Protocol", RFC 2338, April 1998. ๐ŸŒธ

[RFC2453]: Malkin, G., "RIP Version 2", STD 56, RFC 2453, November 1998.

[RFC2464]: Crawford, M., "Transmission of IPv6 Packets over Ethernet Networks", RFC 2464, December 1998.

[RFC3971]: Arkko, J., Ed., Kempf, J., Zill, B., and P. Nikander, "SEcure Neighbor Discovery (SEND)", RFC 3971, March 2005. ๐Ÿ”

[TKARCH]: IBM Incorporated, "IBM Token-Ring Network, Architecture Specification, Publication SC30-3374-02, Third Edition", September 1989.


Appendix A. Operation over FDDI, Token Ring, and ATM LANE ๐ŸŽ€

A.1. Operation over FDDI

Okay so FDDI interfaces remove frames from the ring when the source MAC address matches the device's own hardware address. ๐Ÿ™ˆ Under some conditions, like router isolations, ring failures, protocol transitions, etc., VRRP can end up with more than one Master router. If a Master router sets the virtual router MAC address as the hardware address on an FDDI device, then the other Masters' ADVERTISEMENTS get removed from the ring during Master convergence, and convergence fails. ๐Ÿ’€

To avoid this drama, an implementation SHOULD configure the virtual router MAC address by adding a unicast MAC filter in the FDDI device, rather than changing its hardware MAC address. โœจ This keeps a Master router from removing any ADVERTISEMENTS it didn't originate. Iconic. ๐Ÿ‘‘

A.2. Operation over Token Ring

Token Ring has a few quirks that make running VRRP kinda tricky ๐Ÿ˜ญ These include the following:

  • In order to switch to a new Master located on a different bridge Token-Ring segment from the previous Master when using source-route bridges, a mechanism is needed to update cached source-route information.
  • No general multicast mechanism is supported across old and new Token-Ring adapter implementations. While many newer Token-Ring adapters support group addresses, Token-Ring functional-address support is the only generally available multicast mechanism. Due to the limited number of Token-Ring functional addresses, these may collide with other usage of the same Token-Ring functional addresses.

Because of these difficulties, the preferred mode of operation over Token Ring is to use a Token-Ring functional address for the VRID virtual MAC address. ๐Ÿฆ‹ Token-Ring functional addresses have the two high-order bits in the first MAC address octet set to B'1'. They range from 03-00-00-00-00-80 to 03-00-02-00-00-00 (canonical format). However, unlike multicast addresses, there is only one unique functional address per bit position. The functional addresses 03-00-00-10-00-00 through 03-00-02-00-00-00 are reserved by the Token-Ring Architecture [TKARCH] for user-defined applications. However, since there are only 12 user-defined Token-Ring functional addresses, there may be other non-IPvX protocols using the same functional address. Since the Novell IPX [IPX] protocol uses the 03-00-00-10-00-00 functional address, operation of VRRP over Token Ring will avoid use of this functional address. In general, Token-Ring VRRP users will be responsible for resolution of other user-defined Token-Ring functional address conflicts. ๐Ÿงš

VRIDs are mapped directly to Token-Ring functional addresses. To decrease the likelihood of functional-address conflicts, allocation begins with the largest functional address. Most non-IPvX protocols use the first or first couple user-defined functional addresses, and it's expected that VRRP users will choose VRIDs sequentially, starting with 1. ๐Ÿ’…

      VRID      Token-Ring Functional Address
      ----      -----------------------------
         1             03-00-02-00-00-00
         2             03-00-04-00-00-00
         3             03-00-08-00-00-00
         4             03-00-10-00-00-00
         5             03-00-20-00-00-00
         6             03-00-40-00-00-00
         7             03-00-80-00-00-00
         8             03-00-00-01-00-00
         9             03-00-00-02-00-00
        10             03-00-00-04-00-00
        11             03-00-00-08-00-00

Or, more succinctly, octets 3 and 4 of the functional address are equal to (0x4000 >> (VRID - 1)) in non-canonical format. ๐Ÿค“

Since a functional address cannot be used as a MAC-level source address, the real MAC address is used as the MAC source address in VRRP advertisements. This isn't a problem for bridges, since packets addressed to functional addresses will be sent on the spanning-tree explorer path [ISO.10038.1993]. ๐ŸŒˆ

The functional-address mode of operation MUST be implemented by routers supporting VRRP on Token Ring. โญ

Additionally, routers MAY support the unicast mode of operation to take advantage of newer Token-Ring adapter implementations that support non-promiscuous reception for multiple unicast MAC addresses, and to avoid both the multicast traffic and usage conflicts associated with the use of Token-Ring functional addresses. Unicast mode uses the same mapping of VRIDs to virtual MAC addresses as Ethernet. However, one important difference exists. ND request/reply packets contain the virtual MAC address as the source MAC address. The reason for this is that some Token-Ring driver implementations keep a cache of MAC address/source-routing information independent of the ND cache. ๐Ÿซถ

Hence, these implementations have to receive a packet with the virtual MAC address as the source address in order to transmit to that MAC address in a source-route-bridged network.

Unicast mode on Token Ring has one limitation that should be considered. If there are VRID routers on different source-route-bridge segments, and there are host implementations that keep their source-route information in the ND cache and do not listen to gratuitous NDs, these hosts won't update their ND source-route information correctly when a switchover occurs. ๐Ÿ˜ฌ The only possible solution is to put all routers with the same VRID on the same source-route-bridge segment and use techniques to prevent that bridge segment from being a single point of failure. These techniques are beyond the scope of this document.

For both the multicast and unicast mode of operation, VRRP advertisements sent to 224.0.0.18 should be encapsulated as described in [RFC1469]. ๐Ÿ“

A.3. Operation over ATM LANE

Operation of VRRP over ATM LANE on routers with ATM LANE interfaces and/or routers behind proxy LAN Emulation Clients (LECs) is beyond the scope of this document. ๐ŸŒธ


Author's Address ๐Ÿ’–

Stephen Nadas (editor)
Ericsson
900 Chelmsford St., T3 4th Floor
Lowell, MA  01851
USA

Phone: +1 978 275 7448
EMail: stephen.nadas@ericsson.com

That's the whole RFC, bestie! You made it ๐ŸŒˆโœจ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from