RFC 9568

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

๐Ÿ“… published April 2024, from ietf

RFC 9568: Virtual Router Redundancy Protocol (VRRP) Version 3 for IPv4 and IPv6 โœจ

okay bestie, let's get the title block out of the way first ๐ŸŽ€ this is the RFC's ID card:

  • RFC number: 9568 ๐Ÿ’–
  • Stream: Internet Engineering Task Force (IETF) ๐ŸŒธ
  • Authors: A. Lindem (LabN Consulting, L.L.C.) and A. Dogra (Cisco Systems) ๐Ÿซถ
  • Category: Standards Track ๐Ÿ‘‘
  • ISSN: 2070-1721
  • Date: April 2024
  • Obsoletes: RFC 5798 ๐Ÿ’… (it replaces that older VRRP version)
  • Updates: nothing listed here

Abstract

okay so this doc defines version 3 of the Virtual Router Redundancy Protocol (VRRP) for both IPv4 and IPv6 ๐Ÿฆ‹ it obsoletes RFC 5798, which was the old VRRPv3 spec, and RFC 5798 had already replaced RFC 3768, the VRRPv2 spec for IPv4 ๐Ÿ™ˆ

so what does VRRP actually do? it's an election protocol ๐Ÿ—ณ๏ธ it picks one VRRP Router on a LAN to be in charge of a Virtual Router. the one that wins is called the Active Router, and it forwards packets sent to the IPv4 or IPv6 addresses tied to that Virtual Router. the Active Router is set up with virtual IPv4 or IPv6 addresses, and Backup Routers figure out which address family is being advertised just by looking at the IP version of the packet ๐Ÿงš

one important vibe: inside a single VRRP Router, the IPv4 Virtual Routers and the IPv6 Virtual Routers are totally separate. they never mix and they're always treated as their own instances ๐ŸŒˆ

if the Active Router goes down, the election kicks in and forwarding responsibility fails over automatically โšก for IPv4, the big win is a higher-availability default path, and you don't have to run dynamic routing or router discovery protocols on every single end host ๐Ÿ“ for IPv6, the win is a faster switchover to Backup Routers than standard IPv6 Neighbor Discovery can give you ๐Ÿ”ฅ

Status of This Memo

this is an Internet Standards Track document โœจ

it's a product of the Internet Engineering Task Force (IETF) and represents the consensus of the IETF community ๐Ÿ’œ it got public review and was approved for publication by the Internet Engineering Steering Group (IESG). if you want more on Internet Standards, check Section 2 of RFC 7841 ๐Ÿ“š

info about the current status of this doc, any errata, and how to send feedback is over at https://www.rfc-editor.org/info/rfc9568 ๐Ÿฆ‹

Copyright (c) 2024 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 (https://trustee.ietf.org/license-info) as they stand on the publication date. please read those carefully, because they spell out your rights and restrictions ๐Ÿ’… any Code Components pulled out of this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Revised BSD License ๐ŸŒธ

Table of Contents

1.  Introduction
  1.1.  Differences from RFC 5798
  1.2.  A Note on Terminology
  1.3.  IPv4
  1.4.  IPv6
  1.5.  Requirements Language
  1.6.  Scope
  1.7.  Definitions
2.  Required Features
  2.1.  IPvX Address Backup
  2.2.  Preferred Path Indication
  2.3.  Minimization of Unnecessary Service Disruptions
  2.4.  Efficient Operation over Extended LANs
  2.5.  Sub-second Operation for IPv4 and IPv6
3.  VRRP Overview
4.  Sample VRRP Networks
  4.1.  Sample VRRP Network 1
  4.2.  Sample VRRP Network 2
5.  Protocol
  5.1.  VRRP Packet Format
    5.1.1.  IPv4 Field Descriptions
      5.1.1.1.  Source Address
      5.1.1.2.  Destination Address
      5.1.1.3.  TTL
      5.1.1.4.  Protocol
    5.1.2.  IPv6 Field Descriptions
      5.1.2.1.  Source Address
      5.1.2.2.  Destination Address
      5.1.2.3.  Hop Limit
      5.1.2.4.  Next Header
  5.2.  VRRP Field Descriptions
    5.2.1.  Version
    5.2.2.  Type
    5.2.3.  Virtual Rtr ID (VRID)
    5.2.4.  Priority
    5.2.5.  IPvX Addr Count
    5.2.6.  Reserve
    5.2.7.  Maximum Advertisement Interval (Max Advertise Interval)
    5.2.8.  Checksum
    5.2.9.  IPvX Address(es)
6.  Protocol State Machine
  6.1.  Parameters per Virtual Router
  6.2.  Timers
  6.3.  State Transition Diagram
  6.4.  State Descriptions
    6.4.1.  Initialize
    6.4.2.  Backup
    6.4.3.  Active
7.  Sending and Receiving VRRP Packets
  7.1.  Receiving VRRP Packets
  7.2.  Transmitting VRRP Packets
  7.3.  Virtual Router MAC Address
  7.4.  IPv6 Interface Identifiers
8.  Operational Issues
  8.1.  IPv4
    8.1.1.  ICMP Redirects
    8.1.2.  Host ARP Requests
    8.1.3.  Proxy ARP
  8.2.  IPv6
    8.2.1.  ICMPv6 Redirects
    8.2.2.  ND Neighbor Solicitation
    8.2.3.  Router Advertisements
    8.2.4.  Unsolicited Neighbor Advertisements
  8.3.  IPvX
    8.3.1.  Potential Forwarding Loop
    8.3.2.  Recommendations Regarding Setting Priority Values
  8.4.  VRRPv3 and VRRPv2 Interoperation
    8.4.1.  Assumptions
    8.4.2.  VRRPv3 Support of VRRPv2 Interoperation
      8.4.2.1.  Interoperation Considerations
9.  Security Considerations
10. IANA Considerations
11. References
  11.1.  Normative References
  11.2.  Informative References
Acknowledgments
Authors' Addresses

1. Introduction โœจ

okay so this doc defines version 3 of VRRP for IPv4 and IPv6 ๐Ÿ’– it obsoletes [RFC5798], which previously specified VRRP (version 3), and [RFC5798] itself obsoleted [RFC3768], the VRRP (version 2) spec for IPv4 ๐ŸŒธ

the vibe is the same as the abstract: VRRP runs an election that hands responsibility for a Virtual Router (see Section 1.7) to one VRRP Router on a LAN ๐Ÿ—ณ๏ธ the winner is the Active Router, and it forwards packets routed to those IPv4 or IPv6 addresses. the one exception is packets addressed to those addresses in the way described in Section 8.3.1 ๐Ÿ™ˆ VRRP Active Routers get configured with virtual IPv4 or IPv6 addresses, and Backup Routers infer the address family from the IP protocol version ๐Ÿงš inside one VRRP Router, the IPv4 and IPv6 Virtual Routers stay independent and are always treated as separate instances ๐ŸŒˆ and if the Active Router dies, the election gives you dynamic failover ๐Ÿ”ฅ

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

1.1. Differences from RFC 5798

the changes from [RFC5798] are the glow-up list ๐Ÿ’…

  1. the VRRP terminology got updated to match inclusive language guidelines for IETF technologies ๐Ÿซถ the IETF points to the National Institute of Standards and Technology (NIST) document "Guidance for NIST Staff on Using Inclusive Language in Documentary Standards" [NISTIR8366] for those guidelines โœจ
  2. the term for the VRRP Router taking over forwarding responsibility changed to "Active Router" to match IETF inclusive terminology ๐Ÿ‘‘ inconsistencies in the [RFC5798] terminology for both "Active Router" and "Backup Router" got fixed too, and the not-so-nice term for attracting and dropping unreachable packets was changed ๐Ÿ’€
  3. errata about the state machines in Section 6 got fixed ๐Ÿ”ฅ
  4. the checksum calculation in Section 5.2.8 got clarified so it's super clear what's included, and it does not include the pseudo-header for IPv4 ๐Ÿงฎ
  5. when a VRRP advertisement comes in from a lower priority VRRP Router, the Active VRRP Router immediately sends a VRRP advertisement so learning bridges bridge the packets to the correct Ethernet segment ๐ŸŒ‰ (see Section 6.4.3)
  6. the appendices on legacy tech (Fiber Distributed Data Interface (FDDI), Token Ring, and ATM LAN Emulation) got removed ๐Ÿ“
  7. a recommendation got added: IPv6 Unsolicited Neighbor Advertisements SHOULD be accepted by the Active and Backup Routers (Section 8.2.4) ๐Ÿ’œ
  8. checking that the Maximum Advertisement Intervals match is recommended, although a mismatch will not result in the VRRP packet being dropped (Section 7.1) ๐Ÿ™ˆ
  9. misc editorial changes for readability ๐ŸŽ€
  10. the IANA Considerations section got beefed up to include all the IPv4/IPv6 multicast address allocations and Ethernet Media Access Control (MAC) address allocations ๐ŸŒˆ

1.2. A Note on Terminology

this doc talks about both IPv4 and IPv6, and a lot of the VRRP descriptions and procedures are shared between them ๐Ÿฆ‹ it would be less wordy to just say "IP" to mean "IPv4 or IPv6", but historically "IP" usually means IPv4 ๐Ÿ˜ญ so in this spec, the term "IPvX" (where X is 4 or 6) is introduced to mean either "IPv4" or "IPv6" ๐Ÿ’– wherever the IP version matters, the specific term gets used, and "IP" is avoided ๐Ÿ’…

part 1 of 8 is done bestie ๐ŸŽ€ more parts are coming, so stay tuned ๐Ÿ’–

1.3. IPv4 ๐ŸŒธ

okay so an IPv4 end-host has a few ways to figure out its first-hop router for a given IPv4 destination. It can run (or snoop on) a dynamic routing protocol like Routing Information Protocol (RIP) [RFC2453] or OSPF version 2 [RFC2328], run an ICMP router discovery client [RFC1256], run DHCPv4 [RFC2131], or just use a statically configured default route. ๐Ÿ’…

Running a dynamic routing protocol on every end-host might not be doable for a bunch of reasons: admin overhead, processing overhead, security issues, or there just isn't an implementation for that platform ๐Ÿ˜ญ. Neighbor or router discovery protocols usually need every host on the network to take an active part, so the timers have to be huge to keep the protocol chatter down for each host. The result? Spotting a dead router can take forever, and the default route can stay unreachable for unacceptably long stretches ๐Ÿ’€.

Manually configured default routes (static or DHCPv4) are super popular, ngl, because they barely cost the end-host any config or processing, and basically every IPv4 implementation supports them โœจ. BUT this creates a single point of failure. If the default router dies, it's a catastrophic event, and every end-host that can't find an alternate path is just isolated ๐Ÿ™ˆ.

Enter VRRP, the main character ๐Ÿ‘‘. VRRP is designed to kill that single point of failure in a network that relies on default routing. It runs 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 address(es) of a Virtual Router is called the Active Router, and it forwards packets sent to those IPv4 addresses. If the Active Router becomes unavailable, the election gives you dynamic failover of 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 win with VRRP is a higher-availability default path without needing dynamic routing or a router discovery protocol on every end-host ๐Ÿฆ‹.

1.4. IPv6 ๐Ÿงš

IPv6 hosts on a LAN 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 hosts can take more than 10 seconds to learn the default routers on a LAN. They aren't sent often enough to rely on a missing Router Advertisement to detect router failures ๐Ÿ˜ฌ.

ND has a mechanism called Neighbor Unreachability Detection for spotting a failed neighbor node (router or host) or a broken forwarding path to one. It works by sending unicast ND Neighbor Solicitation messages to the neighbor node. To keep the overhead of those Neighbor Solicitations down, 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 while. With default ND parameters, a host can take more than 10 seconds to realize a router is unreachable before it switches to another default router. That delay is very noticeable to users and can make some transport protocol implementations time out ๐Ÿ˜ญ๐Ÿซถ.

You could make Neighbor Unreachability Detection quicker by making the timer intervals more aggressive (the current lower limit is 5 seconds, fyi). But that would seriously ramp up ND traffic overhead, especially when lots of hosts are all checking the reachability of one or more routers at once ๐Ÿ”ฅ.

The Virtual Router Redundancy Protocol 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). It all happens without any interaction with the hosts and with a minimum amount of VRRP traffic ๐ŸŒˆ.

1.5. Requirements Language ๐Ÿ’œ

The BCP 14 key words in this doc are "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL". They get their BCP 14 meaning from [RFC2119] [RFC8174] only when they show up in all capitals, exactly like they do right here ๐Ÿค“.

1.6. Scope ๐ŸŽ€

The rest of the doc covers VRRP's features, design goals, and theory of operation. It presents the message formats, protocol processing rules, and state machine that guarantee convergence to a single Active Router. The last bit covers operational issues around MAC address mapping, handling of ARP messages, generation of ICMP redirect messages, and security issues ๐Ÿ”.

1.7. Definitions ๐Ÿ“–

Here's the glossary, bestie. The terms matter, so I'm keeping it exactly as written ๐Ÿซถ.

   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
                           can serve as a Backup Router for one or more
                           Virtual Routers.

   Virtual Router Identifier  An integer value (1-255) identifying an
                           instance of a Virtual Router on a LAN.  Also
                           referred by its acronym, VRID.

   Virtual Router MAC Address  The multicast Ethernet MAC address used
                           for VRRP advertisements for a VRID.  Refer to
                           Section 7.3.

   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
                           connection requests, 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, 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.

   Forwarding Responsibility  The responsibility for forwarding packets
                           sent to the IPvX address(es) associated with
                           the Virtual Router.  This includes receiving
                           packets sent to the Virtual Router MAC
                           address, forwarding these packets based on
                           the local Routing Information Base (RIB) /
                           Forwarding Information Base (FIB), answering
                           ARP requests for the IPv4 address(es), and
                           answering ND requests for the IPv6
                           address(es).

   Active Router           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 be the Active Router.

   Backup Router(s)        The set of VRRP Routers available to assume
                           forwarding responsibility for a Virtual
                           Router should the current Active Router fail.

   Drop Route              A route installed in the Routing Information
                           Base (RIB) that will result in traffic with a
                           destination address that matches the route to
                           be dropped.

2. Required Features ๐Ÿ‘‘

This section covers the features that were considered mandatory and that guided VRRP's design ๐Ÿ’–.

2.1. IPvX Address Backup ๐Ÿฆ‹

Backing up IPvX address(es) is VRRP's primary function. While it's doing Active Router election plus the extra stuff below, the protocol should strive to:

  • minimize the duration of unreachability,
  • 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, and
  • support multiple logical IPvX subnets on a single LAN segment.

2.2. Preferred Path Indication โญ

A simple model for Active Router election among redundant routers is to treat every router as equal and call it a win once the group converges on any router as the Active Router. But there are likely to be lots of environments with a distinct preference (or range of preferences) among the redundant routers. That preference might be based on access link cost or speed, router performance or reliability, or other policy considerations ๐Ÿ“. The protocol should let you express this relative path preference in an intuitive way, and it should guarantee Active Router convergence to the most preferred Virtual Router currently available ๐Ÿ‘‘.

2.3. Minimization of Unnecessary Service Disruptions ๐Ÿ’…

Once Active Router election is done, any unnecessary transition between Active and Backup Routers can disrupt service. So the protocol should ensure that, after election, no state transition is triggered by any Backup Router of equal or lower preference, as long as the Active Router keeps functioning properly โœจ.

Some environments may find it beneficial to dodge the state transition that happens when a router preferred over the current Active Router becomes available. It may be useful to support an override of the immediate restoration to the preferred path ๐ŸŒธ.

2.4. Efficient Operation over Extended LANs ๐Ÿ—บ๏ธโœจ

okay so sending IPvX packets (that's IPv4 or IPv6, bestie ๐Ÿซถ) on a multiaccess LAN means you have to map an IPvX address to a MAC address. Here's the tea ๐Ÿต: using the Virtual Router MAC address on an extended LAN with learning bridges can seriously change how much bandwidth overhead the packets sent to the Virtual Router eat up ๐Ÿ“. If the Virtual Router MAC address is never used as the source address in a link-level frame, its MAC address location never gets learned, so every packet sent to the Virtual Router gets flooded ๐Ÿ˜ญ๐Ÿ’€. To get more efficient in that environment, the protocol should do the following:

  1. Use the Virtual Router MAC address as the source in a packet sent by the Active Router to trigger MAC learning.
  2. Trigger a message immediately after transitioning to the Active Router to update MAC learning.
  3. Trigger periodic messages from the Active Router to maintain the MAC address cache.

2.5. Sub-second Operation for IPv4 and IPv6 โšก๐Ÿƒโ€โ™€๏ธ

Sub-second detection of Active Router failure is needed in both IPv4 and IPv6 environments ๐Ÿ’…. Earlier work proposed that sub-second operation was for IPv6, and this specification borrows that earlier approach for both IPv4 and IPv6 ๐Ÿฆ‹.

Okay, now the spicy scenario ๐ŸŒถ๏ธ. One possible problem can pop up when you use a small Advertisement_Interval (refer to Section 6.1): a VRRP Router is generating more packets than it can transmit, so a queue builds up on the VRRP Router ๐Ÿ˜ฌ. When that happens, packets being transmitted onto the VRRP-protected LAN could see a bigger queueing delay than the smallest Advertisement_Interval. In that case, the Active_Down_Interval (refer to Section 6.1) may be small enough that normal queuing delays make a Backup Router think the Active Router is down, so it promotes itself to Active Router ๐Ÿ‘‘. Shortly afterwards, the delayed VRRP packets from the original Active Router show up and the VRRP Router switches back to Backup Router ๐Ÿ™ƒ. Furthermore, this can repeat many times per second, which causes a serious disruption of traffic ๐Ÿ’€. To mitigate this, giving VRRP packets priority on egress interface queues should be considered ๐ŸŽ€. If the Active Router notices this happening, it SHOULD log the problem (subject to rate-limiting) ๐Ÿ“.

3. VRRP Overview ๐ŸŒธ

VRRP specifies an election protocol to provide the Virtual Router function described earlier ๐Ÿ—ณ๏ธ. All protocol messaging is done using either IPv4 or IPv6 multicast datagrams. That means the protocol can run over a bunch of multiaccess LAN technologies that support IPvX multicast ๐ŸŒˆ. Each link of a VRRP Virtual Router gets a single well-known MAC address. This document currently only details the mapping to networks using an IEEE 802 48-bit MAC address. The Virtual Router MAC address is used as the source in all periodic VRRP messages sent by the Active Router, which helps Layer 2 (L2) bridges on an extended LAN do MAC learning ๐Ÿง .

A Virtual Router is defined by its Virtual Router Identifier (VRID) and a set of either IPv4 or IPv6 address(es) ๐Ÿ†”. A VRRP Router may associate a Virtual Router with its real address on an interface. The scope of each Virtual Router is restricted to a single LAN ๐Ÿ . A VRRP Router may be configured with additional Virtual Router mappings and priority for the Virtual Routers it is willing to back up. The mapping between the VRID and its IPvX address(es) must be coordinated among all VRRP Routers on a LAN ๐Ÿค.

There's no restriction against reusing a VRID with a different address mapping on different LANs, and there's also no restriction against using the same VRID number for a set of IPv4 addresses and a set of IPv6 addresses. Just know these are two different Virtual Routers ๐Ÿ‘ฏ.

To keep network traffic low, only the Active Router for each Virtual Router sends periodic VRRP Advertisement messages ๐Ÿ“ฃ. A Backup Router will not attempt to preempt the Active Router unless the Backup Router has a higher priority. This avoids service disruption unless a more preferred path becomes available ๐Ÿ›ค๏ธ. It's also possible to administratively prohibit Active Router preemption attempts ๐Ÿšซ. The only exception is that a VRRP Router will always become the Active Router for any Virtual Router associated with address(es) it owns ๐Ÿ‘‘. If the Active Router becomes unavailable, the highest-priority Backup Router will transition to the Active Router after a short delay, giving a controlled transition of Virtual Router responsibility with minimal service interruption ๐Ÿฆ‹.

The VRRP protocol design gives a rapid transition from the Backup Router to the Active Router so service interruption stays minimal, and it includes optimizations that reduce protocol complexity while guaranteeing a controlled Active Router transition for typical operational scenarios โšก. These optimizations give 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 for each router. One side effect when these assumptions are violated, i.e., more than two redundant paths with equal preference, is that duplicate packets may be forwarded for a brief period during Active Router election ๐Ÿ˜ตโ€๐Ÿ’ซ. Still, the typical scenario assumptions are likely to cover the vast majority of deployments, loss of the Active Router is infrequent, and the expected duration for Active Router election convergence is quite small (< 4 seconds when using the default Advertisement_Interval and configurable to < 1/25 second) โฑ๏ธ. So the VRRP optimizations are significant simplifications in the protocol design while carrying an insignificant probability of brief network disruption ๐Ÿซถโœจ.

4. Sample VRRP Networks ๐Ÿงš

4.1. Sample VRRP Network 1 ๐Ÿ–ฅ๏ธ

Here's a simple network with two VRRP Routers implementing one Virtual Router ๐Ÿ‘€.

        +-----------+ +-----------+
        | Router-1  | | Router-2  |
        |(AR VRID=1)| |(BR VRID=1)|
        |           | |           |
VRID=1  +-----------+ +-----------+
IPvX A------>*            *<---------IPvX B
             |            |
             |            |
-------------+------------+--+-----------+-----------+-----------+
                             ^           ^           ^           ^
                             |           |           |           |
     Default Router          |           |           |           |
     IPvX Addresses ---> (IPvX A)    (IPvX A)    (IPvX A)    (IPvX A)
                             |           |           |           |
                    IPvX H1->*  IPvX H2->*  IPvX H3->*  IPvX H4->*
                          +--+--+     +--+--+     +--+--+     +--+--+
                          |  H1 |     |  H2 |     |  H3 |     |  H4 |
                          +-----+     +-----+     +--+--+     +--+--+
Legend:
      --+---+---+-- = Ethernet
                  H = Host computer
                 AR = Active 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

                   Figure 1: Sample VRRP Network 1

In the IPv4 case, meaning IPvX is IPv4 everywhere in the figure, each router is permanently assigned an IPv4 address on the LAN interface (Router-1 gets IPv4 A and Router-2 gets IPv4 B). Each host installs a default route (learned through DHCPv4 or via a configured static route) through one of the routers. In this example, they all use Router-1's IPv4 A ๐Ÿ›ฃ๏ธ.

In the IPv6 case, meaning IPvX is IPv6 everywhere in the figure, each router has its own link-local IPv6 address on the LAN interface and a link-local IPv6 address per VRID that's shared with the other routers serving the same VRID ๐ŸŒ. Each host learns a default route from Router Advertisements through one of the routers. In this example, they all use Router-1's IPv6 Link-Local A ๐Ÿ’œ.

In an IPv4 VRRP environment, each router supports reception and transmission for the exact same IPv4 address. Router-1 is the IPv4 address owner of IPv4 A, and Router-2 is the IPv4 address owner of IPv4 B. A Virtual Router is then defined by associating a unique identifier (the VRID) with the address owned by Router-1 ๐Ÿชช.

In an IPv6 VRRP environment, each router supports transmission and reception for the IPv6 addresses associated with the VRID. Router-1 is the IPv6 address owner of IPv6 A, and Router-2 is the IPv6 address owner of IPv6 B. A Virtual Router is then defined by associating a unique identifier (the VRID) with the address owned by Router-1 ๐ŸŽ€.

Finally, in both the IPv4 and IPv6 cases, the VRRP protocol manages Virtual Router failover to a Backup Router ๐Ÿ”.

The IPvX example above shows a Virtual Router configured to cover the IPvX address owned by Router-1 (VRID=1, IPvX_Address=A) ๐Ÿซถ. When VRRP is enabled on Router-1 for VRID=1, it asserts itself as the Active Router, with priority = 255, since it's the IPvX address owner for the Virtual Router IPvX address ๐Ÿ‘‘. When VRRP is enabled on Router-2 for VRID=1, it transitions to the Backup Router, with priority = 100 (the default priority is 100), since it's not the IPvX address owner ๐Ÿฅˆ. If Router-1 fails, the VRRP protocol transitions Router-2 to the Active Router, temporarily taking over forwarding responsibility for IPvX A so the hosts keep getting uninterrupted service ๐Ÿฆธโ€โ™€๏ธ๐Ÿ’–.

Note that in both cases in this example, IPvX B isn't backed up, and it's only used by Router-2 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 VRRP Network 2 ๐ŸŒธ

okay so this one is giving load-splitting ๐Ÿฆ‹ two Virtual Routers, and the hosts split their traffic between them. Peep the figure:

           +-----------+  +-----------+
           |  Router-1 |  | Router-2  |
           |(AR VRID=1)|  |(BR VRID=1)|
           |(BR VRID=2)|  |(AR VRID=2)|
   VRID=1  +-----------+  +-----------+  VRID=2
   IPvX A ----->*             *<---------- IPvX B
                |             |
                |             |
      ----------+-------------+-+-----------+-----------+-----------+
                                ^           ^           ^           ^
                                |           |           |           |
        Default Router          |           |           |           |
        IPvX Addresses ---> (IPvX A)    (IPvX A)    (IPvX B)    (IPvX B)
                                |           |           |           |
                       IPvX H1->*  IPvX H2->*  IPvX H3->*  IPvX H4->*
                             +--+--+     +--+--+     +--+--+     +--+--+
                             |  H1 |     |  H2 |     |  H3 |     |  H4 |
                             +-----+     +-----+     +--+--+     +--+--+

    Legend:
         ---+---+---+--  =  Ethernet
                      H  =  Host computer
                     AR  =  Active 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

                      Figure 2: Sample VRRP Network 2

In the IPv4 example (IPvX is IPv4 everywhere in the figure), half of the hosts have a static default route through Router-1's IPv4 A, and half are using Router-2's IPv4 B. โœจ The configuration of Virtual Router VRID=1 is exactly the same as in the first example (see Section 4.1), and a second Virtual Router has been added to cover the IPv4 address owned by Router-2 (VRID=2, IPv4_Address=B). So in this case, Router-2 asserts itself as the Active Router for VRID=2, while Router-1 acts as a Backup Router. This scenario shows a deployment that gives you load-splitting when both routers are available, and full redundancy for robustness. ๐Ÿ’…

In the IPv6 example (IPvX is IPv6 everywhere in the figure), half of the hosts are using a default route through Router-1's IPv6 A, and half are using Router-2's IPv6 B. ๐Ÿงš The configuration of Virtual Router VRID=1 is exactly the same as in the first example (see Section 4.1), and a second Virtual Router has been added to cover the IPv6 address owned by Router-2 (VRID=2, IPv6_Address=B). Router-2 will assert itself as the Active Router for VRID=2, while Router-1 will act as a Backup Router. Same vibe: load-splitting when both routers are up, plus full redundancy for robustness. ๐Ÿซถ

Note that the details of load-balancing are out of scope of this document. ๐Ÿ™ˆ However, in a case where the servers need different weights, it may not make sense to rely on Router Advertisements alone to balance the host traffic between the routers [RFC4311].


5. Protocol โœจ

The whole point of the VRRP Advertisement is to tell all the VRRP Routers about the priority, the Maximum Advertisement Interval, and the IPvX addresses of the Active Router associated with the VRID. Main character energy ๐Ÿ‘‘

When VRRP is protecting an IPv4 address, VRRP packets get sent encapsulated in IPv4 packets. They go to the IPv4 multicast address assigned to VRRP. ๐ŸŒˆ

When VRRP is protecting an IPv6 address, VRRP packets get sent encapsulated in IPv6 packets. They go to the IPv6 multicast address assigned to VRRP. ๐Ÿฆ‹

5.1. VRRP Packet Format ๐ŸŽ€

okay this section is where we break down the actual packet and the fields in the IPvX header (which depend on the address family). Here's the layout:

     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    |IPvX Addr Count|
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Reserve| Max Advertise Interval|          Checksum             |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                                                               |
    +                                                               +
    |                       IPvX Address(es)                        |
    +                                                               +
    +                                                               +
    +                                                               +
    +                                                               +
    |                                                               |
    +                                                               +
    |                                                               |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

            Figure 3: IPv4/IPv6 VRRP Advertisement Packet Format

5.1.1. IPv4 Field Descriptions ๐Ÿ’–

5.1.1.1. Source Address

This is the primary IPv4 address of the interface from which the packet is being sent.

5.1.1.2. Destination Address

The IPv4 multicast address as assigned by the IANA 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. ๐Ÿšซ

5.1.1.3. TTL

The TTL MUST be set to 255. A VRRP Router receiving a packet with the TTL not equal to 255 MUST discard the packet [RFC5082]. ๐Ÿ’€

5.1.1.4. Protocol

The IPv4 protocol number assigned by the IANA 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 from which the packet is being sent.

5.1.2.2. Destination Address

The IPv6 multicast address assigned by the 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. ๐Ÿšซ

5.1.2.3. Hop Limit

The Hop Limit MUST be set to 255. A VRRP Router receiving a packet with the Hop Limit not equal to 255 MUST discard the packet [RFC5082]. ๐Ÿ’…

5.1.2.4. Next Header

The IPv6 Next Header protocol assigned by the IANA for VRRP is 112 (decimal). ๐Ÿฆ‹

5.2. VRRP Field Descriptions ๐ŸŽ€

5.2.1. Version

The Version field specifies the VRRP protocol version of this packet. This document defines version 3. โœจ

5.2.2. Type

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

1  - ADVERTISEMENT

A packet with unknown type MUST be discarded. ๐Ÿ—‘๏ธ

5.2.3. Virtual Rtr ID (VRID)

The Virtual Rtr ID field identifies the Virtual Router for which this packet is reporting status. ๐Ÿ‘‘

5.2.4. Priority

The Priority field specifies sending the VRRP Router's priority for the Virtual Router. Higher values indicate higher priority. This field 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).

VRRP Routers backing up a Virtual Router MUST use priority values between 1-254 (decimal). The default priority value for VRRP Routers backing up a Virtual Router is 100 (decimal). Refer to Section 8.3.2 for recommendations on setting the priority. ๐Ÿง

The priority value zero (0) has special meaning, indicating that the current Active Router has stopped participating in VRRP. This is used to trigger Backup Routers to quickly transition to the Active Router without having to wait for the current Active_Down_Interval (refer to Section 6.1). โšก

5.2.5. IPvX Addr Count

The IPvX Addr Count field is the number of either IPv4 addresses or IPv6 addresses contained in this VRRP advertisement. The minimum value is 1. If the received count is 0, the VRRP advertisement MUST be ignored. ๐Ÿ™ˆ

5.2.6. Reserve

The Reserve field MUST be set to zero on transmission and ignored on reception. ๐Ÿซง

5.2.7. Maximum Advertisement Interval (Max Advertise Interval)

The Max Advertise Interval is a 12-bit field that indicates the time interval (in centiseconds) between advertisements. The default is 100 centiseconds (1 second). โฑ๏ธ

Note that higher-priority Active Routers with slower transmission rates than their Backup Routers are unstable. This is because lower-priority Backup Routers configured to faster rates could join the LAN and decide they should be Active Routers before they have heard anything from the higher-priority Active Router with a slower rate. When this happens, it is temporary, i.e., once the lower-priority node does hear from the higher-priority Active Router, it will relinquish Active Router status. ๐Ÿ˜ญ this is the drama of the protocol, bestie.

5.2.8. Checksum

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

For both the IPv4 and IPv6 address families, the checksum is the 16-bit one's complement of the one's complement sum of the VRRP message. For computing the checksum, the Checksum field is set to zero. See [RFC1071] for more details. ๐Ÿงฎ

For the IPv4 address family, the checksum calculation only includes the VRRP message starting with the Version field and ending after the last IPv4 address (refer to Section 5.2).

For the IPv6 address family, the checksum calculation also includes a prepended "pseudo-header", as defined in Section 8.1 of [RFC8200]. The Next Header field in the "pseudo-header" should be set to 112 (decimal) for VRRP. ๐Ÿ’œ

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 IPvX Addr Count field. These fields are used for troubleshooting misconfigured routers. If more than one address is sent, it is recommended that all routers be configured to send these addresses in the same order to simplify comparisons. ๐Ÿ•ต๏ธโ€โ™€๏ธ

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. The address family of the addresses, IPv4 or IPv6 but not both, MUST be the same as the VRRP packet's IPvX header address family. ๐Ÿฆ‹

6. Protocol State Machine โœจ

6.1. Parameters per Virtual Router โœจ

okay so this section is the settings menu for each Virtual Router ๐Ÿ’… every knob lives here, from the VRID to the MAC address. here's the full list, untouched:

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

   Priority                    Priority value to be used by this VRRP
                               Router in Active Router 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 Active Router to
                               indicate it is relinquishing
                               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
                               list of addresses with no default.

   IPv6_Addresses              One or more IPv6 addresses associated
                               with this Virtual Router.  Configured
                               list of addresses with no default.  The
                               first address MUST be the Link-Local
                               address associated with the Virtual
                               Router.

   IPvX_Addresses              Refer to either the IPv4 or IPv6 address
                               associated with this Virtual Router (see
                               IPv4_Addresses and IPv6_Addresses above).

   Advertisement_Interval      Time interval between VRRP Advertisements
                               (centiseconds) sent by this Virtual
                               Router.  Default is 100 centiseconds (1
                               second).

   Active_Adver_Interval       Advertisement interval contained in VRRP
                               Advertisements received from the Active
                               Router (in centiseconds).  This value is
                               saved by Virtual Routers in the Backup
                               state and used to compute Skew_Time (as
                               specified in Section 8.3.2) and
                               Active_Down_Interval.  The initial value
                               is the same as Advertisement_Interval.

   Skew_Time                   Time to skew Active_Down_Interval in
                               centiseconds.  Calculated as:

                                   (((256 - Priority) *
                                   Active_Adver_Interval) / 256)

   Active_Down_Interval        Time interval for the Backup Router to
                               declare the Active Router down
                               (centiseconds).  Calculated as:

                                   (3 * Active_Adver_Interval) +
                                   Skew_Time

   Preempt_Mode                Controls whether a (starting or
                               restarting) higher-priority Backup Router
                               preempts a lower-priority Active 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
                               Active state will accept packets
                               addressed to the address owner's IPvX
                               address as its own even 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/ND messages as the MAC
                               address to use for IPvX_Addresses.

Priority is the big one ๐Ÿ”ฅ the owner of the IPvX address gets 255, the Active Router uses 0 to say "bye, I'm stepping down" ๐Ÿ˜ญ, and everyone else fights over 1-254. the default is 100.

Skew_Time and Active_Down_Interval are the math bits ๐Ÿงฎ Skew_Time gets smaller as the Priority gets bigger, and Active_Down_Interval is built from it. it's giving precision ๐ŸŽ€

6.2. Timers ๐Ÿฆ‹

two timers run the show here, and they're each only for one type of router โœจ

   Active_Down_Timer        Timer that fires when a VRRP Advertisement
                            has not been received for
                            Active_Down_Interval (Backup Routers only).

   Adver_Timer              Timer that fires to trigger transmission of
                            a VRRP Advertisement based on the
                            Advertisement_Interval (Active Routers
                            only).

6.3. State Transition Diagram ๐ŸŒˆ

here's the state map, so you can see how a router hops between Initialize, Active, and Backup ๐Ÿงš

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

                     Figure 4: State Transition Diagram

6.4. State Descriptions ๐Ÿ’…

so in the descriptions below, state names get wrapped in curly braces like {state-name}, and packets are written in ALL CAPS ๐Ÿ“ฆ

every VRRP Router runs its own copy of the state machine for each Virtual Router it's part of ๐Ÿซถ

6.4.1. Initialize ๐ŸŒธ

this is the waiting room ๐Ÿšช the router just sits here until a Startup event shows up. that's an implementation-defined trigger, basically whatever mechanism kicks the protocol off once it's been configured. the configuration part itself is out of scope for this spec, so don't look for it here ๐Ÿ™ˆ

if a Startup event comes in, the router checks whether it owns the address (Priority = 255). if it does, it does the owner stuff, and if not, it becomes a Backup:

   If a Startup event is received, then:

   *  If the Priority = 255, i.e., the router owns the IPvX address(es)
      associated with the Virtual Router, then:

      -  Send an ADVERTISEMENT

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

         o  For each IPv4 address associated with the Virtual Router,
            broadcast a gratuitous ARP message containing the Virtual
            Router MAC address and with the target link-layer address
            set to the Virtual Router MAC address.

      -  else // IPv6

         o  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) clear, 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.

      -  endif // was protected address IPv4?

      -  Set the Adver_Timer to Advertisement_Interval

      -  Transition to the {Active} state

   *  else // Router is not the address owner

      -  Set the Active_Adver_Interval to Advertisement_Interval

      -  Set the Active_Down_Timer to Active_Down_Interval

      -  Transition to the {Backup} state

   *  endif // was priority 255?

   endif // Startup event was received

6.4.2. Backup ๐Ÿ’œ

this is the watch-and-wait state ๐Ÿ‘€ the {Backup} router keeps an eye on the Active Router and jumps in when needed. the Solicited-Node multicast address [RFC4291] shows up in the pseudocode below, so keep it in mind ๐Ÿง 

while a router is in {Backup}, it has some strict rules it's not allowed to break ๐Ÿšซ here's the whole routine:

   While in the {Backup} state, a VRRP Router MUST do the following:

   *  If the protected IPvX address is an IPv4 address, then:

      -  It MUST NOT respond to ARP requests for the IPv4 address(es)
         associated with the Virtual Router.

   *  else // protected address is IPv6

      -  It MUST NOT respond to ND Neighbor Solicitation messages for
         the IPv6 address(es) associated with the Virtual Router.

      -  It MUST NOT send ND Router Advertisement messages for the
         Virtual Router.

   *  endif // was protected address IPv4?

   *  It MUST discard packets with a destination link-layer MAC address
      equal to the Virtual Router MAC address.

   *  It MUST NOT accept packets addressed to the IPvX address(es)
      associated with the Virtual Router.

   *  If a Shutdown event is received, then:

      -  Cancel the Active_Down_Timer

      -  Transition to the {Initialize} state

   *  endif // Shutdown event received

   *  If the Active_Down_Timer fires, then:

      -  Send an ADVERTISEMENT

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

         o  For each IPv4 address associated with the Virtual Router,
            broadcast a gratuitous ARP message containing the Virtual
            Router MAC address and with the target link-layer address
            set to the Virtual Router MAC address.

      -  else // IPv6

         o  Compute and join the Solicited-Node multicast address
            [RFC4291] for the IPv6 address(es) associated with the
            Virtual Router.

         o  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) clear, 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.

      -  endif // was protected address IPv4?

      -  Set the Adver_Timer to Advertisement_Interval

      -  Transition to the {Active} state

   *  endif // Active_Down_Timer fired

   *  If an ADVERTISEMENT is received, then:

      -  If the Priority in the ADVERTISEMENT is 0, then:

         o  Set the Active_Down_Timer to Skew_Time

      -  else // priority non-zero

         o  If Preempt_Mode is False, or if the Priority in the
            ADVERTISEMENT is greater than or equal to the local
            Priority, then:

            +  Set the Active_Adver_Interval to the Max Advertise
               Interval contained in the ADVERTISEMENT

            +  Recompute the Skew_Time

            +  Recompute the Active_Down_Interval

            +  Set the Active_Down_Timer to Active_Down_Interval

         o  else // preempt was true and priority was less than the
            local priority

            +  Discard the ADVERTISEMENT

         o  endif // preempt test

      -  endif // was priority 0?

   *  endif // was advertisement received?

   endwhile // {Backup} state

6.4.3. Active ๐Ÿฆ‹

okay so while we're in the {Active} state, the router is the forwarding router for the IPvX address(es) tied to the Virtual Router ๐Ÿ’… the Preempt_Mode Flag doesn't get a say here at all ๐Ÿ™ˆ

bestie, while in {Active}, a VRRP Router MUST do the following ๐Ÿซถ

*  If the protected IPvX address is an IPv4 address, then:

   -  It MUST respond to ARP requests for the IPv4 address(es)
      associated with the Virtual Router.

*  else // IPv6

   -  It MUST be a member of the Solicited-Node multicast address for
      the IPv6 address(es) associated with the Virtual Router.

   -  It MUST respond to ND Neighbor Solicitation messages (with the
      Router Flag (R) set) for the IPv6 address(es) associated with
      the Virtual Router.

   -  It MUST send ND Router Advertisements for the Virtual Router.

   -  If Accept_Mode is False:

      o  It MUST NOT drop IPv6 Neighbor Solicitations and Neighbor
         Advertisements.

*  endif // IPv4?

*  It MUST forward packets with a destination link-layer MAC address
   equal to the Virtual Router MAC address.

*  It 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, it MUST NOT accept these
   packets.

*  If a Shutdown event is received, then:

   -  Cancel the Adver_Timer

   -  Send an ADVERTISEMENT with Priority = 0

   -  Transition to the {Initialize} state

*  endif // shutdown received

*  If the Adver_Timer fires, then:

   -  Send an ADVERTISEMENT

   -  Reset the Adver_Timer to Advertisement_Interval

*  endif // advertisement timer fired

*  If an ADVERTISEMENT is received, then:

   -  If the Priority in the ADVERTISEMENT is 0, then:

      o  Send an ADVERTISEMENT

      o  Reset the Adver_Timer to Advertisement_Interval

   -  else // priority was non-zero

      o  If the Priority in the ADVERTISEMENT is greater than the
         local Priority or 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 (based
         on an unsigned integer comparison of the IPvX addresses in
         network byte order), then:

         +  Cancel Adver_Timer

         +  Set the Active_Adver_Interval to the Max Advertise
            Interval contained in the ADVERTISEMENT

         +  Recompute the Skew_Time

         +  Recompute the Active_Down_Interval

         +  Set the Active_Down_Timer to Active_Down_Interval

         +  Transition to the {Backup} state

      o  else // new Active Router logic

         +  Discard the ADVERTISEMENT

         +  Send an ADVERTISEMENT immediately to assert the {Active}
            state to the sending VRRP Router and to update any
            learning bridges with the correct Active VRRP Router
            path.

      o  endif // new Active Router detected

   -  endif // was priority zero?

*  endif // advert received

endwhile // in {Active} state

Note: VRRP packets go out with the Virtual Router MAC address as the source MAC address โœจ that's so learning bridges can figure out which LAN segment the Virtual Router is actually on ๐ŸŒˆ


7. Sending and Receiving VRRP Packets ๐Ÿ“ฆ

7.1. Receiving VRRP Packets ๐Ÿ“ฅ

these are the checks that happen whenever a VRRP packet shows up ๐Ÿ‘€

  • If the received packet is an IPv4 packet, then:
    • It MUST verify that the IPv4 TTL is 255.
  • else // IPv6 VRRP packet received
    • It MUST verify that the IPv6 Hop Limit is 255.
  • endif
  • It MUST verify that the VRRP version is 3.
  • It MUST verify that the VRRP packet type is 1 (ADVERTISEMENT).
  • It MUST verify that the received packet contains the complete VRRP packet (including fixed fields and the IPvX address).
  • It MUST verify the VRRP checksum.
  • It 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 ๐Ÿ—‘๏ธ it SHOULD log the event (subject to rate-limiting), and it MAY indicate via network management that an error occurred ๐Ÿšจ

a receiver SHOULD also check that the Max Advertise Interval in the received VRRP packet matches the Advertisement_Interval configured for the VRID ๐Ÿง instability can happen when the intervals differ (refer to Section 5.2.7). if this check fails, the receiver SHOULD log the event (subject to rate-limiting) and MAY indicate via network management that a misconfiguration was detected ๐Ÿ’…

a receiver MAY also check that "IPvX Addr Count" and the list of IPvX address(es) match the IPvX address(es) configured for the VRID. if this check fails, the receiver SHOULD log the event (subject to rate-limiting) and MAY indicate via network management that a misconfiguration was detected ๐Ÿซถ

7.2. Transmitting VRRP Packets ๐Ÿ“ค

these operations MUST be performed when a VRRP packet is transmitted ๐ŸŽ€

  • Fill in the VRRP packet fields with the appropriate Virtual Router configuration state
  • Compute the VRRP checksum
  • Set the source MAC address to the Virtual Router MAC address
  • If the protected address is an IPv4 address, then:
    • Set the source IPv4 address to the interface's primary IPv4 address
  • else // IPv6
    • Set the source IPv6 address to the interface's link-local IPv6 address
  • endif
  • Set the IPvX protocol to VRRP
  • Send the VRRP packet to the VRRP IPvX multicast group

Note: VRRP packets go out with the Virtual Router MAC address as the source MAC address ๐ŸŒธ same reason as before: so learning bridges correctly work out which LAN segment the Virtual Router is attached to ๐Ÿงš

7.3. Virtual Router MAC Address ๐Ÿชช

the Virtual Router MAC address for a Virtual Router is an IEEE 802 MAC address [RFC9542] in the following format ๐Ÿ’–

IPv4 case: 00-00-5E-00-01-{VRID} (in hex, in network byte order)

the first three octets come from the IANA's Organizationally Unique Identifier (OUI). the next two octets (00-01) mark the address block assigned to the VRRP protocol for IPv4. {VRID} is the Virtual Router Identifier. this mapping gives you up to 255 IPv4 VRRP Routers on a LAN ๐ŸŒˆ

IPv6 case: 00-00-5E-00-02-{VRID} (in hex, in network byte order)

the first three octets are from the IANA's OUI. the next two octets (00-02) mark the address block assigned to the VRRP protocol for IPv6. {VRID} is the Virtual Router Identifier. this mapping gives you up to 255 IPv6 VRRP Routers on a LAN ๐Ÿซถ

7.4. IPv6 Interface Identifiers ๐Ÿ†”

[RFC8064] says that [RFC7217] should be the default scheme for generating a stable address in IPv6 Stateless Address Autoconfiguration (SLAAC) [RFC4862]. the Virtual Router MAC MUST NOT be used for the Net_Iface parameter in the Interface Identifier (IID) derivation algorithms in [RFC7217] and [RFC8981] ๐Ÿ™…โ€โ™€๏ธ

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 can be used normally when VRRP is running among a group of routers ๐Ÿ’… this lets VRRP work 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 it made its next-hop routing decision. if a VRRP Router is acting as the Active Router for Virtual Router(s) containing address(es) it does not own, then it must figure out which Virtual Router the packet was sent to when picking the redirect source address ๐Ÿง one way to work that out is to look at the destination MAC address in the packet that triggered the redirect ๐Ÿ”

it may be useful to disable redirects in specific cases where VRRP is used to load-share traffic among several 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 Active Router MUST respond with an ARP response that gives the Virtual Router MAC address ๐Ÿ’Œ the source address of the Ethernet frame for this ARP response is the physical MAC address of the physical router, but the Active Router MUST NOT put its physical MAC address in the ARP response ๐Ÿ™…โ€โ™€๏ธ that way the host always uses the same MAC address, no matter who the current Active Router is ๐Ÿ‘‘

when a VRRP Router restarts or boots, it SHOULD NOT send any ARP messages using its physical MAC address for an IPv4 address it owns (as defined in Section 1.7), and it should only send ARP messages that include Virtual Router MAC addresses ๐Ÿซถ

this means the following:

  • When configuring an interface, Active Routers SHOULD broadcast a gratuitous ARP message containing the Virtual Router MAC address for each IPv4 address on that interface.
  • At system boot, when initializing interfaces for VRRP operation, gratuitous ARP messages MUST be delayed until both the IPv4 address and the Virtual Router MAC address are configured โณ
  • When, for example, Secure Shell (SSH) access to a particular VRRP Router is required, an IPv4 address known to belong to that router SHOULD be used ๐Ÿ”

8.1.3. Proxy ARP ๐Ÿชž

if Proxy ARP is going 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 make hosts learn the real MAC address of the VRRP Router ๐Ÿ’€

8.2. IPv6 ๐Ÿ’œ

8.2.1. ICMPv6 Redirects ๐Ÿงšโ€โ™€๏ธ

ICMPv6 redirects can be used normally when VRRP is running among a group of routers [RFC4443] โœจ this lets VRRP work 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 it made its next-hop routing decision. if a VRRP Router is acting as the Active Router for Virtual Router(s) containing address(es) it does not own, then it has to figure out which Virtual Router the packet was sent to when picking the redirect source address ๐Ÿค” one method to deduce the Virtual Router used is to look at the destination MAC address in the packet that triggered the redirect ๐Ÿ”

8.2.2. ND Neighbor Solicitation ๐Ÿ’Œ

Okay so when a host sends an ND Neighbor Solicitation for a Virtual Router IPv6 address, the Active Router MUST respond with the Virtual Router MAC address for that Virtual Router. It MUST NOT respond with its physical MAC address ๐Ÿ™…โ€โ™€๏ธ This way the host can always use the same MAC address, no matter who the current Active Router is ๐Ÿ’–

When an Active Router sends an ND Neighbor Solicitation for a host's IPv6 address, it MUST include the Virtual Router MAC address in the source link-layer address option, if it sends that option at all. It MUST NOT put its physical MAC address in that option ๐Ÿฆ‹

When a VRRP Router restarts or boots, it SHOULD NOT send any ND messages carrying its physical MAC address for the IPv6 address it owns. It should only send ND messages that include Virtual Router MAC addresses ๐ŸŒธ

This means:

  • When configuring an interface, Active Routers SHOULD send an unsolicited ND Neighbor Advertisement 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 Advertisements, ND Neighbor Advertisements, and ND Neighbor Solicitation messages MUST be delayed until both the IPv6 address and the Virtual Router MAC address are configured ๐ŸŽ€

Quick heads up on one edge case ๐Ÿ‘€ On a restarting Active Router where the VRRP protected address is an interface address (the address owner), Duplicate Address Detection may fail, because the Backup Router MAY answer that it owns the address. One fix is to just not run Duplicate Address Detection in this situation ๐Ÿ’…

8.2.3. Router Advertisements ๐Ÿ“ฃ

When a Backup VRRP Router has become the Active Router for a Virtual Router, it's now responsible for sending Router Advertisements for that Virtual Router, as described in Section 6.4.3. The Backup Routers MUST be configured to send the same Router Advertisement options as the address owner. No skipping, bestie ๐Ÿ’œ

Router Advertisement options that advertise special services (like the Home Agent Information Option) that are present on the address owner SHOULD NOT be sent by the address owner. The exception is when the Backup Routers are ready to take over those services fully and have a complete, synchronized database for them ๐Ÿงš

8.2.4. Unsolicited Neighbor Advertisements ๐Ÿ“ก

A VRRP Router acting as an IPv6 Active Router or Backup Router SHOULD accept Unsolicited Neighbor Advertisements and update the matching neighbor cache [RFC4861]. These get sent to the IPv6 all-nodes multicast address (ff02::1) [RFC4861] or the IPv6 all-routers multicast address (ff02::2), so they will definitely be received ๐Ÿ™Œ Unsolicited Neighbor Advertisements go out both when link-level addresses change [RFC4861] and for gratuitous neighbor discovery by first-hop routers [RFC9131]. Extra configuration might be needed for these to actually update the neighbor cache, so keep an eye on that ๐Ÿ‘€

8.3. IPvX ๐ŸŒˆ

8.3.1. Potential Forwarding Loop ๐Ÿ”

If it is not the address owner, a VRRP Router SHOULD NOT forward packets addressed to the IPvX address it becomes the Active Router for. Forwarding those would just create unnecessary traffic ๐Ÿ˜ฉ Also, on LANs where a router receives the packets it transmits, this can turn into a forwarding loop that only ends when the IPvX TTL expires. Yikes ๐Ÿ’€

One way VRRP Routers can dodge these loops is to add or delete a host Drop Route for each non-owned IPvX address when they transition to or from the Active state ๐Ÿ›ก๏ธ

8.3.2. Recommendations Regarding Setting Priority Values ๐Ÿ†

Priority 255 is the special "IPvX address owner" value for the VRID ๐Ÿ‘‘ VRRP Routers with priority 255 will preempt all lower-priority routers as soon as they start up, so they basically take over immediately. For a VRID, only a single VRRP Router on the link SHOULD be configured with priority 255. If multiple VRRP Routers advertising priority 255 are detected, the condition SHOULD be logged (subject to rate-limiting). And if no VRRP Router has this priority and preemption is disabled, then no preemption happens. Simple as that โœจ

To keep two or more Backup Routers from becoming Active Routers at the same time after the previous Active Router fails or shuts down, all Virtual Routers SHOULD be configured with different priorities. The gaps should be big enough that lower-priority Backup Routers don't move to the Active state before they hear an advertisement from the highest-priority Backup Router once it becomes the Active Router. If multiple VRRP Routers advertising the same priority are detected, this condition MAY be logged as a warning (subject to rate-limiting) ๐Ÿšจ

Here's the fun part: Skew_Time gets smaller as priority goes up, so a higher priority on your preferred Backup Router can get you faster convergence ๐Ÿƒโ€โ™€๏ธ But when there are multiple Backup Routers, the priorities still need those sufficient differences we just talked about ๐Ÿซถ

8.4. VRRPv3 and VRRPv2 Interoperation ๐Ÿฆ‹

8.4.1. Assumptions ๐Ÿง 

  1. VRRPv2 and VRRPv3 interoperation is optional.
  2. Mixing VRRPv2 and VRRPv3 should only happen when you're transitioning from VRRPv2 to VRRPv3. Mixing the two versions is not meant to be a permanent solution ๐Ÿ™ˆ

8.4.2. VRRPv3 Support of VRRPv2 Interoperation ๐Ÿ”„

As I mentioned above, this support is for upgrade scenarios and is NOT RECOMMENDED for permanent deployments. Not a forever setup, babe ๐Ÿ’…

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 is the Active Router, it MUST send both types at the configured rate, even if that rate is sub-second โšก

When a Virtual Router is configured this way and is the Backup Router, it MUST time out based on the rate advertised by the Active Router. If the Active Router is VRRPv2, the Backup Router MUST translate the timeout value it receives (in seconds) into centiseconds. Also, a Backup Router SHOULD ignore VRRPv2 advertisements from the current Active Router if it is also receiving VRRPv3 packets from that same router. It MAY report when a VRRPv3 Active Router is not sending VRRPv2 packets, since that suggests they don't agree on whether they're supporting VRRPv2 interoperation ๐Ÿ‘€

8.4.2.1. Interoperation Considerations ๐Ÿงฉ

8.4.2.1.1. Slow, High-Priority Active Routers ๐Ÿข

See also Section 5.2.7, "Maximum Advertisement Interval (Max Advertise Interval)".

The most important example of this is a VRRPv2 Active Router interacting with a sub-second VRRPv3 Backup Router ๐Ÿ˜ณ

A VRRPv2 implementation SHOULD NOT be given a higher priority than a VRRPv2 or VRRPv3 implementation it's interoperating with if that VRRPv2 or VRRPv3 router's advertisement rate is sub-second.

8.4.2.1.2. Overwhelming VRRPv2 Backups ๐ŸŒŠ

It seems possible that a VRRPv3 Active Router sending at centisecond rates could overwhelm a VRRPv2 Backup Router, and the results could be non-deterministic ๐Ÿ˜ต

In this upgrade case, a deployment should initially run the VRRPv3 Active Routers at lower frequencies, e.g., 100 centiseconds, until the VRRPv2 routers are upgraded. Once the deployment has verified that VRRPv3 is working properly, the VRRPv2 support may be disabled and the desired sub-second rates may be configured. Patience pays off, hun ๐Ÿ“

9. Security Considerations ๐Ÿ”

VRRP for IPvX does not currently include any type of authentication. Earlier versions of the VRRP specification included several types of authentication, ranging from none at all to strong authentication. Operational experience and further analysis showed these did not provide enough security to outweigh the risk of misconfigured secrets, which could cause multiple Active Routers to be elected. Due to the nature of the VRRP protocol, even if VRRP messages are cryptographically protected, that doesn't stop hostile nodes from acting like they're an Active Router and creating multiple Active Routers. Authentication of VRRP messages could have stopped a hostile node from pushing all properly functioning routers into the Backup state. However, having multiple Active Routers 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 could still disrupt ARP/ND and cause the same effect as all routers going into the Backup state. Scary stuff, fr fr ๐Ÿ˜ญ

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

These attacks aren't any worse than, and are a subset of, the attacks any node attached to a LAN can do without VRRP. The kinds of attacks a malicious node on a LAN can perform 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, etc.

All of these can happen whether or not you implement VRRP. VRRP doesn't add to these vulnerabilities, and most of them are handled independently, e.g., by SEcure Neighbor Discovery (SEND) [RFC3971] ๐Ÿฆ‹

VRRP includes a mechanism that protects against VRRP packets being injected from another remote network [RFC5082]. It works by setting the IPv4 TTL or IPv6 Hop Limit to 255 and checking that value on receipt. This keeps most vulnerabilities limited to attacks on the local network ๐Ÿ”’

VRRP does not provide any confidentiality. Confidentiality isn't necessary for VRRP to work correctly, and there's no information in VRRP messages that has to be kept secret from other nodes on the LAN ๐Ÿคทโ€โ™€๏ธ

In the context of IPv6 operation, if 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 Active and Backup Routers the same prefix delegation in the certificates, so they advertise the same set of subnet prefixes. However, the Active and Backup Routers should have their own key pairs to avoid private key sharing ๐Ÿ”‘

Also in the context of IPv6 operation, it is RECOMMENDED that the link-level security guidelines in Section 2.3 of [RFC9099] be followed ๐Ÿซถ

10. IANA Considerations ๐Ÿ’…โœจ

okay so IANA is the org that keeps all the official registries, and they've updated every registry reference that used to point to [RFC5798] so they now point to RFC 9568, aka this doc ๐ŸŽ€ The individual IANA references are listed below, bestie.

The value 112 is assigned to VRRP in the "Assigned Internet Protocol Numbers" registry ๐Ÿ”ข๐Ÿฆ‹

In the "Local Network Control Block (224.0.0.0 - 224.0.0.255 (224.0.0/24))" registry of the "IPv4 Multicast Address Space Registry" [RFC5771], IANA has assigned the IPv4 multicast address 224.0.0.18 for VRRP ๐Ÿ“ก๐Ÿ’œ

In the "Link-Local Scope Multicast Addresses" registry of the "IPv6 Multicast Address Space Registry" [RFC3307], IANA has assigned the IPv6 link-local scope multicast address ff02:0:0:0:0:0:0:12 for VRRP for IPv6 ๐ŸŒˆ

In the "IANA MAC ADDRESS BLOCK" registry [RFC9542], IANA has assigned blocks of Ethernet unicast addresses as follows (in hexadecimal) ๐Ÿ“ this is the table, ngl it's giving organized:

  +======================+===========================+===========+
  | Addresses            | Usage                     | Reference |
  +======================+===========================+===========+
  | 00-01-00 to 00-01-FF | VRRP (Virtual Router      | RFC 9568  |
  |                      | Redundancy Protocol)      |           |
  +----------------------+---------------------------+-----------+
  | 00-02-00 to 00-02-FF | VRRP IPv6 (Virtual Router | RFC 9568  |
  |                      | Redundancy Protocol IPv6) |           |
  +----------------------+---------------------------+-----------+

                               Table 1

11. References ๐Ÿ“š

11.1. Normative References ๐Ÿ”’

These are the must-read ones, the foundation of the whole thing:

11.2. Informative References ๐Ÿง 

These are the bonus reads for when you want the deep lore ๐ŸŒธ

Acknowledgments ๐Ÿซถ

the IPv6 text in this spec 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. Huge respect to them ๐Ÿ‘‘

The authors of [VRRP-IPv6] also wanted 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 spec is based on [RFC3768]. The authors of that spec wanted to thank Glen Zorn, Michael Lane, Clark Bremer, Hal Peterson, Tony Li, Barbara Denny, Joel Halpern, Steve M. Bellovin, Thomas Narten, Rob Montgomery, Rob Coltun, Radia Perlman, Russ Housley, Harald Alvestrand, Ned Freed, Ted Hardie, Bert Wijnen, Bill Fenner, and Alex Zinin for their comments and suggestions โœจ

Thanks to Steve Nadas for his work merging and editing [RFC3768] and [VRRP-IPv6] into the document that eventually became [RFC5798] ๐Ÿงš

Thanks to Stewart Bryant, Sasha Vainshtein, Pascal Thubert, Alexander Okonnikov, Ben Niven-Jenkins, Tim Chown, Maliลกa Vuฤiniฤ‡, Russ White, Donald Eastlake, Dave Thaler, Eric Kline, and Vijay Gurbani for comments on the current document (RFC 9568) ๐Ÿฆ‹ Thanks to Gyan Mishra, Paul Congdon, and Jon Rosen for discussions related to the removal of legacy technology appendices ๐ŸŒˆ Thanks to Dhruv Dhody and Donald Eastlake for comments and suggestions for improving the IANA section ๐ŸŽ€ Thanks to Sasha Vainshtein for recommending "Maximum Advertisement Interval" validation ๐Ÿ’… Thanks to Tim Chown and Fernando Gont for discussions and updates related to IPv6 SLAAC ๐Ÿ’œ

Special thanks to Quentin Armitage for a detailed review and extensive comments on the current document (RFC 9568) ๐Ÿ˜ญ๐Ÿ‘‘

Authors' Addresses ๐ŸŒธ

The two authors, in their own words (well, their addresses ๐Ÿ’Œ):

Acee Lindem
LabN Consulting, L.L.C.
301 Midenhall Way
Cary, NC 27513
United States of America
Email: acee.ietf@gmail.com


Aditya Dogra
Cisco Systems
Sarjapur Outer Ring Road
Bangalore 560103
Karnataka
India
Email: addogra@cisco.com

And that's a wrap on RFC 9568, bestie! ๐ŸŒˆ๐Ÿ’– You made it through the whole thing, you absolute legend ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from