<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-ietf-idr-ts-flowspec-srv6-policy-21" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="true">

<front>
<title abbrev="FlowSpec with SR Policy">Traffic Steering using BGP FlowSpec with SR Policy</title><seriesInfo value="draft-ietf-idr-ts-flowspec-srv6-policy-21" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="W." surname="Jiang" fullname="Wenying 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 initials="Y." surname="Liu" fullname="Yisong 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 initials="S." surname="Zhuang" fullname="Shunwan Zhuang"><organization>Huawei Technologies</organization><address><postal><street>Huawei Bld., No.156 Beiqing Rd.</street>
<city>Beijing</city>
<code>100095</code>
<country>China</country>
</postal><email>zhuangshunwan@huawei.com</email>
</address></author><author initials="G." surname="Mishra" fullname="Gyan Mishra"><organization>Verizon Communications Inc.</organization><address><postal><street>13101 Columbia Pike</street>
<city>Silver Spring, MD 20904</city>
<country>United States of America</country>
</postal><email>hayabusagsm@gmail.com</email>
</address></author><author initials="S." surname="Chen" fullname="Shuanglong Chen"><organization>Huawei Technologies</organization><address><postal><street>Huawei Bld., No.156 Beiqing Rd.</street>
<city>Beijing</city>
<code>100095</code>
<country>China</country>
</postal><email>chenshuanglong@huawei.com</email>
</address></author><date/>
<area>Routing</area>
<workgroup>IDR Working Group</workgroup>
<keyword>BGP</keyword>
<keyword>FlowSpec</keyword>
<keyword>SR Policy</keyword>
<keyword>SRv6</keyword>
<keyword>SR-MPLS</keyword>
<keyword>Segment Routing</keyword>

<abstract>
<t>BGP Flow Specification (FlowSpec) provides mechanisms to distribute traffic filtering and steering rules across BGP networks.  This document specifies BGP FlowSpec procedures to steer matching traffic flows into Segment Routing (SR) Policies.  It defines two modes of operation: transport steering into an SR Policy (&quot;Mode 1&quot;), in SR-MPLS and SRv6 networks, using BGP Extended Communities; and, in SRv6 networks, transport steering combined with an egress service action at the egress node (&quot;Mode 2&quot;), signaled with the BGP Prefix-SID Attribute.</t>
</abstract>

</front>

<middle>

<section anchor="sec-intro"><name>Introduction</name>
<t>Segment Routing (SR) <xref target="RFC8402"></xref> leverages the source routing paradigm for both SR-MPLS <xref target="RFC8660"></xref> and SRv6 <xref target="RFC8754"></xref> <xref target="RFC8986"></xref>.  An SR Policy <xref target="RFC9256"></xref> defines an explicit ordering of segments to steer traffic through a network, which may be instantiated locally or signaled via BGP SR Policy <xref target="RFC9830"></xref> or the Path Computation Element Protocol (PCEP) for SR Policy <xref target="RFC9862"></xref>.</t>
<t>BGP Flow Specification (FlowSpec) <xref target="RFC8955"></xref> <xref target="RFC8956"></xref> <xref target="RFC9117"></xref> enables the dissemination of traffic filtering rules and associated actions using MP_REACH_NLRI / MP_UNREACH_NLRI <xref target="RFC4760"></xref> and Extended Community attributes <xref target="RFC4360"></xref>.</t>
<t>This document specifies BGP FlowSpec mechanisms to steer matching traffic flows into an SR Policy <xref target="RFC9256"></xref>.  It defines two operational modes:</t>

<ul>
<li><t>Transport Steering Only (Mode 1): Steers traffic into a transport SR Policy toward a target Endpoint.</t>
</li>
<li><t>Steering with Egress Service Action (Mode 2): Steers traffic into an SRv6 Policy while conveying an Egress Service SID for egress service action processing (e.g., decapsulation and routing table lookup in a specific Virtual Routing and Forwarding (VRF) table or the global table, or L3 interface cross-connect, as defined in <xref target="RFC8986"></xref> and signaled via <xref target="RFC9252"></xref>).</t>
</li>
</ul>
<t>Mode 2 is needed where the matching traffic is to be delivered into a specific routing table (for example, a VRF) or onto a specific interface at the egress Provider Edge (PE), which transport steering alone cannot express.</t>
<t>This document does not modify the base Segment Routing architecture <xref target="RFC8402"></xref> or SR Policy constructs <xref target="RFC9256"></xref>, but establishes the BGP FlowSpec interworking semantics for SR Policy steering.</t>

<section anchor="sec-req-lang"><name>Requirements Language</name>
<t>The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;NOT RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref> when, and only when, they appear in all capitals, as shown here.</t>
</section>
</section>

<section anchor="sec-definitions"><name>Definitions and Acronyms</name>

<section anchor="sec-terminology"><name>Terminology</name>

<ul>
<li><t>Mode 1 (Transport Steering Only): Steering traffic into an SR Policy (SR-MPLS or SRv6) toward a target Endpoint solely for transport path selection.</t>
</li>
<li><t>Mode 2 (Steering with Egress Service Action): Steering traffic into an SRv6 Policy toward a target Endpoint while executing an Egress Service SID function (e.g., decapsulation followed by routing table lookup via End.DT4/DT6/DT46, or L3 interface cross-connect via End.DX4/DX6 <xref target="RFC8986"></xref> <xref target="RFC9252"></xref>) at the egress PE.</t>
</li>
<li><t>Redirect-to-IP: The FlowSpec Redirect-to-IP Extended Community defined in <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>.</t>
</li>
<li><t>Egress Service SID: An SRv6 Service SID <xref target="RFC9252"></xref> that is signaled in the BGP Prefix-SID Attribute of a FlowSpec route and executed at the egress node of the SR Policy into which the matching traffic is steered.</t>
</li>
</ul>
</section>

<section anchor="sec-acronyms"><name>Acronyms</name>
<t>BGP: Border Gateway Protocol</t>
<t>BGP FS: BGP Flow Specification <xref target="RFC8955"></xref> <xref target="RFC8956"></xref> <xref target="RFC9117"></xref></t>
<t>EC: Extended Community <xref target="RFC4360"></xref></t>
<t>ECMP: Equal Cost Multi-Path</t>
<t>LPM: Longest Prefix Match</t>
<t>NLRI: Network Layer Reachability Information <xref target="RFC4271"></xref></t>
<t>PBR: Policy-Based Routing</t>
<t>PCEP: Path Computation Element Protocol</t>
<t>PE: Provider Edge</t>
<t>SID: Segment Identifier <xref target="RFC8402"></xref></t>
<t>SR-MPLS: Segment Routing over MPLS data plane <xref target="RFC8660"></xref></t>
<t>SRH: Segment Routing Header <xref target="RFC8754"></xref></t>
<t>SRv6: Segment Routing over IPv6 data plane <xref target="RFC8754"></xref> <xref target="RFC8986"></xref></t>
<t>UCMP: Unequal Cost Multi-Path</t>
<t>USD: Ultimate Segment Decapsulation (Flavor defined in <xref target="RFC8986"></xref>)</t>
<t>VRF: Virtual Routing and Forwarding</t>
</section>
</section>

<section anchor="sec-procedures"><name>Protocol Procedures</name>
<t>BGP FlowSpec NLRI <xref target="RFC8955"></xref> <xref target="RFC8956"></xref> 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"></xref> in either SR-MPLS or SRv6 data planes.</t>
<t>This specification relies on a two-tier control plane architecture:</t>

<ul>
<li><t>Transport Steering: The Color Extended Community <xref target="RFC9012"></xref> is combined with the FlowSpec Redirect-to-IP Extended Community <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> to form an explicit (Color, Endpoint) tuple.  This tuple binds the matching FlowSpec traffic to an SR Policy (SR-MPLS or SRv6) at the headend (Ingress PE) <xref target="RFC9256"></xref>.</t>
</li>
<li><t>Egress Service Action (SRv6-specific): For SRv6 scenarios requiring a specific egress service action (e.g., decapsulation and routing table lookup in a VRF or the global table, or L3 interface cross-connect, as defined in <xref target="RFC8986"></xref> and <xref target="RFC9252"></xref>) at the tailend router (Egress PE), the BGP Prefix-SID Attribute <xref target="RFC9252"></xref> may be attached to convey an SRv6 Service SID.</t>
</li>
</ul>
<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>

<section anchor="sec-relationship"><name>Relationship to Other Specifications</name>
<t>This document specifies, for the address families above:</t>

<ul>
<li><t>the use of the Color Extended Community <xref target="RFC9012"></xref>, including the Color-Only bits defined in Section 3 of <xref target="RFC9830"></xref>, which does not cover the use of the community in other address families.</t>
</li>
<li><t>the use of the BGP Prefix-SID Attribute <xref target="RFC8669"></xref>.  Section 1 of <xref target="RFC8669"></xref> leaves the use of the attribute in other AFI/SAFI combinations to future specifications; this document is such a specification.  The SRv6 Service TLV encodings of <xref target="RFC9252"></xref> are used as specified in <xref target="sec-psid"></xref>; the processing and error-handling procedures of <xref target="RFC9252"></xref> are written for address families in which the Service SID is required for forwarding and do not apply here.</t>
</li>
<li><t>steering into SR Policies <xref target="RFC9256"></xref> as PBR steering (Section 8.7 of <xref target="RFC9256"></xref>).  The BGP destination-steering procedures of Sections 8.4, 8.5 and 8.8 of <xref target="RFC9256"></xref> derive the Endpoint from a BGP next hop, which a FlowSpec route does not carry (Section 4 of <xref target="RFC8955"></xref>), and do not apply; the Endpoint is the target IP address of the Redirect-to-IP Extended Community.</t>
</li>
</ul>
<t>This document reuses the encodings defined by the referenced specifications (<xref target="RFC9012"></xref>, <xref target="RFC9830"></xref>, <xref target="RFC8669"></xref>, <xref target="RFC9252"></xref>, <xref target="RFC9256"></xref>, and <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>).  For IPv4 and IPv6 FlowSpec routes within the scope of <xref target="sec-scope"></xref>, it defines the steering, validation, and failure procedures specified below.  These procedures do not alter the behavior of the referenced specifications for routes outside that scope.</t>
</section>

<section anchor="sec-scope"><name>Scope</name>
<t>A FlowSpec route is within the scope of this document if it carries both a Redirect-to-IP Extended Community <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> and a Color Extended Community <xref target="RFC9012"></xref>, and carries no Redirect-to-VRF Extended Community.  Any other FlowSpec route is outside the scope of this document and is processed as specified in <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, <xref target="RFC8955"></xref> and <xref target="RFC8956"></xref>; a BGP Prefix-SID Attribute on such a route is ignored.</t>
<t>A route that carries a Redirect-to-VRF Extended Community (<xref target="RFC8955"></xref>, Section 7.4; <xref target="RFC8956"></xref>, Section 6.1) is outside the scope of this document irrespective of the other communities it carries, and is processed as specified in Section 2.2.1 of <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>.  This exclusion reflects the distinct nature of the two redirection mechanisms: the Redirect-to-VRF Extended Community performs a <em>local</em> redirection (the receiving headend immediately looks up and forwards matching traffic in the target VRF, with no tunnel), whereas the mechanisms of this document perform a <em>remote</em> redirection (matching traffic is carried through the SR Policy selected by the (Endpoint, Color) tuple toward the remote egress, where the egress service action, if any, is executed).  As a FlowSpec rule can direct its matching traffic to only one destination, the two mechanisms MUST NOT be combined on the same FlowSpec route.  VPN FlowSpec address families (SAFI=134) are outside the scope of this document.</t>
<t>Color-Only steering (Section 8.8 of <xref target="RFC9256"></xref>) is outside the scope of this document.  If the Color Extended Community carries a Color-Only Type other than Type 0 (Specific Endpoint Match) <xref target="RFC9830"></xref>, the receiver MUST treat it as Type 0.</t>
<t>For a route within scope, the procedures of this document apply in place of those of <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>; the two are not combined.  The target IP address is the SR Policy Endpoint (<xref target="sec-redirect-ip"></xref>) and not a forwarding target, so the reachability condition of Section 2.2 of <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> does not apply to it.  Section 8.1 of <xref target="RFC9256"></xref> specifies the default behavior for traffic on an SR Policy that becomes invalid; for a route within this scope, <xref target="sec-failure"></xref> specifies a different behavior.</t>
</section>

<section anchor="sec-modes"><name>Operational Steering Modes</name>
<t>Traffic steering specified in this document leverages BGP FlowSpec filtering rules to steer flows into SR Policies <xref target="RFC9256"></xref>.</t>
<t>FlowSpec-based steering corresponds to Policy-Based Routing (PBR) steering per Section 8.7 of <xref target="RFC9256"></xref> and does not perform per-destination steering (Section 8.4 of <xref target="RFC9256"></xref>).  Implementations MUST NOT apply per-destination route resolution, BGP multipath path selection, or On-Demand BSID recursion <xref target="RFC9256"></xref> to FlowSpec routes.</t>
<t>A BGP FlowSpec sender MUST construct the BGP UPDATE message using one of two operational modes: Mode 1 (Transport Steering Only) or Mode 2 (Steering with Egress Service Action).</t>

<section anchor="sec-mode1"><name>Mode 1: Steering Without Egress Service Action (SR-MPLS / SRv6)</name>
<t>When matching traffic requires steering into an SR Policy (SR-MPLS or SRv6) toward an Endpoint without a specific egress service action, Mode 1 steering applies:</t>

<ul>
<li><t>Sender Behavior: The sender MUST attach a Redirect-to-IP Extended Community and a Color Extended Community <xref target="RFC9012"></xref>, and MUST NOT attach the BGP Prefix-SID Attribute (see <xref target="sec-interworking"></xref> for attribute validation).</t>
</li>
<li><t>Ingress Behavior: Upon resolving the (Endpoint, Color) tuple per <xref target="sec-interworking"></xref>, the headend steers matching traffic into the resolved SR Policy by encapsulating it solely with the policy's segment list (MPLS label stack or SRH).</t>
</li>
<li><t>Egress Behavior: Decapsulation or label popping at the egress PE relies on the final segment behavior of the target SR Policy (e.g., Implicit Null for SR-MPLS or End function with Ultimate Segment Decapsulation (USD) flavor <xref target="RFC8986"></xref> for SRv6).</t>
</li>
</ul>
</section>

<section anchor="sec-mode2"><name>Mode 2: Steering With Egress Service Action (SRv6-specific)</name>
<t>When matching traffic requires steering into an SRv6 Policy and a specific service context or decapsulation behavior at the egress PE, Mode 2 steering applies:</t>

<ul>
<li><t>Sender Behavior: The sender MUST attach a Redirect-to-IP Extended Community, a Color Extended Community <xref target="RFC9012"></xref>, and the BGP Prefix-SID Attribute <xref target="RFC9252"></xref> carrying the Egress Service SID (encoded per <xref target="sec-psid"></xref>).</t>
</li>
<li><t>Ingress Behavior: The headend resolves the target SRv6 Policy using the (Endpoint, Color) tuple per <xref target="sec-interworking"></xref>, and synthesizes the active segment list in the SRH by combining the SR Policy segment list with the Egress Service SID per <xref target="sec-receiver"></xref>.</t>
</li>
<li><t>Egress Behavior: Upon receiving the packet, the egress PE executes the behavior bound to the Egress Service SID.  The supported DT/DX behaviors remove the outer IPv6 header and its extension headers before performing the specified routing-table lookup or L3 cross-connect (<xref target="RFC8986"></xref>, <xref target="RFC9252"></xref>).</t>
</li>
</ul>
</section>

<section anchor="sec-encap"><name>Data-Plane Encapsulation Considerations</name>
<t>When matching traffic is successfully resolved and steered into an SR Policy or Segment Routing path, the headend encapsulates the packet with an outer header (e.g., an outer IPv6 header with an SRH for SRv6) as specified in <xref target="RFC8754"></xref> and <xref target="RFC9256"></xref>.</t>
<t>For SRv6, the headend MAY omit the SRH only when the applicable requirements of Section 4.1 of <xref target="RFC8754"></xref> and Section 5 of <xref target="RFC8986"></xref> are met.  When SID compression is used, the headend MUST also satisfy the requirements of Section 6 of <xref target="RFC9800"></xref>, including its restrictions on SRH omission.</t>
</section>
</section>

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

<ol>
<li><t>Construct the explicit (Color, Endpoint) tuple by attaching the Color Extended Community <xref target="RFC9012"></xref> and setting the target IP address in the Redirect-to-IP Extended Community <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>.</t>
</li>
<li><t>If and only if every headend expected to receive the route resolves the (Endpoint, Color) tuple to an SRv6 Policy, and an egress service action is intended (Mode 2, <xref target="sec-mode2"></xref>), attach the BGP Prefix-SID Attribute carrying the SRv6 Service SID constructed per <xref target="sec-psid"></xref>.  A route carrying the BGP Prefix-SID Attribute is unusable at a headend that resolves the (Endpoint, Color) tuple to an SR-MPLS Policy: such a headend MUST NOT forward matching traffic using Mode 1 and MUST apply the failure procedures of <xref target="sec-resolution-failure"></xref>, per <xref target="sec-sequential"></xref>, Step 3.  Operators SHOULD NOT advertise Mode 2 routes to speakers whose data-plane resolution for the (Endpoint, Color) tuple is not known to be SRv6.</t>
</li>
</ol>
<t>A BGP speaker that re-advertises a FlowSpec route within the scope of this document does not modify the Color Extended Community, the Redirect-to-IP Extended Community or the BGP Prefix-SID Attribute it carries, except as specified in <xref target="sec-psid"></xref> for a malformed BGP Prefix-SID Attribute.  The next-hop-dependent procedures of Section 2 of <xref target="RFC9252"></xref> do not apply.  An operator MAY configure policy that removes the whole route at an administrative domain boundary (see <xref target="sec-leakage"></xref>).</t>
</section>

<section anchor="sec-receiver"><name>Procedures for the Receiving BGP Speaker (Headend / Ingress PE)</name>
<t>The procedures specified in this section apply to BGP FlowSpec receivers acting as SR headends.  A BGP speaker that is not acting as an SR headend for a FlowSpec route performs no SR Policy binding and propagates the route as specified in <xref target="sec-sender"></xref>.</t>
<t>Upon receiving a FlowSpec route, the headend performs evaluation and forwarding programming per the sequence specified in <xref target="sec-sequential"></xref>.  The procedures below expand on the operations referenced by the steps of that sequence:</t>

<ol>
<li><t>Validation and Mode Determination: The FlowSpec route is validated as specified in <xref target="RFC8955"></xref>, <xref target="RFC8956"></xref> and <xref target="RFC9117"></xref>, and malformed attributes are handled per <xref target="RFC7606"></xref>.  The validation procedure of Section 2.1 of <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> does not apply to a route within the scope of this document, whose target IP address is an SR Policy Endpoint.  The steering attributes determine whether the route is Mode 1 or Mode 2 per <xref target="sec-sequential"></xref>.</t>
</li>
<li><t>SR Policy Binding &amp; Synthesis: The headend uses the extracted (Color, Endpoint) tuple to select the SR Policy with that Color and Endpoint and its active Candidate Path (Sections 2.9 and 5 of <xref target="RFC9256"></xref>).  Matching traffic is steered into that SR Policy by PBR (Section 8.7 of <xref target="RFC9256"></xref>).</t>

<ul>
<li><t>For Mode 1, traffic is encapsulated using the active Segment List.</t>
</li>
<li><t>For Mode 2, the headend MUST synthesize the effective Segment List with the Egress Service SID (<xref target="sec-psid"></xref>) as follows:</t>

<ul>
<li><t>Appending: The headend MUST append the Egress Service SID as the final segment (innermost SID) of the Segment List, provided that the final segment of the resolved path is a forwarding or transit behavior.  However, the headend MUST NOT append a Service SID after a behavior (such as End.DT4, End.DT6, End.DT46, End.DX4, or End.DX6) that requires the SID to be in the final position of the list (see <xref target="RFC8986"></xref>, Sections 4.4-4.8).</t>
</li>
<li><t>Replacing: Alternatively, if the final segment of the resolved Segment List is known to the headend to be replaceable by the Egress Service SID, the headend MAY replace that final segment with the Egress Service SID.  Replacement MUST NOT be performed where it would discard a forwarding constraint expressed by the segment it replaces (for example, an End.X SID).  The means by which a headend determines that a segment is replaceable are outside the scope of this document.</t>
</li>
<li><t>Eligibility and Feasibility Check: Before using a synthesized Segment List (including lists used for weighted load sharing), the headend MUST verify that the resulting list preserves the transport constraints of the resolved SR Policy, is valid for the endpoint behaviors involved, and can be programmed in the forwarding plane.  If SRv6 SID compression <xref target="RFC9800"></xref> is used, the resulting sequence MUST be encoded in accordance with Section 6 of <xref target="RFC9800"></xref>.</t>
</li>
<li><t>Handling of Unusable Segment Lists: If neither appending nor permitted replacement produces a usable and valid list due to endpoint constraint violations, that specific Segment List is considered unusable.  When an individual Segment List within a multi-path or weighted load-sharing SR Policy is deemed unusable, it MUST be excluded from the active set, and the traffic load MUST be distributed across the remaining usable Segment Lists with adjusted weights (consistent with the behavior defined in <xref target="sec-loadbalancing"></xref>).  If all candidate Segment Lists for the steering binding are unusable, the failure procedures in <xref target="sec-resolution-failure"></xref> apply.</t>
</li>
</ul></li>
</ul>
<t>When an SR Policy is resolved, LPM redirection toward the target IP address is not performed (see <xref target="sec-scope"></xref>).  Non-steering FlowSpec actions in the same route remain applicable.</t>
</li>
<li><t>Control Plane Retention &amp; Decoupling: If a matching active SR Policy cannot be resolved for a received FlowSpec route carrying an explicit steering intent, or if the resolved SR Policy subsequently transitions to Down state:</t>

<ul>
<li><t>Control Plane: The FlowSpec route MUST be retained in the BGP Loc-RIB as a valid route (unless rendered invalid by standard BGP path validation rules) and MUST continue to be advertised to downstream BGP peers according to standard BGP path selection and propagation rules.  The headend MUST NOT implicitly invalidate or withdraw the BGP FlowSpec route solely due to underlay transport-layer resolution or SR Policy failures.</t>
</li>
<li><t>Forwarding Plane: The associated SR steering forwarding state (e.g., a PBR entry) MUST NOT be activated in the forwarding plane, or MUST be marked as inactive.  Matching traffic is handled as specified in <xref target="sec-resolution-failure"></xref>.</t>
</li>
</ul></li>
</ol>
</section>

<section anchor="sec-redirect-ip"><name>Interaction with Redirect-to-IP Extended Community</name>
<t>When a FlowSpec route carries both a Color Extended Community <xref target="RFC9012"></xref> and a Redirect-to-IP Extended Community <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, the target IP address MUST be interpreted as the target SR Policy Endpoint to form the explicit (Color, Endpoint) tuple <xref target="RFC9256"></xref>.</t>

<ul>
<li><t>Single Redirect-to-IP Enforcement: A sender using the procedures of this document MUST attach exactly one Redirect-to-IP Extended Community.  Multiple Redirect-to-IP Extended Communities are not supported by this document: a FlowSpec route within the scope of this document that carries multiple Redirect-to-IP Extended Communities MUST be handled with the &quot;treat-as-withdraw&quot; action of <xref target="RFC7606"></xref> (i.e., the FlowSpec rule ceases to exist locally and is not re-advertised), and the headend SHOULD generate a diagnostic log entry.</t>
</li>
<li><t>Color Selection: If multiple Color Extended Communities are present, the headend selects the SR Policy using the Color with the highest numerical value for which an SR Policy to the target Endpoint is valid; if no Color yields a valid SR Policy, <xref target="sec-resolution-failure"></xref> applies.  This follows the preference order of Section 8.4.1 of <xref target="RFC9256"></xref>; the per-destination steering procedures of Section 8.4 of <xref target="RFC9256"></xref> are not used.</t>
</li>
</ul>
</section>

<section anchor="sec-psid"><name>BGP Prefix-SID Attribute Encoding and Validation Rules</name>
<t>The BGP Prefix-SID Attribute <xref target="RFC8669"></xref> is used strictly for conveying SRv6 Service SIDs in SRv6 Mode 2 (<xref target="sec-mode2"></xref>) and MUST NOT be attached for SR-MPLS.  The SRv6 Service TLV encodings of <xref target="RFC9252"></xref> and the SRv6 SID encodings of <xref target="RFC8986"></xref> are used as follows:</t>

<ul>
<li><t>SRv6 Service TLVs and Selection Rules: The SRv6 L3 Service TLV (Type 5) MUST be used, containing an SRv6 SID Information Sub-TLV (Type 1).  A sender MUST include exactly one SRv6 L3 Service TLV containing exactly one SRv6 SID Information Sub-TLV.  If multiple SRv6 L3 Service TLVs are received, all but the first MUST be ignored.  Within the selected TLV, the receiver MUST use the first SRv6 SID Information Sub-TLV.  The SRv6 SID Structure Sub-Sub-TLV (Type 1) MAY be included.  SRv6 L2 Service TLVs (e.g., Type 6) MUST NOT be included for Layer 3 FlowSpec (SAFI 133) and MUST be ignored if received, treating the route as lacking an Egress Service SID.</t>
</li>
<li><t>Endpoint Behaviors and AFI Matching: Supported codepoints are restricted to Layer 3 behaviors (<xref target="RFC8986"></xref>).  Layer 2 and transit behaviors MUST NOT be used.  Furthermore, the selected SRv6 Endpoint Behavior MUST match the respective FlowSpec AFI/SAFI:</t>

<ul>
<li><t>For IPv4 FlowSpec, the behavior MUST be End.DT4, End.DX4, or End.DT46.</t>
</li>
<li><t>For IPv6 FlowSpec, the behavior MUST be End.DT6, End.DX6, or End.DT46.  (An IPv4 payload MUST NOT be delivered through End.DT6 or End.DX6, and an IPv6 payload MUST NOT be delivered through End.DT4 or End.DX4).</t>
</li>
</ul></li>
<li><t>Disallowance of Transposition and Structure Constraints: Transposition Schemes (<xref target="RFC9252"></xref>) MUST NOT be used because FlowSpec NLRIs lack an MPLS Label field.  The full SRv6 Service SID MUST be encoded entirely within the SRv6 SID Information Sub-TLV.  If the SRv6 SID Structure Sub-Sub-TLV is present, its Transposition Length, Transposition Offset, and Argument Length fields MUST all be zero.  The SID and, when present, its structure MUST satisfy the applicable requirements of <xref target="RFC9252"></xref>, as updated by <xref target="RFC9819"></xref>.  For the behaviors supported by this document, all bits following the function portion of the SID MUST be zero.</t>
</li>
</ul>
<t>Two classes of BGP Prefix-SID Attribute failure are distinguished:</t>

<ul>
<li><t>Malformed attribute: A BGP Prefix-SID Attribute that cannot be parsed per <xref target="RFC8669"></xref> and <xref target="RFC9252"></xref> (e.g., undecodable TLVs, invalid encoding).  A headend that receives such an attribute on an in-scope FlowSpec route SHOULD treat the route per the &quot;treat-as-withdraw&quot; action of <xref target="RFC7606"></xref>, and MUST NOT re-advertise the route as a Mode 1 route, so that the service intent is not silently removed for downstream speakers.  The headend SHOULD generate a diagnostic log entry.</t>
</li>
<li><t>Semantic, matching or authorization failure: An attribute that is well-formed but whose SRv6 SID Information Sub-TLV does not contain a usable Egress Service SID, or that violates any of the validation and matching rules specified above (e.g., wrong behavior for the AFI, unauthorized SID).  The headend MUST ignore the attribute for local forwarding decisions, MUST NOT forward matching traffic using Mode 1 as a result of a missing, malformed, unsupported, unauthorized, or otherwise unusable Egress Service SID, and MUST apply the failure procedures of <xref target="sec-resolution-failure"></xref>.  The headend SHOULD generate a diagnostic log entry.  The attribute MUST be propagated unmodified to downstream BGP speakers per standard BGP propagation: authorization is a local decision, and one headend's local policy MUST NOT strip the service intent from the route for other speakers.  For C-bit = 1, this failure affects only the copied stream, as specified in <xref target="sec-cbit"></xref>.</t>
</li>
</ul>
</section>

<section anchor="sec-failure"><name>Steering Failure and Fallback Procedures</name>
<t><xref target="sec-no-color"></xref> states how a route without a Color Extended Community is handled.  <xref target="sec-resolution-failure"></xref> specifies the handling of a route within the scope of this document whose SR Policy or Egress Service SID cannot be resolved.</t>

<section anchor="sec-no-color"><name>Routes Without a Color Extended Community</name>
<t>A FlowSpec route that carries a Redirect-to-IP Extended Community but no Color Extended Community is outside the scope of this document (see <xref target="sec-scope"></xref>).  It is processed as specified in <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, and a BGP Prefix-SID Attribute on it is ignored.</t>
</section>

<section anchor="sec-resolution-failure"><name>Policy and SID Resolution Failures (Forwarding Plane Failure)</name>
<t>This section applies to FlowSpec routes whose steering attributes are syntactically valid but whose intended SR Policy steering cannot be achieved.  Handling of malformed attributes (e.g., a malformed BGP Prefix-SID Attribute per <xref target="sec-psid"></xref>, or multiple Redirect-to-IP Extended Communities per <xref target="sec-redirect-ip"></xref>) is governed by <xref target="RFC7606"></xref> and results in the route being treated as withdrawn — i.e., the FlowSpec rule ceases to exist locally, and matching traffic is not subject to this section's failure handling.</t>
<t>If a FlowSpec route contains both a valid Redirect-to-IP Extended Community and a Color Extended Community (expressing explicit SR steering intent), but:</t>

<ul>
<li><t>The corresponding (Endpoint, Color) SR Policy is Down, unresolvable, or not programmed in the forwarding plane; or</t>
</li>
<li><t>The target SR Policy is active, but the headend cannot construct and program an eligible effective Segment List containing the authorized Egress Service SID; or</t>
</li>
<li><t>The headend resolves the (Endpoint, Color) tuple to an SR-MPLS Policy for a Mode 2 route;</t>
</li>
</ul>
<t>Then, to prevent silent SLA violations and unexpected path leakage, the headend MUST NOT fall back to shortest-path IP forwarding, or to Redirect-to-IP forwarding, toward the target IP address.</t>
<t>Matching traffic MUST be processed according to local administrative failure policy, subject to <xref target="sec-cbit"></xref> where the C-bit is set.  The local failure policy MUST be one of:</t>

<ul>
<li><t>Drop the matching traffic (Drop-on-Failure).  This is the default action.</t>
</li>
<li><t>Forward the matching traffic by the normal destination-based forwarding lookup, ignoring the FlowSpec steering action.</t>
</li>
</ul>
<t>Under no circumstance MUST the traffic be forwarded by IP or LPM redirection toward the target IP address of the Redirect-to-IP Extended Community.</t>
<t>Other non-steering FlowSpec actions present in the same route (e.g., Traffic-Rate, DSCP remarking) MUST continue to be enforced.</t>
<t>These procedures apply irrespective of whether the target IP address in the Redirect-to-IP Extended Community is reachable in the headend's routing table: within the scope of this document that address identifies an SR Policy Endpoint, not a forwarding target.</t>
</section>

<section anchor="sec-diagnostics"><name>Diagnostics and Recovery</name>
<t>A headend that is unable to program the forwarding plane for a FlowSpec route within the scope of this document SHOULD generate a diagnostic notification identifying the route and the reason (for example, a YANG notification <xref target="RFC8639"></xref>, a Syslog message <xref target="RFC5424"></xref> or an SNMP notification <xref target="RFC3411"></xref>).</t>
<t>A headend that was unable to program the forwarding plane owing to a transient resource constraint SHOULD re-attempt programming when resources become available, without requiring the route to be re-advertised.  This SHOULD may be bypassed when the resource constraint is not expected to clear (e.g., persistent hardware table exhaustion), or when the route has since been updated or withdrawn; the consequence of bypassing it is that the affected FlowSpec route remains without forwarding state (and its matching traffic continues to be handled per <xref target="sec-resolution-failure"></xref>) until resources become available or the route is re-advertised.</t>
<t>A headend should maintain a counter, per FlowSpec route, of packets discarded under <xref target="sec-resolution-failure"></xref>, so that an operator can distinguish traffic dropped by steering failure from traffic dropped by an explicit FlowSpec action.</t>
</section>
</section>

<section anchor="sec-cbit"><name>Handling of the Redirect-to-IP C-bit</name>
<t>The Redirect-to-IP Extended Community <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> includes a C-bit (Copy Bit) in its Local Administrator field:</t>

<ul>
<li><t>C-bit = 0 (Direct Redirection): Matching packets MUST be encapsulated and steered into the resolved SR Policy, bypassing normal IP routing.</t>
</li>
<li><t>C-bit = 1 (Traffic Copying): The headend MUST duplicate matching packets.  The original packet continues along normal IP routing without encapsulation, while the copy is encapsulated and steered into the resolved SR Policy per <xref target="sec-modes"></xref>.</t>
</li>
</ul>
<t>Setting C-bit = 1 does not alter SR Policy resolution logic; (Endpoint, Color) resolution and BGP Prefix-SID Attribute processing remain unchanged for the copied stream.  The failure procedures of <xref target="sec-failure"></xref> and <xref target="sec-sla-protection"></xref> apply only to the copied stream: on steering failure, the copy MUST be discarded, and the original stream MUST continue to be forwarded by normal IP routing, unaffected by the steering failure.</t>
</section>

<section anchor="sec-loadbalancing"><name>Load Balancing Considerations</name>
<t>When matching traffic is steered into an SR Policy with multiple active Segment Lists <xref target="RFC9256"></xref>, the headend MUST distribute traffic across active Segment Lists according to their defined weights (ECMP/UCMP).  FlowSpec filtering actions direct traffic into the policy as a single aggregate stream and MUST NOT alter Segment List selection.</t>
<t>The headend acts as an SR source node for the traffic it steers.  For SRv6, the outer IPv6 Flow Label is computed from the inner packet as specified in Section 5.5 of <xref target="RFC8754"></xref>, which also provides the entropy used for multipath hashing by transit nodes.  This document imposes no additional requirement and grants no exception.</t>
</section>

<section anchor="sec-compat"><name>Backward Compatibility and Coexistence</name>
<t>A BGP speaker that implements base FlowSpec <xref target="RFC8955"></xref> <xref target="RFC8956"></xref> and Redirect-to-IP, but not this specification, processes such routes under the rules of those specifications:</t>

<ul>
<li><t>Attribute Propagation: The BGP Prefix-SID Attribute is an optional transitive attribute <xref target="RFC8669"></xref>.  A speaker that does not recognize it propagates it with the Partial bit set <xref target="RFC4271"></xref>.</t>
</li>
<li><t>Forwarding on non-supporting headends: A non-supporting headend processes the route as specified in <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, which may result in LPM redirection toward the target IP address.  Such forwarding is outside the forwarding paths defined in this document.</t>
</li>
</ul>
<t>Implementations MUST support administrative controls to enable or disable advertisement of SRv6 service steering attributes per neighbor and per service <xref target="RFC9252"></xref>.  Filtering at domain boundaries is specified in <xref target="sec-leakage"></xref>; an operator who requires that these attributes not leave a domain configures it rather than relying on non-support.</t>
</section>
</section>

<section anchor="sec-interworking"><name>Multi-Attribute Interworking and Steering Resolution</name>
<t>When a router receives a BGP FlowSpec route carrying a combination of the Redirect-to-IP Extended Community, the Color Extended Community, and the BGP Prefix-SID Attribute, it MUST evaluate these attributes in a sequential pipeline to resolve the steering action.</t>

<section anchor="sec-sequential"><name>Sequential Resolution Logic</name>
<t>The headend evaluates received attribute containers step-by-step.  The steps below form the authoritative processing sequence; <xref target="sec-receiver"></xref> expands on the operations referenced by each step.</t>
<t>Before Step 1, the headend applies the scope determination of <xref target="sec-scope"></xref>: a route carrying a Redirect-to-VRF Extended Community is outside the scope of this document irrespective of the other attributes it carries, and a route carrying neither a Redirect-to-IP Extended Community nor a Color Extended Community is outside the scope of this document.  Such routes are not evaluated by the steps below and are processed as specified in <xref target="sec-scope"></xref>.</t>
<t>The data-plane outcome of the sequence (SR-MPLS versus SRv6) is not itself a sequence step: it is a property of how the headend resolves the (Endpoint, Color) tuple, determined by the upper-layer control plane from the information carried in the attributes and in the local SR Policy state (e.g., a headend whose transport for the tuple is SR-MPLS can determine, prior to tuple resolution, that a Mode 2 route will fail-closed per <xref target="sec-resolution-failure"></xref>).</t>
<t>Step 1: Redirect-to-IP Extended Community</t>

<ul>
<li><t>Absent: Procedures in this document do not apply.  Process route per standard BGP FlowSpec <xref target="RFC8955"></xref> <xref target="RFC8956"></xref>.</t>
</li>
<li><t>Present, exactly one: Extract target IP as SR Policy Endpoint, process C-bit (<xref target="sec-cbit"></xref>), and proceed to Step 2.</t>
</li>
<li><t>Present, more than one: Not a supported combination; handle per the &quot;treat-as-withdraw&quot; action of <xref target="RFC7606"></xref> (<xref target="sec-redirect-ip"></xref>).  The sequence terminates; the FlowSpec rule ceases to exist locally.</t>
</li>
</ul>
<t>Step 2: Color Extended Community</t>

<ul>
<li><t>Absent: The route is outside the scope of this document and is processed as specified in <xref target="sec-no-color"></xref>.</t>
</li>
<li><t>Present: Extract Color value C to form the (Endpoint, Color) tuple.  If multiple Color Extended Communities are present, the headend selects the Color per <xref target="sec-redirect-ip"></xref> (abnormal-case handling).  Proceed to Step 3.</t>
</li>
</ul>
<t>Step 3: BGP Prefix-SID Attribute (PSID) - Mode Determination</t>

<ul>
<li><t>Note: This step is a pure attribute-layer determination of Mode 1 versus Mode 2.  Data-plane matching is not performed in this step; whether the resolved SR Policy is SR-MPLS or SRv6 is an outcome of the (Endpoint, Color) tuple resolution in <xref target="sec-receiver"></xref>.</t>
</li>
<li><t>Absent (Mode 1): Resolve and steer traffic into the SR Policy corresponding to (Endpoint, Color) per <xref target="sec-receiver"></xref>.  For SR-MPLS and SRv6 data planes alike, this includes both the SR-MPLS and the SRv6 USD-flavored cases of Table 1.  If no valid SR Policy can be resolved, <xref target="sec-resolution-failure"></xref> applies.</t>
</li>
<li><t>Present (Mode 2): Validate the attribute per <xref target="sec-psid"></xref>.  If the attribute is malformed, handle per the &quot;treat-as-withdraw&quot; action of <xref target="RFC7606"></xref>; the sequence terminates and the FlowSpec rule ceases to exist locally.  Otherwise, extract the Egress Service SID, resolve the SR Policy via (Endpoint, Color), and synthesize the active segment list per <xref target="sec-receiver"></xref> and <xref target="sec-psid"></xref>.  If the (Endpoint, Color) tuple resolves to an SR-MPLS Policy, or if no usable Egress Service SID can be determined, the BGP Prefix-SID Attribute MUST NOT be used for SR-MPLS steering, the headend MUST NOT forward matching traffic using Mode 1, and the failure procedures of <xref target="sec-resolution-failure"></xref> apply, with a diagnostic log entry generated.</t>
</li>
</ul>
</section>

<section anchor="sec-combinations"><name>Valid Attribute Combinations Summary</name>
<t>Table 1 summarizes all possible attribute combinations and their corresponding resolution modes after applying the sequential logic above.</t>

<sourcecode type="ascii-art"><![CDATA[Table 1: FlowSpec to SR Policy Steering Resolution

+-------------+----------+-----------+------------------------------+
| Redirect-   | Color EC | Prefix-SID| Steering Resolution Mode     |
| to-IP       |          |           |                              |
+-------------+----------+-----------+------------------------------+
| Present     | Present  | Absent    | Mode 1: Transport Steering   |
|             |          |           | (SR-MPLS / SRv6 USD)         |
+-------------+----------+-----------+------------------------------+
| Present     | Present  | Present   | Mode 2: Transport Steering + |
|             |          |           | Egress Service Action (SRv6) |
+-------------+----------+-----------+------------------------------+
| Present     | Absent   | Any       | Out of Scope for SR Policy   |
|             |          |           | (Standard Redirect-to-IP;    |
|             |          |           | Prefix-SID ignored)          |
+-------------+----------+-----------+------------------------------+
| Absent      | Ignored  | Ignored   | Out of Scope for SR Policy   |
|             |          |           | (Standard FlowSpec)          |
+-------------+----------+-----------+------------------------------+
]]></sourcecode>
<t>Notes:</t>

<ul>
<li><t>A route whose attributes fall in the third or fourth row of Table 1 is outside the scope of this document: a route in the third row is processed as specified in <xref target="sec-no-color"></xref> (per <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, with a BGP Prefix-SID Attribute, if present, ignored), and a route in the fourth row is processed per standard BGP FlowSpec <xref target="RFC8955"></xref> <xref target="RFC8956"></xref>.</t>
</li>
<li><t>A route carrying a Redirect-to-VRF Extended Community is outside the scope of this document irrespective of the other attributes it carries (i.e., irrespective of which row its other attributes would otherwise match): it is processed as a local redirection to the target VRF per <xref target="sec-scope"></xref>, and the procedures of this document do not apply to it.</t>
</li>
<li><t>The &quot;(SR-MPLS / SRv6 USD)&quot; annotation of the first row denotes the two data-plane forms of Mode 1, not two distinct modes: for SR-MPLS, decapsulation relies on the implicit label-popping behavior of the final label; for SRv6, it relies on the final segment of the resolved SR Policy supporting the USD flavor <xref target="RFC8986"></xref> (see <xref target="sec-mode1"></xref>).  In both cases the (Endpoint, Color) tuple selects the SR Policy.</t>
</li>
</ul>
</section>

<section anchor="sec-sla-protection"><name>Protection Against Silent SLA Violations</name>
<t>To prevent unintentional redirection and SLA violations, implementations MUST strictly enforce the following rules:</t>

<ol>
<li><t>Steering Failure: For a route within the scope of this document, the procedures of <xref target="sec-resolution-failure"></xref> apply; matching traffic is not forwarded by standard IP or Redirect-to-IP forwarding toward the target IP address, and is handled according to the local administrative failure policy of <xref target="sec-resolution-failure"></xref>, which defaults to discarding the traffic.</t>
</li>
<li><t>Enforcement of Non-Steering Actions: In all failure cases, other valid non-steering actions present in the FlowSpec route (e.g., Traffic-Rate/Drop <xref target="RFC8955"></xref>, DSCP remarking) MUST continue to be enforced in the forwarding plane.</t>
</li>
<li><t>Logging and Diagnostics: Implementations should generate diagnostic log entries whenever an SR Policy steering route contains corrupted or invalid steering attributes.  An exception to this &quot;should&quot; occurs during high-volume error events or flood conditions (e.g., malformed route injection attacks), where strict per-route logging could exhaust control plane CPU or storage resources.  In such scenarios, implementations MAY rate-limit, aggregate, or temporarily suppress individual diagnostic log entries, provided that summary metrics or counter-based telemetry remain available to operators.</t>
</li>
</ol>
</section>
</section>

<section anchor="sec-ops"><name>Operational Considerations</name>
<t>FlowSpec provides a control-plane mechanism for distributing traffic matches and their SR Policy bindings.  Operators need to account for classifier capacity, the number of policy bindings and synthesized encapsulations, and the effect of policy changes on forwarding-state programming.</t>
<t>The mechanisms defined in this document are intended for deployment within an SR domain <xref target="RFC8402"></xref> under a single administrative control, which may span multiple ASes.  <xref target="sec-leakage"></xref> specifies the filtering of these routes and attributes at the boundaries of that domain.</t>
<t>The selection of Mode 1 or Mode 2 for a given FlowSpec route is determined by the attributes the sender attaches, per Table 1: a sender that attaches only the Redirect-to-IP and Color Extended Communities requests Mode 1; a sender that additionally attaches the BGP Prefix-SID Attribute requests Mode 2.  Advertisement of these attributes is a configurable behavior (see the per-neighbor and per-service administrative controls in <xref target="sec-compat"></xref>).  A receiver does not need to be configured to distinguish the modes: the sequential logic of <xref target="sec-sequential"></xref> derives the mode from the received attributes.</t>
<t>In deployments mixing headends that support this specification with headends that do not, or mixing SR-MPLS and SRv6 resolution for the same (Endpoint, Color) tuple, the same FlowSpec route can be processed differently on different headends: a supporting SRv6 headend steers per this document, a supporting SR-MPLS headend fails closed for a Mode 2 route per <xref target="sec-resolution-failure"></xref>, and a non-supporting headend processes the route per <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> (see <xref target="sec-compat"></xref>).  There is no in-band signal distinguishing these outcomes.  Operators therefore SHOULD scope the advertisement of in-scope FlowSpec routes, and in particular of Mode 2 routes, to BGP speakers that are known to support this specification and to resolve the (Endpoint, Color) tuple to the intended data plane.</t>
<t>For concrete application scenarios, detailed flow steering sequences, and an overall operational workflow summary, readers should refer to <xref target="sec-appendix-a"></xref> (with a high-level summary provided in <xref target="sec-a23"></xref>).</t>
<t><xref target="sec-diagnostics"></xref> specifies the notifications, re-attempts and counters a headend provides when steering fails; operators can use the counters to distinguish steering failures from deliberate discards.</t>
</section>

<section anchor="sec-security"><name>Security Considerations</name>
<t>The security considerations of BGP FlowSpec <xref target="RFC8955"></xref> <xref target="RFC8956"></xref>, Redirect-to-IP <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, BGP Prefix-SID <xref target="RFC9252"></xref>, and core Segment Routing <xref target="RFC8402"></xref> apply to this document.  Combining FlowSpec redirection with SR Policy selection and SRv6 Service SIDs introduces specific threat vectors that need to be mitigated, as described in the subsections below.</t>

<section anchor="sec-vrf-injection"><name>Cross-Table/VRF Traffic Injection and Service Hijacking</name>
<t>The BGP Prefix-SID Attribute in a FlowSpec route conveys an SRv6 Service SID (e.g., End.DT4/DT6/DT46, End.DX4/DX6 <xref target="RFC8986"></xref> <xref target="RFC9252"></xref>) that determines the egress routing table (e.g., a specific VRF or the global table) or specific egress interface at the egress PE.  A malicious or compromised speaker could steer traffic into an arbitrary remote VRF, the global routing context, or an unauthorized interface, causing unauthorized traffic injection, cross-table/VRF data leakage, or traffic interception.</t>
<t>To mitigate this, receiving PEs MUST validate that any SRv6 Service SID belongs to an authorized Locator range allocated for the target VRF, global table, or service context.  The mapping of authorized Locator ranges to VRFs and service contexts is derived from local device configuration or controller provisioning, since the ingress PE cannot otherwise determine the locator assignments of a remote egress PE.  BGP sessions with FlowSpec controllers MUST be secured using TCP-AO <xref target="RFC5925"></xref> and restricted to trusted entities.</t>
</section>

<section anchor="sec-validation-limits"><name>Scope and Validation Limits of BGP FlowSpec Attributes</name>
<t>The validation procedures of <xref target="RFC8955"></xref>, <xref target="RFC8956"></xref>, and <xref target="RFC9117"></xref> validate FlowSpec routes against unicast routing information.  The additional Redirect-to-IP validation procedure in <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref> does not apply to routes within the scope of this document, as specified in <xref target="sec-receiver"></xref>.  These checks do not authorize the Color Extended Community or the service context conveyed by the BGP Prefix-SID Attribute; those require the local authorization checks specified in this section and <xref target="sec-vrf-injection"></xref>.</t>
<t>An attacker could alter or strip these attributes.  Injecting an unauthorized Color EC could hijack traffic onto unintended SR paths.  Conversely, stripping the Color EC from a route takes it out of the scope of this document (<xref target="sec-no-color"></xref>): the traffic is then redirected as specified in <xref target="I-D.ietf-idr-flowspec-redirect-ip"></xref>, bypassing the SR Policy and, for Mode 2, the Egress Service SID.</t>
<t>Headends MUST apply local policy checks to verify that the (Color, Endpoint) tuple resolves to an authorized SR Policy before binding traffic.  Filtering of these attributes at administrative domain boundaries is specified in <xref target="sec-leakage"></xref>.  Implementations SHOULD generate log messages or management alarms when unexpected attribute stripping is detected.</t>
</section>

<section anchor="sec-leakage"><name>SR Domain Leakage and Boundary Security</name>
<t>SRv6 SIDs and BGP Prefix-SID Attributes are intended strictly for use within a trusted SR domain <xref target="RFC8402"></xref> <xref target="RFC8754"></xref> <xref target="RFC8986"></xref> <xref target="RFC9252"></xref>.  Propagation across untrusted EBGP boundaries leaks internal SRv6 Locators and topology, exposing the domain to external steering attacks.</t>
<t>FlowSpec routes within the scope of this document, including their Redirect-to-IP, Color and, where present, BGP Prefix-SID attributes, are scoped to a single administrative domain.  BGP speakers at the boundary of the administrative domain MUST NOT advertise in-scope FlowSpec routes, or the steering attributes they carry, to BGP peers outside that domain.  Where multiple ASes are under a single administrative control with explicit inter-domain trust, filtering is applied at the edge of that administrative domain instead.  Removing the BGP Prefix-SID Attribute or the Color Extended Community while still advertising the route outside the domain is NOT RECOMMENDED, as the residual Redirect-to-IP Extended Community would redirect external matching traffic toward an internal SR Policy Endpoint by LPM resolution (see also Section 5 of <xref target="RFC8669"></xref>).</t>
</section>

<section anchor="sec-amplification"><name>Traffic Amplification and Path Pinning</name>
<t>A single FlowSpec route can match high-volume distributed flows across multiple Ingress PEs and redirect them to a single destination <xref target="RFC9117"></xref>.  Binding redirected flows to an SR Policy allows an attacker to pin amplified traffic to a specific engineered path, potentially overloading transit nodes or egress interfaces.</t>
<t>Ingress PEs SHOULD combine FlowSpec redirect actions with Traffic Rate Extended Communities <xref target="RFC8955"></xref> to bound redirected bandwidth.  An exception to this SHOULD requirement occurs when a FlowSpec route is deployed for legitimate traffic steering and rate limiting would cause unwanted packet drops, where adequate capacity planning guarantees sufficient bandwidth along the candidate path.</t>
<t>Implementations SHOULD monitor path utilization on SR Policies used for FlowSpec steering to detect and mitigate link congestion dynamically.  An exception to this SHOULD requirement occurs in centralized control plane architectures where automated Controller-based TE or PCE monitoring dynamically adjusts policy pathing and prevents link congestion automatically.</t>
</section>
</section>

<section anchor="sec-implementation"><name>Implementation Status</name>
<t>[Note to the RFC Editor: Please remove this section before publication, as well as remove the reference to <xref target="RFC7942"></xref>.  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"></xref>.  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"></xref>, &quot;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&quot;.</t>

<section anchor="sec-interop"><name>Interop-test Status</name>
<t>The traffic steering mechanism using BGP FlowSpec with SR-MPLS and SRv6 Policies described in this specification has been implemented by multiple major networking vendors across hardware platforms, router operating systems, and SDN controllers.</t>
<t>These implementations successfully participated in multi-vendor joint interoperability testing events organized by China Mobile between July 2021 and October 2021.  The following hardware devices, software versions, and controllers passed the interoperability suite (listed in alphabetical order by vendor):</t>
<t>Routers:</t>

<sourcecode type="ascii-art"><![CDATA[+---------+---------------+--------------------------------+
| Vendor  | Device Model  | Version                        |
+---------+---------------+--------------------------------+
| Huawei  | NE40E-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)               |
+---------+---------------+--------------------------------+
]]></sourcecode>
<t>Controllers:</t>

<sourcecode type="ascii-art"><![CDATA[+----------------+---------------+-------------------------+
| Vendor         | System Name   | 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            |
+----------------+---------------+-------------------------+
]]></sourcecode>
</section>

<section anchor="sec-deployment"><name>Deployment Status</name>
<t>The mechanisms specified in this document have been natively deployed and in active production use on large-scale IP backbone networks, including China Mobile's production network, since August 2022.</t>
<t>In production deployments featuring pure SRv6 architectures, traffic steering driven by FlowSpec routes with Color Extended Communities and IPv6 Redirect addresses operates over SRv6 Policies.  In hybrid or multi-AS network environments where SR-MPLS and SRv6 coexist, policy selection for FlowSpec traffic steering adheres strictly to the steering framework defined in <xref target="RFC9256"></xref>.</t>
</section>
</section>

<section anchor="sec-iana"><name>IANA Considerations</name>
<t>This document requires no IANA actions.</t>
</section>

<section anchor="sec-contributors"><name>Contributors</name>
<t>The following people made significant contributions to this document:</t>
<t>Yunan Gu<br />
Huawei Technologies<br />
Email: guyunan@huawei.com</t>
<t>Haibo Wang<br />
Huawei Technologies<br />
Email: rainsword.wang@huawei.com</t>
<t>Jie Dong<br />
Huawei Technologies<br />
Email: jie.dong@huawei.com</t>
<t>Xue Yang<br />
China Mobile<br />
Email: yangxuewl@chinamobile.com</t>
</section>

<section anchor="sec-ack"><name>Acknowledgements</name>
<t>The authors would like to thank:</t>

<ul>
<li><t>Nat Kao for suggesting the inclusion of SR-MPLS use cases and providing detailed recommendations regarding failure and fallback procedures.</t>
</li>
<li><t>Ketan Talaulikar for his in-depth review and valuable input, which substantially enhanced the precision and overall quality of this document.</t>
</li>
<li><t>Donald E. Eastlake, 3rd for his thorough review and insightful suggestions.</t>
</li>
</ul>
<t>The authors also gratefully acknowledge the reviews, 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 (Sandy), Xuewei Wang, Yanrong Liang, Xuhui Cai, Haojie Wang, Lili Wang, Nan Geng, Stephane Litkowski, Zhenqiang Li, Jinming Li, Shengnan Yue, Yao Liu, Yujia Gao, Zhiyuan Wang, Guanming Zeng, Jianwei Mao, Xiaoming He, Ziqing Cao and Giuseppe Fioccola.</t>
</section>

</middle>

<back>
<references><name>References</name>
<references><name>Normative References</name>
<reference anchor="I-D.ietf-idr-flowspec-redirect-ip" target="https://datatracker.ietf.org/doc/html/draft-ietf-idr-flowspec-redirect-ip-16">
  <front>
    <title>BGP Flow-Spec Redirect-to-IP Action</title>
    <author fullname="Jeffrey Haas" initials="J." surname="Haas"></author>
    <author fullname="Wim Henderickx" initials="W." surname="Henderickx"></author>
    <author fullname="Adam Simpson" initials="A." surname="Simpson"></author>
    <date year="2026" month="May"></date>
  </front>
  <seriesInfo name="Internet-Draft" value="draft-ietf-idr-flowspec-redirect-ip-16"></seriesInfo>
</reference>
<reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
  <front>
    <title>Key words for use in RFCs to Indicate Requirement Levels</title>
    <author fullname="Scott Bradner" initials="S." surname="Bradner"></author>
    <date year="1997" month="March"></date>
  </front>
  <seriesInfo name="BCP" value="14"></seriesInfo>
  <seriesInfo name="RFC" value="2119"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC2119"></seriesInfo>
</reference>
<reference anchor="RFC4271" target="https://www.rfc-editor.org/info/rfc4271">
  <front>
    <title>A Border Gateway Protocol 4 (BGP-4)</title>
    <author fullname="Yakov Rekhter" initials="Y." surname="Rekhter"></author>
    <author fullname="Tony Li" initials="T." surname="Li"></author>
    <author fullname="Susan Hares" initials="S." surname="Hares"></author>
    <date year="2006" month="January"></date>
  </front>
  <seriesInfo name="RFC" value="4271"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC4271"></seriesInfo>
</reference>
<reference anchor="RFC4360" target="https://www.rfc-editor.org/info/rfc4360">
  <front>
    <title>BGP Extended Communities Attribute</title>
    <author fullname="Srihari Sangli" initials="S." surname="Sangli"></author>
    <author fullname="Dan Tappan" initials="D." surname="Tappan"></author>
    <author fullname="Yakov Rekhter" initials="Y." surname="Rekhter"></author>
    <date year="2006" month="February"></date>
  </front>
  <seriesInfo name="RFC" value="4360"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC4360"></seriesInfo>
</reference>
<reference anchor="RFC4760" target="https://www.rfc-editor.org/info/rfc4760">
  <front>
    <title>Multiprotocol Extensions for BGP-4</title>
    <author fullname="Tony Bates" initials="T." surname="Bates"></author>
    <author fullname="Ravi Chandra" initials="R." surname="Chandra"></author>
    <author fullname="Dave Katz" initials="D." surname="Katz"></author>
    <author fullname="Yakov Rekhter" initials="Y." surname="Rekhter"></author>
    <date year="2007" month="January"></date>
  </front>
  <seriesInfo name="RFC" value="4760"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC4760"></seriesInfo>
</reference>
<reference anchor="RFC5925" target="https://www.rfc-editor.org/info/rfc5925">
  <front>
    <title>The TCP Authentication Option</title>
    <author fullname="Joe Touch" initials="J." surname="Touch"></author>
    <author fullname="Attila Mankin" initials="A." surname="Mankin"></author>
    <author fullname="Ron Bonica" initials="R." surname="Bonica"></author>
    <date year="2010" month="June"></date>
  </front>
  <seriesInfo name="RFC" value="5925"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC5925"></seriesInfo>
</reference>
<reference anchor="RFC7606" target="https://www.rfc-editor.org/info/rfc7606">
  <front>
    <title>Revised Error Handling for BGP UPDATE Messages</title>
    <author fullname="Enke Chen" initials="E." surname="Chen"></author>
    <author fullname="John Scudder" initials="J." surname="Scudder"></author>
    <author fullname="Pradosh Mohapatra" initials="P." surname="Mohapatra"></author>
    <author fullname="Keyur Patel" initials="K." surname="Patel"></author>
    <date year="2015" month="August"></date>
  </front>
  <seriesInfo name="RFC" value="7606"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC7606"></seriesInfo>
</reference>
<reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
  <front>
    <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
    <author fullname="Barry Leiba" initials="B." surname="Leiba"></author>
    <date year="2017" month="May"></date>
  </front>
  <seriesInfo name="BCP" value="14"></seriesInfo>
  <seriesInfo name="RFC" value="8174"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8174"></seriesInfo>
</reference>
<reference anchor="RFC8402" target="https://www.rfc-editor.org/info/rfc8402">
  <front>
    <title>Segment Routing Architecture</title>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Stefano Previdi" initials="S." surname="Previdi"></author>
    <author fullname="Les Ginsberg" initials="L." surname="Ginsberg"></author>
    <author fullname="Bruno Decraene" initials="B." surname="Decraene"></author>
    <author fullname="Stephane Litkowski" initials="S." surname="Litkowski"></author>
    <author fullname="Rob Shakir" initials="R." surname="Shakir"></author>
    <date year="2018" month="July"></date>
  </front>
  <seriesInfo name="RFC" value="8402"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8402"></seriesInfo>
</reference>
<reference anchor="RFC8660" target="https://www.rfc-editor.org/info/rfc8660">
  <front>
    <title>Segment Routing with the MPLS Data Plane</title>
    <author fullname="Ahmed Bashandy" initials="A." surname="Bashandy"></author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Stefano Previdi" initials="S." surname="Previdi"></author>
    <author fullname="Bruno Decraene" initials="B." surname="Decraene"></author>
    <author fullname="Stephane Litkowski" initials="S." surname="Litkowski"></author>
    <author fullname="Rob Shakir" initials="R." surname="Shakir"></author>
    <date year="2019" month="December"></date>
  </front>
  <seriesInfo name="RFC" value="8660"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8660"></seriesInfo>
</reference>
<reference anchor="RFC8669" target="https://www.rfc-editor.org/info/rfc8669">
  <front>
    <title>Segment Routing Prefix Segment Identifier Extensions for BGP</title>
    <author fullname="Stefano Previdi" initials="S." surname="Previdi"></author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Acee Lindem" initials="A." surname="Lindem"></author>
    <author fullname="Arjun Sreekantiah" initials="A." surname="Sreekantiah"></author>
    <author fullname="Hannes Gredler" initials="H." surname="Gredler"></author>
    <date year="2019" month="December"></date>
  </front>
  <seriesInfo name="RFC" value="8669"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8669"></seriesInfo>
</reference>
<reference anchor="RFC8754" target="https://www.rfc-editor.org/info/rfc8754">
  <front>
    <title>IPv6 Segment Routing Header (SRH)</title>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Darren Dukes" initials="D." surname="Dukes"></author>
    <author fullname="Stefano Previdi" initials="S." surname="Previdi"></author>
    <author fullname="John Leddy" initials="J." surname="Leddy"></author>
    <author fullname="Satoru Matsushima" initials="S." surname="Matsushima"></author>
    <author fullname="Daniel Voyer" initials="D." surname="Voyer"></author>
    <date year="2020" month="March"></date>
  </front>
  <seriesInfo name="RFC" value="8754"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8754"></seriesInfo>
</reference>
<reference anchor="RFC8955" target="https://www.rfc-editor.org/info/rfc8955">
  <front>
    <title>Dissemination of Flow Specification Rules</title>
    <author fullname="Christoph Loibl" initials="C." surname="Loibl"></author>
    <author fullname="Susan Hares" initials="S." surname="Hares"></author>
    <author fullname="Robert Raszuk" initials="R." surname="Raszuk"></author>
    <author fullname="Danny McPherson" initials="D." surname="McPherson"></author>
    <author fullname="Martin Bacher" initials="M." surname="Bacher"></author>
    <date year="2020" month="December"></date>
  </front>
  <seriesInfo name="RFC" value="8955"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8955"></seriesInfo>
</reference>
<reference anchor="RFC8956" target="https://www.rfc-editor.org/info/rfc8956">
  <front>
    <title>Dissemination of Flow Specification Rules for IPv6</title>
    <author fullname="Christoph Loibl" initials="C." surname="Loibl"></author>
    <author fullname="Robert Raszuk" initials="R." surname="Raszuk"></author>
    <author fullname="Susan Hares" initials="S." surname="Hares"></author>
    <date year="2020" month="December"></date>
  </front>
  <seriesInfo name="RFC" value="8956"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8956"></seriesInfo>
</reference>
<reference anchor="RFC8986" target="https://www.rfc-editor.org/info/rfc8986">
  <front>
    <title>Segment Routing over IPv6 (SRv6) Network Programming</title>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Pablo Camarillo" initials="P." surname="Camarillo"></author>
    <author fullname="John Leddy" initials="J." surname="Leddy"></author>
    <author fullname="Daniel Voyer" initials="D." surname="Voyer"></author>
    <author fullname="Satoru Matsushima" initials="S." surname="Matsushima"></author>
    <author fullname="Zhenbin Li" initials="Z." surname="Li"></author>
    <date year="2021" month="February"></date>
  </front>
  <seriesInfo name="RFC" value="8986"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8986"></seriesInfo>
</reference>
<reference anchor="RFC9012" target="https://www.rfc-editor.org/info/rfc9012">
  <front>
    <title>The BGP Tunnel Encapsulation Attribute</title>
    <author fullname="Keyur Patel" initials="K." surname="Patel"></author>
    <author fullname="Gunter Van de Velde" initials="G." surname="Van de Velde"></author>
    <author fullname="Srihari Sangli" initials="S." surname="Sangli"></author>
    <author fullname="John Scudder" initials="J." surname="Scudder"></author>
    <date year="2021" month="April"></date>
  </front>
  <seriesInfo name="RFC" value="9012"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9012"></seriesInfo>
</reference>
<reference anchor="RFC9117" target="https://www.rfc-editor.org/info/rfc9117">
  <front>
    <title>Revised Validation Procedure for BGP Flow Specifications</title>
    <author fullname="Jim Uttaro" initials="J." surname="Uttaro"></author>
    <author fullname="Juan Alcaide" initials="J." surname="Alcaide"></author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Danny Smith" initials="D." surname="Smith"></author>
    <author fullname="Pradosh Mohapatra" initials="P." surname="Mohapatra"></author>
    <date year="2021" month="August"></date>
  </front>
  <seriesInfo name="RFC" value="9117"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9117"></seriesInfo>
</reference>
<reference anchor="RFC9252" target="https://www.rfc-editor.org/info/rfc9252">
  <front>
    <title>BGP Overlay Services Based on Segment Routing over IPv6 (SRv6)</title>
    <author fullname="Gaurav Dawra" initials="G." surname="Dawra"></author>
    <author fullname="Ketan Talaulikar" initials="K." surname="Talaulikar"></author>
    <author fullname="Robert Raszuk" initials="R." surname="Raszuk"></author>
    <author fullname="Bruno Decraene" initials="B." surname="Decraene"></author>
    <author fullname="Shunwan Zhuang" initials="S." surname="Zhuang"></author>
    <author fullname="Jorge Rabadan" initials="J." surname="Rabadan"></author>
    <date year="2022" month="July"></date>
  </front>
  <seriesInfo name="RFC" value="9252"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9252"></seriesInfo>
</reference>
<reference anchor="RFC9256" target="https://www.rfc-editor.org/info/rfc9256">
  <front>
    <title>Segment Routing Policy Architecture</title>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Ketan Talaulikar" initials="K." surname="Talaulikar"></author>
    <author fullname="Daniel Voyer" initials="D." surname="Voyer"></author>
    <author fullname="Alexander Bogdanov" initials="A." surname="Bogdanov"></author>
    <author fullname="Przemyslaw Mattes" initials="P." surname="Mattes"></author>
    <date year="2022" month="July"></date>
  </front>
  <seriesInfo name="RFC" value="9256"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9256"></seriesInfo>
</reference>
<reference anchor="RFC9800" target="https://www.rfc-editor.org/info/rfc9800">
  <front>
    <title>Compressed SRv6 Segment List Encoding</title>
    <author fullname="Weiqiang Cheng" initials="W." surname="Cheng"></author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Zhenbin Li" initials="Z." surname="Li"></author>
    <author fullname="Bruno Decraene" initials="B." surname="Decraene"></author>
    <author fullname="Frederic Clad" initials="F." surname="Clad"></author>
    <date year="2025" month="June"></date>
  </front>
  <seriesInfo name="RFC" value="9800"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9800"></seriesInfo>
</reference>
<reference anchor="RFC9819" target="https://www.rfc-editor.org/info/rfc9819">
  <front>
    <title>Argument Signaling for BGP Services in Segment Routing over IPv6 (SRv6)</title>
    <author fullname="Ketan Talaulikar" initials="K." surname="Talaulikar"></author>
    <author fullname="Khalid Raza" initials="K." surname="Raza"></author>
    <author fullname="Jorge Rabadan" initials="J." surname="Rabadan"></author>
    <author fullname="Weiqiang Lin" initials="W." surname="Lin"></author>
    <date year="2025" month="July"></date>
  </front>
  <seriesInfo name="RFC" value="9819"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9819"></seriesInfo>
</reference>
<reference anchor="RFC9830" target="https://www.rfc-editor.org/info/rfc9830">
  <front>
    <title>Advertising Segment Routing Policies in BGP</title>
    <author fullname="Stefano Previdi" initials="S." surname="Previdi"></author>
    <author fullname="Clarence Filsfils" initials="C." surname="Filsfils"></author>
    <author fullname="Ketan Talaulikar" initials="K." surname="Talaulikar"></author>
    <author fullname="Przemyslaw Mattes" initials="P." surname="Mattes"></author>
    <author fullname="Dhruv Jain" initials="D." surname="Jain"></author>
    <date year="2025" month="September"></date>
  </front>
  <seriesInfo name="RFC" value="9830"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9830"></seriesInfo>
</reference>
</references>
<references><name>Informative References</name>
<reference anchor="RFC3411" target="https://www.rfc-editor.org/info/rfc3411">
  <front>
    <title>An Architecture for Describing Simple Network Management Protocol (SNMP) Management Frameworks</title>
    <author fullname="David Harrington" initials="D." surname="Harrington"></author>
    <author fullname="Randy Presuhn" initials="R." surname="Presuhn"></author>
    <author fullname="Bert Wijnen" initials="B." surname="Wijnen"></author>
    <date year="2002" month="December"></date>
  </front>
  <seriesInfo name="STD" value="62"></seriesInfo>
  <seriesInfo name="RFC" value="3411"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC3411"></seriesInfo>
</reference>
<reference anchor="RFC5424" target="https://www.rfc-editor.org/info/rfc5424">
  <front>
    <title>The Syslog Protocol</title>
    <author fullname="Rainer Gerhards" initials="R." surname="Gerhards"></author>
    <date year="2009" month="March"></date>
  </front>
  <seriesInfo name="RFC" value="5424"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC5424"></seriesInfo>
</reference>
<reference anchor="RFC7942" target="https://www.rfc-editor.org/info/rfc7942">
  <front>
    <title>Improving Awareness of Running Code: The Implementation Status Section</title>
    <author fullname="Yaron Sheffer" initials="Y." surname="Sheffer"></author>
    <author fullname="Adrian Farrel" initials="A." surname="Farrel"></author>
    <date year="2016" month="July"></date>
  </front>
  <seriesInfo name="BCP" value="205"></seriesInfo>
  <seriesInfo name="RFC" value="7942"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC7942"></seriesInfo>
</reference>
<reference anchor="RFC8639" target="https://www.rfc-editor.org/info/rfc8639">
  <front>
    <title>Subscription to YANG Notifications</title>
    <author fullname="Eric Voit" initials="E." surname="Voit"></author>
    <author fullname="Alexander Clemm" initials="A." surname="Clemm"></author>
    <author fullname="Alberto Gonzalez Prieto" initials="A." surname="Gonzalez Prieto"></author>
    <author fullname="Einar Nilsen-Nygaard" initials="E." surname="Nilsen-Nygaard"></author>
    <author fullname="Akshita Tripathy" initials="A." surname="Tripathy"></author>
    <date year="2019" month="September"></date>
  </front>
  <seriesInfo name="RFC" value="8639"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC8639"></seriesInfo>
</reference>
<reference anchor="RFC9862" target="https://www.rfc-editor.org/info/rfc9862">
  <front>
    <title>Path Computation Element Communication Protocol (PCEP) Extensions for Segment Routing (SR) Policy Candidate Paths</title>
    <author fullname="Mike Koldychev" initials="M." surname="Koldychev"></author>
    <author fullname="Siva Sivabalan" initials="S." surname="Sivabalan"></author>
    <author fullname="Samuel Sidor" initials="S." surname="Sidor"></author>
    <author fullname="Christian Barth" initials="C." surname="Barth"></author>
    <author fullname="Shuping Peng" initials="S." surname="Peng"></author>
    <author fullname="Hossein Bidgoli" initials="H." surname="Bidgoli"></author>
    <date year="2025" month="October"></date>
  </front>
  <seriesInfo name="RFC" value="9862"></seriesInfo>
  <seriesInfo name="DOI" value="10.17487/RFC9862"></seriesInfo>
</reference>
</references>
</references>

<section anchor="sec-appendix-a"><name>Application Examples (Informative)</name>
<t>This appendix provides illustrative examples for steering BGP FlowSpec traffic into SR Policies in SR-MPLS and SRv6 networks per <xref target="sec-procedures"></xref> and <xref target="sec-interworking"></xref>.</t>

<section anchor="sec-a1"><name>SR-MPLS Steering Example (Mode 1)</name>
<t>Figure 1 illustrates steering FlowSpec traffic into an SR-MPLS Policy without egress service actions (<xref target="sec-mode1"></xref>).</t>
<figure><name>Steering Traffic into SR-MPLS Policy (Mode 1)
</name>
<sourcecode type="ascii-art"><![CDATA[             +------------+
             |  BGP FS    |
             | Controller |
             +------------+
                | FlowSpec Route:
                |   NLRI: Filter Rules
                |   Redirect-to-IP: Endpoint Address
                |   Color EC: C0
                |   (Prefix-SID: Absent)
                |          .-----.
                |         (       )
                V     .--(         )--.
          +-------+  (                 )  +-------+
          |       |_(  SR-MPLS Network  )_|       |
          |Headend| ( ================> ) |Tailend|
          +-------+  (SR List<S1,S2,S3>)  +-------+
                      '--(         )--'
                          (       )
                           '-----'
]]></sourcecode>
</figure>
<t>Control Plane: The BGP FS Controller advertises a FlowSpec route with matching rules, Redirect-to-IP (Endpoint Address), and Color C0.  The BGP Prefix-SID Attribute is omitted.</t>
<t>Headend Resolution: The headend resolves the SR-MPLS Policy matching the tuple (Endpoint: Tailend, Color: C0).</t>
<t>Encapsulation: Matching traffic is encapsulated into the policy's MPLS label stack:</t>

<sourcecode type="ascii-art"><![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)   |
+---------------------------------------------+
]]></sourcecode>
</section>

<section anchor="sec-a2"><name>SRv6 Steering Examples</name>
<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>

<section anchor="sec-a21"><name>SRv6 Mode 2: Transport Steering with Egress Service Action</name>
<t>Figure 2 illustrates signaling an explicit egress service action (Egress_Service_SID) alongside transport steering (<xref target="sec-mode2"></xref>).</t>
<figure><name>Steering Traffic into SRv6 Policy with Egress Service Action (Mode 2)
</name>
<sourcecode type="ascii-art"><![CDATA[     +------------+
     |  BGP FS    |
     | Controller |
     +------------+
        | FlowSpec Route:
        |   NLRI: Filter Rules
        |   Redirect-to-IPv6: Endpoint Address
        |   Color EC: C1
        |   Prefix-SID: 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.)
                   '-----'
]]></sourcecode>
</figure>
<t>Control Plane &amp; Resolution: The route carries Color C1, Redirect-to-IPv6 (Endpoint Address), and a BGP Prefix-SID Attribute carrying Egress_Service_SID.  The headend resolves the SRv6 Policy matching (Endpoint: Tailend, Color: C1), yielding candidate Segment List &lt;S1, S2, S3&gt;.</t>
<t>Segment List Synthesis (<xref target="sec-receiver"></xref>):</t>

<ul>
<li><t>Scenario A (Replacing, conditional): If the headend knows that S3 can be replaced by Egress_Service_SID (e.g., S3 is an End SID of the tailend and expresses no path constraint), S3 MAY be replaced, yielding the synthesized Segment List &lt;S1, S2, Egress_Service_SID&gt;.</t>
</li>
<li><t>Scenario B (Appending, default): Otherwise, Egress_Service_SID is appended, yielding the synthesized Segment List &lt;S1, S2, S3, Egress_Service_SID&gt;.</t>
</li>
</ul>
<t>Packet Encapsulation Format:</t>
<t>At the headend, matching traffic is encapsulated into an outer IPv6 header and SRH with the corresponding synthesized Segment List:</t>

<sourcecode type="ascii-art"><![CDATA[+-----------------------------------------------------+
| Outer IPv6 Header (DA = S1)                         |
+-----------------------------------------------------+
| SRH (Segments Left = 2 for Scenario A,              |
|      Segments Left = 3 for Scenario B)              |
|   Segment List: <S1, S2, Egress_Service_SID> (A)    |
|             OR: <S1, S2, S3, Egress_Service_SID> (B)|
+-----------------------------------------------------+
| Inner Payload (Original IPv4/IPv6 Packet)           |
+-----------------------------------------------------+
]]></sourcecode>
<t>Upon reaching the tailend device, the packet is decapsulated and processed per the function denoted by Egress_Service_SID (e.g., routing table lookup in a specific VRF or the global table, such as End.DT4/DT6 <xref target="RFC8986"></xref>).</t>
</section>

<section anchor="sec-a22"><name>SRv6 Mode 1: Transport Steering Only (USD-Flavored End SID)</name>
<t>When the final SID S3 instantiated on the tailend supports the Ultimate Segment Decapsulation (USD) flavor <xref target="RFC8986"></xref>, an explicit Egress Service SID MAY be omitted from the FlowSpec route.</t>
<figure><name>Steering Traffic into SRv6 Policy (Mode 1)
</name>
<sourcecode type="ascii-art"><![CDATA[           +------------+
           |  BGP FS    |
           | Controller |
           +------------+
              | FlowSpec Route:
              |   NLRI: Filter Rules
              |   Redirect-to-IPv6: Endpoint Address
              |   Color EC: C2
              |   (Prefix-SID: Absent)
              |          .-----.
              |         (       )
              V     .--(         )--.
        +-------+  (                 )  +-------+
        |       |_( SRv6 Core Network )_|       |
        |Headend| ( ================> ) |Tailend|
        +-------+  (SR List<S1,S2,S3>)  +-------+
                    '--(         )--'
                        (       )
                         '-----'
          Note: S3 is an SRv6 SID with USD flavor on the tailend.
]]></sourcecode>
</figure>
<t>The controller advertises the route with Color C2 and Redirect-to-IPv6 without a BGP Prefix-SID.  The headend encapsulates traffic using Segment List &lt;S1, S2, S3&gt;.  Upon arrival, the tailend executes USD behavior, pops the outer IPv6 header/SRH, and performs standard table lookup on the inner packet in the default/global routing context.</t>
</section>

<section anchor="sec-a23"><name>Summary of Operational Workflow</name>
<t>In typical network operations:</t>

<ol>
<li><t>The Centralized Controller maintains full visibility of topology and SR Policies across the network domain.</t>
</li>
<li><t>When dynamic traffic steering or mitigation is triggered, the Controller advertises a FlowSpec route combining packet matching criteria with explicit steering attributes (Color EC, Redirect-to-IP, and optional BGP Prefix-SID Attribute).</t>
</li>
<li><t>Ingress PEs parse these received attributes, resolve and bind the matching traffic to the designated SR Policies, and synthesize the encapsulation headers dynamically without requiring manual per-flow provisioning across distributed nodes.</t>
</li>
</ol>
</section>
</section>
</section>

</back>

</rfc>
