RFC 3768

Virtual Router Redundancy Protocol (VRRP)

πŸ“… published April 2004, from ietf

Network Working Group πŸ’– Request for Comments: 3768 πŸŽ€ Obsoletes: RFC 2338 (this one replaces it, bestie πŸ¦‹) Updates: nothing listed 🌸 Category: Standards Track ✨ Date: April 2004 πŸ“… Authors: R. Hinden, Ed. (Nokia) πŸ’œ

Virtual Router Redundancy Protocol (VRRP) πŸ‘‘

Part 1 of 6 🧚 more parts are coming, so stay tuned!

Status of This Memo ✨

Okay so this one is an Internet standards track protocol for the Internet community 🌈 It's also asking everyone to chat about it and send ideas for making it better πŸ’¬ For the current standardization state and status of this protocol, check the "Internet Official Protocol Standards" (STD 1) πŸ“š And distribution of this memo is unlimited, so share away! 🫢

Copyright (C) The Internet Society (2004). All Rights Reserved. πŸ’…

Abstract πŸ¦‹

Hiii, so this memo defines the Virtual Router Redundancy Protocol (VRRP) πŸŽ€ VRRP is an election protocol, and it's giving main character energy πŸ‘‘ It picks one of the VRRP routers on a LAN to take responsibility for a virtual router. The router in charge of the IP address(es) tied to that virtual router is called the Master 🧚, and it's the one that forwards packets sent to those addresses πŸ“¦ If the Master goes down, the election process gives you dynamic fail over in forwarding, so nobody gets left on read 😭 Any of the virtual router IP addresses on the LAN can be used as the default first hop router by end-hosts 🌸 The big win is a higher availability default path without having to set up dynamic routing or router discovery protocols on every end-host πŸ’–


Table of Contents πŸ“

   1.  Introduction. . . . . . . . . . . . . . . . . . . . . . . . .   2
       1.1.  Contributors. . . . . . . . . . . . . . . . . . . . . .   3
       1.2.  Scope . . . . . . . . . . . . . . . . . . . . . . . . .   4
       1.3.  Definitions . . . . . . . . . . . . . . . . . . . . . .   4
   2.  Required Features . . . . . . . . . . . . . . . . . . . . . .   5
       2.1.  IP Address Backup . . . . . . . . . . . . . . . . . . .   5
       2.2.  Preferred Path Indication . . . . . . . . . . . . . . .   5
       2.3.  Minimization of Unnecessary Service Disruptions . . . .   5
       2.4.  Efficient Operation over Extended LANs. . . . . . . . .   6
   3.  VRRP Overview . . . . . . . . . . . . . . . . . . . . . . . .   6
   4.  Sample Configurations . . . . . . . . . . . . . . . . . . . .   7

       4.1.  Sample Configuration 1. . . . . . . . . . . . . . . . .   7
       4.2.  Sample Configuration 2. . . . . . . . . . . . . . . . .   9
   5.  Protocol. . . . . . . . . . . . . . . . . . . . . . . . . . .  10
       5.1.  VRRP Packet Format. . . . . . . . . . . . . . . . . . .  10
       5.2.  IP Field Descriptions . . . . . . . . . . . . . . . . .  10
       5.3.  VRRP Field Descriptions . . . . . . . . . . . . . . . .  11
   6.  Protocol State Machine. . . . . . . . . . . . . . . . . . . .  13
       6.1.  Parameters per Virtual Router . . . . . . . . . . . . .  13
       6.2.  Timers. . . . . . . . . . . . . . . . . . . . . . . . .  14
       6.3.  State Transition Diagram. . . . . . . . . . . . . . . .  15
       6.4.  State Descriptions. . . . . . . . . . . . . . . . . . .  15
   7.  Sending and Receiving VRRP Packets. . . . . . . . . . . . . .  18
       7.1.  Receiving VRRP Packets. . . . . . . . . . . . . . . . .  18
       7.2.  Transmitting Packets. . . . . . . . . . . . . . . . . .  19
       7.3.  Virtual MAC Address . . . . . . . . . . . . . . . . . .  19
   8.  Operational Issues. . . . . . . . . . . . . . . . . . . . . .  20
       8.1.  ICMP Redirects. . . . . . . . . . . . . . . . . . . . .  20
       8.2.  Host ARP Requests . . . . . . . . . . . . . . . . . . .  20
       8.3.  Proxy ARP . . . . . . . . . . . . . . . . . . . . . . .  20
       8.4.  Potential Forwarding Loop . . . . . . . . . . . . . . .  21
   9.  Operation over FDDI, Token Ring, and ATM LANE . . . . . . . .  21
       9.1.  Operation over FDDI . . . . . . . . . . . . . . . . . .  21
       9.2.  Operation over Token Ring . . . . . . . . . . . . . . .  21
       9.3.  Operation over ATM LANE . . . . . . . . . . . . . . . .  23
   10. Security Considerations . . . . . . . . . . . . . . . . . . .  23
   11. Acknowledgements. . . . . . . . . . . . . . . . . . . . . . .  24
   12. References. . . . . . . . . . . . . . . . . . . . . . . . . .  24
       12.1. Normative References. . . . . . . . . . . . . . . . . .  24
       12.2. Informative References. . . . . . . . . . . . . . . . .  25
   13. Changes from RFC2338. . . . . . . . . . . . . . . . . . . . .  25
   14. Editor's Address. . . . . . . . . . . . . . . . . . . . . . .  26
   15. Full Copyright Statement. . . . . . . . . . . . . . . . . . .  27

1. Introduction ✨

Okay bestie, so an end-host has a few ways to figure out its first hop router toward a given IP destination πŸ—ΊοΈ It can run (or snoop on) a dynamic routing protocol like Routing Information Protocol [RIP] or OSPF version 2 [OSPF] 🧭 It can run an ICMP router discovery client [DISC] πŸ” Or it can just use a statically configured default route πŸ“Œ

Running a dynamic routing protocol on every end-host might be infeasible πŸ™ˆ The reasons include administrative overhead, processing overhead, security issues, or simply not having a protocol implementation for some platforms πŸ’€ Neighbor or router discovery protocols may need active participation from all hosts on a network 😩 So they tend to use large timer values to keep protocol overhead down when there are tons of hosts 🐒 The tradeoff is that spotting a lost (i.e., dead) neighbor can take forever, and that can cause unacceptably long "black hole" periods πŸ•³οΈ Not it!

A statically configured default route is honestly so popular πŸ’… It keeps configuration and processing overhead on the end-host to a minimum, and basically every IP implementation supports it 🌸 This mode is probably going to stick around as dynamic host configuration protocols [DHCP] get deployed, since those usually hand out an end-host IP address and default gateway 🎁 BUT here's the catch: it creates a single point of failure 😱 If the default router goes down, it's a catastrophic event that isolates every end-host that can't detect another path πŸ’”

That's where the Virtual Router Redundancy Protocol (VRRP) comes in πŸ¦Έβ€β™€οΈ It's designed to eliminate the single point of failure that comes with the static default routed setup πŸ’– 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 controlling the IP address(es) tied to a virtual router is called the Master, and it forwards packets sent to those addresses πŸ“¦ If the Master becomes unavailable, the election gives you dynamic fail-over in forwarding responsibility ✨ Then any of the virtual router's IP addresses on a LAN can be used as the default first hop router by end-hosts 🫢 The advantage is a higher availability default path, with no need to configure dynamic routing or router discovery protocols on every end-host πŸ‘‘

VRRP does a job similar to the proprietary protocols "Hot Standby Router Protocol (HSRP)" [HSRP] and "IP Standby Protocol" [IPSTB] 🀝

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] πŸ“– (Yes, I know, the fine print matters, periodt 🧐)

1.1. Contributors 🌷

These people wrote the RFC 2338 that this document is based on and replaces, and they contributed to the text here πŸ₯° They are P. Higginson, R. Hinden, P. Hunt, S. Knight, A. Lindem, D. Mitzel, M. Shand, D. Weaver, and D. Whipple πŸ’œ They aren't listed as authors of this document because of current RFC-Editor policies πŸ“

1.2. Scope πŸ”­

The rest of this document covers the features, design goals, and theory of operation of VRRP 🧠 It also presents the message formats, protocol processing rules, and the state machine that guarantee convergence to a single Virtual Router Master 🎯 Last but not least, it addresses operational issues related to MAC address mapping, handling of ARP requests, generation of ICMP redirect messages, and security issues πŸ”

This protocol is intended for use with IPv4 routers only 🌐 If it's decided that similar functionality is wanted in an IPv6 environment, a separate specification will be produced 🧚

1.3. Definitions πŸ“š

   VRRP Router            A router running the Virtual Router Redundancy
                          Protocol.  It may participate in 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
                          a set of associated IP address(es) across a
                          common LAN.  A VRRP Router may backup one or
                          more virtual routers.

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

   Primary IP Address     An IP address selected from the set of real
                          interface addresses.  One possible selection
                          algorithm is to always select the first
                          address.  VRRP advertisements are always sent
                          using the primary IP address as the source of
                          the IP packet.

   Virtual Router Master  The VRRP router that is assuming the
                          responsibility of forwarding packets sent to
                          the IP address(es) associated with the virtual
                          router, and answering ARP requests for these
                          IP addresses.  Note that if the IP 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 lays out the features that were considered mandatory and that guided the design of VRRP πŸ’…

2.1. IP Address Backup πŸ¦‹

Backing up IP addresses is the main job of the Virtual Router Redundancy Protocol πŸ’– On top of electing a Virtual Router Master and doing the extra stuff 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 IP traffic 🌈
  • Provide for election of multiple virtual routers on a network for load balancing βš–οΈ
  • Support multiple logical IP subnets on a single LAN segment 🧚

2.2. Preferred Path Indication πŸ¦‹

okay so the lazy version of electing a Master is to treat every router as equally good, then just crown whichever one shows up first πŸ™„ but ngl that's not how the real world works. some routers are literally better, bestie. the access link might be cheaper or faster, a router might have stronger performance or be more reliable, or someone's policy just says "this one first" πŸ’… so the protocol needs a way to express that relative path preference in an intuitive way, and it should guarantee that the Master converges to the most preferred router that is currently available πŸ‘‘ no settling for second best when the queen is online ✨

2.3. Minimization of Unnecessary Service Disruptions πŸ’œ

okay this one is giving stability 😭 once a Master has been elected, every unnecessary switch between Master and Backup routers can cause a service disruption, and nobody wants that. so after the election, the protocol should make sure that no Backup router with equal or lower preference triggers a state transition, as long as the Master is still working properly 🫢 the Master just keeps doing its thing and nobody starts drama.

some environments might actually want to avoid the state transition that happens when a router shows up that's preferred over the current Master πŸ€” so it can be useful to support an override of that immediate convergence to the preferred path. it's like saying "not right now, I'm busy" to the more fancy router πŸ’… (iykyk, this is the preemption vibe)

2.4. Efficient Operation over Extended LANs 🌸

sending IP packets on a multiaccess LAN means you have to map an IP address to a MAC address first 🧚 and using the virtual router MAC address in an extended LAN with learning bridges can seriously affect how much bandwidth gets eaten by packets headed to the virtual router 😩 here's the tea: if the virtual router MAC address is never used as the source address in a link level frame, the station location never gets learned. and when that happens, every packet sent to the virtual router gets flooded everywhere πŸ’€ nobody's invited to that party.

so to make this run efficiently, the protocol should do three things: 1) use the virtual router MAC as the source in a packet sent by the Master, so the bridges learn where the station is πŸŽ€ 2) trigger a message right after a router transitions to Master, so the station learning gets updated immediately ⭐ and 3) keep triggering periodic messages from the Master so the station learning cache stays fresh 🌈 it's all about keeping the bridges in the loop, periodt πŸ’…

3. VRRP Overview ✨

okay so VRRP is the election protocol that gives us the virtual router function we talked about earlier πŸ¦‹ all of the protocol messaging is done with IP multicast datagrams, which means it can run over a bunch of different multiaccess LAN technologies as long as they support IP multicast 🌈 each VRRP virtual router gets one well-known MAC address assigned to it 🫢 for now this document only details how that maps onto networks that use the IEEE 802 48-bit MAC address, so that's the main focus πŸ’œ and the virtual router MAC address is used as the source in every periodic VRRP message the Master router sends, so the bridges in an extended LAN can learn where it is 🧚

a virtual router is defined by its virtual router identifier (VRID) and a set of IP addresses πŸ‘‘ a VRRP router can associate a virtual router with its real addresses on an interface, and it can also be configured with extra virtual router mappings and a priority for any virtual routers it's willing to back up πŸ’… the mapping between VRID and addresses has to be coordinated across all VRRP routers on a LAN, that part is non-negotiable 😀 but there's no rule stopping you from reusing a VRID with a different address mapping on a different LAN 🌸 and the scope of each virtual router is limited to a single LAN, so it stays in its lane πŸŽ€

to keep network traffic low, only the Master for each virtual router sends periodic VRRP Advertisement messages ✨ a Backup router won't try to preempt the Master unless it has higher priority, which means no service disruption unless a more preferred path actually shows up πŸ™Œ you can also administratively prohibit all preemption attempts if you want to lock things down πŸ”’ the only exception is that a VRRP router will always become Master of any virtual router tied to addresses it owns, that's its birthright πŸ‘‘ and if the Master goes offline, the highest priority Backup transitions to Master after a short delay 😌 this gives a controlled handoff of the virtual router responsibility with minimal service interruption, so nobody even notices πŸ¦‹

the VRRP design gives a fast transition from Backup to Master to keep interruptions short πŸš€ it also has optimizations that reduce protocol complexity while still guaranteeing a controlled Master transition in typical operational scenarios πŸ’… the end result is an election protocol with minimal runtime state requirements, minimal active protocol states, and a single message type and sender, which is so clean 😭 the typical scenarios are defined as two redundant routers and/or distinct path preferences among each router 🫢 when those assumptions get broken (like having more than two redundant paths all with equal preference), duplicate packets may be forwarded for a brief period during Master election πŸ’€ but the typical scenario assumptions are likely to cover the vast majority of deployments, losing the Master is infrequent, and the expected convergence time for Master election is quite small ( << 1 second ) ⭐ so the VRRP optimizations are a huge simplification of the protocol design while only risking an insignificant chance of brief network degradation 🌈 worth it, fr fr.

4. Sample Configurations πŸŽ€

4.1. Sample Configuration 1 🧚

okay so this figure shows a simple network with two VRRP routers implementing one virtual router πŸ’– just so you know, this example is here to help you understand the protocol, but it isn't expected to show up in actual practice πŸ™ˆ

            +-----------+      +-----------+
            |   Rtr1    |      |   Rtr2    |
            |(MR VRID=1)|      |(BR VRID=1)|
            |           |      |           |
    VRID=1  +-----------+      +-----------+
    IP A ---------->*            *<--------- IP B
                    |            |
                    |            |
  ------------------+------------+-----+--------+--------+--------+--
                                       ^        ^        ^        ^
                                       |        |        |        |
                                     (IP A)   (IP A)   (IP A)   (IP A)
                                       |        |        |        |
                                    +--+--+  +--+--+  +--+--+  +--+--+
                                    |  H1 |  |  H2 |  |  H3 |  |  H4 |
                                    +-----+  +-----+  +--+--+  +--+--+
     Legend:
              ---+---+---+--  =  Ethernet, Token Ring, or FDDI
                           H  =  Host computer
                          MR  =  Master Router
                          BR  =  Backup Router
                           *  =  IP Address
                        (IP)  =  default router for hosts

if you erase every mention of VRRP (VRID=1) from that figure, you're left with a totally typical IP deployment 🌸 each router has a permanently assigned IP address on the LAN interface (Rtr1 gets IP A and Rtr2 gets IP B), and each host installs a static default route through one of the routers (in this example they all use Rtr1's IP A) πŸ“

now switch over to the VRRP environment πŸ¦‹ each router has the exact same permanently assigned IP address. Rtr1 is the IP address owner of IP A, and Rtr2 is the IP address owner of IP B πŸ’œ a virtual router is then defined by linking a unique identifier (the virtual router ID) to the address a router owns πŸ‘‘ and finally, VRRP manages the virtual router fail over to a backup router πŸ”₯

the example above shows a virtual router set up to cover the IP address owned by Rtr1 (VRID=1,IP_Address=A) πŸ’… when VRRP is enabled on Rtr1 for VRID=1, it asserts itself as Master with priority=255, since it owns the IP address for the virtual router ⭐ when VRRP is enabled on Rtr2 for VRID=1, it transitions to Backup with priority=100, since it doesn't own that address 🫢 and if Rtr1 fails, VRRP transitions Rtr2 to Master, which temporarily takes over forwarding responsibility for IP A so the hosts get uninterrupted service πŸ™Œ main character energy from Rtr2 fr

note that IP B isn't backed up in this example. Rtr2 only uses it as its interface address. to back up IP B, you need a second virtual router configured, and that's what the next section is about πŸŽ€

4.2. Sample Configuration 2 🌈

this figure shows a configuration with two virtual routers, and the hosts are splitting their traffic between them πŸ’– this one is expected to be super common in actual practice, so pay attention bestie πŸ‘€

            +-----------+      +-----------+
            |   Rtr1    |      |   Rtr2    |
            |(MR VRID=1)|      |(BR VRID=1)|
            |(BR VRID=2)|      |(MR VRID=2)|
    VRID=1  +-----------+      +-----------+  VRID=2
    IP A ---------->*            *<---------- IP B
                    |            |
                    |            |
  ------------------+------------+-----+--------+--------+--------+--
                                       ^        ^        ^        ^
                                       |        |        |        |
                                     (IP A)   (IP A)   (IP B)   (IP B)
                                       |        |        |        |
                                    +--+--+  +--+--+  +--+--+  +--+--+
                                    |  H1 |  |  H2 |  |  H3 |  |  H4 |
                                    +-----+  +-----+  +--+--+  +--+--+
     Legend:
              ---+---+---+--  =  Ethernet, Token Ring, or FDDI
                           H  =  Host computer
                          MR  =  Master Router
                          BR  =  Backup Router
                           *  =  IP Address
                        (IP)  =  default router for hosts

in the example above, half the hosts have a static route set up through Rtr1's IP A, and the other half are using Rtr2's IP 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 IP address owned by Rtr2 (VRID=2, IP_Address=B) πŸ¦‹ in this case Rtr2 asserts itself as Master for VRID=2, while Rtr1 acts as a backup πŸ’… this setup gives you load splitting when both routers are available, plus full redundancy for robustness. two birds, one stone, iconic πŸ”₯

5. Protocol πŸ’œ

okay this is the part where we get into the actual protocol 🫢 the whole point of the VRRP packet is to tell every VRRP router the priority and the state of the Master router tied to the Virtual Router ID πŸ‘‘

VRRP packets are sent encapsulated in IP packets 🌸 they go out to the IPv4 multicast address assigned to VRRP ✨

5.1. VRRP Packet Format πŸ“¦βœ¨

okay so this section is the blueprint for the VRRP packet itself, plus the IP header fields that matter. the diagram is giving everything πŸ’…

    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
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Version| Type  | Virtual Rtr ID|   Priority    | Count IP Addrs|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |   Auth Type   |   Adver Int   |          Checksum             |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                         IP Address (1)                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                            .                                  |
   |                            .                                  |
   |                            .                                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                         IP Address (n)                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                     Authentication Data (1)                   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                     Authentication Data (2)                   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

5.2. IP Field Descriptions 🌐

5.2.1. Source Address

the source is the primary IP address of the interface the packet gets sent from πŸš€

5.2.2. Destination Address

the destination is the IP multicast address IANA assigned to VRRP:

224.0.0.18

this one is link-local scope 🌸 Routers MUST NOT forward a datagram with this destination address regardless of its TTL. no forwarding this one, no matter what the TTL says πŸ™…β€β™€οΈ

5.2.3. TTL

the TTL MUST be set to 255 πŸ’œ and if a VRRP router gets a packet where the TTL is not equal to 255, it MUST discard the packet. strict but iconic πŸ’…

5.2.4. Protocol

the IP protocol number IANA assigned for VRRP is 112 (decimal) πŸ”’

5.3. VRRP Field Descriptions πŸŽ€

5.3.1. Version

the version field tells you which VRRP protocol version this packet is. this document defines version 2 ✨

5.3.2. Type

the type field tells you what kind of VRRP packet this is. in this version the only packet type is:

1      ADVERTISEMENT

A packet with unknown type MUST be discarded. no mystery packets allowed πŸ™ˆ

5.3.3. Virtual Rtr ID (VRID)

the Virtual Router Identifier (VRID) says which virtual router the packet is giving a status update for. it's a configurable item in the range 1-255 (decimal), and there is no default. you gotta pick one πŸ¦‹

5.3.4. Priority

the priority field is the sending VRRP router's priority for the virtual router. higher numbers mean higher priority πŸ‘‘ It's an 8 bit unsigned integer field.

the router that owns the IP address(es) tied to the virtual router MUST use priority 255 (decimal). main character energy, no debate πŸ’–

VRRP routers that are backing up a virtual router MUST use priority values between 1-254 (decimal). if you don't set one, the default for a backup router is 100 (decimal) 🌈

priority zero (0) is special. it means the current Master has stopped participating in VRRP. this tells the Backup routers to jump to Master right away instead of waiting around for the current Master to time out ⏩ πŸ’€

5.3.5. Count IP Addrs

this is just the number of IP addresses in this VRRP advertisement πŸ”’

5.3.6. Authentication Type

the authentication type field says which authentication method is in use. it's unique per virtual router, and it's an 8 bit unsigned integer. A packet with unknown authentication type or that does not match the locally configured authentication method MUST be discarded. if it doesn't match your config, bye bye πŸ‘‹

Note: Earlier version of the VRRP specification had several defined authentication types [RFC2338]. These were removed in this specification because operational experience showed that they did not provide any real security and would only cause multiple masters to be created. πŸ₯² the old auth types were basically security theater, and they just made multiple masters show up. not worth keeping

the authentication methods currently defined are:

0 - No Authentication
1 - Reserved
2 - Reserved

5.3.6.1. Authentication Type 0 - No Authentication

with this type, VRRP exchanges are not authenticated πŸ«₯ the Authentication Data field should be set to zero on transmission and ignored on reception.

5.3.6.2. Authentication Type 1 - Reserved

this one is reserved so it stays backwards compatible with RFC 2338 πŸ”’

5.3.6.3. Authentication Type 2 - Reserved

same deal, reserved for backwards compatibility with RFC 2338 πŸ”’

5.3.7. Advertisement Interval (Adver Int)

this is how many seconds pass between ADVERTISEMENTS. the default is 1 second ⏱️ It's used for troubleshooting misconfigured routers, so it's like a little clue when something's off πŸ•΅οΈβ€β™€οΈ

5.3.8. Checksum

the checksum is how VRRP catches data corruption in the message 🧩

the checksum is the 16-bit one's complement of the one's complement sum of the entire VRRP message, starting at the version field. when you compute it, the checksum field gets set to zero. See RFC 1071 for more detail [CKSM]. it's giving math, but it's the good kind πŸ€“

5.3.9. IP Address(es)

these are one or more IP addresses associated with the virtual router. how many there are gets spelled out in the "Count IP Addrs" field. these fields are used for troubleshooting misconfigured routers πŸŽ€

5.3.10. Authentication Data

the authentication string is only there now to stay backwards compatible with RFC 2338 🌸 It SHOULD be set to zero on transmission and ignored on reception. zero it out and move on 🫢


6. Protocol State Machine 🧚

6.1. Parameters per Virtual Router πŸ’œ

here's the cast of parameters for each virtual router:

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 IP addresses
                        associated with the virtual router.  The
                        value of 0 (zero) is reserved for 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.  The
                        default value is 100 (decimal).

IP_Addresses            One or more IP addresses associated with this
                        virtual router.  Configured item.  No
                        default.

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

Skew_Time               Time to skew Master_Down_Interval in seconds.
                        Calculated as:

                          ( (256 - Priority) / 256 )

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

                          (3 * Advertisement_Interval) + Skew_time

Preempt_Mode            Controls whether a higher priority Backup
                        router preempts a lower priority Master.
                        Values are True to allow preemption and False
                        to prohibit preemption.  Default is True.

                        Note: Exception is that the router that owns
                        the IP address(es) associated with the
                        virtual router always preempts independent of
                        the setting of this flag.

Authentication_Type     Type of authentication being used.  Values
                        are defined in section 5.3.6.

Authentication_Data     Authentication data specific to the
                        Authentication_Type being used.

6.2. Timers ⏰

there are two timers you need to know about:

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 πŸ—ΊοΈ

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

6.4. State Descriptions πŸ¦‹

in the state descriptions below, state names show up as {state-name}, and packets are written in ALL CAPS. it's giving consistency ✨

A VRRP router runs an instance of the state machine for each virtual router election it's taking part in πŸ’…

6.4.1. Initialize 🌱

the whole point of this state is to wait for a Startup event. when one arrives, this is what happens:

-   If the Priority = 255 (i.e., the router owns the IP address(es)
    associated with the virtual router)

    o  Send an ADVERTISEMENT
    o  Broadcast a gratuitous ARP request containing the virtual
       router MAC address for each IP address associated with the
       virtual router.
    o  Set the Adver_Timer to Advertisement_Interval
    o  Transition to the {Master} state

    else

    o  Set the Master_Down_Timer to Master_Down_Interval
    o  Transition to the {Backup} state

    endif

6.4.2. Backup 🫧

the {Backup} state is all about watching over the Master Router and checking that it's still alive and well πŸ‘€

while in this state, a VRRP router MUST do the following:

  • MUST NOT respond to ARP requests for the IP address(es) associated with the virtual router. no sneaky ARP replies πŸ™…β€β™€οΈ
  • MUST discard packets with a destination link layer MAC address equal to the virtual router MAC address. πŸ—‘οΈ
  • MUST NOT accept packets addressed to the IP address(es) associated with the virtual router. hands off 🚫

and then the events:

-   If a Shutdown event is received, then:

    o  Cancel the Master_Down_Timer
    o  Transition to the {Initialize} state

       endif

-   If the Master_Down_Timer fires, then:

    o  Send an ADVERTISEMENT
    o  Broadcast a gratuitous ARP request containing the virtual
       router MAC address for each IP address associated with the
       virtual router
    o  Set the Adver_Timer to Advertisement_Interval
    o  Transition to the {Master} state

       endif

-   If an ADVERTISEMENT is received, then:

    If the Priority in the ADVERTISEMENT is Zero, then:

    o  Set the Master_Down_Timer to Skew_Time

       else:

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

           o Reset the Master_Down_Timer to Master_Down_Interval

          else:

           o Discard the ADVERTISEMENT

          endif
       endif
    endif

6.4.3. Master πŸ‘‘

okay so while a router is in the {Master} state, it's the one doing the forwarding for the IP address(es) tied to the virtual router πŸ’…

while it's in this state, a VRRP router MUST do the following:

  • MUST respond to ARP requests for the IP address(es) associated with the virtual router. 🫢
  • MUST forward packets with a destination link layer MAC address equal to the virtual router MAC address. ✨
  • MUST NOT accept packets addressed to the IP address(es) associated with the virtual router if it is not the IP address owner. πŸ™…β€β™€οΈ
  • MUST accept packets addressed to the IP address(es) associated with the virtual router if it is the IP address owner. πŸ’–

here's the event handling, copied exactly as written πŸ‘‡

-  If a Shutdown event is received, then:

   o  Cancel the Adver_Timer
   o  Send an ADVERTISEMENT with Priority = 0
   o  Transition to the {Initialize} state

      endif

   -  If the Adver_Timer fires, then:

   o  Send an ADVERTISEMENT o  Reset the Adver_Timer to
      Advertisement_Interval

      endif

   -  If an ADVERTISEMENT is received, then:

      If the Priority in the ADVERTISEMENT is Zero, then:

   o  Send an ADVERTISEMENT
   o  Reset the Adver_Timer to Advertisement_Interval

      else:

         If the Priority in the ADVERTISEMENT is greater than the
         local Priority,
         or
         If the Priority in the ADVERTISEMENT is equal to the local
         Priority and the primary IP Address of the sender is greater
         than the local primary IP Address, then:

          o Cancel Adver_Timer
          o Set Master_Down_Timer to Master_Down_Interval
          o Transition to the {Backup} state

         else:

          o Discard ADVERTISEMENT

         endif
      endif
   endif

7. Sending and Receiving VRRP Packets πŸš€

7.1. Receiving VRRP Packets

okay so whenever a VRRP packet shows up, these are the things that get checked πŸ“¬

  • MUST verify that the IP TTL is 255.
  • MUST verify the VRRP version is 2.
  • MUST verify that the received packet contains the complete VRRP packet (including fixed fields, IP Address(es), and Authentication Data).
  • MUST verify the VRRP checksum.
  • MUST verify that the VRID is configured on the receiving interface and the local router is not the IP Address owner (Priority equals 255 (decimal)).
  • MUST verify that the Auth Type matches the locally configured authentication method for the virtual router and perform that authentication method.

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. 😬

  • MAY verify that "Count IP Addrs" and the list of IP Address matches the IP_Addresses 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. if the packet was not generated by the address owner (Priority does not equal 255 (decimal)), the receiver MUST drop the packet, otherwise it keeps processing. 🫠

  • MUST verify that the Adver Interval in the packet is the same as the locally configured for this virtual router

if the above check fails, the receiver MUST discard the packet, SHOULD log the event, and MAY indicate via network management that a misconfiguration was detected. πŸ™ˆ

7.2. Transmitting VRRP Packets

the following operations MUST be performed when transmitting a VRRP packet πŸ’…

  • Fill in the VRRP packet fields with the appropriate virtual router configuration state
  • Compute the VRRP checksum
  • Set the source MAC address to Virtual Router MAC Address
  • Set the source IP address to interface primary IP address
  • Set the IP protocol to VRRP
  • Send the VRRP packet to the VRRP IP 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

the virtual router MAC address for a virtual router is an IEEE 802 MAC Address in this format:

00-00-5E-00-01-{VRID} (in hex in internet standard bit-order)

the first three octets come from the IANA's OUI. the next two octets (00-01) mark the address block assigned to the VRRP protocol. {VRID} is the VRRP Virtual Router Identifier. this mapping gives you up to 255 VRRP routers on a network 🌈


8. Operational Issues 🧚

8.1. ICMP Redirects

ICMP Redirects may be used normally when VRRP is running between a group of routers. this lets VRRP work in environments where the topology is not symmetric 🌸

the IP source address of an ICMP redirect should be the address 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 figure out which virtual router the packet was sent to when picking the redirect source address. one way to deduce the virtual router used is to look at 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.2. Host ARP Requests

when a host sends an ARP request for one of the virtual router IP addresses, the Master virtual router MUST respond to the ARP request with the virtual MAC address for the virtual router. The Master virtual router MUST NOT respond with its physical MAC address. this way the client can always use the same MAC address no matter which router is currently Master πŸŽ€

when a VRRP router restarts or boots, it SHOULD not send any ARP messages with its physical MAC address for the IP address it owns. it should only send ARP messages that include Virtual MAC addresses. this may entail: πŸ“

  • When configuring an interface, VRRP routers should broadcast a gratuitous ARP request containing the virtual router MAC address for each IP address on that interface.
  • At system boot, when initializing interfaces for VRRP operation; delay gratuitous ARP requests and ARP responses until both the IP address and the virtual router MAC address are configured.

8.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 cause hosts to learn the real MAC address of the VRRP router 😭

8.4. Potential Forwarding Loop

a VRRP router SHOULD not forward packets addressed to the IP Address(es) it becomes Master for if it is not the owner. forwarding these packets would result in unnecessary traffic. also, on LANs that receive the packets they transmit (e.g., token ring), this can turn into a forwarding loop that only ends when the IP TTL expires πŸ’€

one such mechanism for VRRP routers is to add/delete a reject host route for each adopted IP address when transitioning to/from MASTER state. πŸ”₯


9. Operation over FDDI, Token Ring, and ATM LANE πŸ¦‹

9.1. Operation over FDDI

FDDI interfaces remove frames from the FDDI ring that have a source MAC address matching the device's hardware address. under some conditions, like router isolations, ring failures, protocol transitions, etc., VRRP may cause there to be more than one Master router. if a Master router installs the virtual router MAC address as the hardware address on an FDDI device, then other Masters' ADVERTISEMENTS will be removed from the ring during the Master convergence, and convergence will fail 😱

to avoid this, 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 will stop a Master router from removing any ADVERTISEMENTS it did not originate. 🫢

9.2. Operation over Token Ring ✨

okay bestie, token ring is lowkey a nightmare for VRRP πŸ’€ there are two big issues that make it super tricky:

  • πŸŒ€ when you switch to a new master that sits on a different bridge segment than the old one (using source route bridges), you need some way to update the cached source route info πŸ™ˆ
  • πŸŒ€ there's no general multicast mechanism that works across old and new token ring adapters. newer adapters support group addresses, but token ring functional addresses are the only multicast option that's generally available everywhere πŸ’… and since there aren't many of those, they might collide with other stuff already using them 😭

because of all that drama, the preferred way to run VRRP over token ring is to use a token ring functional address for the VRID virtual MAC address πŸŽ€ a functional address has the two high order bits in its first MAC address octet set to B'1' πŸ’– they go from 03-00-00-00-00-80 to 03-00-02-00-00-00 (canonical format) πŸ¦‹ unlike multicast addresses though, there's 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 apps 🌸 but there are only 12 of those, so other non-IP protocols might be using the same one too πŸ‘€ and since Novell IPX [IPX] uses 03-00-00-10-00-00, VRRP over token ring is going to avoid that one πŸ™…β€β™€οΈ in general, token ring VRRP users are responsible for sorting out any other user-defined functional address conflicts πŸ’…

VRIDs get mapped directly to token ring functional addresses πŸ¦‹ to lower the odds of conflicts, allocation starts with the largest functional address πŸ‘‘ most non-IP protocols use the first (or first couple) user-defined functional addresses, so VRRP users are expected to pick 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 equal (0x4000 >> (VRID - 1)) in non-canonical format ✨

since a functional address can't be used as a MAC level source address, the real MAC address gets used as the MAC source address in VRRP advertisements 🌈 this isn't a problem for bridges, because packets addressed to functional addresses get sent on the spanning-tree explorer path [802.1D] 🫢

The functional address mode of operation MUST be implemented by routers supporting VRRP on token ring. πŸ’œ

additionally, routers MAY support unicast mode πŸ¦‹ this takes advantage of newer token ring adapters that support non-promiscuous reception for multiple unicast MAC addresses, and it avoids both the multicast traffic and the usage conflicts that come with functional addresses 🌸 unicast mode uses the same VRID-to-virtual-MAC mapping as Ethernet, but there's one important difference πŸ™ˆ ARP request/reply packets contain the virtual MAC address as the source MAC address. why? some token ring driver implementations keep a cache of MAC address/source routing info that's separate from the ARP cache, so they need 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 you should keep in mind πŸ’€ if VRID routers sit on different source-route bridge segments, and hosts keep their source-route info in the ARP cache and don't listen to gratuitous ARPs, those hosts won't update their ARP source-route info correctly when a switch-over happens 😭 the only possible fix is to put all routers with the same VRID on the same source-bridge segment, and use techniques to stop that segment from being a single point of failure πŸ”₯ those 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]. πŸŽ€

9.3. Operation over ATM LANE πŸ¦‹

operation of VRRP over ATM LANE on routers with ATM LANE interfaces and/or routers behind proxy LEC's is beyond the scope of this document 🌸

10. Security Considerations πŸ”₯

okay this section is serious, so buckle up πŸ’€ VRRP doesn't currently include any type of authentication 😱 earlier versions of the spec had several authentication types, from none all the way up to strong, but operational experience and further analysis showed they didn't give any real measure of security πŸ™…β€β™€οΈ

even if VRRP messages are cryptographically protected, it doesn't stop a hostile router from acting like a VRRP master and creating multiple masters πŸ‘€ authentication of VRRP messages could have stopped a hostile router from making all the properly working routers go into backup state 🫠 but having multiple masters can cause just as much disruption as having no routers at all, and authentication can't prevent that πŸ’€ also, even if a hostile router couldn't disrupt VRRP, it could still disrupt ARP and cause the same effect as all routers going into backup 😭

it's worth noting that these attacks aren't worse, and they're a subset of the attacks that any node attached to a LAN can do without VRRP at all πŸ™ˆ the kinds of attacks a malicious node on a LAN can pull off 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 meant for the router to the malicious node instead 😱 sending redirects to tell hosts to send their traffic somewhere else πŸŒ€ sending unsolicited ARP replies, answering ARP requests, etc., etc. πŸ’… all of this can be done whether or not you implement VRRP, so VRRP doesn't add to these vulnerabilities ✨

independent of any authentication type, VRRP includes a mechanism (setting TTL=255, checking on receipt) that protects against VRRP packets being injected from another remote network πŸ›‘οΈ this limits most vulnerabilities to local attacks 🌈

VRRP doesn't provide any confidentiality 🀫 confidentiality isn't necessary for VRRP to operate correctly, and there's no information in the VRRP messages that has to be kept secret from other nodes on the LAN 🫢

11. Acknowledgements 🫢

the authors would like to thank Glen Zorn, and 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 πŸ’– iconic squad πŸ‘‘

12. References πŸ“š

12.1. Normative References

  • [802.1D] International Standard ISO/IEC 10038: 1993, ANSI/IEEE Std 802.1D, 1993 edition.
  • [CKSM] Braden, R., Borman, D. and C. Partridge, "Computing the Internet checksum", RFC 1071, September 1988.
  • [HSRP] Li, T., Cole, B., Morton, P. and D. Li, "Cisco Hot Standby Router Protocol (HSRP)", RFC 2281, March 1998.
  • [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.
  • [RFC1469] Pusateri, T., "IP Multicast over Token Ring Local Area Networks", RFC 1469, June 1993.
  • [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
  • [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.
  • [TKARCH] IBM Token-Ring Network, Architecture Reference, Publication SC30-3374-02, Third Edition, (September, 1989).

12.2. Informative References

  • [DISC] Deering, S., Ed., "ICMP Router Discovery Messages", RFC 1256, September 1991.
  • [DHCP] Droms, R., "Dynamic Host Configuration Protocol", RFC 2131, March 1997.
  • [OSPF] Moy, J., "OSPF version 2", STD 54, RFC 2328, April 1998.
  • [RIP] Malkin, G., "RIP Version 2", STD 56, RFC 2453, November 1998.

13. Changes from RFC 2338 🌈

  • Moved authors of RFC 2338 to a new Contributers section to comply with RFC editor policy, and listed R. Hinden as Editor. πŸ’…
  • Removed authentication methods from VRRP. Changes included:
    • Removed the values for password and IPSEC based authentication. The fields and values are retained to keep backwards compatibility with RFC 2338. πŸ”
    • Removed section on extensible security. πŸ—‘οΈ
    • Updated security consideration section to remove discussion of different authentication methods, and added new text explaining the motivation for change and describing vulnerabilities. πŸ’€
  • Revised the section 4 examples text with a clearer description of mapping of IP address owner, priorities, etc. ✨
  • Clarified the section 7.1 text describing address list validation. πŸŽ€
  • Corrected text in Preempt_Mode definition. πŸ¦‹
  • Changed authentication to be per Virtual Router instead of per Interface. 🌸
  • Added new subsection (9.3) stating that VRRP over ATM LANE is beyond the scope of this document. 🧚
  • Clarified text describing received packet length check. πŸ“
  • Clarified text describing received authentication check. 🫢
  • Clarified text describing VRID verification check. πŸ‘‘
  • Added new subsection (8.4) describing need to not forward packets for adopted IP addresses. πŸ™…β€β™€οΈ
  • Added clarification to the security considerations section. πŸ”₯
  • Added reference for computing the internet checksum. πŸ“š
  • Updated references and author information. πŸ’–
  • Various small editorial changes. 🌈

14. Editor's Address πŸ’Œ

Robert Hinden Nokia 313 Fairchild Drive Mountain View, CA 94043 US

Phone: +1 650 625-2004 EMail: bob.hinden@nokia.com

Okay bestie, last stop! πŸŽ€ This is the legal part, but it's still giving main character energy.

Copyright (C) The Internet Society (2004). This document is covered by the rights, licenses and restrictions in BCP 78. Apart from what that says, the authors keep all of their rights πŸ’œ.

This document and everything in it is handed over on an "AS IS" basis 🫢. The contributor, the organization they represent or are sponsored by (if any), the Internet Society, and the IETF all disclaim all warranties, express or implied. That covers no promise that using the info won't infringe any rights, and no implied warranties of merchantability or fitness for a particular purpose πŸ’€.

Intellectual Property

The IETF takes no position on whether any Intellectual Property Rights or other rights that might be claimed to cover the tech in this document are valid or how far they reach. It also doesn't say whether licenses for those rights are available, and it hasn't made any independent effort to find such rights πŸ™ˆ. If you want the procedures for rights in RFC documents, check out BCP 78 and BCP 79.

Copies of IPR disclosures made to the IETF Secretariat, any assurances of licenses that will be available, and the results of any attempt to get a general license or permission for implementers or users of this spec can be found in the IETF online IPR repository at http://www.ietf.org/ipr πŸ”.

The IETF invites any interested party to flag any copyrights, patents, patent applications, or other proprietary rights that might cover tech needed to implement this standard. Send that info to the IETF at ietf-ipr@ietf.org πŸ’Œ.

Acknowledgement

Funding for the RFC Editor function is currently provided by the Internet Society. 🌸


And that's the whole VRRP spec, bestie! πŸŒˆπŸ‘‘ You made it!

πŸ“¦ where this page comes from