<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?rfc toc="yes"?>
<?rfc tocompact="no"?>
<?rfc tocdepth="6"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="yes" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude"
     category="std" docName="draft-ietf-idr-bgp-bfd-strict-mode-12"
     ipr="trust200902"
     obsoletes=""
     updates="RFC4271"
     submissionType="IETF"
     xml:lang="en"
     tocInclude="true"
     tocDepth="6"
     symRefs="true"
     sortRefs="true"
     consensus="true"
     version="3">
  <!-- xml2rfc v2v3 conversion 3.12.3 -->
  <!-- ***** FRONT MATTER ***** -->
  <front>
    <title abbrev="BGP BFD Strict-Mode ">BGP BFD Strict-Mode</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-idr-bgp-bfd-strict-mode-12"/>
    <author initials="M" surname="Zheng" fullname="Mercia Zheng">
      <organization>Ciena</organization>
      <address>
        <postal>
          <street>3939 N. 1st Street</street>
          <region>San Jose, CA 95134</region>
          <country>UNITED STATES</country>
        </postal>
        <phone/>
        <email>merciaz.ietf@gmail.com</email>
      </address>
    </author>
    <author initials="A" surname="Lindem" fullname="Acee Lindem">
      <organization>LabN Consulting, L.L.C.</organization>
      <address>
        <postal>
          <street>301 Midenhall Way</street>
          <region>Cary, NC 27513</region>
          <country>UNITED STATES</country>
        </postal>
        <phone/>
        <email>acee.ietf@gmail.com</email>
      </address>
    </author>
    <author initials="J" surname="Haas" fullname="Jeffrey Haas">
      <organization>Juniper Networks, Inc.</organization>
      <address>
        <postal>
          <street>1133 Innovation Way</street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94089</code>
          <country>USA</country>
        </postal>
        <phone/>
        <email>jhaas@juniper.net</email>
      </address>
    </author>
    <author initials="A" surname="Fu" fullname="Albert Fu">
      <organization>Bloomberg L.P.</organization>
      <address>
        <postal>
          <street>731 Lexington Avenue</street>
          <city>New York</city>
          <region>NY</region>
          <code>10022</code>
          <country>USA</country>
        </postal>
        <email>afu14@bloomberg.net</email>
      </address>
    </author>
    <date/>
    <area>Routing</area>
    <workgroup>IDR Workgroup</workgroup>
    <abstract>
      <t>
         This document specifies extensions to RFC4271 BGP-4 that enable a BGP speaker
         to negotiate additional Bidirectional Forwarding Detection (BFD) extensions using a
         BGP capability. This BFD Strict-Mode Capability enables a BGP speaker to prevent
         a BGP session from being established until a BFD session is established.
         It is referred to as BGP BFD "strict-mode". BGP BFD strict-mode will be supported
         when both the local speaker and its remote peer are BFD strict-mode capable.

      </t>
    </abstract>
  </front>
  <!-- ***** MIDDLE MATTER ***** -->

  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>
         Bidirectional Forwarding Detection BFD <xref target="RFC5882" format="default"/> enables routers to monitor
         data plane connectivity and to detect faults in the bidirectional forwarding path between them.
         This capability is leveraged by routing protocols such as BGP <xref target="RFC4271" format="default"/> to rapidly
         react to topology changes in the face of path failures.
      </t>
      <t>
            The BFD interaction with BGP is specified in Section 10.2 of <xref target="RFC5882" format="default"/>.
            When BFD is enabled for a BGP neighbor, faults in the bidirectional forwarding detected by
            BFD result in session termination. It is possible in some failure scenarios for the network to be
            in a state such that a BGP session may be established but a BFD session cannot be established.
            In some other scenarios, it may be possible to establish a BGP session, but a degraded or
            poor-quality link may result in the corresponding BFD session going up and down frequently.
      </t>
      <t>
            To avoid situations which result in routing churn and to minimize the impact of network
            interruptions, it will be beneficial to disallow BGP to establish a session until BFD session
            is successfully established and has stabilized. We refer to this mode of operation as BGP BFD "strict-mode".
            However, always using "strict-mode" would preclude BGP operation in an environment where not all routers
            support BFD strict-mode or have BFD enabled. This document defines BGP "strict-mode" operation as
            preventing BGP session establishment until both the local and remove speakers have a stable BFD session.
            The document also specifies the BGP protocol extensions for BGP capability <xref target="RFC5492" format="default"/> for
            announcing BFD parameters including a BGP speaker's support for "strict-mode", i.e., requiring a
            BFD session for BGP session establishment.
      </t>
    </section>
    <section numbered="true" toc="default">
      <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" format="default"/> <xref target="RFC8174" format="default"/>
        when, and only when, they appear in all capitals, as shown here.</t>
    </section>
    <section numbered="true" toc="default">
      <name>BFD Strict-Mode Capability</name>
      <t>
           The BGP Strict-Mode Capability <xref target="RFC5492" format="default"/> will allow a BGP speaker's
           to advertise this capability. The capability is defined as follows:
      </t>
      <t>
   Capability code: 74
      </t>
      <t>
        Capability length: 0 octets
      </t>
    </section>
    <section anchor="operation" numbered="true" toc="default">
      <name>BGP BFD Strict-Mode Procedures</name>
      <t>
          A BGP speaker which supports capabilities advertisement and has BFD strict-mode enabled
          MUST include the BFD Strict-Mode Capability.
      </t>
      <t>
          A BGP speaker which supports the BFD Strict-Mode Capability, examines the list
          of capabilities present in the capabilities that the speaker
          receives from its peer. If both the local and remote BGP speakers include
          the BFD Strict-Mode Capability,
          the BGP finite state machine does not transition to the Established state from
          OpenConfirm state <xref target="RFC4271" format="default"/> until the BFD session is in the Up state (see
          below for AdminDown state). This means that a KEEPALIVE message is not sent nor is the
          KeepaliveTimer set.
      </t>
      <t>
          If the BFD session does not transition to the Up state, and the HoldTimer has been negotiated to
          a non-zero value, the BGP FSM will close the session appropriately.
          If the HoldTimer has been negotiated to a zero value, the session should be closed after a
          time of X. This time X is  referred as "BGP BFD Hold time". The proposed default BGP BFD
          Hold time value is 30 seconds. The BGP BFD Hold time value is configurable.
      </t>
      <t>
          If BFD session is in the AdminDown state, then the BGP finite state machine will proceed
          normally without input from BFD. This means that BFD session "AdminDown" state WILL NOT prevent
          the BGP state transition from the OpenConfirm state to the Established state.
      </t>
      <t>
        Once the BFD session has transitioned to the Up state, the BGP FSM may proceed to
        transition from the OpenConfirm state to state Established state. Once in the Established state,
        a KEEPALIVE message is sent and a KeepaliveTimer for the BGP peer is started.
      </t>
      <t>
        BGP strict-mode cannot be enabled unless BFD is configured for the
        BGP peer.  If BFD is removed for the BGP peer, then BGP strict-mode
        will also be disabled.
      </t>
      <t>
        Note that it is fully possible to have BFD enabled between the peers without BGP strict-mode.
      </t>
      <t>
        If either BGP peer has not advertised the BFD Strict-Mode Capability, then a BFD session
        WILL NOT be required for the BGP session to reach Established state. This does not preclude usage
        of BFD after BGP session establishment <xref target="RFC5882" format="default"/>.
      </t>
      <t>
        If BFD strict-mode is enabled or disabled for a BGP peer and the BGP session state
        is not Established state, then the BGP will close the session.
      </t>
      <t>
        If BFD strict-mode is enabled or disabled for a BGP peer and the BGP session
        state is in the Established state, the local BFD strict-mode configuration
        will be modified but the session will remain in Established state.
      </t>
      <t>
        Since BFD strict-mode is only applicable during BGP session
        establishment, this inconsistency would not have an impact on the
        Established session unless the remote BGP peer is waiting in OpenConfirm state.
        To avoid this situation, BFD strict-mode SHOULD be modified
        consistently on both the local and remote BGP peers.
      </t>
      <section numbered="true" toc="default">
        <name>Closing BGP Sessions</name>
        <t>
          When BGP sessions are closed according to the procedures in this document, the session
          SHOULD be terminated with a NOTIFICATION message with the Cease Code and the "BFD Down"
          Subcode. (<xref target="I-D.ietf-idr-bfd-subcode"/>)  This informs the operator that
          interaction with BFD is the root cause of the BGP session being unable to move to the
          Established state.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Stability Considerations</name>
        <t>
          The use of BGP BFD strict-mode along with mechanisms such as
          hold-down (a delay in the initial BGP Establishment state following
          BFD session establishment) and/or dampening (a delay in the BGP
          Establishment state following failure detected by BFD) may help
          reduce the frequency of BGP session flaps and therefore reduce the
          associated routing churn.
        </t>
        <t>
          To avoid deadlock when utilizing both BFD hold-down and BGP BFD
          strict-mode, when strict-mode is enabled for a peer, the BGP FSM MUST
          be enabled.  That is, BFD hold-down procedures MUST NOT prevent BGP from
          establishing a connection with the remote BGP speaker.
        </t>
        <t>
          If both the local and remote BGP speakers include the
          BFD Strict-Mode Capability, the BGP state machine is permitted to
          transition to the Established state from the OpenConfirm state after
          the locally configured BFD hold-down interval is observed.  That is,
          the BFD session has been Up for the desired amount of time.
          Implementations MAY start the BFD session associated with the BGP
          bfd-strict session prior to the BGP FSM starting.
        </t>
        <t>
          It is RECOMMENDED that the BFD hold-down intervals used with BFD
          strict-mode, when configured, use similar values.  Similarly, the
          negotiated BGP holdtime SHOULD be long enough to account for the time
          between the BGP FSM reaching the OpenConfirm state, the BFD hold-down
          interval, and any delay for the BFD session being initiated.
          Failure to do so can result in the BGP speaker that has transitioned
          to the Established state expiring its BGP holdtime and closing the
          connection.  This is because the remote BGP speaker hasn't
          transitioned to Established and begun sending KEEPALIVE messages.
        </t>
        <t>
          A BGP speaker SHOULD log a message if it closes its session due to
          hold timer expiration while waiting for the BFD hold-down interval.
        </t>
        <t>
          The behavior of BGP speakers implementing BFD hold-down without
          negotiating the BFD strict-mode feature is out of scope of this
          document.  However, the authors are aware that inconsistent behaviors
          in BGP implementations for BFD hold-down without BGP BFD strict-mode
          may result in BGP session deadlock.
        </t>
      </section>
    </section>
    <section numbered="true" toc="default">
      <name>Manageability Considerations</name>
      <t>
          Auto-configuration is possible for the enabling BGP BFD strict-mode. However,
          the configuration automation is out of the scope of this document.
      </t>
      <t>
        To simplify troubleshoorting and avoid inconsistencies, it is RECOMMENDED that BFD strict-mode
        configuration be consistent for both BGP peers. 
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
          The mechanism defined in this document interacts with the BGP finite state machine when so configured.
          The security considerations of BFD thus, become considerations for BGP-4 <xref target="RFC4271" format="default"/>
          so used. Given that a BFD session is required for a BGP session, a Denial-of-Service (DoS) attack on
          BGP can now be mounted by preventing a BFD session between the BGP peers from being established or
          interrupting an existing BFD session.
          The use of the BFD Authentication mechanism defined in <xref target="RFC5880" format="default"/> is thus
          RECOMMENDED when used to protect BGP-4 <xref target="RFC4271" format="default"/>.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>
        This document defines the BGP BFD Strict-Mode Capability. The Capability Code 74 has been assigned from
        the First-Come-First-Served range (64-238) of the Capability Codes registry.
      </t>
    </section>
    <section numbered="true" toc="default">
      <name>Acknowledgement</name>
      <t>
              The authors would like to acknowledge the review and inputs from Shyam Sethuram, Mohammed Mirza,
              Bruno Decraene, Carlos Pignataro, Enke Chen, and Anup Kumar.
      </t>
    </section>
  </middle>
  <!--  *****BACK MATTER ***** -->

  <back>
    <references>
      <name>Normative References</name>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5492.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5880.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5882.xml"/>
      <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-bfd-subcode.xml"/>
    </references>
  </back>
</rfc>
