<?xml version="1.0" encoding="utf-8"?>

<?xml-model href="rfc7991bis.rnc"?>

<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="exp"
  consensus="false"
  docName="draft-nser-vrrp-sbfd-02"
  ipr="trust200902"
  submissionType="IETF"
  tocInclude="true"
  tocDepth="4"
  symRefs="true"
  sortRefs="true"
  xml:lang="en"
  version="3">

  <front>
    <title abbrev="VRRP and S-BFD">Fast failure detection in VRRP with S-BFD</title>

    <seriesInfo name="Internet-Draft" value="draft-nser-vrrp-sbfd-02"/>

    <author fullname="Nicola Serafini" initials="N" surname="Serafini">
      <organization>Individual</organization>
      <address>
        <email>n.serafini@tutanota.com</email>
      </address>
    </author>

    <author initials="A" surname="Dogra" fullname="Aditya Dogra">
      <organization>Cisco Systems, Inc.</organization>
      <address>
        <postal>
          <street>Sarjapur Outer Ring Road</street>
          <city>Bangalore</city>
          <code>560103</code>
          <country>India</country>
        </postal>
        <email>addogra@cisco.com</email>
        <uri>http://www.cisco.com/</uri>
      </address>
    </author>

    <date day="11" month="April" year="2026"/>

    <area>Routing</area>
    <workgroup>Internet Engineering Task Force</workgroup>

    <keyword>VRRP</keyword>
    <keyword>BFD</keyword>
    <keyword>S-BFD</keyword>

    <abstract>
      <t>
        The Virtual Router Redundancy Protocol (VRRP) protocol depends on IPv4
        or IPv6 connectivity between redundant peers and can use Seamless
        Bidirectional Forwarding Detection (S-BFD) to detect a Primary Router
        failure faster than the base VRRP advertisement timers.
      </t>
      <t>
        This document describes an extension that allows VRRP to use S-BFD as
        an additional failure-detection mechanism. It defines a new VRRP packet
        type, a dedicated timer, and a mechanism for a VRRP Primary Router to
        advertise an S-BFD reflector discriminator to Backup Routers. Local
        discriminator allocation is left to the implementation.
      </t>
    </abstract>
  </front>

  <middle>
    <section anchor="sect-1">   <!-- Introduction -->
      <name>Introduction</name>
      <t>
        Bidirectional Forwarding Detection (BFD), defined in <xref
        target="RFC5880"/>, is a protocol for rapid failure detection between a
        pair of systems. <xref target="RFC5881"/> specifies its use for
        single-hop IPv4 and IPv6 sessions. Seamless BFD (S-BFD), defined in
        <xref target="RFC7880"/>, reduces setup and negotiation overhead and
        enables simpler provisioning. <xref target="RFC7881"/> extends S-BFD
        to IPv4, IPv6, and MPLS networks.
      </t>
      <t>
        VRRP is a standardized first-hop redundancy protocol for IPv4 and IPv6
        networks. VRRP defined in <xref target="RFC9568"/> provides a standard election
        procedure for selecting a Primary Router and interoperable behavior
        across implementations. In the base protocol, failure detection depends
        on advertisement processing and associated timers.
      </t>
      <t>
        This document combines S-BFD with VRRP for deployments that need
        failure detection in the millisecond or sub-second range without
        relying only on aggressive VRRP advertisement timers.
      </t>
      <t>
        Similar to the S-BFD discriminator advertisements defined for IS-IS in
        <xref target="RFC7883"/> and OSPF in <xref target="RFC7884"/>, the
        extension defined in this document allows a VRRP Primary Router to
        advertise an S-BFD reflector discriminator that Backup Routers can use
        to create SBFDInitiator sessions. The selection of local S-BFD
        discriminators remains implementation specific.
      </t>
    </section>

    <!-- Applicability <section>  
      <name>Applicability</name>
      <t>
            BFD <xref target="RFC5880"/> is a specialized protocol to detect failures between a pair of systems in microseconds; <xref target="RFC5881"/> extends <xref target="RFC5880"/> to IPvX addresses in single-hop. BFD has a lot of implementations and they are the standard for the industry. As extension of BFD, <xref target="RFC7880"/> was developed to allow a simplified mechanism for using BFD with a large proportion of negotiation aspects eliminated, thus providing benefits such as quick provisioning, as well as improved control and flexibility for network nodes initiating path monitoring. <xref target="RFC7881"/> is the extension of <xref target="RFC7880"/> for IPvX and MPLS networks.
      </t>
    </section>
    -->

    <section anchor="sect-2">   <!-- Terminology -->
      <name>Terminology</name>
      <dl newline="true">
        <dt>VRRP</dt>
        <dd>Virtual Router Redundancy Protocol</dd>
        <dt>BFD</dt>
        <dd>Bidirectional Forwarding Detection</dd>
        <dt>S-BFD</dt>
        <dd>Seamless Bidirectional Forwarding Detection</dd>
        <dt>FHRP</dt>
        <dd>First Hop Redundancy Protocol</dd>
        <dt>SBFD_Handler</dt>
        <dd>
          Handler in the Virtual Router that is triggered when an S-BFD
          Initiator session detects a failure.
        </dd>
        <dt>SBFD_My_Discriminator</dt>
        <dd>
          State variable maintained by the Virtual Router when S-BFD is used as
          a failure-detection mechanism. Its meaning depends on the current
          S-BFD operating mode.
        </dd>
        <dt>SBFD_Your_Discriminator</dt>
        <dd>
          State variable maintained by the Virtual Router when it uses S-BFD as
          an Initiator.
        </dd>
        <dt>SBFD_Primary_Down_Timer</dt>
        <dd>
          Timer in the Virtual Router that starts when S-BFD triggers the
          SBFD_Handler and is used by the election procedure defined in this
          document.
        </dd>
      </dl>
    </section>

    <section anchor="sect-3">   <!-- Requirements Language -->
      <name>Requirements Language</name>
      <t>
        The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
        "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
        "OPTIONAL" in this document are to be interpreted as described in BCP
        14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only
        when, they appear in all capitals, as shown here.
      </t>
    </section>

    <section anchor="sect-4">   <!-- Required Features -->
      <name>Required Features</name>
      <t>
        This section lists the features that guided the design of this
        specification.
      </t>
      <t>
        There is no implied priority among them, and all of the features below
        MUST be supported by an implementation of this specification.
      </t>
      <section>
        <name>Timers for Primary election</name>
        <t>
          When enabled, this specification MUST allow S-BFD to accelerate
          failure detection independently of the normal VRRP advertisement
          timers.
        </t>
      </section>

      <section>
        <name>Local S-BFD Discriminator allocation</name>
        <t>
          Every Router in a VRRP domain MUST be able to allocate a local S-BFD
          discriminator for use as an SBFDInitiator or SBFDReflector. The
          allocation method is implementation specific, but the selected value
          MUST satisfy the local uniqueness requirements of
          <xref target="RFC7880"/> and <xref target="RFC7881"/>.
        </t>
      </section>
      <section>
        <name>Remote S-BFD Discriminator advertisement and learning</name>
        <t>
          A Router in VRRP Backup state MUST be able to learn the remote
          S-BFD discriminator for the VRRP Primary Router acting as an
          SBFDReflector from the VRRP packet type defined in this document.
        </t>
      </section>
      <section>
        <name>S-BFD Discriminator length</name>
        <t>
          The locally allocated and remotely advertised S-BFD discriminator
          MUST be 32 bits long, as defined in <xref target="RFC5880"/>.
        </t>
      </section>
    </section>

    <section anchor="sect-5">   <!-- Known Limitations -->
      <name>Known Limitations</name>
      <t>
        Before S-BFD is used as a failure-detection mechanism with VRRP, the
        following limitation MUST be considered.
      </t>
      <section>
        <name>Inconsistency</name>
        <t>
          The implementation SHOULD raise an event when it detects an
          inconsistency between the VRRP state machine and the corresponding
          S-BFD operating mode.
        </t>
      </section>
    </section>

    <section anchor="sect-6">   <!-- Overview -->
      <name>Overview</name>
      <t>
        Each VRRP Router that uses S-BFD for failure detection MUST allocate a
        local S-BFD discriminator and MUST operate as an SBFDReflector or
        SBFDInitiator according to its VRRP state.
      </t>
      <t>
        When VRRP is in Primary state and the router wants other peers to
        monitor it, it MUST start an SBFDReflector session using the locally
        allocated discriminator and MUST advertise that discriminator by
        sending the VRRP packet type defined in this document. When VRRP is in
        Backup state, the router MUST start an SBFDInitiator session to
        monitor the Primary Router.
      </t>
      <t>
        To start a new session, the SBFDInitiator MUST learn the Primary
        Router's SBFDReflector discriminator and source IPvX address from the
        VRRP S-BFD Advertisement defined in this document. The SBFDInitiator
        MUST use a locally allocated discriminator as My Discriminator and the
        learned reflector discriminator as Your Discriminator, and it MUST
        monitor the learned source address. When the SBFDReflector receives a
        control packet from an SBFDInitiator, it MUST locate the corresponding
        SBFDReflector session by using the incoming Your Discriminator value.
      </t>
      <t>
        This document also defines how VRRP and S-BFD state changes interact,
        how the new handler and timer are used, and how the new packet type
        advertises the reflector discriminator needed by VRRP peers. This
        document does not define a deterministic algorithm for deriving S-BFD
        discriminators from VRRP fields.
      </t>
      <t>
        The following figure illustrates the high-level behavior.
      </t>
      <figure>
        <name>VRRP and S-BFD</name>
        <artset>
          <artwork type="ascii-art" name="stream.txt">
            <![CDATA[
    +---------------------+                +------------------------+
    |        Backup       |                |         Primary        |
    | +-----------------+ |                |    +-----------------+ |
    | |  SBFDInitiator  |---S-BFD Ctrl pkt----->|  SBFDReflector  | |
    | | +-------------+ |<--S-BFD Ctrl pkt------| +-------------+ | |
    | | |S-BFD Discrim| | |                |    | |S-BFD Discrim| | |
    | | |             | |---S-BFD Echo pkt---+  | |             | | |
    | | +-^-----------+ | |                | |  | +----------^--+ | |
    | +---|-------------+<-------------------+  +------------|----+ |
    |     |               |                |                 |      |
    | +---v----+          |                |             +---v----+ |
    | |  VRID  |          |                |             |  VRID  | |
    | +---^----+          |                |             +----^---+ |
    |     |               |                |                  |     |
    |     +----+          |                |             +----+     |
    |          |          |                |             |          |
    +---------[^]---------+                +------------[v]---------+
               |                  VRRP                   |
               +-------------------//--------------------+
            ]]>
          </artwork>
        </artset>
      </figure>
    </section>
    
    <section anchor="sect-7">   <!-- VRRP state machine and S-BFD operational mode -->
      <name>VRRP state machine and S-BFD operational mode</name>
      <t>
        To facilitate interoperability between the two protocols, this document
        defines a direct relationship between the VRRP state machine and the
        S-BFD operating mode.
      </t>
      <t>
        When VRRP is in Primary state, the router MUST initialize an
        SBFDReflector session using the locally allocated discriminator. When
        VRRP is in Backup state, the router MUST initialize an SBFDInitiator
        session using a locally allocated discriminator as My Discriminator and
        the value advertised by the VRRP Primary Router as Your
        Discriminator. The destination of the Initiator session is the source
        IPvX address from which the corresponding VRRP S-BFD Advertisement was
        received. When VRRP is in Initialize state, no S-BFD session is
        associated with that Virtual Router instance, including its VRID, VRRP
        version, address family, and applicable interface, bridge-domain, or
        VRF context.
      </t>
      <t>
        An implementation that uses this specification is responsible for
        maintaining the relationship between VRRP and S-BFD. When an
        inconsistency is detected, it MUST be treated as a critical error.
      </t>
    </section>

    <section anchor="sect-8">   <!-- VRRP and S-BFD state machines interoperability -->
      <name>VRRP and S-BFD state machines interoperability</name>
      <t>
        As defined in <xref target="RFC7880"/>, S-BFD also has its own state
        machine. In SBFDInitiator mode, the relevant states are Up and Down.
        The Down state is entered when a timer expires or when an AdminDown
        indication is received from the remote Reflector session. In
        SBFDReflector mode, the session can indicate Up or AdminDown.
      </t>
      <t>
        When VRRP is in Primary state and S-BFD is operating as an
        SBFDReflector, VRRP MUST drive the associated S-BFD session behavior.
        When VRRP is in Backup state and S-BFD is operating as an Initiator,
        S-BFD MUST trigger the SBFD_Handler and VRRP MUST start and monitor the
        SBFD_Primary_Down_Timer.
      </t>
      <t>
        When VRRP is in Primary state and sends an advertisement with priority
        0 in order to relinquish the role, it MUST continue to follow the base
        VRRP behavior. In that case, the election behavior remains the one
        defined by the corresponding VRRP version rather than the timer defined
        in this document.
      </t>
      <t>
        The implementation is responsible for defining how VRRP and S-BFD
        communicate state changes internally.
      </t>
    </section>

    <section anchor="sect-9">   <!-- Relation maintenance -->
      <name>Relation maintenance</name>
      <t>
        The implementation is responsible for maintaining the relationship
        among the S-BFD session, the current VRID, the VRRP version, the
        address family, the applicable interface, bridge-domain, or VRF
        context, and the applicable S-BFD operating mode. When VRRP
        changes state, the implementation MUST destroy the old S-BFD session,
        initialize the new one as needed, and continue to apply the base VRRP
        state machine behavior.
      </t>
      <t>
        This relationship is maintained by using the two state variables
        SBFD_My_Discriminator and SBFD_Your_Discriminator. Their precise
        behavior depends on the current operating mode.
      </t>
      <t>
        When operating as an Initiator, the learned destination IPvX address of
        the SBFDReflector need not be retained after the S-BFD session has been
        initialized.
      </t>
      <section>
        <name>Relation requirements</name>
        <t>
          This section clarifies how the relationship and state variables are
          managed for each VRRP state.
        </t>
        <t>
          To create and maintain the association, VRRP MUST store the state
          variables in the Virtual Router instance and use them to identify,
          create, or destroy the corresponding S-BFD session.
        </t>
        <section>
          <name>Primary state</name>
          <dl newline="true">
            <dt>SBFD_My_Discriminator</dt>
            <dd>
              SBFDReflector discriminator allocated by the implementation for
              the Virtual Router instance.
              This state variable MUST be initialized if the Primary Router
              wants peers to monitor it through S-BFD and MUST be used to start
              the corresponding SBFDReflector session as My Discriminator.
            </dd>
          </dl>
        </section>
        <section>
          <name>Backup state</name>
          <dl newline="true">
            <dt>SBFD_My_Discriminator</dt>
            <dd>Required SBFDInitiator discriminator allocated by the implementation.</dd>
            <dt>SBFD_Your_Discriminator</dt>
            <dd>Required SBFDReflector discriminator learned from the VRRP S-BFD Advertisement for this VRRP instance.</dd>
          </dl>
        </section>
        <section>
          <name>Initialize state</name>
          <t>
            In this state, the implementation MUST NOT maintain a relationship,
            and any previous S-BFD sessions MUST be destroyed.
          </t>
          <t>
            VRRP might terminate abnormally and therefore be unable to notify
            S-BFD. The behavior for handling such inconsistencies is discussed
            in <xref target="sect-7"/>.
          </t>
        </section>
      </section>
    </section>    

    <section anchor="sect-10">  <!-- S-BFD Discriminator advertisement -->
      <name>S-BFD Discriminator advertisement</name>
      <t>
        This specification does not define a deterministic algorithm for
        deriving S-BFD discriminators from the VRID, IP addresses, or other
        VRRP state. A Router that implements this specification MUST allocate
        SBFD_My_Discriminator according to local implementation policy and
        MUST ensure that the selected value is a valid non-zero 32-bit
        S-BFD discriminator that satisfies the local uniqueness requirements
        of <xref target="RFC7880"/> and <xref target="RFC7881"/>.
      </t>
      <t>
        Similar to the S-BFD discriminator advertisements defined for IS-IS in
        <xref target="RFC7883"/> and OSPF in <xref target="RFC7884"/>, the
        VRRP packet type defined in this document explicitly carries the
        SBFDReflector discriminator selected by the VRRP Primary Router.
      </t>

      <section>
        <name>Advertisement field</name>
        <t>
          A VRRP S-BFD Advertisement reuses the advertisement format of the
          applicable VRRP version and appends a 32-bit
          S-BFD Reflector Discriminator field after the protected IPvX address
          list. All other fields are identical to the corresponding VRRP
          Advertisement and are processed according to <xref target="RFC9568"/>.
        </t>
        <figure>
          <name>VRRP S-BFD Advertisement Extension</name>
          <artset>
            <artwork type="ascii-art" name="stream.txt">
              <![CDATA[
     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
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    ~     VRRP Advertisement fields for the applicable version      ~
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |             S-BFD Reflector Discriminator                     |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
              ]]>
            </artwork>
          </artset>
        </figure>
        <t>
          The checksum processing for the corresponding VRRP version MUST cover
          the S-BFD Reflector Discriminator field.
        </t>
      </section>

      <section>
        <name>Learning the SBFDInitiator Your Discriminator field</name>
        <t>
          When a Backup Router receives a VRRP S-BFD Advertisement, it MUST
          copy the advertised S-BFD Reflector Discriminator value into
          SBFD_Your_Discriminator and use that value as the S-BFD Your
          Discriminator, as defined in Section 7.2 of <xref target="RFC7880"/>.
        </t>
      </section>

      <section>
        <name>Implementation considerations</name>
        <t>
          The same VRID can be reused on different interfaces or bridge
          domains, and overlapping IPv4 or IPv6 addresses can exist in
          different VRF contexts. Therefore, deriving S-BFD discriminators only
          from the VRID and IP addressing information is not sufficient to
          guarantee uniqueness across VRRP deployments. Explicit advertisement
          avoids this ambiguity and leaves local discriminator allocation to
          the implementation.
        </t>
      </section>

      <section>
        <name>Why explicit advertisement is required</name>
        <t>
          A point-to-multipoint BFD solution, such as one based on
          <xref target="RFC8562"/>, can make a different design choice because
          the Primary Router itself originates BFD Control packets and a Backup
          Router can demultiplex the received session by using the source IPvX
          address together with locally defined rules.
        </t>
        <t>
          S-BFD has a different operational model. An SBFDInitiator MUST know
          the discriminator allocated by the remote SBFDReflector before it can
          send an S-BFD Control packet with the correct Your Discriminator
          value, as described in <xref target="RFC7880"/>. Because the same
          VRID can be reused in different interface, bridge-domain, or VRF
          contexts, and because overlapping IP addressing is possible, this
          document does not attempt to infer the remote reflector discriminator
          from VRRP state alone.
        </t>
        <t>
          For that reason, this specification carries the SBFDReflector
          discriminator explicitly in the VRRP S-BFD Advertisement. A
          specification that uses point-to-multipoint BFD instead of S-BFD
          could avoid that advertisement, but it would define a different
          failure-detection mechanism.
        </t>
      </section>

    </section>

    <section anchor="sect-11">  <!-- Timers -->
      <name>Timers</name>
      <t>
        The standard VRRP election procedure uses the advertisement interval as
        part of its failure-detection behavior and cannot directly provide the
        behavior required by this specification. To avoid collisions between
        the two mechanisms, a dedicated timer named SBFD_Primary_Down_Timer
        MUST be implemented in the VRRP Router. This timer MUST be equal to
        the Skew_Time for the applicable VRRP version and MUST be started only
        when an S-BFD Initiator session triggers the VRRP SBFD_Handler because
        of a Down or AdminDown indication from the Reflector.
      </t>
    </section>

    <section anchor="sect-12">  <!-- Operational requirements -->
      <name>Operational requirements</name>
      <t>
        This section defines the operational requirements of this
        specification and summarizes how VRRP and S-BFD are integrated.
      </t>
      <t>
        For IPv6 procedures, the Solicited-Node multicast address is the one
        defined in <xref target="RFC4291"/>.
      </t>

    <section> <!-- Initialize -->
      <name>Initialize state</name>
      <artwork><![CDATA[
+ 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:

>>     + If S-BFD is required, then:
>>
>>       - Allocate the SBFD_My_Discriminator according to local
>>         implementation policy.
>>
>>       - Start a new SBFDReflector session with
>>         SBFD_My_Discriminator as My Discriminator.
>>
>>       - Set the VRRP packet type to 2
>>
>>       - Include SBFD_My_Discriminator as the
>>         S-BFD Reflector Discriminator field
>>
>>    + else
>>
>>       - Set the VRRP packet type to 1
>>
>>    + endif // is S-BFD required?

       - Send an ADVERTISEMENT

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

         - 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

         - 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 {Primary} state

    + else // Router is not the address owner

       - Set Primary_Adver_Interval to Advertisement_Interval

       - Set the Primary_Down_Timer to Primary_Down_Interval

>>    + If S-BFD is required, then:
>>
>>      - Set the SBFD_Primary_Down_Timer to Skew_Time
>>
>>    + endif // is S-BFD required?

       - Transition to the {Backup} state

    + endif // was priority 255?

+ endif // Startup event was received
       ]]></artwork>
    </section>

    <section> <!-- Backup -->
      <name>VRRP Backup state</name>
      <artwork><![CDATA[
While in 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 Primary_Down_Timer

>>    + If S-BFD is required, then:
>>
>>       - Destroy the previous SBFDInitiator session.
>>
>>       - Cancel the SBFD_Primary_Down_Timer.
>>
>>    + endif // is S-BFD required?

       - Transition to the {Initialize} state

    + endif // Shutdown event received

>> + If the SBFD_Handler event is received, then:
>>
>>    - Start the SBFD_Primary_Down_Timer.
>>
>> + endif // SBFD_Handler event received

>> + If the Primary_Down_Timer OR
>>   the SBFD_Primary_Down_Timer fires, then:

>>    + If S-BFD is required, then:
>>
>>       - Allocate the SBFD_My_Discriminator according to local
>>         implementation policy.
>>
>>       - Start a new SBFDReflector session with
>>         SBFD_My_Discriminator as My Discriminator.
>>
>>       - Set the VRRP packet type to 2
>>
>>       - Include SBFD_My_Discriminator as the
>>         S-BFD Reflector Discriminator field
>>
>>    + else
>>
>>       - Set the VRRP packet type to 1
>>
>>    + endif // is S-BFD required?

       - Send an ADVERTISEMENT

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

          - 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

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

          - 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

>>    + If S-BFD is required, then:
>>
>>       - Cancel the SBFD_Primary_Down_Timer timer.
>>
>>    + endif // is S-BFD required?

       - Transition to the {Primary} state

    + endif // Primary_Down_Timer fired

    + If an ADVERTISEMENT is received, then:

>>    + If VRRP packet type is 2, then:
>>
>>       - Allocate the SBFD_My_Discriminator according to local
>>         implementation policy.
>>
>>       - Set the SBFD_Your_Discriminator to the
>>         S-BFD Reflector Discriminator field carried in the
>>         ADVERTISEMENT.
>>
>>       - Create or update the SBFDInitiator session against
>>         the Primary
>>         Router using SBFD_My_Discriminator as My Discriminator 
>>         and SBFD_Your_Discriminator as Your Discriminator;
>>         the destination IPvX of the new session is the
>>         source IPvX learnt from the advertisement packet
>>         and the port is the same defined in RFC7881.
>>
>>    + endif // is VRRP packet type 2?

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

          - Set the Primary_Down_Timer to Skew_Time

       + else // priority non-zero

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

             - Set Primary_Adver_Interval to Max Advertise
               Interval contained in the ADVERTISEMENT

             - Recompute the Skew_Time

             - Recompute the Primary_Down_Interval,

             - Set the Primary_Down_Timer to Primary_Down_Interval

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

             - Discard the ADVERTISEMENT

          + endif // preempt test

       + endif // was priority 0?

   + endif // was advertisement received?

endwhile // Backup state

       ]]></artwork>
    </section>

    <section> <!-- Primary -->
      <name>Primary state</name> 
      <artwork><![CDATA[
While in Primary state, 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:  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,
      MUST NOT accept these packets.

   + If a Shutdown event is received, then:

       - Cancel the Adver_Timer

>>    + If S-BFD is required, then:
>>
>>       - Set the VRRP packet type to 2
>>
>>       - Include SBFD_My_Discriminator as the
>>         S-BFD Reflector Discriminator field
>>
>>    + else
>>
>>       - Set the VRRP packet type to 1
>>
>>    + endif // is S-BFD required?
>>

       - Send an ADVERTISEMENT with Priority = 0

       - Transition to the {Initialize} state

    + endif // shutdown received

    + If the Adver_Timer fires, then:

>>    + If S-BFD is required, then:
>>
>>       - Set the VRRP packet type to 2
>>
>>       - Include SBFD_My_Discriminator as the
>>         S-BFD Reflector Discriminator field
>>
>>    + else
>>
>>       - Set the VRRP packet type to 1
>>
>>    + endif // is S-BFD required?

       - Send an ADVERTISEMENT

       - Reset the Adver_Timer to Advertisement_Interval

    + endif // advertisement timer fired

>> + If an ADVERTISEMENT type 1 or 2 is received, then:

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

>>       + If an ADVERTISEMENT type 2, then:
>>
>>          - Set the VRRP packet type to 2
>>
>>          - Include SBFD_My_Discriminator as the
>>            S-BFD Reflector Discriminator field
>>
>>       + else
>>
>>          - Set the VRRP packet type to 1
>>
>>       + endif // is ADVERTISEMENT type 2?

          - Send an ADVERTISEMENT

          - Reset the Adver_Timer to Advertisement_Interval

       + else // priority was non-zero

          + 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 Primary_Adver_Interval to Max Advertise
               Interval contained in the ADVERTISEMENT

             - Recompute the Skew_Time

             - Recompute the Primary_Down_Interval

             - Set Primary_Down_Timer to Primary_Down_Interval

             - Transition to the {Backup} state

          + else // new Primary Router logic

             - Discard the ADVERTISEMENT

>>          + If an ADVERTISEMENT type 2, then:
>>
>>            - Set the VRRP packet type to 2
>>
>>            - Include SBFD_My_Discriminator as the
>>              S-BFD Reflector Discriminator field
>>
>>          + else
>>
>>            - Set the VRRP packet type to 1
>>
>>          + endif // is ADVERTISEMENT type 2?

             - Send an ADVERTISEMENT immediately to assert
               Primary state to the sending VRRP Router and
               to update any learning bridges with the correct
               Primary VRRP Router path.

          + endif // new Primary Router detected

       + endif // was priority zero?

    + endif // advert received

endwhile // in Primary state
       ]]></artwork>
    </section>

    </section>

    <section anchor="IANA">     <!-- IANA -->
      <name>IANA Considerations</name>
      <t>
        This document requests IANA to assign a new VRRP packet type for use
        with S-BFD-enabled VRRP advertisements.
      </t>
      <t>
        The requested value is 2, with a description of
        "S-BFD Advertisement". If IANA assigns a different value,
        implementations of this specification MUST use the IANA-assigned value.
      </t>
    </section>

    <section anchor="Security"> <!-- Security -->
      <name>Security Considerations</name>
      <t>
        This document does not define a new security mechanism. It specifies
        how VRRP can use S-BFD to accelerate failure detection.
      </t>
      <t>
        Implementations inherit the security considerations of
        <xref target="RFC9568"/>,
        <xref target="RFC5880"/>, <xref target="RFC5881"/>,
        <xref target="RFC7880"/>, and <xref target="RFC7881"/>. A false or
        spoofed S-BFD Advertisement can inject an incorrect reflector
        discriminator or misdirect monitoring traffic, and a false failure
        indication can still trigger unnecessary VRRP state transitions. For
        that reason, operators should apply the same filtering, integrity, and
        control plane protections recommended for the base protocols.
      </t>
    </section>
  </middle>

  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
          <front>
            <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
            <author fullname="B. Leiba" initials="B." surname="Leiba"/>
            <date month="May" year="2017"/>
            <abstract>
              <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="8174"/>
          <seriesInfo name="DOI" value="10.17487/RFC8174"/>
        </reference>
        <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
          <front>
            <title>Key words for use in RFCs to Indicate Requirement Levels</title>
            <author fullname="S. Bradner" initials="S." surname="Bradner"/>
            <date month="March" year="1997"/>
            <abstract>
              <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
            </abstract>
          </front>
          <seriesInfo name="BCP" value="14"/>
          <seriesInfo name="RFC" value="2119"/>
          <seriesInfo name="DOI" value="10.17487/RFC2119"/>
        </reference>
        <reference anchor="RFC4291" target="https://www.rfc-editor.org/info/rfc4291">
          <front>
            <title>IP Version 6 Addressing Architecture</title>
            <author fullname="R. Hinden" initials="R." surname="Hinden"/>
            <author fullname="S. Deering" initials="S." surname="Deering"/>
            <date month="February" year="2006"/>
            <abstract>
              <t>This specification defines the addressing architecture of the IP Version 6 (IPv6) protocol. The document includes the IPv6 addressing model, text representations of IPv6 addresses, definition of IPv6 unicast addresses, anycast addresses, and multicast addresses, and an IPv6 node's required addresses.</t>
              <t>This document obsoletes RFC 3513, "IP Version 6 Addressing Architecture". [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="4291"/>
          <seriesInfo name="DOI" value="10.17487/RFC4291"/>
        </reference>
        <reference anchor="RFC9568" target="https://www.rfc-editor.org/info/rfc9568">
          <front>
            <title>Virtual Router Redundancy Protocol (VRRP) Version 3 for IPv4 and IPv6</title>
            <author fullname="A. Lindem" initials="A." surname="Lindem"/>
            <author fullname="A. Dogra" initials="A." surname="Dogra"/>
            <date month="April" year="2024"/>
            <abstract>
              <t>This document defines version 3 of the Virtual Router Redundancy Protocol (VRRP) for IPv4 and IPv6. It obsoletes RFC 5798, which previously specified VRRP (version 3). RFC 5798 obsoleted RFC 3768, which specified VRRP (version 2) for IPv4. VRRP specifies an election protocol that dynamically assigns responsibility for a Virtual Router to one of the VRRP Routers on a LAN. The VRRP Router controlling the IPv4 or IPv6 address(es) associated with a Virtual Router is called the Active Router, and it forwards packets routed to these IPv4 or IPv6 addresses. Active Routers are configured with virtual IPv4 or IPv6 addresses, and Backup Routers infer the address family of the virtual addresses being advertised based on the IP protocol version. Within a VRRP Router, the Virtual Routers in each of the IPv4 and IPv6 address families are independent of one another and always treated as separate Virtual Router instances. The election process provides dynamic failover in the forwarding responsibility should the Active Router become unavailable. For IPv4, the advantage gained from using VRRP is a higher-availability default path without requiring configuration of dynamic routing or router discovery protocols on every end-host. For IPv6, the advantage gained from using VRRP for IPv6 is a quicker switchover to Backup Routers than can be obtained with standard IPv6 Neighbor Discovery mechanisms.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="9568"/>
          <seriesInfo name="DOI" value="10.17487/RFC9568"/>
        </reference>
        <reference anchor="RFC5880" target="https://www.rfc-editor.org/info/rfc5880">
          <front>
            <title>Bidirectional Forwarding Detection (BFD)</title>
            <author fullname="D. Katz" initials="D." surname="Katz"/>
            <author fullname="D. Ward" initials="D." surname="Ward"/>
            <date month="June" year="2010"/>
            <abstract>
              <t>This document describes a protocol intended to detect faults in the bidirectional path between two forwarding engines, including interfaces, data link(s), and to the extent possible the forwarding engines themselves, with potentially very low latency. It operates independently of media, data protocols, and routing protocols. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5880"/>
          <seriesInfo name="DOI" value="10.17487/RFC5880"/>
        </reference>
        <reference anchor="RFC5881" target="https://www.rfc-editor.org/info/rfc5881">
          <front>
            <title>Bidirectional Forwarding Detection (BFD) for IPv4 and IPv6 (Single Hop)</title>
            <author fullname="D. Katz" initials="D." surname="Katz"/>
            <author fullname="D. Ward" initials="D." surname="Ward"/>
            <date month="June" year="2010"/>
            <abstract>
              <t>This document describes the use of the Bidirectional Forwarding Detection (BFD) protocol over IPv4 and IPv6 for single IP hops. [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="5881"/>
          <seriesInfo name="DOI" value="10.17487/RFC5881"/>
        </reference>
        <reference anchor="RFC7880" target="https://www.rfc-editor.org/info/rfc7880">
          <front>
            <title>Seamless Bidirectional Forwarding Detection (S-BFD)</title>
            <author fullname="C. Pignataro" initials="C." surname="Pignataro"/>
            <author fullname="D. Ward" initials="D." surname="Ward"/>
            <author fullname="N. Akiya" initials="N." surname="Akiya"/>
            <author fullname="M. Bhatia" initials="M." surname="Bhatia"/>
            <author fullname="S. Pallagatti" initials="S." surname="Pallagatti"/>
            <date month="July" year="2016"/>
            <abstract>
              <t>This document defines Seamless Bidirectional Forwarding Detection (S-BFD), a simplified mechanism for using BFD with a large proportion of negotiation aspects eliminated, thus providing benefits such as quick provisioning, as well as improved control and flexibility for network nodes initiating path monitoring.</t>
              <t>This document updates RFC 5880.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7880"/>
          <seriesInfo name="DOI" value="10.17487/RFC7880"/>
        </reference>
        <reference anchor="RFC7881" target="https://www.rfc-editor.org/info/rfc7881">
          <front>
            <title>Seamless Bidirectional Forwarding Detection (S-BFD) for IPv4, IPv6, and MPLS</title>
            <author fullname="C. Pignataro" initials="C." surname="Pignataro"/>
            <author fullname="D. Ward" initials="D." surname="Ward"/>
            <author fullname="N. Akiya" initials="N." surname="Akiya"/>
            <date month="July" year="2016"/>
            <abstract>
              <t>This document defines procedures for using Seamless Bidirectional Forwarding Detection (S-BFD) in IPv4, IPv6, and MPLS environments.</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="7881"/>
          <seriesInfo name="DOI" value="10.17487/RFC7881"/>
        </reference>
      </references>

      <references>
        <name>Informative References</name>
        <reference anchor="RFC8562" target="https://www.rfc-editor.org/info/rfc8562">
          <front>
            <title>Bidirectional Forwarding Detection (BFD) for Multipoint Networks</title>
            <author fullname="D. Katz" initials="D." surname="Katz"/>
            <author fullname="D. Ward" initials="D." surname="Ward"/>
            <author fullname="S. Pallagatti" initials="S." role="editor" surname="Pallagatti"/>
            <author fullname="G. Mirsky" initials="G." role="editor" surname="Mirsky"/>
            <date month="April" year="2019"/>
          </front>
          <seriesInfo name="RFC" value="8562"/>
          <seriesInfo name="DOI" value="10.17487/RFC8562"/>
        </reference>
        <reference anchor="RFC7883" target="https://www.rfc-editor.org/info/rfc7883">
          <front>
            <title>Advertising Seamless Bidirectional Forwarding Detection (S-BFD) Discriminators in IS-IS</title>
            <author fullname="L. Ginsberg" initials="L." surname="Ginsberg"/>
            <author fullname="N. Akiya" initials="N." surname="Akiya"/>
            <author fullname="M. Chen" initials="M." surname="Chen"/>
            <date month="July" year="2016"/>
          </front>
          <seriesInfo name="RFC" value="7883"/>
          <seriesInfo name="DOI" value="10.17487/RFC7883"/>
        </reference>
        <reference anchor="RFC7884" target="https://www.rfc-editor.org/info/rfc7884">
          <front>
            <title>OSPF Extensions to Advertise Seamless Bidirectional Forwarding Detection (S-BFD) Target Discriminators</title>
            <author fullname="C. Pignataro" initials="C." surname="Pignataro"/>
            <author fullname="M. Bhatia" initials="M." surname="Bhatia"/>
            <author fullname="S. Aldrin" initials="S." surname="Aldrin"/>
            <author fullname="T. Ranganath" initials="T." surname="Ranganath"/>
            <date month="July" year="2016"/>
          </front>
          <seriesInfo name="RFC" value="7884"/>
          <seriesInfo name="DOI" value="10.17487/RFC7884"/>
        </reference>
      </references>
    </references>

    <section>
      <name>Prior Work</name>
      <t>
        This document was inspired by earlier work on VRRP and BFD, including
        draft-ietf-rtgwg-vrrp-bfd-p2p-xx and
        draft-ietf-rtgwg-vrrp-p2mp-bfd-xx.
      </t>
    </section>

    <section>
      <name>Tools</name>
      <t>
        This document uses templates written by Pekka Savola, Elwyn Davies,
        and Henrik Levkowetz and relies on the open source xml2rfc project.
      </t>
    </section>

    <section anchor="Acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>
        Thanks to the authors of the VRRP specifications for their work on the
        Primary and Backup election procedure.
      </t>
      <t>
        Thanks to the authors of the BFD specifications for their work on rapid
        failure detection.
      </t>
      <t>
        Thanks to the authors of the S-BFD specifications for their work on a
        streamlined BFD mode that can be applied to VRRP.
      </t>
      <t>
        Thanks to G. Mirsky, J. Tantsura, G. Mishra, N. Gupta, A. Dogra, and
        C. Docherty for their earlier work on VRRP and BFD.
      </t>
      <t>
        Thanks to the open source maintainers of VRRP and BFD implementations
        for their efforts.
      </t>
    </section>

    <section anchor="Contributors" numbered="false">
      <name>Contributors</name>
      <t>
          Contributions are welcome.
      </t>
    </section>

 </back>

</rfc>
