<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-idr-ts-flowspec-srv6-policy-14"
     ipr="trust200902" updates="">
  <front>
    <title abbrev="FlowSpec with SR Policy">Traffic Steering using BGP
    FlowSpec with SR Policy</title>

    <author fullname="Wenying Jiang" initials="W. " surname="Jiang">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street>No.32 XuanWuMen West Street</street>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>jiangwenying@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Yisong Liu" initials="Y. " surname="Liu">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street>No.32 XuanWuMen West Street</street>

          <city>Beijing</city>

          <code>100053</code>

          <country>China</country>
        </postal>

        <email>liuyisong@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Shunwan Zhuang" initials="S." surname="Zhuang">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>zhuangshunwan@huawei.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Gyan Mishra" initials="G." surname="Mishra">
      <organization>Verizon Communications Inc.</organization>

      <address>
        <postal>
          <street>13101 Columbia Pike</street>

          <city>Silver Spring, MD 20904</city>

          <region/>

          <code/>

          <country>United States of America</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>gyan.s.mishra@verizon.com</email>

        <uri/>
      </address>
    </author>

    <author fullname="Shuanglong Chen" initials="S." surname="Chen">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <region/>

          <code>100095</code>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>chenshuanglong@huawei.com</email>

        <uri/>
      </address>
    </author>

    <date day="21" month="August" year="2026"/>

    <area>Routing</area>

    <workgroup>IDR Working Group</workgroup>

    <abstract>
      <t>BGP Flow Specification (FlowSpec) provides mechanisms to distribute
      traffic filtering and steering rules across BGP networks. This document
      specifies extensions to BGP Flow Specification (RFC 8955, RFC 8956) to
      steer matching traffic flows into Segment Routing (SR) Policies (RFC
      9256). Specifically, it defines normative protocol procedures for
      combining FlowSpec Network Layer Reachability Information (NLRI) (RFC
      8955, RFC 8956) with the BGP Prefix-SID Attribute (RFC 8669, RFC 9252)
      and specific BGP Extended Communities (RFC 9012) to signal SR-MPLS and
      SRv6 Policy steering pathways.</t>

      <t/>
    </abstract>

    <note title="Requirements Language">
      <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>

      <t/>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Segment Routing (SR) <xref target="RFC8402"/> leverages the source
      routing paradigm for both SR-MPLS <xref target="RFC8660"/> and SRv6
      <xref target="RFC8754"/><xref target="RFC8986"/>. An SR Policy <xref
      target="RFC9256"/> defines an explicit ordering of segments to steer
      traffic through a network, where candidate paths may be signaled via
      protocols such as BGP <xref target="RFC9830"/> or PCEP <xref
      target="RFC9862"/>, or instantiated locally.</t>

      <t><xref target="RFC8955"/>, <xref target="RFC8956"/> and <xref
      target="RFC9117"/> define the BGP <xref target="RFC4271"/> Flow
      Specification that allows conveying Flow Specifications and traffic
      Action/Rules associated (rate- limiting, redirect, remark ...). BGP Flow
      Specifications are encoded within the MP_REACH_NLRI and MP_UNREACH_NLRI
      attributes <xref target="RFC4760"> </xref>. Rules (Actions associated)
      are encoded in Extended Community attributes <xref target="RFC4360">
      </xref>. The BGP Flow Specification function allows BGP Flow
      Specification routes that carry traffic policies to be transmitted to
      BGP Flow Specification peers to steer traffic.</t>

      <t/>

      <t>This document specifies extensions to BGP Flow Specification
      (FlowSpec) <xref target="RFC8955"/><xref target="RFC8956"/> to steer
      matching traffic flows into a Segment Routing (SR) Policy <xref
      target="RFC9256"/>.</t>

      <t/>

      <t>This document does not modify the base Segment Routing architecture
      <xref target="RFC8402"/> or SR Policy constructs <xref
      target="RFC9256"/>, but rather establishes the interworking protocol
      semantics between BGP FlowSpec controllers and SR Headends on the
      Standards Track.</t>

      <t/>
    </section>

    <section title="Definitions and Acronyms">
      <t><list style="symbols">
          <t>BGP FS: BGP Flow Specification [RFC8955] [RFC8956]</t>

          <t>CO: Color-Only</t>

          <t>FlowSpec: Flow Specification</t>

          <t>NLRI: Network Layer Reachability Information.</t>

          <t>PBR: Policy-Based Routing.</t>

          <t>Redirect-to-IP: The FlowSpec action defined in
          [I-D.ietf-idr-flowspec-redirect-ip]</t>

          <t>SR: Segment Routing</t>

          <t>SR-MPLS: SR over the MPLS data plane</t>

          <t>SRv6: SR over the IPv6 data plane</t>

          <t>SID: Segment Identifier</t>

          <t>SRH: Segment Routing Header</t>

          <t>Transport Steering Only (Mode 1): A mode of FlowSpec steering
          operation where traffic is directed into an SR Policy (SR-MPLS or
          SRv6) toward a TailEnd endpoint solely for path/transport
          engineering, without imposing an explicit egress service action or
          carrying a BGP Prefix-SID Attribute.</t>

          <t>Transport Steering with Egress Service Action (Mode 2): A mode of
          FlowSpec steering operation where traffic is directed into an SR
          Policy toward a TailEnd endpoint and additionally carries an
          explicit egress service function (e.g., SRv6 Service SID,
          End.DT4/DT6) to specify the egress VRF or forwarding context at the
          TailEnd device.</t>

          <t>USD: Ultimate Segment Decapsulation</t>
        </list></t>
    </section>

    <section title="Protocol Procedures">
      <t>BGP FlowSpec NLRI <xref target="RFC8955"/><xref target="RFC8956"/>
      can be combined with BGP Extended Communities and, where applicable, the
      BGP Prefix-SID Attribute to steer matching traffic into a Segment
      Routing (SR) Policy <xref target="RFC9256"/> in either SR-MPLS or SRv6
      data planes.</t>

      <t>This specification relies on a two-tier control plane
      architecture:</t>

      <t><list style="symbols">
          <t>Transport Steering: The Color Extended Community <xref
          target="RFC9012"/> is combined with the FlowSpec Redirect-to-IP
          Extended Community <xref
          target="I-D.ietf-idr-flowspec-redirect-ip"/> to form an explicit
          (Color, Endpoint) tuple. This tuple binds the matching FlowSpec
          traffic to an SR Policy (SR-MPLS or SRv6) at the head-end router
          (Ingress PE) <xref target="RFC9256"/>.</t>

          <t>Egress Service Action (SRv6-specific): For SRv6 scenarios
          requiring a specific egress service action (e.g., decapsulation and
          table/VRF lookup) at the tail-end router (Egress PE), the BGP
          Prefix-SID Attribute <xref target="RFC9252"/> MAY be attached to
          convey an SRv6 Service SID.</t>
        </list></t>

      <t>The procedures in this document apply strictly to IPv4 and IPv6
      FlowSpec address families in the global routing context (AFI=1/2,
      SAFI=133).</t>

      <t/>

      <section title="Operational Steering Modes">
        <t>The traffic steering mechanism specified in this document relies on
        BGP FlowSpec filtering rules to perform flow-based policy
        encapsulation into SR Policies <xref target="RFC9256"/>.</t>

        <t>Architecturally, FlowSpec-based steering corresponds strictly to
        Policy-Based Routing (PBR) steering as defined in Section 8.7 of <xref
        target="RFC9256"/>. It SHALL NOT be interpreted or implemented as
        per-destination steering (Section 8.4 of <xref target="RFC9256"/>).
        Implementations MUST NOT apply per-destination route-resolution
        mechanics, BGP multipath path resolution, or On-Demand BSID recursion
        <xref target="RFC9256"/> to FlowSpec route processing.</t>

        <t>When advertising a FlowSpec route to steer traffic into an SR
        Policy, the sender MUST construct the BGP UPDATE message according to
        one of the two deterministic operational modes specified below, based
        on the target data plane (SR-MPLS or SRv6) and egress service context
        requirements:</t>

        <t/>

        <section title="Mode 1: Steering Without Egress Service Action (SR-MPLS / SRv6)">
          <t>When matching traffic only needs to be steered into an SR Policy
          (SR-MPLS or SRv6) toward an Endpoint, and no specific VRF or table
          lookup action is required at the egress PE:</t>

          <t><list style="symbols">
              <t>The sender MUST attach both a valid Color Extended Community
              <xref target="RFC9012"/> and a Redirect-to-IP (or
              Redirect-to-IPv6) Extended Community <xref
              target="I-D.ietf-idr-flowspec-redirect-ip"/>.</t>

              <t>The sender SHALL NOT attach the BGP Prefix-SID Attribute.</t>

              <t>Decapsulation or label popping at the egress PE relies
              entirely on the final segment's behavior of the target SR Policy
              (e.g., Implicit Null for SR-MPLS or End with USD flavor for
              SRv6).</t>

              <t>At the ingress PE, the active encapsulation consists solely
              of the Segment List (MPLS Label Stack or SRH Segment List) of
              the selected SR Policy.</t>
            </list></t>
        </section>

        <section title="Mode 2: Steering With Egress Service Action (SRv6-specific)">
          <t>When matching traffic needs to be steered into an SRv6 Policy AND
          requires a specific service context or decapsulation behavior (e.g.,
          table/VRF lookup) at the egress PE:</t>

          <t><list style="symbols">
              <t>The sender MUST attach a valid Color Extended Community <xref
              target="RFC9012"/>, a Redirect-to-IP (or Redirect-to-IPv6)
              Extended Community <xref
              target="I-D.ietf-idr-flowspec-redirect-ip"/>, AND the BGP
              Prefix-SID Attribute <xref target="RFC9252"/>.</t>

              <t>The BGP Prefix-SID Attribute carries the SRv6 Service SID
              representing the Egress Service Action, encoded according to
              Section 3.6.</t>

              <t>At the ingress PE, the active Segment List encapsulated in
              the SRH is synthesized by stitching the SR Policy Segment List
              and the Egress SRv6 Service SID, strictly following Section 5 of
              <xref target="RFC9252"/> and <xref target="RFC8986"/>.</t>
            </list></t>
        </section>
      </section>

      <section title="Procedures for the Sending BGP Speaker / Controller">
        <t>A BGP speaker or controller originating or re-advertising a
        FlowSpec route to steer traffic into an SR Policy MUST perform the
        following operations:</t>

        <t><list style="numbers">
            <t>Determine the explicit (Color, Endpoint) tuple required for
            transport steering. Attach the corresponding Color Extended
            Community <xref target="RFC9012"/> and set the target IP address
            in the Redirect-to-IP (or Redirect-to-IPv6) Extended Community
            <xref target="I-D.ietf-idr-flowspec-redirect-ip"/> to match the SR
            Policy Endpoint.</t>

            <t>Evaluate whether an egress service action is required:<list
                style="symbols">
                <t>If no egress service action is required (Mode 1, Section
                3.1.1), the speaker MUST NOT attach the BGP Prefix-SID
                Attribute.</t>

                <t>If an egress SRv6 service action is required (Mode 2,
                Section 3.1.2), the speaker MUST attach the BGP Prefix-SID
                Attribute containing the SRv6 Service SID, constructed
                strictly per Section 3.6.</t>
              </list></t>

            <t>If a BGP speaker receives a FlowSpec route containing a valid
            Color Extended Community and a Redirect-to-IP Extended Community
            and re-advertises it, it MUST preserve these attributes unchanged
            unless local policy explicitly modifies the steering intent.</t>
          </list></t>
      </section>

      <section title="Procedures for the Receiving BGP Speaker (Headend / Ingress PE)">
        <t>The validation and installation procedures specified in this
        section apply EXCLUSIVELY to BGP FlowSpec receivers acting as SR
        Headends (e.g., Ingress PEs) that process packet steering into SR
        Policies.</t>

        <t>Intermediate BGP Speakers, such as Route Reflectors (RRs), that do
        not participate in data-plane traffic steering MUST transparently
        reflect and propagate the FlowSpec routes along with their attached
        attributes (e.g., Color Extended Community, Redirect-to-IP, and BGP
        Prefix-SID Attribute) per standard BGP propagation rules <xref
        target="RFC8955"/>, without attempting SR Policy binding or FIB
        installation.</t>

        <t>Upon receiving a FlowSpec route (AFI=1/2, SAFI=133), the receiving
        headend router MUST process the route in accordance with the following
        sequence:</t>

        <t><list style="numbers">
            <t>Base NLRI &amp; Attribute Syntactic Validation:<list
                style="symbols">
                <t>The receiver MUST validate the FlowSpec NLRI against the
                base rules defined in <xref target="RFC8955"/><xref
                target="RFC8956"/>. If NLRI validation fails, BGP error
                handling per <xref target="RFC8955"/><xref target="RFC8956"/>
                applies.</t>

                <t>Syntactic attribute errors (e.g., malformed BGP Prefix-SID
                Attribute or Extended Communities) MUST be handled according
                to BGP Error Handling rules <xref target="RFC7606"/> (e.g.,
                Treat-as-Withdraw).</t>
              </list></t>

            <t>Steering Mode Determination and Attribute Interworking
            Validation:<list style="empty">
                <t>The headend MUST evaluate the co-existing steering
                attributes for correct interworking and mode
                determination:<list style="letters">
                    <t>Mode 1 Validation: If a valid Color Extended Community
                    and a valid Redirect-to-IP Extended Community are present,
                    and the BGP Prefix-SID Attribute is ABSENT, the route is
                    validated as Mode 1 (Transport Steering Only).</t>

                    <t>Mode 2 Validation: If a valid Color Extended Community,
                    a valid Redirect-to-IP Extended Community, AND a valid BGP
                    Prefix-SID Attribute are present, the route is validated
                    as Mode 2 (Transport Steering with Egress Service Action).
                    The BGP Prefix-SID Attribute MUST contain a valid SRv6 L3
                    Service TLV (Type 5) and SRv6 SID Information Sub-TLV
                    (Type 1) <xref target="RFC9252"/>. The carried SRv6
                    Endpoint Behavior MUST belong to the allowed Layer 3
                    behavior set specified in Section 3.6.</t>
                  </list></t>
              </list><list style="empty">
                <t>If any required steering attribute is missing, or if the
                attributes fail the interworking validation above, the headend
                MUST NOT perform SR Policy steering via Modes 1 or 2, and
                SHALL handle the route according to the failure and matrix
                resolution procedures defined in Section 3.7 and Section
                4.</t>

                <t/>
              </list></t>

            <t>Steering Parameter Extraction &amp; SR Policy Lookup:<list
                style="symbols">
                <t>The headend MUST extract the Color value from the Color
                Extended Community and the target IP address from the
                Redirect-to-IP Extended Community. Together, these form the
                explicit (Color, Endpoint) tuple used as the binding key <xref
                target="RFC9256"/>.</t>

                <t>The headend MUST perform a lookup in its local SR Policy
                database using the (Color, Endpoint) tuple strictly per
                Section 8.8.1 of <xref target="RFC9256"/> to resolve an
                active, valid SR Policy Candidate Path.</t>

                <t>The BGP Prefix-SID Attribute, if present (Mode 2), SHALL
                NOT be used as part of the SR Policy database lookup key. It
                is extracted exclusively to provide the egress service
                decapsulation context during segment list synthesis.</t>
              </list></t>

            <t>Forwarding Action Installation &amp; Encapsulation Synthesis:
            <list style="empty">
                <t>If a matching active SR Policy candidate path is
                successfully resolved:<list style="letters">
                    <t>The default Longest-Prefix-Match (LPM) lookup
                    prescribed in <xref
                    target="I-D.ietf-idr-flowspec-redirect-ip"/> SHALL NOT be
                    performed.</t>

                    <t>Mode 1: The headend MUST program its forwarding plane
                    to encapsulate matching traffic using strictly the active
                    Segment List of the resolved SR Policy.</t>

                    <t>Mode 2: The headend MUST synthesize the active
                    encapsulation segment list by stitching the resolved SR
                    Policy Segment List and the Egress SRv6 Service SID, in
                    strict adherence to Section 5 of <xref target="RFC9252"/>.
                    Specifically:<list style="symbols">
                        <t>When the headend device determines (with the help
                        of the SRv6 SID Structure Sub-Sub-TLV <xref
                        target="RFC9252"/>) that the Egress SRv6 Service SID
                        belongs to the same SRv6 Locator as the last SRv6 SID
                        of the tailend device in the resolved SRv6 Policy
                        segment list, it MAY omit/replace the Endpoint SID
                        with the Egress Service SID when steering the service
                        flow (e.g., replacing segment list &lt;S1, S2, S3&gt;
                        with &lt;S1, S2, Egress_Service_SID&gt;).</t>

                        <t>Otherwise, the Egress SRv6 Service SID MUST be
                        appended to the resolved SR Policy segment list (e.g.,
                        &lt;S1, S2, S3, Egress_Service_SID&gt;).</t>
                      </list></t>

                    <t>Coexisting FlowSpec Actions: Non-steering FlowSpec
                    actions present in the same route (such as Traffic-Rate
                    policing or drop per <xref target="RFC8955"/>) MUST be
                    applied to matching traffic regardless of the steering
                    resolution or programming state, unless local policy
                    explicitly dictates otherwise.</t>
                  </list></t>
              </list></t>

            <t>Control Plane Route Retention and Propagation Rules:<list
                style="empty">
                <t>If a FlowSpec route carrying SR Policy attributes cannot be
                bound to an active, valid SR Policy in the local SR Database,
                or if its steering entry cannot be installed into the
                forwarding plane:<list style="letters">
                    <t>BGP Route Status: The receiving BGP speaker MUST NOT
                    discard, withdraw, or mark the BGP FlowSpec route as
                    BGP-Invalid solely due to the absence or uninstantiated
                    state of a matching SR Policy or a forwarding programming
                    failure. If the BGP UPDATE message and its attributes pass
                    standard syntactic validation <xref
                    target="RFC7606"/><xref target="RFC8955"/>, the route
                    SHALL be considered BGP-Valid and retained in the BGP
                    Loc-RIB.</t>

                    <t>Best-Path Selection: The route MUST remain eligible for
                    the BGP best-path selection process per standard decision
                    rules <xref target="RFC4271"/><xref
                    target="RFC8955"/>.</t>

                    <t>Propagation: If selected as the best path, the BGP
                    speaker MUST propagate the FlowSpec route along with its
                    attached steering attributes to other BGP peers according
                    to local policy and standard BGP propagation rules.</t>

                    <t>Data Plane Steering Failure Enforcement: The headend
                    router MUST decouple control plane route propagation from
                    data plane steering. While the route is safely retained
                    and propagated in the control plane, the data plane
                    traffic filtering actions for packets matching the
                    FlowSpec NLRI SHALL be handled strictly according to the
                    steering failure and fallback procedures defined in
                    Section 3.7 and Section 4.</t>
                  </list></t>
              </list></t>
          </list></t>
      </section>

      <section title="Interaction with Redirect-to-IP Extended Community">
        <t>When a FlowSpec route carries both a valid Color Extended Community
        <xref target="RFC9012"/> and a Redirect-to-IP (or Redirect-to-IPv6)
        Extended Community <xref
        target="I-D.ietf-idr-flowspec-redirect-ip"/>:</t>

        <t><list style="symbols">
            <t>Syntactic Validation and Attribute Reuse: The receiving router
            MUST perform syntactic and structural validation of the
            Redirect-to-IP Extended Community according to <xref
            target="I-D.ietf-idr-flowspec-redirect-ip"/>. However, the target
            IP address in the Redirect-to-IP Extended Community SHALL be
            interpreted strictly as the Endpoint of the target SR Policy,
            forming the explicit (Color, Endpoint) tuple <xref
            target="RFC9256"/>.</t>

            <t>Precedence and Supersedence of Forwarding Behavior: In
            accordance with Section 2.2.2 of <xref
            target="I-D.ietf-idr-flowspec-redirect-ip"/>, the SR Policy
            steering procedures defined in this specification take precedence
            over, and explicitly SUPERSEDE, the default forwarding behavior
            specified in Section 2.2 of <xref
            target="I-D.ietf-idr-flowspec-redirect-ip"/>. The standard
            Longest-Prefix-Match (LPM) lookup toward the target IP address
            SHALL NOT be performed. Instead, matching traffic MUST be steered
            into the SR Policy resolved by the (Color, Endpoint) tuple.</t>
          </list>If a FlowSpec route carries multiple Color Extended
        Communities, the preference rule among multiple colors, as well as the
        fallback mechanism to the next-highest numerical color value when the
        highest-color SR Policy is uninstantiated or inactive, follows the
        procedures specified in Section 8.4.1 of <xref target="RFC9256"/>.</t>

        <t/>
      </section>

      <section title="Scope Exceptions and Explicit Constraints">
        <t/>

        <section title="Scope regarding Color-Only (CO) Steering">
          <t>Steering procedures based on Color-Only (CO) flags (as defined in
          <xref target="RFC9830"/> and Section 8.8.1 of <xref
          target="RFC9256"/>) are outside the scope of this document.</t>

          <t>The steering mechanism specified in this document strictly
          requires an explicit (Color, Endpoint) tuple. If a receiving router
          encounters a FlowSpec route with non-zero CO bits in the Color
          Extended Community, the receiver SHALL treat the Color Extended
          Community as if CO bits were zero (i.e., explicit Endpoint matching)
          and attempt to process the route using the explicit (Color,
          Endpoint) matching procedure. If no matching SR Policy exists for
          the specified (Color, Endpoint) tuple, the route SHALL be handled
          according to the steering failure procedures in Section 3.7.</t>

          <t/>
        </section>

        <section title="Scope regarding VPN FlowSpec and Redirect-to-VRF">
          <t>BGP VPN FlowSpec address families (SAFI=134) and interaction with
          the Redirect-to-VRF Extended Community <xref target="RFC8955"/><xref
          target="RFC8956"/> are outside the scope of this specification.</t>

          <t>If a receiving router encounters a VPN FlowSpec route (SAFI=134)
          or a FlowSpec route containing a Redirect-to-VRF Extended Community
          for SR Policy steering, such routes MUST NOT be processed according
          to the procedures in this specification.</t>

          <t/>
        </section>
      </section>

      <section title="BGP Prefix-SID Attribute Encoding Rules">
        <t>The BGP Prefix-SID Attribute is used in this specification strictly
        for conveying SRv6 Service SIDs in SRv6 Mode 2 (Section 3.1.2). For
        SR-MPLS scenarios, the BGP Prefix-SID Attribute SHALL NOT be
        attached.</t>

        <t>When the BGP Prefix-SID Attribute is attached to a FlowSpec route
        in an SRv6 environment, the following encoding rules apply per <xref
        target="RFC9252"/> and <xref target="RFC8986"/>:</t>

        <t><list style="symbols">
            <t>SRv6 Service TLVs: The SRv6 L3 Service TLV (Type 5) <xref
            target="RFC9252"/> SHALL be used to convey the egress service
            action.</t>

            <t>Sub-TLVs: The SRv6 SID Information Sub-TLV (Type 1) SHALL be
            included within the SRv6 Service TLV. The SRv6 SID Structure
            Sub-Sub-TLV (Type 1) <xref target="RFC9252"/> MAY be included to
            specify the SRv6 Locator and SID structure <xref
            target="RFC8986"/>.</t>

            <t>Supported Endpoint Behaviors: The SRv6 Service SID Endpoint
            Behavior codepoints supported for FlowSpec egress service steering
            are restricted to Layer 3 behaviors defined in <xref
            target="RFC8986"/>, including End.DT4, End.DT6, End.DT46, End.DX4,
            and End.DX6. Layer 2 behaviors (e.g., End.DX2, End.DT2M) and
            transit/underlay behaviors (e.g., End, End.X) SHALL NOT be used
            for FlowSpec egress service steering under this specification.</t>

            <t>Disallowance of Transposition Scheme: <xref target="RFC9252"/>
            Section 4 defines a Transposition Scheme where part of the SRv6
            SID is transposed into the MPLS Label field of the BGP NLRI.
            Because FlowSpec NLRIs <xref target="RFC8955"/><xref
            target="RFC8956"/> do not carry an MPLS Label field, the
            Transposition Scheme SHALL NOT be used. The full SRv6 Service SID
            MUST be encoded entirely within the SRv6 SID Information Sub-TLV
            of the BGP Prefix-SID Attribute.</t>
          </list></t>
      </section>

      <section title="Steering Failure and Fallback Procedures">
        <t>If a receiving headend router cannot steer matching traffic into an
        SR Policy for a FlowSpec route carrying a Color Extended Community and
        a Redirect-to-IP Extended Community - due to any of the conditions
        defined in Section 4 (such as an uninstantiated matching SR Policy, an
        invalid Prefix-SID attribute per <xref target="RFC9252"/>, or
        forwarding programming resource exhaustion) - the router MUST handle
        matching traffic according to local steering failure policies and
        Section 4.3.</t>

        <t>Standard fallback actions MAY include, in order of administrative
        preference:</t>

        <t><list style="numbers">
            <t>Fallback Color Evaluation: If the FlowSpec route carries
            multiple Color Extended Communities, evaluate the remaining colors
            in descending numerical order per Section 8.4.1 of <xref
            target="RFC9256"/>.</t>

            <t>Native/Default Path Forwarding: Forward matching traffic using
            the normal IP/MPLS routing table lookup toward the packet's
            original destination address.</t>

            <t>Traffic Drop: Silently drop matching traffic if configured by
            policy for strict traffic isolation or anti-leak enforcement.</t>
          </list></t>
      </section>

      <section title="Load Balancing Considerations">
        <t>When traffic matching a BGP FlowSpec rule is steered into an SR
        Policy (under either Mode 1 or Mode 2), the target SR Policy may
        contain multiple active Segment Lists for multi-path load balancing
        (ECMP or UCMP) as specified in <xref target="RFC9256"/>.</t>

        <t><list style="numbers">
            <t>Flow Spec to SR Policy Mapping:<list style="empty">
                <t>The FlowSpec rule classifies matching packets and directs
                them into the resolved SR Policy as a single aggregate traffic
                stream. The FlowSpec filtering actions MUST NOT alter or
                bypass the selection of Segment Lists within that SR
                Policy.</t>
              </list></t>

            <t>Multi-Path ECMP/UCMP Hashing:<list style="empty">
                <t>When the target SR Policy consists of multiple candidate
                Segment Lists with equal or unequal weights:<list
                    style="symbols">
                    <t>The headend router MUST distribute the matched FlowSpec
                    traffic across all active Segment Lists according to their
                    defined weights.</t>

                    <t>For both SR-MPLS and SRv6 data planes, the multipath
                    hash calculation MUST be performed using the packet's
                    inner header fields (e.g., 5-tuple) to ensure symmetric
                    and fine-grained per-flow load balancing.</t>
                  </list></t>
              </list></t>

            <t>SRv6 Flow Label Generation (RFC 8754 Alignment):<list
                style="empty">
                <t>In SRv6 steering scenarios (including Mode 1 and Mode 2
                with SID stitching):<list style="symbols">
                    <t>The generation of the Flow Label field in the outer
                    IPv6 header MUST NOT be affected or overwritten by the
                    FlowSpec matching rule.</t>

                    <t>The headend node MUST compute and assign the outer IPv6
                    Flow Label based on a hash of the inner packet header
                    fields in full accordance with Section 5.1 of
                    [RFC8754].</t>

                    <t>Preserving independent, inner-flow-based IPv6 Flow
                    Label generation is essential to prevent Hash Polarization
                    and packet drops at downstream intermediate P routers
                    performing ECMP over outer IPv6 headers.</t>
                  </list></t>
              </list></t>
          </list></t>

        <t/>
      </section>

      <section title="Backward Compatibility and Coexistence with Base BGP FlowSpec">
        <t>This specification defines extensions to the processing of BGP
        FlowSpec routes when carrying a combination of the Color Extended
        Community <xref target="RFC9012"/>, Redirect-to-IP Extended Community
        <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>, and the BGP
        Prefix-SID Attribute <xref target="RFC9252"/>.</t>

        <t>A BGP speaker receiving a FlowSpec route constructed under this
        specification MUST process and propagate the attributes according to
        its capability level as follows:</t>

        <t><list style="numbers">
            <t>Local Behavior at a Non-Supporting Receiver:<list style="empty">
                <t>If a receiving headend router supports base BGP FlowSpec
                <xref target="RFC8955"/><xref target="RFC8956"/> and the
                Redirect-to-IP Extended Community, but does not support this
                specification or the BGP Prefix-SID Attribute in the context
                of FlowSpec, it MUST ignore the unrecognized BGP Prefix-SID
                Attribute. The receiver SHALL fall back to processing the
                Redirect-to-IP Extended Community according to standard
                procedures (e.g., performing a Longest-Prefix-Match lookup
                toward the target IP address per <xref
                target="I-D.ietf-idr-flowspec-redirect-ip"/>).</t>
              </list></t>

            <t>Attribute Propagation and Control Plane Filtering:<list
                style="empty">
                <t>In accordance with standard BGP Optional Transitive
                attribute handling rules <xref target="RFC4271"/>, a BGP
                speaker that does not support the BGP Prefix-SID Attribute
                MUST propagate the attribute un-modified to other BGP peers,
                setting the Partial bit in the attribute flags.</t>

                <t>Furthermore, implementations supporting the signalling
                defined in this document MUST comply with the following
                operational control rules: <list style="symbols">
                    <t>Attribute Filtering: Attribute filtering and
                    propagation policies for the BGP Prefix-SID Attribute MUST
                    follow Section 5 of <xref target="RFC8669"/>.</t>

                    <t>Neighbor and Service Granularity Control: In strict
                    adherence to Section 3.2.1 of <xref target="RFC9252"/>,
                    implementations MUST provide a control mechanism to enable
                    or disable the advertisement of SRv6-based service
                    steering attributes on a per-neighbor and per-service
                    basis.</t>
                  </list></t>
              </list></t>
          </list></t>

        <t/>
      </section>
    </section>

    <section title="Multi-Attribute Interworking and Steering Resolution">
      <t>The steering mechanism defined in this document relies on the
      co-existence of up to three distinct BGP attributes attached to a BGP
      FlowSpec route <xref target="RFC8955"/><xref target="RFC8956"/>:</t>

      <t><list style="numbers">
          <t>Color Extended Community <xref target="RFC9012"/></t>

          <t>Redirect-to-IP Extended Community <xref
          target="I-D.ietf-idr-flowspec-redirect-ip"/></t>

          <t>BGP Prefix-SID Attribute <xref target="RFC9252"/></t>
        </list>To guarantee deterministic and interoperable behavior across
      implementations, the receiving headend router MUST evaluate all incoming
      combinations strictly according to the procedures defined in this
      section.</t>

      <t/>

      <section title="Policy-Based Steering Classification">
        <t>Architecturally, traffic steering resulting from the matching of a
        BGP FlowSpec route corresponds strictly to Policy-Based Routing (PBR)
        / Policy-Based Steering as defined in Section 8.7 of <xref
        target="RFC9256"/>.</t>

        <t>FlowSpec steering SHALL NOT be interpreted or implemented as
        per-destination steering (Section 8.4 of <xref target="RFC9256"/>).
        Implementations MUST NOT apply per-destination route-resolution
        mechanics, BGP multipath path resolution, or On-Demand BSID recursion
        <xref target="RFC9256"/> to BGP FlowSpec route processing.</t>

        <t/>
      </section>

      <section title="Deterministic Interworking Matrix">
        <t>Upon receiving a BGP FlowSpec route, the headend router MUST
        evaluate the syntactic and semantic validity of the steering
        attributes and execute the corresponding steering outcome,
        non-steering action disposition, and diagnostic requirements defined
        in Table 1.</t>

        <t><figure anchor="Deterministic_Interworking_Matrix"
            suppress-title="true" title="">
            <artwork align="left"><![CDATA[
Legend: Color = Color EC; ReIP = Redirect-to-IP EC; 
        PSID = BGP Prefix-SID Attribute;
        V = Valid; I = Invalid; A = Absent; * = Any (V/I/A).
        V(L3) = Valid L3 Service SID (e.g., End.DT4/6/DX4/6/DT46);
        [flowspec-redirect] = [I-D.ietf-idr-flowspec-redirect-ip].

 Table 1: Deterministic Multi-Attribute Interworking and 
          Action Resolution Matrix

 +---+-------+------+-------+-------------------------+-------------+
 |R# | Color | ReIP | PSID  | Steering Action Outcome | Diagnostics |
 +---+-------+------+-------+-------------------------+-------------+
 | 1 | V     | V    | A     | Mode 1 SR Policy        | None        |
 |   |       |      |       | Steering (Sec 3.1.1)    |             |
 +---+-------+------+-------+-------------------------+-------------+
 | 2 | V     | V    | V(L3) | Mode 2 SR Policy        | None        |
 |   |       |      |       | Steering (Sec 3.1.2)    |             |
 +---+-------+------+-------+-------------------------+-------------+
 | 3 | V     | V    | I     | Steering Failure: NO    | Log: Invalid|
 |   |       |      |       | Policy & NO ReIP Fallbk | Service SID |
 +---+-------+------+-------+-------------------------+-------------+
 | 4 | I     | V    | *     | Steering Failure: Abort | Log: Invalid|
 |   |       |      |       | Steering Actions        | Color EC    |
 +---+-------+------+-------+-------------------------+-------------+
 | 5 | V     | I    | *     | Steering Failure: Abort | Log: Invalid|
 |   |       |      |       | Steering Actions        | ReIP Target |
 +---+-------+------+-------+-------------------------+-------------+
 | 6 | A     | V    | A/I   | Base ReIP Forwarding    | None        |
 |   |       |      |       | per [flowspec-redirect] |             |
 +---+-------+------+-------+-------------------------+-------------+
 | 7 | A     | A/I  | *     | NO Steering Action;     | None        |
 |   |       |      |       | Native Shortest Path    |             |
 +---+-------+------+-------+-------------------------+-------------+

 Note: Non-steering actions (e.g., rate-limit, drop) attached to the
 route MUST be applied in all rows (Rows 1-7).
]]></artwork>
          </figure></t>
      </section>

      <section title="Protection Against Silent SLA Violations ">
        <t>To prevent unintentional redirection and catastrophic SLA
        violations, implementations MUST strictly enforce the following
        operational rules:</t>

        <t><list style="numbers">
            <t>Abortion of Redirection on Corrupted Intent (Table 1, Rows 3,
            4, 5):<list style="empty">
                <t>If a FlowSpec route carries an explicit intent for SR
                Policy steering (indicated by the presence of a Color EC or
                Mode 2 Prefix-SID) but any required steering attribute is
                determined to be INVALID, the receiver MUST NOT perform
                default Redirect-to-IP forwarding. Silently falling back to
                shortest-path IP forwarding toward the target IP address is
                strictly PROHIBITED, as it violates explicit SLA steering
                policies. The matching traffic MUST be dropped or handled
                strictly according to local fallback policy (Section 3.7).</t>
              </list></t>

            <t>Enforcement of Coexisting Non-Steering Actions: <list
                style="empty">
                <t>In all failure or fallback cases (Table 1, Rows 3-7), other
                valid non- steering actions present in the same BGP FlowSpec
                route (such as Traffic- Rate/Drop <xref target="RFC8955"/>,
                Rate-limiting, or DSCP remarking) MUST continue to be
                processed and enforced in the forwarding plane.</t>
              </list></t>

            <t>Multiple Redirect-to-IP Communities and Load-Sharing: <list
                style="empty">
                <t>When multiple valid Redirect-to-IP Extended Communities are
                attached to the same FlowSpec route alongside a valid Color
                Extended Community, the resolution and multi-path load-sharing
                across multiple target SR Policies (identified by their
                respective Endpoint IP addresses) MUST follow the EC-level
                load-sharing procedures defined in Section 2.2 of <xref
                target="I-D.ietf-idr-flowspec-redirect-ip"/>.</t>
              </list></t>

            <t>Logging and Diagnostics:<list style="empty">
                <t>Implementations SHOULD generate diagnostic log entries (as
                specified in Table 1) whenever an SR Policy steering route
                contains corrupted or invalid steering attributes to assist
                network operators in rapid fault isolation.</t>
              </list></t>
          </list></t>

        <t/>
      </section>

      <section title="Backward Compatibility and Coexistence Behavior">
        <t>A BGP speaker receiving a FlowSpec route constructed under this
        specification MUST process and propagate the attributes according to
        its capability level:</t>

        <t><list style="numbers">
            <t>Non-Supporting Headend Behavior:<list style="empty">
                <t>If a receiving headend router supports base BGP FlowSpec
                [RFC8955][RFC8956] and the Redirect-to-IP Extended Community,
                but does not support this specification or the BGP Prefix-SID
                Attribute in the context of FlowSpec, it MUST ignore the
                unrecognized BGP Prefix-SID Attribute. The receiver SHALL fall
                back to processing the Redirect-to-IP Extended Community
                according to standard procedures (e.g., performing a
                Longest-Prefix-Match lookup toward the target IP address per
                <xref target="I-D.ietf-idr-flowspec-redirect-ip"/>).</t>
              </list></t>

            <t>Attribute Propagation and Control Plane Filtering:<list
                style="empty">
                <t>In accordance with standard BGP Optional Transitive
                attribute handling rules <xref target="RFC4271"/>, a BGP
                speaker that does not support the BGP Prefix-SID Attribute
                MUST propagate the attribute unmodified to other BGP peers,
                setting the Partial bit in the attribute flags.</t>

                <t>Furthermore, implementations supporting the signalling
                defined in this document MUST comply with the following
                operational control rules:<list style="symbols">
                    <t>Attribute Filtering: Attribute filtering and
                    propagation policies for the BGP Prefix-SID Attribute MUST
                    follow Section 5 of <xref target="RFC8669"/>.</t>

                    <t>Neighbor and Service Granularity Control: In strict
                    adherence to Section 3.2.1 of <xref target="RFC9252"/>,
                    implementations MUST provide a control mechanism to enable
                    or disable the advertisement of SRv6-based service
                    steering attributes on a per-neighbor and per-service
                    basis.</t>
                  </list></t>
              </list></t>
          </list></t>
      </section>
    </section>

    <section title="Operational Considerations">
      <t/>

      <section title="Forwarding Failure Monitoring and Management">
        <t>When a headend router fails to program a FlowSpec SR Policy
        steering entry into the forwarding plane (Section 3.3), the
        implementation SHOULD make relevant diagnostic information available
        to network operators.<list style="symbols">
            <t>Logging and Notifications: The implementation SHOULD generate
            appropriate management notifications (e.g., Syslog messages, SNMP
            traps, or YANG notifications, if supported) detailing the
            uninstalled FlowSpec NLRI, the associated (Color, Endpoint) tuple,
            and the specific failure reason (e.g., resource exhaustion).</t>

            <t>Resource Recovery and Re-programming: An implementation SHOULD
            monitor forwarding plane resource availability. When sufficient
            forwarding resources become available, the implementation SHOULD
            automatically re-attempt to program any previously uninstalled
            FlowSpec steering entries.</t>
          </list></t>

        <t>Implementations SHOULD provide hardware or software counter metrics
        (e.g., byte/packet dropped counters) associated with uninstalled or
        failed FlowSpec steering entries for operational visibility.</t>
      </section>
    </section>

    <section title="Security Considerations">
      <t>The security considerations of the base BGP FlowSpec specifications
      [RFC8955] [RFC8956], BGP FlowSpec Redirect-to-IP <xref
      target="I-D.ietf-idr-flowspec-redirect-ip"/>, BGP Prefix-SID [RFC8669],
      and the core Segment Routing architecture [RFC8402] apply to this
      document.</t>

      <t>Combining BGP FlowSpec redirection with SR Policy selection and SRv6
      Service SID signaling introduces specific threat vectors that MUST be
      considered. Implementations and network operators MUST apply the
      mitigations described below.</t>

      <t/>

      <section title="Cross-VRF Traffic Injection and Service Hijacking">
        <t>Exposure:</t>

        <t>The BGP Prefix-SID Attribute carried in a FlowSpec route conveys an
        SRv6 Service SID (e.g., End.DT4, End.DT6, End.DT46, End.DX4, End.DX6)
        that determines the egress routing table, VRF, or interface context at
        the TailEnd PE. A malicious or misconfigured BGP FlowSpec Controller
        can utilize this mechanism to steer matched traffic into an arbitrary
        VRF or cross-connect interface at a remote PE, resulting in
        unauthorized cross-VRF data leakage or traffic interception.</t>

        <t>Exploitation &amp; Threat Actor:</t>

        <t>An attacker who compromises a BGP FlowSpec speaker or a
        misconfigured operator controller positioned within the control
        plane.</t>

        <t>Mitigations:</t>

        <t><list style="symbols">
            <t>Strict Control Plane Filtering: PEs MUST validate that any SRv6
            Service SID received in a BGP FlowSpec route belongs to an
            authorized Locator range allocated for the intended target VRF or
            service context.</t>

            <t>Access Control: BGP FlowSpec peering sessions with controllers
            MUST be secured using TCP-AO <xref target="RFC5925"/> and
            restricted to trusted administrative entities.</t>
          </list></t>
      </section>

      <section title="Scope and Validation Limits of BGP FlowSpec Attributes">
        <t>Exposure:</t>

        <t>Standard BGP FlowSpec route validation mechanisms specified in
        <xref target="RFC8955"/><xref target="RFC8956"> </xref><xref
        target="RFC9117"/> validate the FlowSpec NLRI and the Redirect-to-IP
        Extended Community against the originator of the destination prefix.
        However, these RFCs do not define validation rules for the Color
        Extended Community or the BGP Prefix-SID Attribute. Consequently, the
        two attributes that dictate the transport path selection and egress
        service context remain unvalidated by standard origin validation
        algorithms.</t>

        <t>Exploitation &amp; Threat Actor:</t>

        <t>An internal or external entity capable of injecting or altering BGP
        attributes on BGP FlowSpec routes in transit.</t>

        <t>Mitigations:</t>

        <t><list style="symbols">
            <t>Policy-based Validation: Headends MUST apply local policy
            checks to verify that the (Color, Endpoint) tuple resolves to a
            legitimately authorized SR Policy before binding FlowSpec traffic
            flows to it.</t>

            <t>Attribute Filtering: Network operators MUST strip or reject
            unknown or unauthorized Color Extended Communities and BGP
            Prefix-SID Attributes on FlowSpec routes received from untrusted
            BGP peers.</t>
          </list></t>
      </section>

      <section title="SR Domain Leakage and Boundary Security">
        <t>Exposure:</t>

        <t>As detailed in [RFC8402] and [RFC8669], SRv6 SIDs and BGP
        Prefix-SID Attributes are intended for use strictly within a single
        trusted SR domain. If BGP FlowSpec routes carrying Prefix-SID
        Attributes propagate across administrative boundaries or untrusted
        EBGP peers without filtering, internal SRv6 Locator information and
        internal topology structures could leak, exposing the network to
        external steering attacks.</t>

        <t>Exploitation &amp; Threat Actor:</t>

        <t>An external adversary on an adjacent untrusted AS or an insider
        exploiting missing boundary filters.</t>

        <t>Mitigations:</t>

        <t><list style="symbols">
            <t>Border Filtering: Autonomous System Border Routers (ASBRs) MUST
            filter out or strip the BGP Prefix-SID Attribute and SRv6-related
            Extended Communities from BGP FlowSpec routes traversing
            administrative or trust boundaries, unless explicit inter-domain
            trust agreements and strict policy filters are enforced.</t>
          </list></t>
      </section>

      <section title="Traffic Amplification and Path Pinning">
        <t>Exposure:</t>

        <t>Per [RFC9117], a single BGP FlowSpec route can match high-volume
        distributed traffic flows across multiple Ingress PEs and redirect
        them to a single Redirect-to-IP destination (specifically via BGP
        FlowSpec Redirect-to-IP fan-in/fan-out aggregate behavior). Binding
        such redirected flows to an SR Policy does not mitigate this
        amplification and concentration effect; instead, it allows an attacker
        to pin the amplified traffic to a specific engineered transport path,
        potentially overloading transit nodes along the SR Policy path or
        target interfaces at the TailEnd device.</t>

        <t>Exploitation &amp; Threat Actor:</t>

        <t>A compromised controller or malicious BGP speaker attempting a
        Denial of Service (DoS) attack against specific network links or
        egress PEs.</t>

        <t>Mitigations:</t>

        <t><list style="symbols">
            <t>Rate Limiting: Ingress PEs SHOULD combine FlowSpec redirect
            actions with Traffic Rate Extended Communities (Traffic-Policing)
            <xref target="RFC8955"/> to bound the maximum bandwidth redirected
            into an SR Policy.</t>

            <t>Policy Monitoring: Operators SHOULD implement telemetry and
            path utilization monitoring on SR Policies used for FlowSpec
            traffic steering to dynamically detect and mitigate link
            congestion.</t>
          </list></t>
      </section>
    </section>

    <section title="Application Examples (Informative)">
      <t>This section provides illustrative examples for steering BGP FlowSpec
      traffic into SR Policies in both SR-MPLS and SRv6 environments,
      following the normative procedures specified in Section 3 and Section
      4.</t>

      <t/>

      <section title="SR-MPLS Application Examples (Mode 1)">
        <t><xref target="SR_MPLS_Policy_Case"/> illustrates a scenario where a
        BGP FlowSpec Controller signals steering instructions for an SR-MPLS
        network to a Headend device (Ingress PE).</t>

        <t/>

        <t>In the following scenarios shown in <xref
        target="SR_MPLS_Policy_Case"/>, BGP FlowSpec Controller signals the
        filter rules, the Flow-spec Redirect to IPv4/IPv6 action, and the
        policy color to the SR-MPLS HeadEnd device.</t>

        <t><figure anchor="SR_MPLS_Policy_Case"
            title="Steering Traffic into SR-MPLS Policy (Mode 1)">
            <artwork align="center"><![CDATA[

   +------------+
   |  BGP FS    |
   | Controller |
   +------------+
      | FlowSpec route to HeadEnd:
      |   NLRI: Filter Rules
      |   Redirect-to-IP Extended Community: TailEnd Address
      |   Color Extended Community: C0
      |   (Prefix-SID Attribute: ABSENT)
      |          .-----.
      |         (       )
      V     .--(         )--.
+-------+  (                 )  +-------+
|       |_(  SR-MPLS Network  )_|       |
|HeadEnd| ( ================> ) |TailEnd|
+-------+  (SR List<S1,S2,S3>)  +-------+
            '--(         )--'   
                (       )       
                 '-----'

]]></artwork>
          </figure></t>

        <t>In this Mode 1 scenario (Section 3.1.1):</t>

        <t><list style="symbols">
            <t>Control Plane Signalling:<list style="empty">
                <t>The BGP FS Controller advertises a FlowSpec route carrying
                matching rules, Redirect-to-IP (TailEnd Address), and Color
                Extended Community C0. The BGP Prefix-SID Attribute is
                ABSENT.</t>
              </list></t>

            <t>Headend Processing:<list style="empty">
                <t>The Headend resolves the target SR-MPLS Policy matching the
                tuple (Endpoint: TailEnd, Color: C0).</t>
              </list></t>

            <t>Data Plane Encapsulation:<list style="empty">
                <t>Matching traffic flows are encapsulated strictly using the
                MPLS label stack corresponding to the resolved SR Policy
                segment list:</t>

                <t><figure anchor="MPLS_label_stack" suppress-title="true"
                    title="">
                    <artwork align="center"><![CDATA[ 
 +---------------------------------------------+
 | Outer IP / Ethernet Header                  |
 +---------------------------------------------+
 | MPLS Label S1 (Top)                         |
 | MPLS Label S2                               |
 | MPLS Label S3 (Bottom with S=1)             |
 +---------------------------------------------+
 | Inner Payload (Original IPv4/IPv6 Packet)   |
 +---------------------------------------------+

]]></artwork>
                  </figure></t>

                <t>Decapsulation or label popping at the TailEnd device relies
                on standard MPLS segment behaviors (e.g., Penultimate Hop
                Popping or Implicit Null).</t>
              </list></t>
          </list></t>

        <t>When the SR-MPLS HeadEnd device (as a FlowSpec client) receives
        such instructions from BGP FS Controller, it will steer the traffic
        flows matching the criteria in the FlowSpec route into the SR-MPLS
        Policy matching the tuple (Endpoint: TailEnd's Address, Color: C0).
        And the packets of such traffic flows will be encapsulated with an
        MPLS stack using the SR List &lt;S1, S2, S3&gt; in the HeadEnd device,
        then send the packets to the TailEnd device along the path indicated
        by the SR list.</t>

        <t/>
      </section>

      <section title="SRv6 Application Examples">
        <t>In SRv6 networks, FlowSpec traffic steering operates under either
        Mode 2 (Transport Steering with Egress Service Action) or Mode 1
        (Transport Steering Only).</t>

        <t/>

        <section title="SRv6 Mode 2 Example: Transport Steering with Egress Service Action">
          <t>In the scenario shown in <xref target="SRv6_Policy_Case1"/>, the
          BGP FlowSpec Controller signals filter rules, transport steering
          parameters, and an explicit egress service action to the Headend
          device.</t>

          <t>The `Egress_Service_SID` carried in the BGP Prefix-SID Attribute
          represents an SRv6 Endpoint Behavior instantiated and advertised by
          the TailEnd router (Egress PE) within its local SRv6 Locator block.
          Depending on the service context, `Egress_Service_SID` can be
          instantiated as End.DT4, End.DX4, End.DT6, End.DX6, or End.DT46
          (Section 3.6).</t>

          <t><figure anchor="SRv6_Policy_Case1"
              title="Steering Traffic into SRv6 Policy with Egress Service Action (Mode 2)">
              <artwork align="center"><![CDATA[
   +------------+
   |  BGP FS    |
   | Controller |
   +------------+
      | FlowSpec route to HeadEnd:
      |   NLRI: Filter Rules
      |   Redirect-to-IPv6 Extended Community: TailEnd Address
      |   Color Extended Community: C1
      |   Prefix-SID Attribute: Egress_Service_SID
      |          .-----.
      |         (       )
      V     .--(         )--.
+-------+  (                 )  +-------+
|       |_( SRv6 Core Network )_|       |
|HeadEnd| ( ================> ) |TailEnd|
+-------+  (SR List<S1,S2,S3>)  +-------+
            '--(         )--'   SRv6 SID: Egress_Service_SID
                (       )       (e.g., End.DT4, End.DT6, etc.)
                 '-----'

]]></artwork>
            </figure></t>

          <t>In this Mode 2 scenario (Section 3.1.2):</t>

          <t><list style="symbols">
              <t>Control Plane Signalling &amp; Resolution:<list style="empty">
                  <t>The FlowSpec route carries Color C1, Redirect-to-IPv6
                  (TailEnd Address), and the BGP Prefix-SID Attribute carrying
                  `Egress_Service_SID`. The Headend resolves the target SRv6
                  Policy using the (Color C1, TailEnd Address) tuple, which
                  yields candidate Segment List &lt;S1, S2, S3&gt;.</t>
                </list></t>

              <t>Segment List Synthesis &amp; Encapsulation:<list
                  style="empty">
                  <t>Per Section 3.3 (Step 4.c), the Headend synthesizes the
                  active segment list by inspecting the SRv6 SID Structure
                  Sub-Sub-TLV <xref target="RFC9252"/>: <list style="symbols">
                      <t>Scenario A (SID Replacement / Locator Match):<list
                          style="empty">
                          <t>When `Egress_Service_SID` belongs to the same
                          SRv6 Locator as S3 (the last SID of the TailEnd in
                          the policy), the Headend excludes S3 and replaces it
                          with `Egress_Service_SID`. The synthesized segment
                          list becomes &lt;S1, S2, Egress_Service_SID&gt;.</t>

                          <t><figure anchor="Mode_2_A" suppress-title="true"
                              title="">
                              <artwork align="center"><![CDATA[
  +---------------------------------------------------+
  | Outer IPv6 Header (DA = S1)                       |
  +---------------------------------------------------+
  | SRH (Segments Left = 2)                           |
  |   Segment List: <S1, S2, Egress_Service_SID>      |
  +---------------------------------------------------+
  | Inner Payload (Original IPv4/IPv6 Packet)         |
  +---------------------------------------------------+

]]></artwork>
                            </figure></t>
                        </list></t>

                      <t>Scenario B (SID Appending / No Locator Match):<list
                          style="empty">
                          <t>Otherwise, `Egress_Service_SID` is appended to
                          the segment list, yielding &lt;S1, S2, S3,
                          Egress_Service_SID&gt;.</t>

                          <t><figure anchor="Mode_2_B" suppress-title="true"
                              title="">
                              <artwork align="center"><![CDATA[
  +---------------------------------------------------+
  | Outer IPv6 Header (DA = S1)                       |
  +---------------------------------------------------+
  | SRH (Segments Left = 3)                           |
  |   Segment List: <S1, S2, S3, Egress_Service_SID>  |
  +---------------------------------------------------+
  | Inner Payload (Original IPv4/IPv6 Packet)         |
  +---------------------------------------------------+

]]></artwork>
                            </figure></t>
                        </list></t>
                    </list></t>
                </list></t>
            </list></t>

          <t>Upon reaching the TailEnd device, the packet is decapsulated and
          processed per the function denoted by `Egress_Service_SID` (e.g.,
          VRF lookup for End.DT4).</t>

          <t/>
        </section>

        <section title="SRv6 Mode 1 Example: Transport Steering Only (USD-Flavored End SID)">
          <t>When matching traffic requires steering into an SRv6 Policy
          toward a TailEnd, and the final SID (S3) configured on the TailEnd
          is USD-flavored, an explicit Egress Service SID is not required.
          <xref target="SRv6_Policy_Case2"/> illustrates this scenario.</t>

          <t/>

          <t><figure anchor="SRv6_Policy_Case2"
              title="Steering Traffic into SRv6 Policy (Mode 1)">
              <artwork align="center"><![CDATA[
   +------------+
   |  BGP FS    |
   | Controller |
   +------------+
      | FlowSpec route to HeadEnd:
      |   NLRI: Filter Rules
      |   Redirect-to-IPv6 Extended Community: TailEnd Address
      |   Color Extended Community: C2
      |   (Prefix-SID Attribute: ABSENT)
      |          .-----.
      |         (       )
      V     .--(         )--.
+-------+  (                 )  +-------+
|       |_( SRv6 Core Network )_|       |
|HeadEnd| ( ================> ) |TailEnd|
+-------+  (SR List<S1,S2,S3>)  +-------+
            '--(         )--'    
                (       )       
                 '-----'
Note: S3 is an SRv6 SID with USD flavor on the TailEnd.

]]></artwork>
            </figure>In this Mode 1 scenario (Section 3.1.1):</t>

          <t><list style="symbols">
              <t>Control Plane &amp; Data Plane Processing:<list style="empty">
                  <t>The BGP FS Controller advertises the FlowSpec route
                  carrying Color C2 and Redirect-to-IPv6 (TailEnd Address)
                  without attaching the BGP Prefix-SID Attribute. The Headend
                  encapsulates matching traffic with an SRH using Segment List
                  &lt;S1, S2, S3&gt;.</t>
                </list></t>

              <t>TailEnd Processing:<list style="empty">
                  <t>As specified in Section 3.1.1, because S3 is an SRv6 SID
                  with USD flavor <xref target="RFC8986"/>, the TailEnd device
                  executes the USD behavior upon packet arrival, pops the
                  outer IPv6 header and SRH, and forwards the inner packet
                  using normal table lookup.</t>
                </list></t>
            </list></t>
        </section>

        <section title="Deployment Considerations">
          <t>The FlowSpec traffic steering mechanisms defined in this document
          apply within a single SR trusted domain (e.g., an intra-AS
          deployment under a single administrative control).</t>

          <t>In this deployment model, the Headend router resolves the
          explicit (Color, Endpoint) tuple provided by the FlowSpec route
          against a locally instantiated SR Policy (e.g., an SRv6 Policy with
          Segment List scoped within the domain). The propagation and handling
          of the BGP Prefix-SID Attribute and Extended Communities MUST adhere
          to the security and trust boundary guidelines specified in Section 6
          (Security Considerations).</t>

          <t/>
        </section>
      </section>
    </section>

    <section title="Implementation Status">
      <t>[Note to the RFC Editor - remove this section before publication, as
      well as remove the reference to <xref target="RFC7942"/>. This section
      records the status of known implementations of the protocol defined by
      this specification at the time of posting of this Internet-Draft, and is
      based on a proposal described in <xref target="RFC7942"/>. The
      description of implementations in this section is intended to assist the
      IETF in its decision processes in progressing drafts to RFCs. Please
      note that the listing of any individual implementation here does not
      imply endorsement by the IETF. Furthermore, no effort has been spent to
      verify the information presented here that was supplied by IETF
      contributors. This is not intended as, and must not be construed to be,
      a catalog of available implementations or their features. Readers are
      advised to note that other implementations may exist.</t>

      <t>According to <xref target="RFC7942"/>, "this will allow reviewers and
      working groups to assign due consideration to documents that have the
      benefit of running code, which may serve as evidence of valuable
      experimentation and feedback that have made the implemented protocols
      more mature. It is up to the individual working groups to use this
      information as they see fit".</t>

      <t/>

      <section title="Interop-test Status">
        <t>The Traffic Steering using BGP FlowSpec with SR-MPLS / SRv6 Policy
        mechanism has been implemented on the following hardware devices,
        Network Operating System software, and SDN controllers. They have also
        successfully participated in a series of joint interoperability
        testing events hosted by China Mobile from July 2021 to October 2021.
        The following hardware devices and Network Operating System software
        passed the interoperability testing (in alphabetical order).</t>

        <t><figure>
            <artwork align="center"><![CDATA[Routers:
+---------+---------------+--------------------------------+
| Vendors | Device Model  | Version                        |
+---------+---------------+--------------------------------+
| Huawei  | NE40-X8A      | NE40E V800R021C00SPC091T       |
+---------+---------------+--------------------------------+
| New H3C | CR16010H-FA   | Version 7.1.075, ESS 8305      |
+---------+---------------+--------------------------------+
| Ruijie  | RG-N8010-R    | N8000-R_RGOS 12.8(1)B08T1      |
+---------+---------------+--------------------------------+
| ZTE     | M6000-8S Plus | V5.00.10(5.60.5)               |
+---------+---------------+--------------------------------+

Controllers:
+----------------+---------------+-------------------------+
| Vendors        | Device Model  | Version                 |
+----------------+---------------+-------------------------+
| China Unitechs | I-T-E SC      | V1.3.6P3                |
+----------------+---------------+-------------------------+
| Huawei         | NCE-IP        | V100R021C00             |
+----------------+---------------+-------------------------+
| Ruijie         | RG-ONC-AIO-H  | RG-ION-WAN-CLOUD_2.00T1 |
+----------------+---------------+-------------------------+
| ZTE            | ZENIC ONE     | R22V16.21.20            |
+----------------+---------------+-------------------------+

]]></artwork>
          </figure></t>

        <t/>
      </section>

      <section title="Deployment Status">
        <t>As of August 2022, this feature has been deployed on the IP
        backbone network of China Mobile.</t>

        <t>China Mobile has fully transitioned to the SRv6 architecture, with
        no scenarios where SRv6 and SR-MPLS coexist. As a result, when
        utilizing Color C and IPv6 redirect addresses, traffic steering is
        executed exclusively via SRv6 policies.</t>

        <t>In scenarios where an operator supports the coexistence of SRv6 and
        SR-MPLS, it is recommended to adhere to <xref target="RFC9256"/> to
        govern policy selection for traffic steering based on Color C and IPv6
        endpoints.</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document requires no IANA actions.</t>

      <t/>
    </section>

    <section title="Contributors ">
      <t>The following people made significant contributions to this
      document:</t>

      <t><figure>
          <artwork align="left"><![CDATA[Yunan Gu
Huawei Technologies
Email: guyunan@huawei.com

Haibo Wang
Huawei Technologies
Email: rainsword.wang@huawei.com

Jie Dong
Huawei Technologies
Email: jie.dong@huawei.com

Xue Yang
China Mobile
Email: yangxuewl@chinamobile.com

]]></artwork>
        </figure></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to express special thanks to:</t>

      <t><list style="symbols">
          <t>Nat Kao for suggesting the inclusion of SR-MPLS use cases and
          providing detailed recommendations regarding failure and fallback
          procedures.</t>

          <t>Ketan Talaulikar for his in-depth review and valuable input,
          which substantially enhanced the precision and overall quality of
          this document.</t>

          <t>Donald E. Eastlake, 3rd for his thorough review and insightful
          suggestions.</t>
        </list>The authors also gratefully acknowledge the review, comments,
      and contributions from Jeffrey Haas, Susan Hares, Keyur Patel, Weiqiang
      Cheng, Kaliraj Vairavakkalai, Robin Li, Acee Lindem, Gunter Van De
      Velde, John Scudder, Rainbow Wu, Linda Dunbar, Gang Yan, Feng Yang, Wim
      Henderickx, Robert Raszuk, Changwang Lin, Aijun Wang, Hao Li, Huaimo
      Chen, Sheng Fang, Yuanxiang Qiu, Ran Chen, Cheng Li, Zheng Zhang, Xuewei
      Wang, Yanrong Liang, Xuhui Cai, Haojie Wang, Lili Wang, Nan Geng,
      Stephane Litkowski, Zhenqiang Li, Jinming Li, Shengnan Yue, and Ziqing
      Cao.</t>

      <t/>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include='reference.I-D.ietf-idr-flowspec-redirect-ip'?>

      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.4271'?>

      <?rfc include='reference.RFC.4360'?>

      <?rfc include='reference.RFC.4760'?>

      <?rfc include='reference.RFC.7606'?>

      <?rfc include='reference.RFC.8174'?>

      <?rfc include='reference.RFC.8402'?>

      <?rfc include='reference.RFC.8660'?>

      <?rfc include='reference.RFC.8669'?>

      <?rfc include='reference.RFC.8955'?>

      <?rfc include='reference.RFC.8956'?>

      <?rfc include='reference.RFC.8986'?>

      <?rfc include='reference.RFC.9012'?>

      <?rfc include='reference.RFC.9117'?>

      <?rfc include='reference.RFC.9252'?>

      <?rfc include='reference.RFC.9256'?>
    </references>

    <references title="Informative References">
      <?rfc include='reference.RFC.5925'?>

      <?rfc include='reference.RFC.7942'?>

      <?rfc include='reference.RFC.8754'?>

      <?rfc include='reference.RFC.9830'?>

      <?rfc include='reference.RFC.9862'?>
    </references>
  </back>
</rfc>
