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

<!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" ipr="trust200902" docName="draft-ietf-mpls-bfd-directed-31" number="9612" consensus="true" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="3" symRefs="true" sortRefs="true" version="3">

  <front>

<title abbrev="BFD Directed Reverse Path for MPLS LSPs">Bidirectional
Forwarding Detection (BFD) Reverse Path for MPLS Label Switched Paths
(LSPs)</title>
    <seriesInfo name="RFC" value="9612"/>
    <author initials="G." surname="Mirsky" fullname="Greg Mirsky">
      <organization>Ericsson</organization>
      <address>
        <email>gregimirsky@gmail.com</email>
      </address>
    </author>
    <author initials="J." surname="Tantsura" fullname="Jeff  Tantsura">
      <organization>NVIDIA</organization>
      <address>
        <email>jefftant.ietf@gmail.com</email>
      </address>
    </author>
    <author initials="I." surname="Varlashkin" fullname="Ilya Varlashkin">
      <organization>Google</organization>
      <address>
        <email>imv@google.com</email>
      </address>
    </author>
    <author fullname="Mach(Guoyi) Chen" initials="M." surname="Chen">
      <organization>Huawei</organization>
      <address>
        <email>mach.chen@huawei.com</email>
      </address>
    </author>
    
    <date year="2024" month="July"/>
    
    <area>RTG</area>
    <workgroup>mpls</workgroup>

    <keyword>LSP Ping</keyword>
    <keyword>BFD</keyword>

    <abstract>
      <t>
Bidirectional Forwarding Detection (BFD) is expected to be able to 
monitor a wide variety of encapsulations of paths between systems.
When a BFD session monitors an explicitly routed unidirectional path, there may be a need to direct
the egress BFD peer to use a specific path for the reverse direction of the BFD session.
This document describes an extension to the MPLS Label Switched Path (LSP) echo request that
allows a BFD system to request that the remote BFD peer transmit BFD control packets
over the specified LSP.
      </t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>
 <xref target="RFC5880"/>, <xref target="RFC5881"/>, and <xref target="RFC5883"/>
 established the Bidirectional Forwarding Detection (BFD)
 protocol for IP networks. <xref target="RFC5884" format="default"/> and <xref target="RFC7726" format="default"/>
 set rules for using BFD Asynchronous mode over MPLS Label Switched Paths (LSPs),
 while not defining means to control the path that an egress BFD system uses to send BFD
 control packets towards the ingress BFD system.
      </t>
      <t>
When BFD is used to detect defects of the traffic-engineered LSP,
the path of the BFD control packets transmitted by the egress BFD system
toward the ingress may be disjoint from the monitored LSP in the forward direction.
The fact that BFD control packets are not
   guaranteed to follow the same links and nodes in both forward and
   reverse directions may be one of the factors contributing to false positive defect
   notifications (i.e., false alarms) at the ingress BFD peer.  Ensuring that both directions 
   of the BFD session use co-routed paths may, in some environments, improve the 
   determinism of the failure detection and localization.

      </t>
      <t>
 This document defines the BFD Reverse Path TLV as an extension to LSP ping
 <xref target="RFC8029" format="default"/> and proposes that it be used to
 instruct the egress BFD system to use an explicit path for its BFD control
 packets associated with a particular BFD session.  IANA has registered this
 TLV in the "TLVs" registry defined by <xref target="RFC8029"
 format="default"/> (see <xref target="iana-TLV" format="default"/>).  As a special case, forward and reverse directions of the
 BFD session can form a bidirectional co-routed associated channel.
      </t>
      <t>The LSP ping extension described in this document was developed and
      implemented as a result of an operational experiment. The lessons
      learned from the operational experiment enabled the use of this
      extension between systems conforming to this specification.  Further
      implementation is encouraged to better understand the operational impact
      of the mechanism described in the document.</t>
      <section numbered="true" toc="default">
        <name>Conventions Used in This document</name>
  
        <section>
	  <name>Terminology</name>

	  <dl newline="false" spacing="normal" indent="7">
            <dt>BFD:</dt><dd>Bidirectional Forwarding Detection</dd>
            <dt>FEC:</dt><dd>Forwarding Equivalence Class</dd>
            <dt>LSP:</dt><dd>Label Switched Path</dd>
            <dt>LSR:</dt><dd>Label Switching Router</dd>
</dl>
         </section>    
 
        <section numbered="true" toc="default">
          <name>Requirements Language</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>",
    "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>",
    "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are
    to be interpreted as described in BCP&nbsp;14 <xref target="RFC2119"/>
    <xref target="RFC8174"/> when, and only when, they appear in all capitals,
    as shown here.
        </t>

        </section>
      </section>
    </section>
    <section anchor="problem-statement" numbered="true" toc="default">
      <name>Problem Statement</name>
      <t>
   When BFD is used to monitor an explicitly routed unidirectional path
   (e.g., MPLS-TE LSP), BFD control packets in the forward direction would
   be in-band using the mechanism defined in <xref target="RFC5884"/>. However, the
   reverse direction of the BFD session would follow the shortest path
   route, which could be completely or partially disjoint from the
   forward path. This creates the potential for the failure of a
   disjoint resource on the reverse path to trigger a BFD failure
   detection, even though the forward path is unaffected.
</t>
      <t>
   If the reverse path is congruent with the forward path, the potential
   for such false positives is greatly reduced. For this purpose, this
   specification provides a means for the egress BFD peer to be
   instructed to use a specific path for BFD control packets.
</t>
    </section>
    <section anchor="direct-reverse-bfd" numbered="true" toc="default">
      <name>Control of the BFD Reverse Path</name>
      <t>
 To bootstrap a BFD session over an MPLS LSP, LSP ping <xref target="RFC8029"
 format="default"/> <bcp14>MUST</bcp14> be used with the BFD Discriminator TLV
 <xref target="RFC5884" format="default"/>.  This document defines a new TLV,
 the BFD Reverse Path TLV, that can be used to carry information about the
 reverse path for the BFD session that is specified by the value in the BFD
 Discriminator TLV. The BFD Reverse Path TLV <bcp14>MAY</bcp14> contain zero
 or more sub-TLVs.
      </t>
      <section anchor="bfd-reverse-path-tlv" numbered="true" toc="default">
        <name>BFD Reverse Path TLV</name>

        <t>
The BFD Reverse Path TLV is an optional TLV within the LSP ping <xref target="RFC8029" format="default"/>. 
However, if used, the BFD Discriminator TLV <bcp14>MUST</bcp14> be included in an echo request message 
as well. If the BFD Discriminator TLV is not present when the BFD Reverse
Path TLV is included, then it <bcp14>MUST</bcp14> be treated as a malformed echo request, as described in <xref target="RFC8029" format="default"/>.
</t>
        <t>
The BFD Reverse Path TLV carries information about the path onto which the egress BFD peer of the BFD session referenced by the BFD
Discriminator TLV <bcp14>MUST</bcp14> transmit BFD control packets. The format of the BFD Reverse Path TLV is presented in <xref target="mpls-bfd-tlv" format="default"/>.
</t>
        <figure anchor="mpls-bfd-tlv">
          <name>BFD Reverse Path TLV</name>
          <artwork name="" type="" align="left" alt=""><![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
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |   BFD Reverse Path TLV Type   |           Length              |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          Reverse Path                         |
 ~                                                               ~
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
        </figure>

<dl newline="true" spacing="normal">	
  <dt>BFD Reverse Path TLV Type:</dt>
  <dd>This two-octet field has a value of 16384 (see <xref
  target="iana-consider" format="default"/>).
  </dd>

  <dt>Length:</dt>
  <dd>This two-octet field defines the length in octets of the
  Reverse Path field.
  </dd>

  <dt>Reverse Path:</dt>
  <dd>This field contains zero or more sub-TLVs. Only non-multicast Target FEC
  Stack sub-TLVs (already defined or to be defined in the future) for TLV
  Types 1, 16, and 21 in the "Multiprotocol Label Switching (MPLS) Label
  Switched Paths (LSPs) Ping Parameters" registry are permitted to be used in
  this field. Other sub-TLVs <bcp14>MUST NOT</bcp14> be used. (This implies
  that multicast Target FEC Stack sub-TLVs, e.g., the Multicast P2MP LDP FEC
  Stack sub-TLV and the Multicast MP2MP LDP FEC Stack sub-TLV, are not
  permitted in the Reverse Path field.)
  </dd>
</dl>	


  <t>If the egress LSR finds a multicast Target FEC Stack sub-TLV, it
  <bcp14>MUST</bcp14> send an echo reply with the received BFD Reverse Path
  TLV and BFD Discriminator TLV and set the Return Code to 192 ("Inappropriate
  Target FEC Stack sub-TLV present") (see <xref target="return-codes"
  format="default"/>).  The BFD Reverse Path TLV includes zero or more
  sub-TLVs.  However, the number of sub-TLVs in the Reverse Path field
  <bcp14>MUST</bcp14> be limited.  The default limit is 128 sub-TLV entries,
  but an implementation <bcp14>MAY</bcp14> be able to control that limit.  An
  empty BFD Reverse Path TLV (i.e., a BFD Reverse Path TLV with no sub-TLVs)
  is used to withdraw any previously set reverse path for the BFD session
  identified in the BFD Discriminator TLV.  If no sub-TLVs are found in the
  BFD Reverse Path TLV, the egress BFD peer <bcp14>MUST</bcp14> revert to
  using the decision based on local policy, i.e., routing over an IP
  network, as described in <xref target="RFC5884"
  format="default" sectionFormat="of" section="7"/>.</t>
  <t>
             If the egress peer LSR cannot find the path specified in the BFD
             Reverse Path TLV, it <bcp14>MUST</bcp14> send an echo reply with
             the received BFD Discriminator TLV and BFD Reverse Path TLV and set
             the Return Code to 193 ("Failed to establish the BFD session. The
             specified reverse path was not found.") (see <xref
             target="return-codes" format="default"/>).  If an implementation
             provides additional configuration options, these can control
             actions at the egress BFD peer, including when the path specified
             in the BFD Reverse Path TLV cannot be found.  For example,
             if the egress peer LSR cannot find the path specified
             in the BFD Reverse Path TLV, it <bcp14>MAY</bcp14> establish the
             BFD session over an IP network, as defined in <xref
             target="RFC5884" format="default"/>.  Note that the Return Code
             required by the "<bcp14>MUST</bcp14>" clause in this paragraph does not preclude
             the session from being established over a different path as
             discussed in the "<bcp14>MAY</bcp14>" clause.
        </t>

	<t>
           The BFD Reverse Path TLV <bcp14>MAY</bcp14> be used in the process
           of bootstrapping the BFD session as described in <xref
           target="RFC5884" section="6" sectionFormat="of" />.  A system that
           supports this specification <bcp14>MUST</bcp14> support using the
           BFD Reverse Path TLV after the BFD session has been established. If
           a system that supports this specification receives an LSP ping with
           the BFD Discriminator TLV and no BFD Reverse Path TLV even though
           the reverse path for the specified BFD session was established
           according to the previously received BFD Reverse Path TLV, the
           egress BFD peer <bcp14>MUST</bcp14> transition to transmitting
           periodic BFD Control messages as described in <xref
           target="RFC5884" section="7" sectionFormat="of" />. If a BFD system
           that received an LSP ping with the BFD Reverse Path TLV does not
           support this specification, it will result in an echo response with
           the Return Code set to 2 ("One or more of the TLVs was not
           understood"), as described in <xref target="RFC8029" section="3"
           sectionFormat="of"/>.
   </t>
      </section>
      <section anchor="return-codes" numbered="true" toc="default">
        <name>Return Codes</name>
        <t>
This document defines the following Return Codes for the MPLS LSP echo reply:
</t>
        <dl spacing="normal" newline="true">
          <dt>"Inappropriate Target FEC Stack sub-TLV present" (192):</dt>
	  <dd>When a multicast Target FEC Stack sub-TLV is found in
the received echo request, the egress BFD peer sends an echo reply with the Return Code set to 192
("Inappropriate Target FEC Stack sub-TLV present") to the ingress BFD peer, as described in <xref target="bfd-reverse-path-tlv" format="default"/>.
</dd>
          <dt>"Failed to establish the BFD session. The specified reverse path was not found." (193):</dt>
<dd>When a specified reverse path is unavailable, the egress BFD peer sends an
echo reply with the Return Code set to 193 ("Failed to establish the BFD
session. The specified reverse path was not found.") to the ingress BFD peer, as
described in <xref target="bfd-reverse-path-tlv" format="default"/>.
</dd>
        </dl>
      </section>
      <section anchor="failure-character-sec" numbered="true" toc="default">
        <name>Failure Characterization</name>
        <t>
         
         A failure detected by a BFD session that uses the BFD Reverse Path
         TLV could be due to a change in the FEC used in the BFD Reverse Path
         TLV.  Upon detection of the network failure, the ingress BFD peer
         <bcp14>MUST</bcp14> transmit the LSP ping echo request with the Reply
         Path TLV <xref target="RFC7110"/> to verify whether the FEC is still
         valid. If the failure was caused by a change in the FEC used for the
         reverse direction of the BFD session, the ingress BFD peer
         <bcp14>MUST</bcp14> redirect the reverse path of the BFD session
         using another FEC in the BFD Reverse Path TLV and notify an operator.
        </t>
        </section>
    </section>
    <section anchor="use-case" numbered="true" toc="default">
      <name>Use Case Scenario</name>

      <t>
 In the network presented in <xref target="use-case-fig" format="default"/>,
 ingress LSR peer A monitors two tunnels to egress LSR peer H: A-B-C-D-G-H and
 A-B-E-F-G-H.  To bootstrap a BFD session to monitor the first tunnel, ingress
 LSR peer A includes a BFD Discriminator TLV with a Discriminator value (e.g.,
 foobar-1) <xref target="RFC7726" format="default"/>. Ingress LSR peer A includes a BFD
 Reverse Path TLV referencing the H-G-D-C-B-A tunnel to control the path from
 the egress LSR.  To bootstrap a BFD session to monitor the second tunnel,
 ingress LSR peer A includes a BFD Discriminator TLV with a different
 Discriminator value (e.g., foobar-2) and a BFD Reverse Path TLV that
 references the H-G-F-E-B-A tunnel.
      </t>
      <figure anchor="use-case-fig">
        <name>Use Case for BFD Reverse Path TLV</name>
        <artwork name="" type="" align="left" alt=""><![CDATA[
        C---------D
        |         |
A-------B         G-----H
        |         |
        E---------F
]]></artwork>
      </figure>
      <t>
If an operator needs egress LSR peer H to monitor a path to ingress LSR peer A, e.g.,
the H-G-D-C-B-A tunnel, then by looking up the list of known reverse paths,
it <bcp14>MAY</bcp14> find and use the existing BFD session.
</t>
    </section>
    <section anchor="operational-sec" numbered="true" toc="default">
      <name>Operational Considerations</name>
      <t>
  When an explicit path is set as either Static or RSVP-TE LSP,
  corresponding sub-TLVs (defined in <xref target="RFC7110" format="default"/>) <bcp14>MAY</bcp14> be used
  to identify the explicit reverse path for the BFD session. If a particular set of sub-TLVs composes the Reply Path TLV <xref target="RFC7110"/>
  and does not increase the length of the Maximum  Transmission Unit for the given LSP, that set can be safely used in the BFD Reverse Path TLV.
  If any of the sub-TLVs defined in <xref target="RFC7110" format="default"/>
   are used in the BFD Reverse Path TLV, then the periodic verification of the control plane
  against the data plane, as recommended in <xref target="RFC5884" section="4" sectionFormat="of" format="default"/>, <bcp14>MUST</bcp14> use
  the Reply Path TLV, as per <xref target="RFC7110" format="default"/>, with that sub-TLV.
  By using the LSP ping with the Reply Path TLV, an operator monitors whether
   the reverse LSP is mapped to the same FEC as the BFD session at the egress BFD node.
  Selection and control of the rate of the LSP ping with the Reply Path TLV
      follows the recommendation in <xref target="RFC5884" format="default"/>:</t>
<blockquote>      
The rate of generation of these LSP Ping Echo request messages
<bcp14>SHOULD</bcp14> be significantly less than the rate of generation of the
BFD Control packets.  An implementation <bcp14>MAY</bcp14> provide
configuration options to control the rate of generation of the periodic LSP
Ping Echo request messages.
</blockquote>   

<t>
    Suppose an operator planned a network maintenance activity that
   possibly affects the FEC used in the BFD Reverse Path TLV. In that case,
   the operator can avoid unnecessary disruption by using the LSP ping
   with a new FEC in the BFD Reverse Path TLV. But in some scenarios, proactive measures cannot be taken
    because the frequency of LSP ping messages is lower than the defect detection time provided by the BFD session.
    As a result, a change in the reverse-path FEC will first be detected as the BFD session's failure.
   An operator will be notified as described in <xref target="failure-character-sec"/>.
      </t>
    </section>
    <section anchor="iana-consider" numbered="true" toc="default">
      <name>IANA Considerations</name>

      <section anchor="iana-TLV" numbered="true" toc="default">
        <name>BFD Reverse Path TLV</name>
        <t>
     IANA has assigned the following value for the BFD Reverse Path TLV from the 16384-31739 range in the "TLVs" subregistry within the "Multiprotocol Label Switching (MPLS) Label Switched Paths (LSPs) Ping Parameters" registry.
        </t>
        <table anchor="bfdtlv-table" align="center">
          <name>New BFD Reverse Path TLV</name>
          <thead>
            <tr>
              <th align="left">Type</th>
              <th align="left">TLV Name</th>
              <th align="left">Reference</th>
              <th align="left">Sub-TLV Registry</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">16384</td>
              <td align="left">BFD Reverse Path</td>
              <td align="left">RFC 9612</td>
              <td align="left">Only non-multicast sub-TLVs (already defined or
              to be defined in the future) in the "Sub-TLVs for TLV Types 1,
              16, and 21" registry at <eref brackets="angle"
target="https://www.iana.org/assignments/mpls-lsp-ping-parameters/mpls-lsp-ping-parameters.xml#sub-tlv-1-16-21"/>
              are permitted to be used in this field. Other sub-TLVs
              <bcp14>MUST NOT</bcp14> be used.
               </td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="iana-return-code" numbered="true" toc="default">
        <name>Return Codes</name>
        <t>
IANA has assigned the following Return Code values from the 192-247 range in the "Return Codes" subregistry
within the "Multiprotocol Label Switching (MPLS) Label Switched Paths (LSPs) Ping Parameters" registry.
</t>
        <table anchor="return-code" align="center">
          <name>New Return Codes</name>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Meaning</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">192</td>
              <td align="left">Inappropriate Target FEC Stack sub-TLV present</td>
              <td align="left">RFC 9612</td>
            </tr>
            <tr>
              <td align="left">193</td>
              <td align="left">Failed to establish the BFD session. The specified reverse path was not found.</td>
              <td align="left">RFC 9612</td>
            </tr>
          </tbody>
        </table>
      </section>
    </section>

    <section anchor="security" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>
 Security considerations discussed in <xref target="RFC5880" format="default"/>, <xref target="RFC5884" format="default"/>, <xref target="RFC7726" format="default"/>,
 <xref target="RFC8029" format="default"/>, and <xref target="RFC7110" format="default"/> apply to this document. 
      </t>
      <t>
      The BFD Reverse Path TLV may be exploited as an attack vector by inflating the number of included sub-TLVs.
      The number of sub-TLVs <bcp14>MUST</bcp14> be limited to mitigate that threat. The default limit for the number of sub-TLVs is
      set to 128 (see <xref target="bfd-reverse-path-tlv"/>). An implementation <bcp14>MAY</bcp14> use a mechanism to control that limit.
      </t>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5880.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5881.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5883.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5884.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8029.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7110.xml"/>
      <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7726.xml"/>
    </references>

    <section numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>The authors greatly appreciate the thorough reviews and helpful
      comments from <contact fullname="Eric Gray"/> and <contact
      fullname="Carlos Pignataro"/>.  The authors much appreciate the help of
      <contact fullname="Qian Xin"/>, who provided information about the
      implementation of this specification.
      </t>
    </section>
  </back>
</rfc>
