<?xml version="1.0" encoding="utf-8"?>
<rfc
  xmlns:xi="http://www.w3.org/2001/XInclude"
  category="std"
  docName="draft-li-idr-bgp-sr-policy-state-report-00"
  ipr="trust200902"
  obsoletes=""
  updates=""
  sortRefs="true"
  consensus="true"
  submissionType="IETF"
  xml:lang="en"
  version="3">
  <front>
    <title abbrev="BGP SR Policy State Report">BGP SR Policy Extensions for State Report</title>
    <seriesInfo name="Internet-Draft" value="draft-li-idr-bgp-sr-policy-state-report-00" />
    <author fullname="Zhenqiang Li" initials="Z" role="editor" surname="Li">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <country>CN</country>
        </postal>
        <email>lizhenqiang@chinamobile.com</email>
      </address>
    </author>
    <author fullname="Liyan Song" initials="L" role="editor" surname="Song">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <country>CN</country>
        </postal>
        <email>songliyan@chinamobile.com</email>
      </address>
    </author>
    <author fullname="Guangchen Song" initials="G" role="editor" surname="Song">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <country>CN</country>
        </postal>
        <email>songguangchenjc@chinamobile.com</email>
      </address>
    </author>

    <date year="2026" />
    <area>Routing</area>
    <workgroup>Inter-Domain Routing</workgroup>
	<keyword>BGP</keyword>
    <keyword>SR Policy</keyword>
    <keyword>State Sub-TLV</keyword>
    <abstract>
      <t>This document extends BGP SR Policy, the same protocol used to configure SR Policies, to report operational state information of SR Policies, Candidate Paths, and Segment Lists.</t>
	  
	  <t>Optional State sub-TLVs, carried within the BGP Tunnel Encapsulation attribute, are introduced in this document to report the operational states (e.g., Down, Inactive, or Invalid) along with their associated reasons of the SR Policies from network elements to controller.</t>
	  
      <t>These extensions are restricted to operational state reporting and do not alter SR Policy computation, path selection procedures, or the operations of the base BGP protocol.</t>      
      
    </abstract>
  </front>
  <middle>
    <section numbered="true" toc="default">
      <name>Introduction</name>
      <t>In practice, BGP SR Policy <xref target="RFC9830"/> is usually used by controller to configure SR Policies <xref target="RFC9256"/> on the relevant network elements, i.e., the headends of the SR Policies. Deployments of SR Policies <xref target="RFC9256"/> require the controller to obtain accurate operational state information for instantiated policies. Such information is critical to policy lifecycle management, troubleshooting, and service assurance.</t>
      
      <t> Existing mechanisms for conveying SR Policy state include YANG notifications as defined in <xref target="I-D.ietf-spring-sr-policy-yang"/> and SR Policy State TLVs carried in BGP-LS, as specified in <xref target="RFC9857"/>. These approaches typically require additional protocol sessions between network elements and controllers, which increases operational complexity.</t>
      
      <t>This document extends BGP SR Policy <xref target="RFC9830"/>, the same protocol used to configure SR Policies, to report the operational states (e.g., Down, Inactive, or Invalid) along with their associated reasons of the SR Policies from network elements to controller, thereby reducing the number of protocols that need to be run between network elements and controller, lowering the requirements for network elements and controller, and simplifying network configuration and network operation and maintenance.</t>
      
      <t>This document does not update or obsolete <xref target="RFC9256"/>, <xref target="RFC9830"/>, <xref target="RFC9857"/>, or <xref target="RFC4271"/>. The extensions defined here are restricted to operational state reporting and do not alter existing protocol procedures or protocol semantics.</t>      

      <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" /> <xref target="RFC8174" />
          when, and only when, they appear in all capitals, as shown here.</t>
      </section>
    </section>
        
    <section numbered="true" toc="default">
      <name>Extensions to BGP SR Policy</name>
	  <t>This document defines optional State sub-TLVs carried within the BGP Tunnel Encapsulation Attribute (see section 2.1) to report the operational states (e.g., Down, Inactive, or Invalid) along with their associated reasons of the SR Policies from network elements to controller. The operational states and the associated reasons include those for SR Policies (see section 2.2), Candidate Paths(see section 2.3), and Segment Lists (see section 2.4).</t>

      <section numbered="true" toc="default">
      	<name>Encoding of SR Policy State Information</name>
      	<t>The extended BGP SR Policy encoding is as follows:</t>
      	<figure>
        <name>Extended BGP SR Policy Encoding</name>
        <artwork align="center"><![CDATA[       
      	SR Policy SAFI NLRI: <Distinguisher, Color, Endpoint>
      	Attributes:
      	  Tunnel Encapsulation Attribute(23)
            Tunnel Type: SR Policy(15)              
              Binding SID
              Preference
              Priority
              SR Policy Name
              SR Policy State
              SR Policy Candidate Path Name
              SR Policy Candidate Path State
              Explicit NULL Label Policy (ENLP)
              Segment List
                State
                Weight
                Segment
                Segment
                ...                   
              ...
           ]]></artwork>
      </figure>
        <t>The state sub-TLVs defined in this document follow a hierarchical
				model where Segment List state may influence Candidate Path state,
				and Candidate Path state may influence overall SR Policy state.
				The exact derivation procedures are implementation-specific.</t>      	
      </section>
      
      <section numbered="true" toc="default">
      	<name>Policy State sub-TLV</name>
      	<t>The Policy State sub-TLV is used to report the operational state of an SR Policy.
      	The format of Policy State sub-TLV is as follows: </t>
      	<figure>
        <name>Policy State sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         State(4 octets)                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        sub-TLVs(optional)                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Type (1 octet): Indicates this sub-TLV is Policy State, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Length in octets of the Value field.</t>
      	<t>Flags (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>State (4 octets): Indicates the operational state of the SR Policy. The format is as follows:</t>
      	<figure>
        <name>State Field for Policy State sub-TLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|A|D|                           RESERVED                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>A flag:</t>
      	<ul>
          <li>If A = 0: The SR Policy is in the administrative up state.</li>
		      <li>If A = 1: The SR Policy is administratively disabled.</li>
        </ul>
      	<t>D flag:</t>
      	<ul>
          <li>If D = 0: The SR Policy is in the up state.</li>
		      <li>If D = 1: The SR Policy is in the down state.</li>
        </ul>
      	<t>RESERVED: Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>The Policy State sub-TLV may optionally carry the following sub-TLVs: 
      	the Active Candidate Path sub-TLV and the Policy Down Reason sub-TLV.</t>
      	
      	<section numbered="true" toc="default">
      	<name>Active Candidate Path sub-TLV</name>
      	<t>The Active Candidate Path sub-TLV is used, when an active Candidate Path exists for the SR Policy,
      	to carry the candidate path that is currently active. Its format is as follows:</t>      	
      	<figure>
        <name>Active Candidate Path sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                 Binding SID(4 or 16 octets)                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Type (1 octet): Indicates this sub-TLV is Active Candidate Path, 
      	specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Active Candidate Path sub-TLV in octets.</t>
      	<t>Flags (1 octet): Indicates the type of Binding SID, its format is as follows:</t>
      	<figure>
        <name>Flags Field for Active Candidate Path Sub-TLV</name>
        <artwork align="center"><![CDATA[
       0 1 2 3 4 5 6 7
      +-+-+-+-+-+-+-+-+
      |S|  RESERVED   |
      +-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Where:</t>
        <ul>
          <li>If S = 0: Indicates the Binding SID is a 4-byte SR-MPLS BSID.</li>
		      <li>If S = 1: Indicates the Binding SID is a 16-byte SRv6 BSID.</li>
        </ul>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>   	
      	<t>Binding SID (4 or 16 octets): The Binding SID of the active 
      	candidate path.  The length is determined by the S bit in the 
      	Flags field.</t>      	
      	</section>      	
      	<section numbered="true" toc="default">
      	<name>Policy Down Reason Sub-TLV</name>
      	<t>The Policy Down Reason sub-TLV is used, when the SR Policy is in the down state, 
      	to carry the reason for the failure. Its format is as follows:</t>      	
      	<figure>
        <name>Policy Down Reason sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Reason(4 octets)                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Type (1 octet): Indicates this sub-TLV is Policy Down Reason, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Policy Down Reason sub-TLV in octets.</t>
      	<t>Flags (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>Reason (4 octet): Indicates the specific reason for the SR Policy failure. Its format is as follows:</t>      	
      	<figure>
        <name>Reason Field for Policy Down Reason sub-TLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|B|I|                       RESERVED                          |U|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>B flag:</t>
      	<ul>
          <li>If B = 0: Indicates the failure is not detected by BFD.</li>
		      <li>If B = 1: Indicates the SR Policy failure is due to BFD detecting the policy as unavailable.</li>
        </ul>
      	<t>I flag:</t>
      	<ul>
          <li>If I = 0: Indicates the failure is not detected after IGP convergence.</li>
		      <li>If I = 1: Indicates the SR Policy failure is due to the IGP 
      	detecting the policy as unavailable after convergence (e.g., the SID used by 
      	the SR Policy becomes unavailable following IGP convergence).</li>
        </ul>
      	<t>U flag:</t>
      	<ul>
          <li>If U = 0: The failure reason is known.</li>
		      <li>If U = 1: The failure reason is unknown.</li>
        </ul>
      	<t>RESERVED:Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>      	
      	</section>      	
      </section>      
      <section numbered="true" toc="default">
      	<name>Candidate Path State Sub-TLV</name>
      	<t>The Candidate Path State sub-TLV reports the operational state
				of an SR Policy Candidate Path. The format of the Candidate Path 
				State sub-TLV is as follows: </t>      	
      	<figure>
        <name>Candidate Path State sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         State(4 octets)                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        sub-TLVs(optional)                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Type (1 octet): Indicates this sub-TLV is Candidate Path State, 
      	specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Candidate Path State sub-TLV in octets.</t>
      	<t>Flags (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>State (4 octets): Indicates the operational state of the Candidate Path. The format is as follows:</t>      	
      	<figure>
        <name>State Field for Candidate Path State sub-TLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|A|D|S|B|V|I|                     RESERVED                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>A flag:</t>
      	<ul>
          <li>If A = 0: The candidate path is in the administrative up state.</li>
		      <li>If A = 1: The candidate path is in the administrative down state, 
      	meaning the path has been administratively configured as unavailable.</li>
        </ul>
      	<t>D flag:</t>
      	<ul>
          <li>If D = 0: The candidate path is in the up state.</li>
		      <li>If D = 1: The candidate path is in the down state.</li>
        </ul>      	
      	<t>S flag:</t>
      	<ul>
          <li>If S = 0: The candidate path is not the active path.</li>
		      <li>If S = 1: The candidate path is the active path selected by the SR Policy.</li>
        </ul>
      	<t>B flag:</t>
      	<ul>
          <li>If B = 0: The candidate path is not a backup path.</li>
		      <li>If B = 1: The candidate path is selected as a backup path.</li>
        </ul>
        <t>A candidate path SHOULD NOT have both S=1 and B=1.</t>
      	<t>V flag: Indicates configuration or structural validity.</t>
      	<ul>
          <li>If V = 0: The candidate path is considered invalid due to configuration or structural inconsistencies.</li>
		      <li>If V = 1: The candidate path has passed configuration and structural validity checks.</li>
        </ul>      	
      	<t>I flag: Indicates runtime operational invalidity.</t>
      	<ul>
          <li>If I = 0: No operational condition currently invalidates the candidate path.</li>
		      <li>If I = 1: The candidate path is considered operationally invalid
   				due to runtime conditions (e.g., detected packet loss, liveness
   				failure, or other operational impairments).</li>
        </ul>
      	<t>RESERVED: Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>      	
      	<t>The Candidate Path State sub-TLV may optionally carry the following sub-TLVs: 
      	the Candidate Path Down Reason sub-TLV 、the Candidate Path Inactive Reason sub-TLV and the Candidate Path Invalid Reason sub-TLV.</t>      	
      	<section numbered="true" toc="default">
      	<name>Candidate Path Down Reason sub-TLV</name>
      	<t>The Candidate Path Down Reason sub-TLV is used, when the candidate path is in the down state, 
      	to carry the reason for the failure. Its format is as follows:</t>      	
      	<figure>
        <name>Candidate Path Down Reason sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Reason(4 octets)                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Type (1 octet): Indicates this sub-TLV is Candidate Path Down Reason, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Candidate Path Down Reason sub-TLV in octets.</t>
      	<t>Flags (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>Reason (4 octet): Indicates the specific reason for the candidate path failure. The format is as follows:</t>
      	<figure>
        <name>Reason Field for Candidate Path Down Reason sub-TLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|B|I|                      RESERVED                           |U|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>B flag:</t>
      	<ul>
          <li>If B = 0: The failure is not detected by BFD.</li>
		      <li>If B = 1: The candidate path failure is due to BFD detecting the path as unavailable.</li>
        </ul>
      	<t>I flag:</t>
      	<ul>
          <li>If I = 0: The failure is not detected after IGP convergence.</li>
		      <li>If I = 1: The candidate path failure is due to the IGP detecting the path as unavailable after convergence (e.g., the SID used 
      	by the candidate path becomes unavailable following IGP convergence).</li>
        </ul>      	
      	<t>U flag:</t>
      	<ul>
          <li>If U = 0: The failure reason is known.</li>
		      <li>If U = 1: The failure reason is unknown.</li>
        </ul>
      	<t>RESERVED: Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>      	
      	</section>      	
      	<section numbered="true" toc="default">
      	<name>Candidate Path Inactive Reason sub-TLV</name>
      	<t>The Candidate Path Inactive Reason sub-TLV is used, when the candidate path is not 
      	selected by the SR Policy and is in the inactive state, to carry the reason 
      	for being inactive. Its format is as follows:</t>
      	<figure>
        <name>Candidate Path Inactive Reason sub-TLV</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     |    Length     |     RESERVED  |      Reason   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>      	
      	<t>Type (1 octet): Indicates this sub-TLV is Candidate Path Inactive Reason, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Candidate Path Inactive Reason sub-TLV in octets, 
      	excluding the Type and Length fields. The value is fixed to 2.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>Reason (1 octet): Indicates the reason why the candidate path is not selected. 
      	Values defined by this document are listed below. Additional values may be assigned by IANA.</t>      	      	
	  	<figure>
        <name>Reason for Candidate Path Inactive Reason Sub-TLV</name>
        <artwork align="center"><![CDATA[          
+------+---------------------------------------+
|Reason|         Description                   |
+------+---------------------------------------+
|   0  |            Reserved                   |
+------+---------------------------------------+
|   1  |         Lower priority                |
+------+---------------------------------------+
|   2  |        Lower protocol origin          |
+------+---------------------------------------+
|   3  |        Configuration-related          |
+------+---------------------------------------+
|   4  |       Lower Discriminator value       |
+------+---------------------------------------+
| 5-255|            Reserved                   |
+------+---------------------------------------+
            ]]></artwork>
      </figure>      	
      	</section>      	
      	<section numbered="true" toc="default">
      	<name>Candidate Path Invalid Reason sub-TLV</name>
      	<t>The Candidate Path Invalid Reason sub-TLV is used, when the candidate path fails validity 
      	check and is invalid, to carry the reason for being invalid.
      	Its format is as follows:</t>      	
      	<figure>
        <name>Candidate Path Invalid Reason sub-TLV</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     |    Length     |    RESERVED   |     Reason    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>Type (1 octet): Indicates this sub-TLV is Candidate Path Invalid Reason, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Candidate Path Invalid Reason sub-TLV in octets, 
      	excluding the Type and Length fields. The value is fixed to 2.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>Reason (1 octet): Indicates the reason why the candidate path is invalid. 
      	Values defined by this document are listed below. Additional values may be assigned by IANA.</t>       	      	
	  	<figure>
        <name>Reason for Candidate Path Invalid Reason Sub-TLV</name>
        <artwork align="center"><![CDATA[          
+------+----------------------------------------------------------+
|Reason|                           Description                    |        
+------+----------------------------------------------------------+
|   0  |                           Reserved                       |        
+------+----------------------------------------------------------+
|   1  |     Explicit Candidate Path has no valid segment list    |       
+------+----------------------------------------------------------+
|   2  |    Explicit Candidate Path contains a segment list       |
|      |       with mixed forwarding plane types                  |
+------+----------------------------------------------------------+
|   3  |   Dynamic Candidate Path cannot compute a path that      |
|      |               satisfies the constraints                  |
+------+----------------------------------------------------------+
|   4  |           Composite Candidate Path has no valid          |     
|      |                constituent SR Policy                     |
+------+----------------------------------------------------------+
| 5-255|                          Reserved                        |       
+------+----------------------------------------------------------+
            ]]></artwork>
      </figure>      	
      	</section>      	
      </section>      
      <section numbered="true" toc="default">
      	<name>Segment List State sub-TLV</name>      	
      	<t>The Segment List State sub-TLV reports the operational state
				of a Segment List.The format of Segment List State sub-TLV is as follows: </t>
      	<figure>
        <name>Segment List State sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         State(4 octets)                       |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        sub-TLVs(optional)                     |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>      	
      	<t>Type (1 octet): Indicates this sub-TLV is Segment List State, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Segment List State sub-TLV in octets.</t>
      	<t>Flags (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>State (4 octets): Indicates the operational state of the segment list. The format is as follows:</t>
      	<figure>
        <name>State Field for Segment List State sub-TLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|A|D|V|                      RESERVED                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>A flag:</t>
      	<ul>
          <li>If A = 0: The segment list is in the administrative up state.</li>
		      <li>If A = 1: The segment list is in the administrative down state, meaning it has been administratively configured 
      	as unavailable.</li>
        </ul>
      	<t>D flag:</t>
      	<ul>
          <li>If D = 0: The segment list is in the up state.</li>
		      <li>If D = 1: The segment list is in the down state.</li>
        </ul>
      	<t>V flag:</t>   
      	<ul>
          <li>If V = 0: The segment list has failed validity check.</li>
		      <li>If V = 1: The segment list has passed validity check and is valid.</li>
        </ul>      	 	
      	<t>RESERVED: Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>      	
      	<t>The Segment List State sub-TLV may optionally carry the following sub-TLVs: 
      	the Segment List Down Reason sub-TLV and the Segment List Invalid Reason sub-TLV.</t>      	
      	<section numbered="true" toc="default">
      	<name>Segment List Down Reason sub-TLV</name>
      	<t>The Segment List Down Reason sub-TLV is used, when the segment list is in the down state, 
      	to carry the reason for the failure. Its format is as follows:
      	</t>      	
      	<figure>
        <name>Segment List Down Reason sub-TLV</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     |    Length     |     Flags     |    RESERVED   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                         Reason(4 octets)                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>      	
        <t>Type (1 octet): Indicates this sub-TLV is Segment List Down Reason, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Segment List Down Reason sub-TLV in octets.</t>
      	<t>Flags (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>Reason (4 octet): Indicates the specific reason for the segment list failure. The format is as follows:</t>
      	<figure>
        <name>Reason Field for Segment List Down Reason sub-TLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|B|I|                     RESERVED                            |U|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>
      	<t>B flag:</t>
      	<ul>
          <li>If B = 0: The failure is not detected by BFD.</li>
		      <li>If B = 1: The segment list failure is due to BFD detecting the segment list as unavailable.</li>
        </ul>
      	<t>I flag:</t>
      	<ul>
          <li>If I = 0: The failure is not detected after IGP convergence.</li>
		      <li>If I = 1: The segment list failure is due to 
      	the IGP detecting the segment list as unavailable after convergence 
      	(e.g., the SID used in the segment list becomes unavailable following IGP 
      	convergence).</li>
        </ul>      	
      	<t>U flag:</t>
      	<ul>
          <li>If U = 0: The failure reason is known.</li>
		      <li>If U = 1: The failure reason is unknown.</li>
        </ul>
      	<t>RESERVED: Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>      	
      	</section>      	
      	<section numbered="true" toc="default">
      	<name>Segment List Invalid Reason sub-TLV</name>
      	<t>The Segment List Invalid Reason sub-TLV is used, when the segment list fails validity 
      	check and is invalid, to carry the reason for being invalid.
      	Its format is as follows:</t>      	
      	<figure>
        <name>Segment List Invalid Reason sub-TLV</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     |    Length     |    RESERVED   |     Reason    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
           ]]></artwork>
      </figure>      	
      	<t>Type (1 octet): Indicates this sub-TLV is Segment List Invalid Reason, specific values need to be assigned by IANA.</t>
      	<t>Length (1 octet): Indicates the length of the Segment List Invalid Reason sub-TLV in octets, 
      	excluding the Type and Length fields. The value is fixed to 2.</t>
      	<t>RESERVED (1 octet): Reserved bits MUST be set to 0 on transmission and ignored on receipt.</t>
      	<t>Reason (1 octet): Indicates the reason why the segment list is invalid. Values defined by this document are listed below. Additional values may be assigned by IANA.</t>       	
      	<figure>
        <name>Reason for Segment List Invalid Reason Sub-TLV</name>
        <artwork align="center"><![CDATA[          
+------+------------------------------------------------------+
|Reason|                       Description                    |
+------+------------------------------------------------------+
|   0  |                       Reserved                       |
+------+------------------------------------------------------+
|   1  |                 Segment list is empty                |
+------+------------------------------------------------------+
|   2  |              Segment list has a weight of 0          |
+------+------------------------------------------------------+
|   3  | Segment list contains a mix of SR-MPLS and SRv6 SIDs |
+------+------------------------------------------------------+
|   4  |           Resolution of the first SID failed         |
+------+------------------------------------------------------+
|   5  | Segment list contains a SID not present in the SRDB  |
+------+------------------------------------------------------+
|   6  |            Segment list contains inconsistent        |
|      |                  or incompatible SIDs                |
+------+------------------------------------------------------+
| 7-255|                        Reserved                      |
+------+------------------------------------------------------+
            ]]></artwork>
      </figure>      	
      	</section>      	
      </section>
    </section>    
    <section numbered="true" toc="default">
      <name>SR Policy State Originator Behavior</name>
      <t>A SR Policy State Originator, such as a network element acting as the headend node of a SR Policy, is a BGP SR Policy speaker that originates SR
			Policies state together with associated state information.</t>
      <t>The originator SHOULD determine the operational state of Segment Lists,
			Candidate Paths, and SR Policies based on local operational data.</t>
      <t>A change in Segment List state that affects the usability or validity
			of a Candidate Path SHOULD result in an update to the corresponding
			Candidate Path State sub-TLV.</t>
			<t>Similarly, when the state of one or more Candidate Paths affects SR
			Policy path selection or operational availability, the originator
			SHOULD update the Policy State sub-TLV accordingly.</t>
			<t>A change of the active Candidate Path for an SR Policy SHOULD be
			reflected in the Active Candidate Path sub-TLV.</t>
			<t>State changes MAY trigger BGP UPDATE messages, subject to local policy
			and report procedures.</t>
			
    </section>    
    <section numbered="true" toc="default">
      <name>SR Policy State Consumer Behavior</name>
      <t>An SR Policy State Consumer, such as a controller, is an entity that receives SR Policy
			state information via BGP SR Policy.</t>
      <t>A consumer:</t>
      	<ul>
          <li>MUST be capable of parsing Policy, Candidate Path, and Segment List
				  State sub-TLVs.</li>
		      <li>MAY use the received state information according to local policy or
  				operational objectives.</li>
        </ul>      
      <t>This document does not specify how the received state information is
			to be used by the consumer.</t>
    </section>    
    <section anchor="IANA">
      <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a
      guide.-->
      <name>IANA Considerations</name>
      <t>IANA is requested to assign new code points from the "BGP Tunnel
   		Encapsulation Attribute Sub-TLVs" registry for the following
   		sub-TLVs defined in this document:</t>
	  <table align="center">
		<name>New BGP Tunnel Encapsulation Sub-TLV Code Points for SR Policy State</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">Policy State 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">Active Candidate Path sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD3</td>
            <td align="left" colspan="1" rowspan="1">Policy Down Reason Sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD4</td>
            <td align="left" colspan="1" rowspan="1">Candidate Path State Sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD5</td>
            <td align="left" colspan="1" rowspan="1">Candidate Path Down Reason Sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD6</td>
            <td align="left" colspan="1" rowspan="1">Candidate Path Inactive Reason sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD7</td>
            <td align="left" colspan="1" rowspan="1">Candidate Path Invalid Reason sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD8</td>
            <td align="left" colspan="1" rowspan="1">Segment List State sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD9</td>
            <td align="left" colspan="1" rowspan="1">Segment List Down Reason sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
          <tr>
            <td align="left" colspan="1" rowspan="1">TBD10</td>
            <td align="left" colspan="1" rowspan="1">Segment List Invalid Reason sub-TLV</td>
            <td align="left" colspan="1" rowspan="1">This document</td>
          </tr>
        </tbody>
      </table>
    </section>
    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a
      guide. -->
      <name>Security Considerations</name>
      <t>This document introduces no new security considerations beyond 
      those already described for BGP <xref target="RFC4271"/> and BGP SR Policy <xref target="RFC9830"/>.</t>
    </section>
  </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.8174.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.9830.xml" />
 
        <!--?rfc include='reference.I-D.ietf-idr-flowspec-redirect-ip'?-->
		<!-- 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.9857.xml" />
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-spring-sr-policy-yang" />
        <!-- The recommended and simplest way to include a well known reference -->
      </references>
    </references>
   
  </back>
</rfc>
