<?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="info" docName="draft-jiang-idr-ts-flowspec-srv6-policy-05"
     ipr="trust200902">
  <front>
    <title abbrev="FlowSpec with SRv6 Policy">Traffic Steering using BGP
    Flowspec with SRv6 Policy</title>

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

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <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/>

          <city>Beijing</city>

          <code/>

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

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

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

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <region/>

          <code/>

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

        <phone/>

        <facsimile/>

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

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

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

      <address>
        <postal>
          <street/>

          <city>Beijing</city>

          <region/>

          <code/>

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

        <phone/>

        <facsimile/>

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

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

    <date day="7" month="March" year="2022"/>

    <abstract>
      <t>BGP Flow Specification (FlowSpec) <xref target="RFC8955"/> <xref
      target="RFC8956"/> has been proposed to distribute BGP FlowSpec NLRI to
      FlowSpec clients to mitigate (distributed) denial-of-service attacks,
      and to provide traffic filtering in the context of a BGP/MPLS VPN
      service. Recently, traffic steering applications in the context of SRv6
      using FlowSpec aslo attract attention. This document introduces the
      usage of BGP FlowSpec to steer packets into an SRv6 Policy.</t>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>Segment Routing IPv6 (SRv6) is a protocol designed to forward IPv6
      data packets on a network using the source routing model. SRv6 enables
      the ingress to add a segment routing header (SRH) <xref
      target="RFC8754"/> to an IPv6 packet and push an explicit IPv6 address
      stack into the SRH. After receiving the packet, each transit node
      updates the IPv6 destination IP address in the packet and segment list
      to implement hop-by-hop forwarding.</t>

      <t>SRv6 Policy <xref target="I-D.ietf-spring-segment-routing-policy"/>
      is a tunneling technology developed based on SRv6. An SRv6 Policy is a
      set of candidate paths consisting of one or more segment lists, that is,
      segment ID (SID) lists. Each SID list identifies an end-to-end path from
      the source to the destination, instructing a device to forward traffic
      through the path rather than the shortest path computed using an IGP.
      The header of a packet steered into an SRv6 Policy is augmented with an
      ordered list of segments associated with that SRv6 Policy, so that other
      devices on the network can execute the instructions encapsulated into
      the list.</t>

      <t>The headend of an SRv6 Policy may learn multiple candidate paths for
      an SRv6 Policy. Candidate paths may be learned via a number of different
      mechanisms, e.g., CLI, NetConf, PCEP, or BGP.</t>

      <t><xref target="RFC8955"/> <xref target="RFC8956"/> defines the flow
      specification (FlowSpec) that allows to convey 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. Rules (Actions associated) are encoded in
      Extended Community attribute. 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>This document proposes BGP flow specification usage that are used to
      steer data flow into an SRv6 Policy as well as to indicate Tailend
      function.</t>
    </section>

    <section title="Definitions and Acronyms">
      <t><list style="symbols">
          <t>FlowSpec: Flow Specification</t>

          <t>SR: Segment Routing</t>

          <t>SRv6: IPv6 Segment Routing</t>

          <t>SID: Segment Identifier</t>

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

          <t>TE: Traffic Engineering</t>
        </list></t>
    </section>

    <section title="Operations">
      <t>An SRv6 Policy <xref
      target="I-D.ietf-spring-segment-routing-policy"/> is identified through
      the tuple &lt;headend, color, endpoint&gt;. In the context of a specific
      headend, one may identify an SRv6 policy by the &lt;color, endpoint&gt;
      tuple. The headend is the node where the SRv6 policy is
      instantiated/implemented. The headend is specified as an IPv4 or IPv6
      address and is expected to be unique in the domain. The endpoint
      indicates the destination of the SRv6 policy. The endpoint is specified
      as an IPv6 address and is expected to be unique in the domain. The color
      is a 32-bit numerical value that associates the SRv6 Policy, and it
      defines an application-level network Service Level Agreement (SLA)
      policy.</t>

      <t>Assume one or multiple SRv6 Policies are already setup in the SRv6
      HeadEnd device. In order to steer traffic into a specific SRv6 policy at
      the Headend, one can use the SRv6 color extended community and endpoint
      to map to a satisfying SRv6 policy, and steer traffic into this specific
      policy.</t>

      <t><xref target="I-D.ietf-idr-flowspec-redirect-ip"/> defines the
      redirect to IPv4 and IPv6 Next-hop action. The IPv6 next-hop address in
      the Flow-spec Redirect to IPv6 Extended Community can be used to specify
      the endpoint of the SRv6 Policy. When the packets reach to the TailEnd
      device, some specific function imformation identifiers can be used
      decide how to further process the flows. Several endpoint functions are
      already defined, e.g., End.DT6: Endpoint with decapsulation and IPv6
      table lookup, and End.DX6: Endpoint with decapsulation and IPv6
      cross-connect. The BGP Prefix-SID defined in <xref target="RFC8669"/> is
      utilized to enable SRv6 VPN services <xref
      target="I-D.ietf-bess-srv6-services"/>. SRv6 Services TLVs within the
      BGP Prefix-SID Attribute can be used to indicate the endpoint
      functions.</t>

      <t>This document proposes to carry the Color Extended Community and BGP
      Prefix-SID Attribute in the context of a Flowspec NLRI <xref
      target="RFC8955"/> <xref target="RFC8956"/> to an SRv6 Headend to steer
      traffic into one SRv6 policy, as well as to indicate specific Tailend
      functions.</t>

      <t>In this document, the usage of at most one Color Extended Community
      in combination at most one BGP Prefix SID Attribute is discussed. For
      the case that a flowspec route carries multiple Color Extend Communities
      and/or a BGP Prefix SID Attribute, a protocol extension to Flowspec is
      required, and is thus out of the scope of this document.</t>

      <t>However, the method proposed in this document still supports load
      balancing to the tailend device. To achieve that, the headend device CAN
      set up multiple paths in one SRv6 policy, and use a Flowspec route to
      indicate the specific SRv6 policy.</t>
    </section>

    <section title="Application Example">
      <t>In following scenario, BGP FlowSpec Controller signals the function
      imformation (SRv6 SID: Service_id_x) to the HeadEnd device.</t>

      <t><figure>
          <artwork align="left"><![CDATA[
   +------------+
   |  BGP FS    |
   | Controller |
   +------------+
      | Flowspec route to HeadEnd:
      |   NLRI: Filter Rules
      |   Redirect to IPv6 Nexthop: TailEnd's Address
      |   Policy Color: C1
      |   PrefixSID: Service_id_x
      |          .-----.
      |         (       )
      V     .--(         )--.
+-------+  (                 )  +-------+
|       |_( SRv6 Core Network )_|       |
|HeadEnd| ( ================> ) |TailEnd|
+-------+  (SR List<S1,S2,S3>)  +-------+
            '--(         )--'   Service SID: Service_id_x
                (       )       (e.g.: End.DT4 or End.DT6 or others)
                 '-----'

      Figure 1: Steering the Flow into SRv6 Policy 

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

      <t>When the headend device (as a Flowspec client) receives such
      instructions, it will steer the flows matching the criteria in the
      Flowspec route into the SRv6 Policy matching the tuple (Endpoint:
      TailEnd's Address, Color: C1). And the packets of such flows will be
      encapsulated with SRH using the SR List&lt;S1, S2, S3, Service_id_x&gt;.
      When the packets reach to the TailEnd device, they will be further
      procetssed per the function denoted by the Service_id_x.</t>

      <t>For the cases of intra-AS and inter-AS traffic steering using this
      method, the usages of Flowspec Color Extended Community with BGP prefix
      SID are the same for both scenarios. The difference lie between the
      local SRv6 policy configurations. For the inter-domain case, the
      operator can configure an inter-domain SRv6 policy/path at the Headend
      device. For the intra-domain case, the operator can configure an
      intra-domain SRv6 policy/path at the Headend device.</t>
    </section>

    <section title="Running Code ">
      <t/>

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

        <t><figure>
            <artwork align="left"><![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 Unitecs | 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>TBD</t>
      </section>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>No IANA actions are required for this document.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>This document does not change the security properties of SRv6 and
      BGP.</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
Email: guyunan@huawei.com

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

Jie Dong
Huawei
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 acknowledge the review and inputs from
      Robin Li, Rainbow Wu and Gang Yang.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

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

      <?rfc include='reference.I-D.ietf-spring-segment-routing-policy'?>

      <?rfc include='reference.I-D.ietf-idr-segment-routing-te-policy'?>

      <?rfc include='reference.I-D.ietf-idr-flowspec-redirect-ip'?>

      <?rfc include='reference.I-D.ietf-bess-srv6-services'?>

      <?rfc include='reference.I-D.ietf-idr-tunnel-encaps'?>

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

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

      <?rfc ?>
    </references>

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

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