<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<rfc
      xmlns:xi="http://www.w3.org/2001/XInclude"
      category="std"
      docName="draft-ll-idr-flowspec-redirect-sidlist-00"
      ipr="trust200902"
      obsoletes=""
      updates=""
      submissionType="IETF"
      xml:lang="en"
      tocInclude="true"
      tocDepth="4"
      symRefs="true"
      sortRefs="true"
      version="3">


  <front>
    <title abbrev="Flow-Spec Redirect to SR Segment List">
      BGP Flow-Spec Redirect to SR Segment List Action
    </title>
    <seriesInfo name="Internet-Draft"
                value="draft-ll-idr-flowspec-redirect-sidlist-00"/>


    <author fullname="Yao Liu" surname="Liu">
      <organization>ZTE Corporation</organization>
      <address>
        <email>liu.yao71@zte.com.cn</email>
      </address>
    </author>

    <author fullname="Changwang Lin" surname="Lin">
      <organization>New H3C Technologies</organization>
      <address>
        <email>linchangwang.04414@h3c.com</email>
      </address>
    </author>	
	

    <date year="2026"/>

    <area/>
    <workgroup/>

    <keyword>BGP Flow Specification</keyword>
    <keyword>SR Policy</keyword>
    <keyword>Segment List</keyword>
    <keyword>Elephant Flow</keyword>

    <abstract>
      <t>BGP Flow Specification (Flow-spec) provides a mechanism for
      distributing traffic filtering and policy-based forwarding rules.
      Existing works enables traffic steering into an SR Policy.  However,
      in Artificial Intelligence (AI) network scenarios, "elephant flows"
      may require deterministic forwarding over specific segment lists
      within an SR Policy candidate path.</t>
      <t>This document specifies a new BGP Flow-spec Redirect action that
      identifies a specific segment list within an SR Policy.</t>
    </abstract>
  </front>

  <middle>
    <!-- 1. Introduction -->
    <section anchor="sec-introduction">
      <name>Introduction</name>
      <t>BGP Flow Specification (Flow-spec) <xref target="RFC8955"/>
      <xref target="RFC8956"/> is an extension to BGP that allows for the
      dissemination of traffic flow specification rules.  BGP Flow-spec
      Version 2 (FSv2) is defined in <xref target="I-D.ietf-idr-flowspec-v2"/>.</t>
      <t><xref target="RFC9256"/> details the concepts of Segment Routing
      (SR) Policy and steering into an SR Policy.  An SR Policy consists
      of one or more candidate paths, each comprising one or more segment
      lists.  As specified in <xref target="RFC9256"/>, if a set of segment lists is associated with the active path of the policy, then the
      steering is per flow and weighted-ECMP (W-ECMP) based according to
      the relative weight of each segment list.</t>
      <t>Traffic generated by AI training and sample transmission exhibits
      elephant flow characteristics.  Compared to ordinary traffic,
      elephant flows are characterized by high per-flow
      bandwidth, and long duration.  When the traffic carried by an SR
      Policy contains elephant flows, distributing traffic across segment
      lists randomly based on weights may cause elephant flows to be
      assigned to inappropriate segment lists, leading to network load
      imbalance, e.g., collocation with other large flows on shared
      links.</t>
      <t>Currently BGP-FS supports steering traffic into an SR Policy.
      <xref target="I-D.ietf-idr-ts-flowspec-srv6-policy"/> enables
      steering into an SR Policy using the address in the Redirect-to-IP
      action <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> as the
      endpoint and the color in the Color Extended Community
      <xref target="RFC9012"/> as the color of the target SR Policy.
      <xref target="I-D.ietf0-idr-srv6-flowspec-path-redirect"/> proposes a
      scheme that steers traffic into an SR Policy through a Binding SID.
      <xref target="I-D.li-idr-flowspec-sr-policy"/> defines a FSv2
      Redirect to SR Policy action directly using Policy Color and endpoint
      as the identifier.</t>
      <t>This document extends BGP-FS to allow traffic to be redirected to
      a specific segment list within an SR Policy candidate path.</t>

      <section anchor="sec-requirements-language">
        <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 anchor="sec-terminology">
        <name>Terminology</name>
        <t>This document uses terminology from <xref target="RFC8955"/>,
        <xref target="RFC9256"/>, and <xref target="RFC9857"/>.</t>
        <ul spacing="normal">
          <li>SR Policy: Segment Routing Policy, identified by
          &lt;headend, color, endpoint&gt;.</li>
          <li>Candidate Path: A specific path option for an SR Policy,
          with an associated preference value.</li>
          <li>Segment List: A specific SID stack that realizes a path;
          may have an associated weight for load balancing.</li>
          <li>Segment List ID: A 32-bit identifier assigned to a segment
          list, unique within the scope of a candidate path
          <xref target="RFC9857"/>.</li>
          <li>Elephant Flow: A long-lived, high-bandwidth traffic flow
          typical in AI/ML training data transfers and storage
          replication flows.</li>
        </ul>
      </section>
    </section>

    <!-- 2. Redirect to Segment List Action -->
    <section anchor="sec-action">
      <name>Redirect to Segment List Action</name>
      <t>This action instructs the headend to redirect matching traffic into
      a specific segment list of a specific candidate path of an SR Policy.</t>
      <t>This action is encoded as a Flow Specification v2 (FSv2) Action
      SubTLV carried in a Wide Community container
      <xref target="I-D.ietf-idr-wide-bgp-communities"/>.</t>

      <section anchor="sec-subtlv-format">
        <name>Action SubTLV Format</name>
        <t>The Redirect to Segment List action is encoded as a single FSv2
        Action SubTLV.</t>
        <t>Sub-Type:  TBD1 (2 octets)<br/>
        Length:    2 octets, indicating the total number of octets of the
        Value field.<br/>
        Value:     Variable, formatted as follows:</t>
        <figure anchor="fig-action-subtlv">
          <name>Redirect to Segment List Action SubTLV Format</name>
          <artwork type="ascii-art"><![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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |     Flags     |      AFI      |      Reserved                 |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 
     |                        Color (4 octets)                       |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ~                   Endpoint (4 or 16 octets)                   ~
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                     Protocol-Origin (4 octets)                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                     Originator( 20octets)                     |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                       Discriminator (4 octets)                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                     Segment List ID (4 octets)                |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
          ]]></artwork>
        </figure>

        <section anchor="sec-flags">
          <name>Flags Field</name>
          <t>The Flags field is 1 octet and defined as follows:</t>
          <figure anchor="fig-flags">
            <artwork type="ascii-art"><![CDATA[
      0 1 2 3 4 5 6 7
     +-+-+-+-+-+-+-+-+
     |F|R|  Reserved |
     +-+-+-+-+-+-+-+-+
            ]]></artwork>
          </figure>
          <t>F (Fallback Enabled - 1 bit):<br/>
          When set (1), the headend MUST perform the fallback procedure
          described in Section 3.2 if the designated segment list or
          candidate path becomes invalid or ceases to be the active
          candidate path.  When clear (0), the headend MUST NOT fall back.</t>
          <t>R (Recovery - 1 bit):<br/>
          When set (1), indicates that if the designated segment list
          later recovers, the headend SHOULD revert to pinning the traffic
          flow onto it.  When clear (0), the headend SHOULD NOT
          automatically revert.</t>
          <t>Reserved (6 bits):<br/>
          MUST be set to 0 on transmission and ignored on receipt.</t>
        </section>

        <section anchor="sec-sr-policy-id">
          <name>SR Policy Identification</name>
          <t>Color (4 octets):<br/>
          The Color value of the target SR Policy, an unsigned non-zero
          32-bit integer.</t>
          <t>AFI (2 octets):<br/>
          Address Family Identifier of the Endpoint.  Values are taken from
          IANA's "Address Family Numbers" registry.  This field determines
          the length of the Endpoint field:<br/>
          - 1 (IPv4): Endpoint = 4 octets<br/>
          - 2 (IPv6): Endpoint = 16 octets<br/>
          Other AFI values are reserved and MUST NOT be sent; if received,
          the entire Action SubTLV MUST be treated as malformed
          (Section 4).</t>
          <t>Endpoint (variable):<br/>
          The endpoint address of the SR Policy, encoded according to the
          AFI field.</t>
        </section>

        <section anchor="sec-candidate-path-id">
          <name>Candidate Path Identification</name>
          <t>Protocol-Origin (4 octets):<br/>
          The Protocol-Origin value of the candidate path.
          (See <xref target="RFC9256"/> Section 2.3.)</t>
          <t>Originator (20 octets):<br/>
          The Originator of the candidate path as specified in
          <xref target="RFC9256"/> Section 2.4.</t>
          <t>Discriminator (4 octets):<br/>
          The Discriminator of the candidate path, as defined in
          <xref target="RFC9256"/> Section 2.5.</t>
        </section>

        <section anchor="sec-segment-list-id">
          <name>Segment List Identification</name>
          <t>Segment List ID (4 octets):<br/>
          The identifier of the segment list within the candidate path.
          The value zero is reserved and MUST NOT be used; if received,
          the Action SubTLV MUST be treated as malformed.</t>
        </section>
      </section>
    </section>

    <!-- 3. Operational Considerations -->
    <section anchor="sec-operational">
      <name>Operational Considerations</name>
      <section anchor="sec-validation">
        <name>Validation and Installation</name>
        <t>Upon receipt of a Flow Specification route containing
        this Action SubTLV, the headend MUST perform the following steps
        in order:</t>
        <ol spacing="normal">
          <li>Resolve the SR Policy using &lt;Color, Endpoint&gt;.</li>
          <li>Locate the candidate path within that SR Policy that exactly
          matches &lt;Protocol-Origin, Originator, Discriminator&gt;.</li>
          <li>Verify that the candidate path is the active candidate path
          of the SR Policy (as in
          <xref target="RFC9256"/> Section 2.9) .</li>
          <li>Locate the segment list within that candidate path whose
          Segment List ID matches the value in the SubTLV.</li>
          <li>Verify that the segment list is valid as per
          <xref target="RFC9256"/> Section 5.</li>
        </ol>
        <t>If any of these steps fail, the Action SubTLV is considered
        invalid, and the Flow Specification rule continues to be processed
        as if this Action SubTLV were not present.  An implementation
        SHOULD log the validation failure.</t>
        <t>If all steps succeed, the headend installs a forwarding rule
        that redirects matching traffic exclusively to the designated
        segment list.  Traffic SHOULD NOT be load-balanced to other segment lists within the same candidate path.</t>
      </section>

      <section anchor="sec-fallback">
        <name>Fallback Behavior</name>
        <t>After successful installation, if the F-Flag is set and any
        of the following events occur:</t>
        <ul spacing="normal">
          <li>The designated segment list becomes invalid,</li>
          <li>The designated candidate path becomes invalid,</li>
          <li>The designated candidate path is no longer the active
          candidate path of the SR Policy.</li>
        </ul>
        <t>Then the headend MUST revert to ordinary SR Policy forwarding
        behavior as defined in <xref target="RFC9256"/>.</t>
        <t>An implementation SHOULD generate an alert to indicate that
        explicit path pinning is no longer in effect and the reason for
        fallback.</t>
      </section>

      <section anchor="sec-recovery">
        <name>Recovery Behavior</name>
        <t>If the R-Flag is set and the designated segment list later
        recovers (becomes valid again) while the designated candidate path
        remains active, the headend SHOULD revert to pinning the
        traffic flow onto the recovered segment list.</t>
        <t>An implementation MAY apply a configurable revert timer to
        avoid flapping.  During the reversion process, traffic MUST NOT be
        dropped.  The transition MAY be performed via make-before-break.</t>
        <t>If the R-Flag is clear, the headend SHOULD NOT automatically
        revert.  A controller MAY withdraw and re-advertise the Flow
        Specification route to re-establish pinning.</t>
      </section>
    </section>

    <!-- 4. Error Handling -->
    <section anchor="sec-error">
      <name>Error Handling</name>
      <t>A Redirect to SR Policy Segment List SubTLV is considered
      malformed if:</t>
      <ul spacing="normal">
        <li>The Length field does not match the expected size derived from
        the AFI and fixed fields.</li>
        <li>The AFI is not 1 (IPv4) or 2 (IPv6).</li>
        <li>The Segment List ID is zero.</li>
        <li>The Originator field does not comply with the encoding rules
        (e.g., non-zero high-order bits for an IPv4 address).</li>
        <li>The Protocol-Origin field has non-zero high-order 24 bits.</li>
      </ul>
	  
      <t>Malformed SubTLVs MUST be handled according to <xref target="RFC7606"/> as treat-as-withdraw.  The implementation SHOULD log the error.</t>
    </section>

    <!-- 5. IANA Considerations -->
    <section anchor="sec-iana">
      <name>IANA Considerations</name>
      <t>IANA is requested to assign a new Action Sub-Type value from the
      "BGP FSv2 Action types" registry (established by
      <xref target="I-D.ietf-idr-flowspec-v2"/>) for the action defined in
      this document.</t>
	  
	  		  <artwork align="center" name=""><![CDATA[
  Sub-Type          Name                         Reference
  --------------------------------------------------------
     TBD1    Redirect to SR Policy Segment List  [this document]   

           ]]></artwork>
	  

    </section>

    <!-- 6. Security Considerations -->
    <section anchor="sec-security">
      <name>Security Considerations</name>
      <t>The security considerations of <xref target="RFC8955"/>,
      <xref target="RFC9256"/>, and
      <xref target="I-D.ietf-idr-flowspec-v2"/> apply.</t>
      <t>The ability to pin traffic to a specific candidate path and
      segment list introduces additional risk.  A malicious controller
      could direct all elephant flows to a single segment list, causing
      link overload and congestion collapse.  Operators SHOULD:</t>
      <ul spacing="normal">
        <li>Implement per-session policies to restrict which BGP peers are
        allowed to send BGP-FS routes with this action.</li>
        <li>Limit the rate of BGP-FS updates to protect headend resources.</li>
      </ul>
    </section>


  </middle>


  <back>
    <references>
      <name>Normative References</name>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.7606.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8955.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.8956.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9012.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9256.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml/reference.RFC.9857.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-v2.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-wide-bgp-communities.xml"/>
    </references>

    <references>
      <name>Informative References</name>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-ts-flowspec-srv6-policy.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-flowspec-redirect-ip.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.ietf0-idr-srv6-flowspec-path-redirect.xml"/>
      <xi:include href="https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.li-idr-flowspec-sr-policy.xml"/>

    </references>
  </back>
</rfc>