<?xml version="1.0" encoding="utf-8"?>
<!-- 
     draft-rfcxml-general-template-standard-00
  
     This template includes examples of the most commonly used features of RFCXML with comments 
     explaining how to customise them. This template can be quickly turned into an I-D by editing 
     the examples provided. Look for [REPLACE], [REPLACE/DELETE], [CHECK] and edit accordingly.
     Note - 'DELETE' means delete the element or attribute, not just the contents.
     
     Documentation is at https://authors.ietf.org/en/templates-and-schemas
-->
<?xml-model href="rfc7991bis.rnc"?>  <!-- Required for schema validation and schema-aware editing -->
<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> -->
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-li-bgp-sr-policy-bfd-extension-00"
  ipr="trust200902"
  obsoletes=""
  sortRefs="true"
  updates=""
  submissionType="IETF"
  xml:lang="en"
  version="3">
<!-- [REPLACE] 
       * docName with name of your draft
     [CHECK] 
       * category should be one of std, bcp, info, exp, historic
       * ipr should be one of trust200902, noModificationTrust200902, noDerivativesTrust200902, pre5378Trust200902
       * updates can be an RFC number as NNNN
       * obsoletes can be an RFC number as NNNN 
-->

  <front>
    <title abbrev="SR Policy for  BFD Configuration">BGP SR Policy Extensions for  BFD Configuration</title>
    <!--  [REPLACE/DELETE] abbrev. The abbreviated title is required if the full title is longer than 39 characters -->

    <seriesInfo name="Internet-Draft" value="draft-li-bgp-sr-policy-bfd-extension-00"/> 
   
    <author fullname="Zhenqiang Li" initials="Z" role="editor" surname="Li">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>China Mobile</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>29 Finance Avenue, Xicheng District</street>
          <city>Beijing</city>
          <country>CN</country>
          <!-- Uses two letter country code -->
        </postal>        
        <email>lizhenqiang@chinamobile.com</email>  
        <!-- Can have more than one <email> element -->
      </address>
    </author>
	<author fullname="Song Liu" initials="S" role="editor" surname="Liu">
      <!-- [CHECK]
             * initials should not include an initial for the surname
             * role="editor" is optional -->
    <!-- Can have more than one author -->
      
    <!-- all of the following elements are optional -->
      <organization>China Mobile</organization>
      <address>
        <postal>
          <!-- Reorder these if your country does things differently -->
          <street>10 Manbai Road, Changping District</street>
          <city>Beijing</city>
          <country>CN</country>
          <!-- Uses two letter country code -->
        </postal>
        <email>liusongwl@chinamobile.com</email>  
        <!-- Can have more than one <email> element -->
        
      </address>
    </author>
   
    <date year="2026"/>
    <!-- On draft subbmission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>Routing</area>
    <workgroup>Inter-Domain Routing</workgroup>
    <!-- "Internet Engineering Task Force" is fine for individual submissions.  If this element is 
          not present, the default is "Network Working Group", which is used by the RFC Editor as 
          a nod to the history of the RFC Series. -->

    <keyword>BGP</keyword>
	<keyword>SR Policy</keyword>
	<keyword>BFD</keyword>
	<keyword>S-BFD</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>Segment Routing (SR) Policies require fast failure detection for Candidate Paths (CPs) to enable rapid rerouting and high availability.  Currently, the provisioning of SR Policies and the configuration of associated Bidirectional Forwarding Detection (BFD) or Seamless BFD (S-BFD) sessions are performed independently. 	This often necessitates separate mechanisms (e.g., manual configuration, NETCONF, or additional signaling) to associate BFD/S-BFD sessions with the SR Policies, resulting in complex and error-prone operations</t>

	  <t>This document defines extensions to BGP SR Policy for the simultaneous provisioning of SR Policy CPs and their BFD/S-BFD configuration parameters during policy advertisement.  The extensions include optional sub-TLVs within the Tunnel Encapsulation Attribute to carry BFD/S-BFD configuration parameters (e.g., discriminators, intervals, multipliers). </t>
	  
	  <t>These extensions simplify deployment in distributed or controller-based environments, reduce configuration overhead, and enhance operational efficiency for SR-based traffic engineering. </t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>Segment Routing (SR) <xref target="RFC8402"/> enables source routing by allowing a headend node to steer packet flows along specific paths using an ordered list of segments, 	eliminating intermediate per-path states.   An SR Policy <xref target="RFC9256"/> defines such paths as one or more Candidate Paths (CPs), each comprising one or more segment lists.</t>

	  <t>To ensure high availability and fast failure detection in SR networks, 	Bidirectional Forwarding Detection (BFD) <xref target="RFC5880"/> or Seamless BFD (S-BFD) <xref target="RFC7880"/> is commonly used to monitor SR Policy path liveliness.  However, current deployments configure SR Policies  and BFD/S-BFD sessions independently. Typically, an SR Policy Controller <xref target="RFC9256"/> defines the set of policies and advertises them to SR Policy headend routers (typically ingress routers) via BGP SR Policy <xref target="RFC9830"/>, or PCEP <xref target="RFC8664"/><xref target="RFC9603"/>. After SR Policies are advertised and installed, separate mechanisms (e.g., manual configuration, NETCONF/YANG, or additional signaling) are required to associate BFD/S-BFD parameters with the paths. This leads to increased operational complexity, longer provisioning times, and potential inconsistencies.</t>

	  <t><xref target="I-D.ietf-pce-pcep-bfd-parameters"/> extends PCEP <xref target="RFC5440"/> to carry S-BFD parameters, which can be used together with <xref target="RFC8664"/> or <xref target="RFC9603"/> to complete S-BFD configuration while distributing SR Policies.</t>

	  <t>This document extends BGP SR Policy <xref target="RFC9830"/> to carry BFD/S-BFD parameters.  These extensions enable simultaneous provisioning of SR Policies and their monitoring sessions, reducing separate configuration steps.</t>

      <t>BGP itself does not install SR Policy CPs or BFD/S-BFD sessions into the data plane; these actions remain the responsibility of the SR Policy Module (SRPM) on the headend node.</t>
      
      <section>
        <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>
      <!-- [CHECK] The 'Requirements Language' section is optional -->

    </section>
    
        <section anchor="extension">
      <name>BGP SR Policy Extensions for BFD/S‑BFD Configuration</name>
	  
      <t>This section defines extensions to BGP SR Policy that allow an SR Policy Candidate Path (CP)
        to be advertised together with the configuration parameters required to establish
        BFD <xref target="RFC5880"/> or S‑BFD <xref target="RFC7880"/> sessions for monitoring
        the liveness of the path.  The extensions are designed to be carried within the
        existing BGP SR Policy SAFI (73) and the Tunnel Encapsulation Attribute as specified
        in <xref target="RFC9830"/>.</t>
             
        <t>The BFD and S‑BFD configuration parameters are carried in new optional
          sub‑TLVs of the Tunnel Encapsulation Attribute <xref target="RFC9012"/>.
          These sub‑TLVs are applicable only for the SR Policy SAFI (AFI/SAFI 1/73
          or 2/73).  They MAY appear at most once in a given Tunnel Encapsulation
          Attribute; if multiple instances of the same sub‑TLV are present, only the
          first instance is processed and subsequent instances MUST be ignored. The Extended BGP SR Policy Encoding structure is as follows.</t>
        
	<figure>
        <name>Extended BGP SR Policy Encoding</name>
        <artwork align="center"><![CDATA[       
 SR Policy SAFI NLRl: <Distinguisher, Color, Endpoint>
 Attributes:
     Tunnel Encapsulation Attribute (23)
         Tunnel Type: SR Policy (15)              
             Binding SID
             Preference
             Priority
             BFD Parameters (This Document) 
             S‑BFD Parameters (This Document) 
             SR Policy Name
             SR Policy Candidate Path Name
             Explicit NULL Label Policy (ENLP)
             Segment List
                 Weight
                 Segment
                 Segment
                 ...                   
             ...
           ]]></artwork>
      </figure>

        <t>The introduced sub‑TLVs in this document are not used by the BGP path selection process. They are passed unchanged to the SRPM on the headend node, which is
          responsible for validating the parameters and instantiating the corresponding BFD/S‑BFD sessions.</t>
        

        <section>
          <name>BFD Parameters Sub‑TLV</name>
          <t>The BFD Parameters sub‑TLV carries the configuration parameters needed to establish a BFD session for monitoring the SR Policy CP. The format of this BFD Parameters Sub-TLV is as follows.</t>
          
          <figure align="center">
            <name>BFD Parameters Sub‑TLV Format</name>
            <artwork align="center"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Type (TBD1) |    Length     |    Flags      |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Vers |   Diag  |Sta|P|F|C|A|D|M|   Detect Mult |    Length     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     My Discriminator                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Your Discriminator                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Desired Min TX Interval                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Required Min RX Interval                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Required Min Echo RX Interval                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>
          </figure>
          
          <t>Type: To be assigned by IANA from the "BGP Tunnel Encapsulation
                Attribute Sub‑TLVs" registry (suggested value 21).</t>
          <t>Length: Length of the value field in octets.  MUST be 24.</t>
          <t>Flags: 1 octet.  Bits 0‑7 are reserved and MUST be set to zero
                on transmission and ignored on receipt.</t>
          <t>Reserved: 1 octet.  MUST be set to zero on transmission and ignored on receipt.</t>
          
		  <t>Other parameters have the same meaning as defined in <xref target="RFC5880"/>.</t>
		  
        </section>
        
        <section>
          <name>S‑BFD Parameters Sub‑TLV</name>
          <t>The S‑BFD Parameters sub‑TLV carries the configuration parameters needed to
            establish a S‑BFD session for monitoring the SR Policy CP.  The format of this S-BFD Parameters Sub-TLV is as follows.</t>
          
          <figure align="center">
            <name>S‑BFD Parameters Sub‑TLV Format</name>
            <artwork align="center"><![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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   Type (TBD2) |    Length     |    Flags      |   Reserved    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Vers |   Diag  |Sta|P|F|C|A|D|M|   Detect Mult |    Length     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                     My Discriminator                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Your Discriminator                         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                  Desired Min TX Interval                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Required Min RX Interval                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               Required Min Echo RX Interval                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
            ]]></artwork>
          </figure>
          
          <t>Type: To be assigned by IANA from the "BGP Tunnel Encapsulation
                Attribute Sub‑TLVs" registry (suggested value 22).</t>
          <t>Length: Length of the value field in octets.  MUST be 24.</t>
          <t>Flags: 1 octet.  Bits 0‑7 are reserved and MUST be set to zero
                on transmission and ignored on receipt.</t>
          <t>Reserved: 1 octet.  MUST be set to zero on transmission and ignored on receipt.</t>
          
		  <t>Other parameters have the same meaning as defined in <xref target="RFC7880"/>.</t>
          
          <t>When establishing an S‑BFD session, the headend typically acts as an initiator
            and the endpoint as a reflector, as described in Section 3 of <xref target="RFC7880"/>.
            My Discriminator field contains the discriminator that will be used by
            the initiator, while Your Discriminator field specifies the
            reflector's discriminator.</t>
        </section>
        
    </section>

	 <section anchor="behavior">
        <name>BGP SR Policy Speaker Behavior</name>
        <t>A BGP SR Policy speaker that receives an SR Policy UPDATE containing BFD/S‑BFD sub‑TLVs
          MUST perform the following steps:</t>
        
        <ol>
          <li>If the BFD/S‑BFD sub‑TLVs are malformed (e.g., length inconsistent, reserved fields non‑zero), 
            the UPDATE MUST be handled according to the "treat‑as‑withdraw" strategy <xref target="RFC7606"/>.</li>
          <li>If multiple BFD‑related sub‑TLVs (BFD Parameters, S‑BFD Parameters) are present in the same
            UPDATE, only the first one is processed and subsequent ones MUST be ignored.</li>
          <li>If the sub‑TLVs are syntactically valid, the speaker MUST pass them unchanged
            to the SRPM together with the rest of the SR Policy CP information.</li>
        </ol>
        
        <t>The SRPM on the headend node is responsible for interpreting the BFD/S‑BFD
          parameters and instantiating the corresponding monitoring sessions in the
          data plane.  If the SRPM cannot support a requested parameter (e.g., an
          interval value below its hardware capability), it SHOULD log an error and
          MAY fall back to locally configured defaults or disable BFD/S‑BFD for that CP.</t>
        
      </section>
    
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document defines new Sub‑TLVs for the BGP Tunnel Encapsulation Attribute that enable BFD/S‑BFD configuration to be advertised along with SR Policy Candidate Paths.</t>
      
        <t>IANA is requested to allocate two new code points in the "BGP Tunnel Encapsulation Attribute Sub‑TLVs" registry:</t>
        
       <table align="center">
		<name>BGP Tunnel Encapsulation Attribute Sub-TLV Values</name>
        <thead>
        <!-- [REPLACE/DELETE] a table header is optional -->
          <tr>
			<th align="left" colspan="1" rowspan="1">Code Point</th>
            <th align="left" colspan="1" rowspan="1">Description</th>
            <th align="left" colspan="1" rowspan="1">Reference</th>
		  </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD1</td>
            <td align="left" colspan="1" rowspan="1">BFD Parameters Sub‑TLV </td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
		  <tr>
            <td align="left" colspan="1" rowspan="1">TBD2</td>
            <td align="left" colspan="1" rowspan="1">S‑BFD Parameters Sub‑TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
        </tbody>
      </table>
        
        <t>The suggested values are 21 for BFD Parameters Sub‑TLV, 22 for S‑BFD Parameters Sub‑TLV.</t>

    </section>
    
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>The security considerations of BGP <xref target="RFC4271"/>, BGP SR Policy <xref target="RFC9830"/>,
        BFD <xref target="RFC5880"/>, and S‑BFD <xref target="RFC7880"/> apply to this document.</t>
      
      <t>Advertisements of BFD/S‑BFD parameters via BGP SR Policy may expose sensitive network information,
        such as failure detection capabilities, session intervals, and discriminator values.
        These advertisements should be confined within trusted administrative domains to prevent
        information disclosure.</t>
      
      <t>Malicious modification of BFD/S‑BFD parameters in BGP SR Policy advertisements could lead to
        denial of service or reduced monitoring effectiveness. For example, setting extremely
        short intervals might overwhelm network resources, while setting inappropriate discriminators
        could prevent session establishment. Implementations should validate received parameters
        against acceptable ranges before applying them.</t>
      
      <t>Unauthorized configuration of BFD/S‑BFD sessions could be used to create false
        failure indications or hide actual failures. Network operators should ensure that
        BGP SR Policy sessions carrying BFD/S‑BFD configuration parameters are properly authenticated
        and authorized.</t>
      
      <t>For BFD/S‑BFD sessions established based on the parameters advertised via BGP SR Policy,
        the security mechanisms defined in <xref target="RFC5880"/> and <xref target="RFC7880"/>
        should be used to protect against session spoofing and unauthorized access.
        This includes using authentication where appropriate.</t>
    </section>
    
    <!-- NOTE: The Acknowledgements and Contributors sections are at the end of this template -->
  </middle>

  <back>
    <references>
      <name>References</name>
      <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.5880.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7880.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.9012.xml"/>   
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9830.xml"/>
	
        <!-- The recommended and simplest way to include a well known reference -->
        
      </references>
	  
	  <references>
        <name>Informative References</name>
        
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.5440.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7606.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8402.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8664.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9603.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-pce-pcep-bfd-parameters.xml" />
		
        <!-- The recommended and simplest way to include a well known reference -->
        
      </references>

    </references>
    
 </back>
</rfc>
