<?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-idr-flowspec-sr-policy-03"
  ipr="trust200902"
  obsoletes=""
  sortRefs="true"
  consensus="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="Flowspec Redirects to SR Policy">BGP Flowspec Redirects to SR Policy</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-idr-flowspec-sr-policy-03"/> 
   
    <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 Flowspec</keyword>
	<keyword>SR Policy</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>BGP Flowspec, an extension of BGP, facilitates the distribution of traffic flow specification 
		  rules and supports steering traffic into Segment Routing (SR) Policies. However, current 
		  approaches that leverage Flowspec to direct traffic toward a SR Policy exhibit certain 
		  limitations (for detailed analysis, refer to Section 1).</t>
	  
	  <t>Using the Community Container attribute, this document defines two new standard actions 
		  for the BGP Flowspec Version 2 (FSv2) protocol: the Redirect to SR Policy Action and the 
		  SRv6 SID Action. The former enables traffic to be directed to a designated SR Policy, 
		  while the latter supports encapsulating an additional SRv6 SID as required during redirection.</t>
	  
	  <t>The Redirect to SR Policy Action may be used either independently or in conjunction with 
		  the SRv6 SID Action, depending on the specific application scenario. In addition, the SRv6 
		  SID Action can be combined with other actions supported by FSv2, such as the Redirect to IPv6 Action.</t>
	  
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
      <t>BGP Flow Specification (Flowspec) is defined in <xref target="RFC8955"/> and <xref target="RFC8956"/>. 
		  BGP Flowspec Version 2 (FSv2) is defined in <xref target="I-D.ietf-idr-flowspec-v2"/>, and 
		  SR Policy is defined in <xref target="RFC9256"/>.</t>
	  
	  <t>BGP Flowspec can be used to steer specific traffic into a SR Policy, as illustrated in documents 
		  such as <xref target="I-D.ietf-idr-ts-flowspec-srv6-policy"/> and <xref target="I-D.ietf0-idr-srv6-flowspec-path-redirect"/>.</t>
	  
	  <t>The method proposed in <xref target="I-D.ietf-idr-ts-flowspec-srv6-policy"/> leverages the 
		  Redirect-to-IP action defined in <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>. It embeds 
		  the endpoint information of the SR Policy within the Redirect-to-IP action, and in this scenario, 
		  requires the BGP Flowspec protocol to carry color information via BGP attributes, with prefix SID 
		  information included as needed. This method adds a new action (Redirect to SR Policy) to the 
		  originally singular "Redirect to IP" action. While reusing attributes or fields defined for other 
		  purposes simplifies implementation, it can introduce ambiguity. Notably, the newly added 
		  "Redirect to SR Policy" action can only be distinguished by whether BGP attributes include the 
		  Color Extended Community attribute. Since the Color Extended Community attribute is optional, 
		  it may lead to errors in the following scenarios: (1) "Redirect to SR Policy" may fail if the 
		  Color Extended Community attribute is missing; (2) "Redirect to IP" may fail if the Color 
		  Extended Community attribute is present. Additionally, <xref target="I-D.ietf-idr-ts-flowspec-srv6-policy"/> 
		  is an informational document, not a standard solution for steering traffic into a SR Policy.</t>
	  
	  <t><xref target="I-D.ietf0-idr-srv6-flowspec-path-redirect"/> proposes a scheme that indirectly 
		  steers traffic into a SR Policy through a Binding SID (BSID). However, this approach requires 
		  prior knowledge of the BSID corresponding to the target SR Policy, which imposes significant 
		  operational overhead. Furthermore, as explicitly stated in <xref target="RFC9256"/>, not 
		  all SR Policies are mandated to have a BSID, and the specific value of a BSID may change over 
		  time and with state. Therefore, <xref target="RFC9256"/> specifically notes that the BSID 
		  should not be used as an identifier for a SR Policy. Consequently, the scheme proposed in 
		  <xref target="I-D.ietf0-idr-srv6-flowspec-path-redirect"/> is technically unfeasible.</t>
	  
	  <t>To address the drawbacks mentioned above, this document extends FSv2 by defining two new standard 
		  traffic filtering actions: the Redirect to SR Policy Action and the SRv6 SID Action. These
		  actions are carried in the Community Container attribute <xref target="I-D.ietf-idr-wide-bgp-communities"/> 
		  and specifically defined for steering traffic into a SR Policy. The SRv6 SID Action is optional 
		  in this use case. It may be used in conjunction with the Redirect to SR Policy Action or other 
		  actions defined in FSv2 when needed.</t>
      
	  <t>The current version of this document focuses on FSv2 extensions for SRv6 Policy. FSv2 extensions 
		  for SR-MPLS Policy will be provided in a later version or written in a separate draft.</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>
      <name>FSv2 Extension</name>
	  <t>This document defines two new traffic filtering actions: the Redirect to SR Policy Action and 
		  the SRv6 SID Action. The SRv6 SID Action is optional for the redirect-to-SR Policy use case. 
		  It may be used in conjunction with the Redirect to SR Policy Action or other actions defined 
		  in FSv2 when needed.</t> 
	
	  <t>The filtering actions defined in this document are encapsulated and carried via the BGP 
		  Community Container Attribute (also known as BGP Wide Communities) <xref target="I-D.ietf-idr-wide-bgp-communities"/>. 
		  The definition and format of an Action-SubTLV within the BGP Community Container Attribute 
		  are presented in Figure 1.</t>
	  
	  <figure align="center">
		<name>Format of the Action-SubTLV</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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      SubTLV Type (2 octets)   |        Length (2 octets)      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Value (variable)   |        
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
		]]></artwork>
	  </figure>

      <section>
        <name>Redirect to SR Policy Action</name>	
	    <t>The newly defined Redirect to SR Policy Action in this document is represented by the Action-SubTLV.</t>
	    <t>Where:</t>
		<t>SubTLV Type (2 octet): Used to indicate that this Action-SubTLV is a Redirect to SR Policy Action SubTLV. Its value is requested to be assigned by IANA.</t>
	    <t>Length (2 octet): Measured in byte, used to indicate the total length of the Redirect to SR Policy Action.</t> 
	    <t>Value (variable): Used to specify the particular SR policy to which the traffic is to be directed. Its format is shown in Figure 2.</t>
		<t>Conflicts/Interactions: Any redirection or traffic sampling actions:</t>
			<ul>
		    	<li>Traffic Action (action 0x8007, <xref target="RFC8955"/>)</li>		
				<li>Interface Set (action 0x0702,  0x4702, <xref target="I-D.ietf-idr-flowspec-interfaceset"/>)</li>
				<li>Redirect to Route Target (action 0x8008, 0x8108, 0x8208, 0x000D, <xref target="RFC8955"/><xref target="RFC8956"/>)</li>
				<li>Flow Specification for SFC Classifiers (action 0x800D, <xref target="RFC9015"/>)</li>
				<li>Redirect to IPv4 (action 0x010C, <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>)</li>
				<li>Redirect to IPv6 (action 0x000C, <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>)</li>
				<li>Redirect to 32-bit Path-id (action 0x0900, <xref target="I-D.ietf-idr-flowspec-path-redirect"/>)</li>	
		  	</ul>

		<figure align="center">
		  <name>Format of the Value Field in the Redirect to SR Policy Action</name>
		  <artwork align="center"><![CDATA[
+-------------------------------+
|          Flags (1 octet)      |
+-------------------------------+
|     Policy Color (4 octets)   |
+-------------------------------+
|     Endpoint (4 or 16 octets) |
+-------------------------------+
			]]></artwork>
		</figure>

		<t>Where:</t>
		<t>Flags (1 octet): Currently, two bits are defined: the S bit and the F bit. The other bits are reserved.
			The S bit and the F bit are used to indicate the type of Endpoint, as shown in Figure 3.</t>
		<t>Policy Color (4 octets): The color value of the SR policy <xref target="RFC9256"/> to which traffic is to be directed. </t>	
		<t>Endpoint (4 or 16 octets): The endpoint of the SR policy <xref target="RFC9256"/> to which traffic is to be directed. 
			When the SR policy's endpoint is represented by an IPv6 address, the Endpoint field is 16 bytes in length, and the S bit in the Flags field is set to 1. 
			When the SR policy's endpoint is represented by an IPv4 address, the Endpoint field is 4 bytes in length, and the F bit in the Flags field is set to 1.</t>
	  
	  
		<figure align="center">
		  <name>Format of the Flags Field</name>
		  <artwork align="center"><![CDATA[
 0 1 2 3 4 5 6 7 
+-+-+-+-+-+-+-+-+
| Reserved  |S|F|        
+-+-+-+-+-+-+-+-+
			]]></artwork>
		</figure>
		<t>Where:</t>
		<t>S Flag (1 bit): Means Six. When set to 1, it indicates that the Endpoint in the Value Field is represented by an IPv6 address.</t> 
		<t>F Flag (1 bit): Means Four. When set to 1, it indicates that the Endpoint in the Value Field is represented by an IPv4 address.</t> 
		<t>Reserved (6 bits): These bits are reserved for future use. They are set to 0 when sending and ignored when receiving.</t>
		<t>Exactly one of the S bit and F bit SHOULD be set to 1.</t>
	  </section>
	  
	  <section>
		<name>SRv6 SID Action</name>
		<t>In certain scenarios, when redirecting specific traffic to a SR Policy for forwarding, the headend 
			node must also encapsulate an additional SRv6 SID. For instance, if the last SID in the SR policy 
			path is not USD (Ultimate Segment Decapsulation) flavored <xref target="RFC8986"/>, an additional 
			SRv6 SID is required to be encapsulated by the headend node to instruct the endpoint node to 
			decapsulate the outer packet header. </t>
		  
		<t>To address this requirement, we define the second new filtering action for the FSv2, the SRv6 SID 
			Action. This action is optional and may be used in conjunction with the Redirect to SR Policy 
			Action when necessary. It is important to note that the Redirect to SR Policy Action can be used 
			independently, while the SRv6 SID Action may also be combined with other actions defined in FSv2.</t>
		
		<t>The newly defined SRv6 SID Action in this document is represented by the Action-SubTLV (as shown in Figure 1).</t>
		<t>Where:</t>
		<t>SubTLV Type (2 octet): Used to indicate that this Action-SubTLV is a SRv6 SID Action SubTLV. Its value is requested to be assigned by IANA.</t>
	    <t>Length (2 octet): Measured in byte, used to indicate the total length of the SRv6 SID Action.</t> 
	    <t>Value (variable): Used to carry the specific SRv6 SID information. Its format is shown in Figure 4.</t>
	    <t>Conflicts/Interactions: Any redirection actions:</t>
			<ul>
		    	<li>Redirect to SR Policy (action TBD, this document)</li>
				<li>Redirect to Route Target (action 0x8008, 0x8108, 0x8208, 0x000D, <xref target="RFC8955"/><xref target="RFC8956"/>)</li>
				<li>Flow Specification for SFC Classifiers (action 0x800D, <xref target="RFC9015"/>)</li>
				<li>Redirect to IPv4 (action 0x010C, <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>)</li>
				<li>Redirect to IPv6 (action 0x000C, <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>)</li>
				<li>Redirect to 32-bit Path-id (action 0x0900, <xref target="I-D.ietf-idr-flowspec-path-redirect"/>)</li>	
		  	</ul>
	  
		<figure align="center">
		  <name>Format of the Value Field in the SRv6 SID Action</name>
		  <artwork align="center"><![CDATA[
+-------------------------------+
|        Action (1 octet)       |
+-------------------------------+
|      SRv6 SID (16 octets)     |
+-------------------------------+
		  ]]></artwork>
		</figure>

		<t>Where:</t>
		<t>Action (1 octet): Currently, the value of 1 is defined, which represents encapsulation, 
			indicating that the headend node SHOULD encapsulate an additional SRv6 SID carried in 
			the SRv6 SID field when performing the redirect action. The other 255 possible values 
			are reserved for future extensions.</t>
	  
		<t>SRv6 SID (16 octets): Its value represents a specific SRv6 SID. The type of this SRv6 SID 
			may be DT4, DT6, DT46, etc., or alternatively an END SID with the USD flavor, as specified 
			in <xref target="RFC8956"/>.</t>
	 
	  </section>
	  
    </section>
    
     <section>
      <name>Application Scenario</name>
	  <t>When the headend node receives a BGP Flowspec policy containing the Redirect to SR Policy Action 
		  issued through the extended FSv2 protocol, it configures the corresponding policy. Upon receiving 
		  traffic matching the policy, the headend node forwards the matching traffic to the corresponding 
		  SR Policy as required by the policy, i.e., encapsulates the traffic in SR and forwards the 
		  encapsulated traffic to the corresponding forwarding node via the interface specified by the policy. 
		  If the policy received by the headend node, issued through the extended FSv2 protocol, contains 
		  both the Redirect to SR Policy Action and the SRv6 SID Action, the headend node configures the 
		  policy accordingly. Upon receiving traffic matching the policy, the headend node performs both 
		  the redirection to the SR policy and the action specified by the SRv6 SID action, such as further 
		  encapsulating the SRv6 SID carried in the SRv6 SID action.</t>
	  

      <t>The forwarding node forwards the packet based on the header information upon receiving the packet. 
	  This document does not introduce any new requirements or extensions for the forwarding node.</t>
	  
	  <t>When traffic arrives at the endpoint node, the endpoint node processes and forwards the packet 
		  based on the header information of the received packet. This document introduces no new 
		  requirements or extensions for the endpoint node. Even if the received packet contains a SRv6 SID 
		  encapsulated by the headend node according to the SRv6 SID Action, the endpoint node will perform 
		  the operations corresponding to the instructions of the SRv6 SID. Examples of such operations 
		  include: removing the SRv6 Policy encapsulation (i.e., decapsulating the outer IPv6 header), 
		  looking up the destination address of the inner packet header in the routing table, and forwarding 
		  the packet accordingly. These operations are all part of the endpoint node’s normal processing 
		  procedures. The endpoint node is unaware that the SID it processes was additionally encapsulated 
		  by the headend node per the SRv6 SID Action. In summary, this document imposes no new requirements 
		  or extensions on the endpoint node.</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 the following code points from the "BGP FSv2 Action types" Registry:
	  </t>

	  <table align="center">
		<name>Code Point for the Actions</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">Redirect to SR Policy Action</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">SRv6 SID Action</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 does not change the security properties of SR Policy <xref target="RFC9256"/> or BGP Flowspec <xref target="RFC8955"/><xref target="RFC8956"/><xref target="I-D.ietf-idr-flowspec-v2"/>.</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/bibxml3/reference.I-D.ietf-idr-flowspec-v2.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-wide-bgp-communities.xml"/>
      </references>
	  
	  <references>
        <name>Informative References</name>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4360.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.4760.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8955.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8956.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8986.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9015.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-redirect-ip.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf0-idr-srv6-flowspec-path-redirect.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-ts-flowspec-srv6-policy.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-interfaceset.xml"/>
		<xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-path-redirect.xml"/>

      </references>

    </references>
    


    <section anchor="Acknowledgements" numbered="false">
      <!-- [REPLACE/DELETE] an Acknowledgements section is optional -->
      <name>Acknowledgements</name>
      <t>The authors would like to express their gratitude for the support from Cheng Chang and Bo Liu.</t>
	  <t>Zheng Zhang, Jie Dong provide valueable comments to this document.</t>
	</section>
    
 </back>
</rfc>
