<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std"
     docName="draft-dong-idr-flowspec-scalable-prefix-steering-01"
     ipr="trust200902">
  <front>
    <title abbrev="BGP-FS for Large Scale Prefix Based Steering">BGP FlowSpec
    Extensions for Large Scale Prefix based Steering</title>

    <author fullname="Jie Dong" initials="J." surname="Dong">
      <organization>Huawei Technologies</organization>

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

          <city>Beijing</city>

          <code>100095</code>

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

        <email>jie.dong@huawei.com</email>
      </address>
    </author>

    <author fullname="Zhenqiang Li" initials="Z." surname="Li">
      <organization>China Mobile</organization>

      <address>
        <postal>
          <street>No.32 Xuanwumenxi Ave., Xicheng District</street>

          <city>Beijing</city>

          <code>100032</code>

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

        <email>li_zhenqiang@hotmail.com</email>
      </address>
    </author>

    <author fullname="Liang Ou" initials="L." surname="Ou">
      <organization>China Telcom Co., Ltd.</organization>

      <address>
        <postal>
          <street>109 West Zhongshan Ave,Tianhe District</street>

          <city>Guangzhou</city>

          <code>510630</code>

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

        <email>oul@gsta.com</email>
      </address>
    </author>

    <author fullname="Yujia Luo" initials="Y." surname="Luo">
      <organization>China Telcom Co., Ltd.</organization>

      <address>
        <postal>
          <street>109 West Zhongshan Ave,Tianhe District</street>

          <city>Guangzhou</city>

          <code>510630</code>

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

        <email>luoyuj@gsta.com</email>
      </address>
    </author>

    <date day="12" month="July" year="2021"/>

    <abstract>
      <t>This document describes a mechanism to use BGP FlowSpec RFC5575 as a
      scalable way of distributing prefix based traffic steering policies. The
      necessary extensions to BGP are also specified.</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>Dynamic traffic steering becomes more and more popular in operator
      networks. It is desirable that an automatic and scalable mechanism can
      be provided to dynamically deploy such policies to network devices. BGP
      FlowSpec <xref target="RFC8955"/> provides a flexible mechanism to
      specify the matching rules and the corresponding actions for specific
      traffic. Due to the flexibility of BGP FlowSpec, the number of flowspec
      filtering entries supported in hardware is usually limited, which is
      suitable for a small number of complicated traffic matching and
      manipulation policies. In some operator networks, there are requirements
      of dynamically deploying a large amount of destination prefix based
      traffic steering policies, thus some scalable mechanism for large scale
      prefix based traffic steering policy is needed.</t>

      <t>One possible option is that the controller advertises the destination
      prefix based steering policy as normal IP routes directly to the network
      devices. Although this seems straightforward, it is difficult to
      determine the interaction results of the steering routes and the
      existing routes in the devices, and may have unexpected impacts to the
      whole network.</t>

      <t>Another option is that the controller advertises the destination
      prefix based steering policy as BGP FlowSpec routes to the network
      devices. Instead of installing these routes as the BGP FlowSpec
      filtering entries, the network devices are instructed by the controller
      to download the prefix based steering policies to their Forwarding
      Information Base (FIB), so that the number of prefix based steering
      policy supported is not limited by the number of BGP FlowSpec filtering
      entries.</t>

      <t>This document proposes to use the mechanism in the second option, and
      specifies the required extensions to BGP protocol.</t>
    </section>

    <section title="Typical Scenario of Prefix based Traffic Steering">
      <t>In ISP networks, usually there are multiple paths to a particular
      destination. The path with better QoS characteristics such as latency,
      loss, jitter, etc., is preferred. Since these QoS characteristics change
      from time to time, the decision of path selection also needs to be
      changed accordingly.</t>

      <t>Figure 1 shows a typical scenario of prefix based traffic steering in
      inter-domain ISP networks. As shown in the figure, there are two transit
      nodes from AS-1 to the destination Prefix-1 in AS-4, saying transit node
      M in AS-2 and transit node N in AS-3. In normal state, traffic from AS-1
      to Prefix-1 goes through transit node M. While transit node N would be
      preferred when performance degradation happens on transit node M. In
      that case, traffic should be steered to go through transit node N
      instead. According to the real time network performance condition, the
      traffic steering policy needs to be changed dynamically. Thus the
      operator of AS-1 expects an efficient and convenient mechanism for
      steering the traffic to different transit nodes.</t>

      <t><figure>
          <artwork><![CDATA[    ********************************
    *                 +----------+ *
    *         AS-1    |  Policy  | *
    *                 |Controller| *      AS-2
    *                 +----------+ *     
    *         +---+         +---+  *  +-----------+
    *        /| B |---------| C |-----| Transit M |\        AS-4
    *       / +---+\        +---+\ *  +-----------+ \\
    *      /    |   \\    /   |    \      /           \  +---------+
    *+---+/     |     \\//    |    * \  /              \_|         |
    *| A |      |     //\     |    *   X                _| Prefix-1|
    *+---+\     |   //   \\   |    * /   \             / |         |
    *      \    |  /       \  |    /       \          /  +---------+
    *       \ +---+         +---+/ *  +-----------+ //
    *        \| D |---------| E |-----| Transit N |/
    *         +---+         +---+  *  +-----------+
    *                              *
    *      ISP Network             *      AS-3
    *                              *
    ********************************
     Figure 1. Scenario of Prefix Based Traffic Steering
]]></artwork>
        </figure></t>
    </section>

    <section title="Proposed BGP Extensions ">
      <t>This section specifies the proposed extension to BGP protocol.</t>

      <section title="New Wide Community Atom">
        <t>A new Wide Community Atoms TLV <xref
        target="I-D.ietf-idr-wide-bgp-communities"/> "Bit Flags List Atom" is
        defined. This atom is an array of units of 32 flags numbered from the
        most significant bit as bit zero. The Length field for this TLV is
        always a multiple of four bytes, regardless of the number of bits
        carried, and no padding is required. Unassigned bits are considered as
        reserved and MUST be set to zero on transmission by the originator of
        this TLV. Bits not contained in the TLV MUST be assumed to be set to
        zero.</t>

        <t><figure>
            <artwork><![CDATA[   Type (TBA): Bit Flags List Atom]]></artwork>
          </figure></t>

        <t>One flag (bit 31) is defined in this document. When this flag is
        set to 1, recursive route lookup SHOULD be performed in the local
        routing table identified by the address family of the received route
        with this TLV. When this bit is set to 0, recursive route lookup
        SHOULD be performed in the global routing table.</t>

        <t><figure>
            <artwork><![CDATA[   +-------+-------+--------------------------------------------------+
   |  Bit  | Value | Meaning                                          |
   +-------+-------+--------------------------------------------------+
   |   31  |   0   | recursive route lookup in global table           |
   |       |   1   | recursive route lookup in local table            |
   | other |   -   | MUST be zero when sent and ignored upon receipt. |
   +-------+-------+--------------------------------------------------+]]></artwork>
          </figure></t>

        <t>The assignment of other bits is managed by IANA.</t>
      </section>

      <section title="New Wide BGP Community">
        <t>A new Registered Wide BGP Community "Download to FIB" is defined.
        It is used to instruct the receiving BGP speakers to download the BGP
        FlowSpec routes carrying this Wide Community into the FIB, instead of
        installing the FlowSpec routes into FlowSpec filtering entries.</t>

        <t><figure>
            <artwork><![CDATA[Download TO FIB: 
       Type: 0x0001                S = src AS #
       F = 0x80                    C = 0x00000000
       H = 0                       T = none
       L = 22 octets               E = none
       R = TBA by IANA             P = Type_TBD (Flags 0x00000001)
]]></artwork>
          </figure></t>

        <t>An example of the Download to FIB Wide BGP community generated by
        the policy controller in Figure 1 is as below:</t>

        <t><figure>
            <artwork><![CDATA[   0                   1                   2                   3   
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                                
   |     Container Type 1 (1)      |1 0 0 0 0 0 0 0| Hop Count: 0  |                                 
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                                  
   |         Length: 22            |                                
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Community: Download TO FIB   (IANA assigned)                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Source AS Number: A                        |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                    Context AS Number: 0                       |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   | Param TLV (3) |   Length:                   7 |                
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                
   | Flags   (TBD) |   Length:                   4 |                
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                            Flags                            |1|
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
          </figure></t>
      </section>
    </section>

    <section title="Operational Procedures">
      <t>In order to achieve dynamic prefix based traffic steering in the
      scenario of Figure 1, the controller of AS-1 constructs a BGP FlowSpec
      route which carries the following information:</t>

      <t><list style="symbols">
          <t>Prefix-1 as the Destination Prefix component of BGP FlowSpec
          NLRI.</t>

          <t>Traffic-Action Extended Community, with the Route Policy
          Distribution (RPD) <xref target="I-D.ietf-idr-rpd"/> Flag set. This
          is to indicate that the corresponding FlowSpec filtering rules are
          used as routing policies.</t>

          <t>NO_ADVERTISE Community <xref target="RFC1997"/>. This indicates
          that the receiving BGP speaker MUST NOT advertise this BGP FlowSpec
          route to other BGP peers.</t>

          <t>"Redirect to IP" Extended Communities <xref
          target="I-D.ietf-idr-flowspec-redirect-ip"/>, with the global
          administrator field set to the address of transit node N.</t>

          <t>"Download to FIB" Wide BGP Community to indicate that the
          receiving BGP speaker SHOULD download this BGP FlowSpec filtering
          rule to its FIB.</t>
        </list>The controller of AS-1 sends this BGP FlowSpec route to the
      ASBRs of AS-1, i.e. router C and E.</t>

      <t>On receipt of this BGP FlowSpec route from the controller, the
      routers processes the received BGP FlowSpec route as follows:</t>

      <t><list style="symbols">
          <t>Extracts the target prefix Prefix-1 from the Destination Prefix
          component in the BGP FlowSpec NLRI.</t>

          <t>Identifies that the RPD Flag in the Traffic-Action Extended
          Community is set, so the corresponding filtering rules will be used
          as Routing Policies.</t>

          <t>Parses the "Download to FIB" Wide BGP Community, and knows that
          this FlowSpec route SHOULD be downloaded into FIB entry, instead of
          being installed as FlowSpec filtering entry. And according to the
          Flag Bit 31 in the Wide Community Parameters TLV, knows that the
          recursive route lookup should be performed in the global routing
          table.</t>

          <t>Extracts the redirect IP address from the "Redirect to IP"
          Extended Communities, which will be used for the recursive route
          lookup.</t>
        </list></t>

      <t>After performing the recursive lookup in the designated routing
      table, the connected next hop is identified and this route is downloaded
      as a FIB entry into the forwarding plane.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>IANA is requested to assign a new code point for the "Bit Flags List
      Atom" TLV from the "Wide BGP Communities Atom Types" registry.</t>

      <t>IANA is requested to assign a new code point for the "Download to
      FIB" Wide BGP Community from the "Registered Wide BGP Communities"
      registry.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>TBD</t>
    </section>

    <section title="Contributing Authors">
      <t>The following individuals gave significant contributions to this
      document:</t>

      <t><figure>
          <artwork><![CDATA[Peng Zhang
China Telecom
15335170018@189.cn

Zhongchao Li
China Telecom
15301588336@189.cn

Dong Shu
China Telecom
15301586130@189.cn
]]></artwork>
        </figure></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors would like to thank Shunwan Zhuang, Nan Wu and Haibo Wang
      for the valuable discussion on this work.</t>
    </section>
  </middle>

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

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

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

      <?rfc include='reference.I-D.ietf-idr-wide-bgp-communities'?>

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

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