<?xml version="1.0" encoding="US-ASCII"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com)
     by Daniel M Kohn (private) -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
]>
<?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="exp" docName="draft-ietf-idr-vpn-prefix-orf-07"
     ipr="trust200902">
  <front>
    <title abbrev="RD-ORF">VPN Prefix Outbound Route Filter (VPN Prefix ORF)
    for BGP-4</title>

    <author fullname="Wei Wang" initials="W" surname="Wang">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>Beiqijia Town, Changping District</street>

          <city>Beijing</city>

          <region>Beijing</region>

          <code>102209</code>

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

        <email>weiwang94@foxmail.com</email>
      </address>
    </author>

    <author fullname="Aijun Wang" initials="A" surname="Wang">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>Beiqijia Town, Changping District</street>

          <city>Beijing</city>

          <region>Beijing</region>

          <code>102209</code>

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

        <email>wangaj3@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Haibo Wang" initials="H" surname="Wang">
      <organization>Huawei Technologies</organization>

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

          <city>Beijing</city>

          <region>Beijing</region>

          <code>100095</code>

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

        <phone/>

        <facsimile/>

        <email>rainsword.wang@huawei.com</email>

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

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

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

          <city>Silver Spring</city>

          <region/>

          <code>MD 20904</code>

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

        <phone>301 502-1347</phone>

        <facsimile/>

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

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

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

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

          <city>Beijing</city>

          <region>Beijing</region>

          <code>100095</code>

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

        <phone/>

        <facsimile/>

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

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

    <date day="22" month="July" year="2024"/>

    <area>RTG Area</area>

    <workgroup>IDR Working Group</workgroup>

    <keyword>RFC</keyword>

    <abstract>
      <t>This draft defines a new Outbound Route Filter (ORF) type, called the
      VPN Prefix ORF. The described VPN Prefix ORF mechanism is applicable
      when the VPN routes from different VRFs are exchanged via one shared BGP
      session.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="intro" title="Introduction">
      <t><xref target="I-D.wang-idr-vpn-routes-control-analysis"/> analyzed
      the scenarios and requirements for VPN routes control in the shared BGP
      session. This draft analyzes the existing solutions and their
      limitations for these scenarios, proposes the new VPN Prefix ORF
      solution to meet the requirements that described in section 8 of <xref
      target="I-D.wang-idr-vpn-routes-control-analysis"/>.</t>

      <t>Now, there are several solutions can be used to alleviate these
      problem:<list style="symbols">
          <t>Route Target Constraint (RTC) as defined in <xref
          target="RFC4684"/></t>

          <t>Address Prefix ORF as defined in <xref target="RFC5292"/></t>

          <t>CP-ORF mechanism as defined in <xref target="RFC7543"/></t>

          <t>PE-CE edge peer Maximum Prefix</t>

          <t>Configure the Maximum Prefix for each VRF on edge nodes</t>
        </list></t>

      <t>However, there are limitations to existing solutions:</t>

      <t>1) Route Target Constraint</t>

      <t>RTC can only filter the VPN routes from the uninterested VRFs, if the
      &ldquo;offending routes&rdquo; come from the interested VRF, RFC
      mechanism can't filter them.</t>

      <t>2) Address Prefix ORF</t>

      <t>Using Address Prefix ORF to filter VPN routes need to
      pre-configuration, but it is impossible to know which prefix may cause
      overflow in advance.</t>

      <t>3) CP-ORF Mechanism</t>

      <t><xref target="RFC7543"/> defines the Covering Prefixes ORF (CP-ORF).
      A BGP speaker sends a CP-ORF to a peer in order to pull routes that
      cover a specified host address. A prefix covers a host address if it can
      be used to forward traffic towards that host address.</t>

      <t>CP-ORF is applicable in Virtual Hub-and-Spoke<xref target="RFC7024"/>
      VPN and also the BGP/MPLS Ethernet VPN (EVPN)<xref target="RFC7432"/>
      networks, but its main aim is also to get the wanted VPN prefixes and
      can't be used to filter the overwhelmed VPN prefixes dynamically.</t>

      <t>4) PE-CE edge peer Maximum Prefix</t>

      <t>The BGP Maximum-Prefix feature is used to control how many prefixes
      can be received from a neighbor. By default, this feature allows a
      router to bring down a peer when the number of received prefixes from
      that peer exceeds the configured Maximum-Prefix limit. This feature is
      commonly used for external BGP peers. If it is applied to internal BGP
      peers, for example the VPN scenarios, all the VPN routes from different
      VRFs will share the common fate, which is not desirable for the finer
      control of the VPN Prefixes advertisement.</t>

      <t>5) Configure the Maximum Prefix for each VRF on edge nodes</t>

      <t>When a VRF overflows, it stops the import of routes and log the extra
      VPN routes into its RIB. However, PEs still need to parse the BGP
      updates. These processes will cost CPU cycles and further burden the
      overflowed PE.</t>

      <t>This draft defines a new ORF-type, called the VPN Prefix ORF. This
      mechanism is event-driven and does not need to be pre-configured. When a
      VRF of a router overflows, the router will find out the VPN prefix (RD,
      RT, source PE, etc.) of offending VPN routes in this VRF, and send a VPN
      Prefix ORF to its BGP peer that carries the relevant information. If a
      BGP speaker receives a VPN Prefix ORF entry from its BGP peer, it will
      filter the VPN routes it tends to send according to the entry.</t>

      <t>The purpose of this mechanism is to control the outrage within the
      minimum range and avoid churn effects when a VRF on a device in the
      network overflows.</t>

      <t>VPN Prefix ORF is applicable when the VPN routes from different VRFs
      are exchanged via one shared BGP session.</t>
    </section>

    <section title="Conventions used in this document">
      <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"/>
      .</t>
    </section>

    <section title="Terminology">
      <t>The following terms are defined in this draft:<list style="symbols">
          <t>RD: Route Distinguisher, defined in <xref target="RFC4364"/></t>

          <t>ORF: Outbound Route Filter, defined in <xref
          target="RFC5291"/></t>

          <t>AFI: Address Family Identifier, defined in <xref
          target="RFC4760"/></t>

          <t>SAFI: Subsequent Address Family Identifier, defined in <xref
          target="RFC4760"/></t>

          <t>EVPN: BGP/MPLS Ethernet VPN, defined in <xref
          target="RFC7432"/></t>

          <t>RR: Router Reflector, provides a simple solution to the problem
          of IBGP full mesh connection in large-scale IBGP implementation.</t>

          <t>VRF: Virtual Routing Forwarding, a virtual routing table based on
          VPN instance.</t>
        </list></t>

      <t/>
    </section>

    <section title="Operation process of VPN Prefix ORF mechanism on sender">
      <t>The operation of VPN Prefix ORF mechanism on each device is
      independent, each of them makes a local judgement to determine whether
      it needs to send VPN Prefix ORF to its upstream peer. Operators can set
      the algorithms in the devices according to their own circumstances.</t>

      <t>The general procedures of the VPN Prefix ORF mechanism on the sender
      are as follows:</t>

      <t>This section describes the procedures for the BGP peer(the first BGP
      peer) receiving the VPN routes information from another BGP peer(the
      second BGP peer). The VPN information includes the updated VPN routes
      and their corresponding VPN instance identification information. Based
      on the VPN instance identification information, the first BGP peer
      determines the newly added VPN routes, and checks whether the number of
      the newly added VPN route has caused the number of total VPN routes
      exceeding the maximum route limit of the associated VPN instance.</t>

      <t>If the route number of the VPN instance that identified by the VPN
      instance identification information is reached or excess its limit, it
      will send the instruction information to the second BGP peer, indicating
      that the second BGP peer stop sending the corresponding VPN routes that
      identified by the VPN instance identification information.</t>

      <t>The first BGP peer and the second BGP peer are iBGP peers that are
      within one AS. The VPN instance identification information is RD and the
      instruction information is sent via the route-refresh message.</t>

      <t>The instruction information that sends to the second BGP peer
      includes the followings information:</t>

      <t>The ORF entries that are included in the route-refresh message.</t>

      <t>Set the Action field in the ORF entries to the value that instructs
      to add the corresponding filter condition into outbound route filter of
      the second the BGP peer.</t>

      <t>Set the Match field in the ORF entries to the value that instructs to
      deny the VPN routes updates that matches the corresponding ORF
      entries.</t>

      <t>The RD value that identifies the above mentioned VPN instance is
      added at the type-specific part of the ORF entries.</t>

      <t>When multiple VRFs on a PE are receiving VPN routes for a specific
      RD, if one VRF exceeds its limit upon receiving routes with that RD and
      the PE sends a VP-ORF message, it will prevent other VRFs that have not
      exceeded their limits from receiving VPN routes containing that RD,
      leading to communication disruptions between these VRFs and the rejected
      VPN routes. In order to more finely control VPN routing, when the above
      situation occurs, VRF should generate a filter when its route limit is
      exceeded, to selectively filter route entries based on RD before they
      enter the VRF from the RIB.</t>

      <t>The PE which receives the offending VPN routes parses the received
      BGP update message to obtain routing information, and obtains VPN
      routing entries associated with the BGP path from the routing
      information. Then, PE should determine the target VRF based on the RT
      import information of the routing target entry, and configure filters
      for the target VRF. PE should first detect whether there is currently a
      filter associated with the target VRF. If yes, PE should use the filter
      to filter the VPN routing entries, so that VPN routing entries carrying
      the specified routing identifier RD are not introduced into the target
      VRF. If there is currently no filter associated with the target VRF, PE
      will directly introduce the VPN routing entry into the target VRF. The
      format of VPN Prefix ORF entry is shown in <xref target="Encoding"/></t>

      <t>When configuring a filter for the target VRF, the PE should detect
      whether there is currently a routing overflow issue with the target VRF.
      If the target VRF currently has a routing overflow issue and the reason
      for the routing overrun is caused by a VPN routing entry carrying the
      specified RD, a filter is generated for the target VRF, wherein the
      filter is used to filter VPN routing entries carrying the specified RD.
      If the target VRF currently does not have routing overflow issues, PE
      will delete the filter for the target VRF.</t>

      <t>The detail procedures for further subdivisions are described
      below:</t>

      <t>a) No quota value is set on PE</t>

      <t>On PE, each VRF has a prefix limit. When the PE receives VPN routes
      from its BGP peer, due to the received VPN routes may belong to
      different VPN and carry the corresponding RDs, the PE should extract the
      VPN route information from BGP UPDATE message which contains VPN routes
      related to BGP optimal routing. PE can determine the target VRFs of the
      received VPN route based on the RT of the VPN route and the RT-import of
      VRFs. Then, the PE should sequentially determine whether each target VRF
      will exceed the limit after importing the received VPN routes. If a
      target VRF exceeds the limit which is caused by the VPN routes carrying
      a certain RD and the other target VRFs have not overflow, PE should not
      trigger the VPN Prefix ORF mechanism, and only performs VPN route
      filtering for the target VRF and stop importing VPN routes carrying the
      specific RD. If a target VRF exceeds the limit and there is no other
      VRFs need these VPN routes, the PE should trigger the VPN Prefix ORF
      mechanism and send a BGP ROUTE-REFRESH message contains the
      corresponding VPN Prefix ORF entry to its peer, which will generate a
      VPN routes filtering strategy for the VRF. And if the "Offending VPN
      routes process method" bit is 1, the receiver of VPN Prefix ORF entry
      should withdraw the extra VPN routes according to the value of VRF
      Prefix Limit, RD, RT and information in optional TLVs in the entry, and
      stop sending the corresponding VPN routes to the sender. If the target
      VRF no longer exceeds the limit, the relevant VPN routing filtering
      strategy needs to be deleted.</t>

      <t>When importing VPN routes to a VRF, it is necessary to determine
      whether there is a VPN routes filtering strategy on the PE for that VRF.
      BGP peers supporting this functionality has VRFs that has maximum route
      limit reached should comply with the procedures defined in this
      document</t>

      <t>b) Quota value is set on PE</t>

      <t>On PE, each VRF has a prefix limit, and routes associated with each
      &lt;RD, source PE&gt; tuple has a pre-configured quota. Considering that
      the received VPN routes may belong to different VPNs and therefore carry
      different RDs, the PE should determine whether VRF will exceed the limit
      after adding the received VPN routes.</t>

      <t><list style="symbols">
          <t>when routes associated with &lt;RD, source PE&gt; tuple pass the
          quota but the prefix limit of VRF is not exceeded, PE should send
          warnings to the operator, and the VPN Prefix ORF mechanism should
          not be triggered.</t>

          <t>when routes associated with &lt;RD, source PE&gt; tuple pass the
          quota and the prefix limit is exceeded and there is no other VRFs on
          offended PE need VPN routes with this &lt;RD, source PE&gt; tuple,
          PE should trigger VPN Prefix ORF mechanism and send a BGP
          ROUTE-REFRESH message contains the corresponding VPN Prefix ORF
          entry to its peer.</t>
        </list></t>

      <t>When the VPN Prefix ORF mechanism is triggered, the device must send
      an alarm information to network operators.</t>

      <section title="Intra-domain Scenarios and Solutions">
        <t>For intra-AS VPN deployment, there are three scenarios:<list
            style="symbols">
            <t>RD is allocated per VPN per PE, each VRF only import one RT
            (see <xref target="scenario-1"/>).</t>

            <t>RD is allocated per VPN per PE. Multiple RTs are associated
            with such VPN routes, and are imported into different VRFs in
            other devices(see <xref target="scenario-2"/>).</t>

            <t>RD is allocated per VPN, each VRF imports one/multiple RTs(see
            <xref target="scenario-3"/>).</t>
          </list></t>

        <t>The following sections will describe solutions to the above
        scenarios in detail.</t>

        <section anchor="scenario-1"
                 title="Scenario-1 and Solution (Unique RD, One RT)">
          <t>In this scenario, PE1-PE4 and RR are iBGP peers. RD is allocated
          per VPN per PE. The offending VPN routes only carry one RT. We
          assume the network topology is shown in Figure 1.</t>

          <figure align="center">
            <artwork><![CDATA[ +------------------------------------------------------------------------+
 |                                                                        |
 |                                                                        |
 |        +-------+                                       +-------+       |
 |        |  PE1  +----------------+    +-----------------+  PE4  |       |
 |        +-------+                |    |                 +-------+       |
 |     VPN1(RD11,RT1)              |    |              VPN2(RD12,RT2)     |
 |     VPN2(RD12,RT2)              |    |                                 |
 |                               +-+----+-+                               |
 |                               |   RR   |                               |
 |                               +-+----+-+                               |
 |                                 |    |                                 |
 |                                 |    |                                 |
 |        +-------+                |    |                 +-------+       |
 |        |  PE2  +----------------+    +-----------------+  PE3  |       |
 |        +-------+                                       +-------+       |
 |     VPN1(RD21,RT1)                                  VPN1(RD31,RT1)     |
 |     VPN2(RD22,RT2,RT1)                              VPN2(RD32,RT2)     |
 |                                                                        |
 |                                 AS 100                                 |
 |                                                                        |
 +------------------------------------------------------------------------+
                 Figure 1 Network Topology of Scenario-1
]]></artwork>
          </figure>

          <t>When PE3 sends excessive VPN routes with RT1, while both PE1 and
          PE2 import VPN routes with RT1, the process of offending VPN routes
          will influence performance of VRFs on PEs. PEs and RR should have
          some mechanisms to identify and control the advertisement of
          offending VPN routes.</t>

          <t>a) PE1</t>

          <t>If quota value is not set on PE1, and each VRF has a prefix limit
          on PE1. When the prefix limit of VPN1 VRF is exceeded, due to there
          is no other VRFs on PE1 need the VPN routes with RT1, PE1 will send
          VPN Prefix ORF message to RR and send warning to operator. The
          message will carry the prefix limit of VPN1 VRF, the RD value is set
          to 0 and the RT value is set to RT1. RR will withdraw the offending
          VPN routes and control the number of VPN routes sending to PE1.</t>

          <t>If quota value is set on PE1, each VRF has a prefix limit, and
          each &lt;RD, source PE&gt; tuple imported into VRF has a quota. When
          routes associated with &lt;RD31, PE3&gt; tuple pass the quota but
          the prefix limit of VPN1 VRF is not exceeded, PE1 sends a warning
          message to the operator, and the VPN Prefix ORF mechanism should not
          be triggered. After the prefix limit of VPN1 VRF is exceeded, since
          there is no other VRFs on PE1 need the VPN routes with RT1, PE1 will
          generate a BGP ROUTE-REFRESH message contains a VPN Prefix ORF
          entry, and send the entry to RR. RR will withdraw and stop to
          advertise such offending VPN routes (RD31, the prefix limit of VPN1
          VRF, source PE is PE3, RT is RT1) to PE1.</t>

          <t>b) PE2</t>

          <t>If quota value is not set on PE2, when the prefix limit of VPN1
          VRF is exceeded, PE2 cannot trigger VPN Prefix ORF mechanism
          directly, because VPN2 VRF needs the VPN routes with RT1. PE2
          triggers the mechanism only when the prefix limit for both, the VPN1
          and VPN2 VRF has exceeded. The VPN Prefix ORF message will carry the
          VRF Prefix Limit = min(prefix limit of VPN1 VRF, prefix limit of
          VPN2 VRF), the RD value is set to 0 and the RT value is set to RT1.
          RR will withdraw the offending VPN routes and control the number of
          VPN routes sending to PE1.</t>

          <t>If quota value is set on PE2, both VPN1 VRF and VPN2 VRF import
          VPN routes with RT1. If PE2 triggers VPN Prefix ORF mechanism when
          VPN1 VRF overflows, VPN2 VRF cannot receive VPN routes with RT1 as
          well. PE2 should not trigger the VPN Prefix ORF mechanism to RR
          (RD31, min(prefix limit of VPN1 VRF, prefix limit of VPN2 VRF), RT1,
          RT2, source PE is PE3) until all the VRFs that import RT1 on it
          overflow.</t>

          <t/>
        </section>

        <section anchor="scenario-2"
                 title="Scenario-2 and Solution (Unique RD, Multiple RTs)">
          <t>In this scenario, PE1-PE4 and RR are iBGP peers. RD is allocated
          per VPN per PE. Multiple RTs are associated with the offending VPN
          routes, and are imported into different VRFs in other devices. We
          assume the network topology is shown in Figure 2.<figure
              align="center">
              <artwork><![CDATA[ +------------------------------------------------------------------------+
 |                                                                        |
 |                                                                        |
 |        +-------+                                       +-------+       |
 |        |  PE1  +----------------+    +-----------------+  PE4  |       |
 |        +-------+                |    |                 +-------+       |
 |     VPN1(RD11,RT1)              |    |              VPN2(RD42,RT2)     |
 |     VPN2(RD12,RT2)              |    |                                 |
 |                               +-+----+-+                               |
 |                               |   RR   |                               |
 |                               +-+----+-+                               |
 |                                 |    |                                 |
 |                                 |    |                                 |
 |        +-------+                |    |                 +-------+       |
 |        |  PE2  +----------------+    +-----------------+  PE3  |       |
 |        +-------+                                       +-------+       |
 |     VPN1(RD21,RT1)                                  VPN1(RD31,RT1,RT2) |
 |                                                     VPN2(RD32,RT2)     |
 |                                                                        |
 |                                 AS 100                                 |
 |                                                                        |
 +------------------------------------------------------------------------+
                Figure 2 Network Topology of Scenario-2
]]></artwork>
            </figure></t>

          <t>When PE3 sends excessive VPN routes with RT1 and RT2, while both
          PE1 and PE2 import VPN routes with RT1, and PE1 also imports VPN
          routes with RT2.</t>

          <t>a) PE1</t>

          <t>If quota value is not set on PE1, when the prefix limit of VPN1
          VRF is exceeded, PE1 cannot trigger VPN Prefix ORF mechanism
          directly, because VPN2 VRF needs the VPN routes with RT1. PE1
          triggers the mechanism only when the prefix limit for both, the VPN1
          VRF and VPN2 VRF has exceeded. PE1 will send VPN Prefix ORF message
          to RR and send warning to operator. The message will carry the VRF
          Prefix Limit = min(prefix limit of VPN1 VRF, prefix limit of VPN2
          VRF), the RD value is set to RD31, the RT value is set to RT1, RT2
          and the source PE is PE3. RR will withdraw and stop advertising such
          offending VPN routes to PE1.</t>

          <t>If quota value is set on PE1, when routes associated with
          &lt;RD31, PE3&gt; tuple pass the quota but the prefix limit of VPN1
          VRF is not exceeded, PE1 sends a warning to the operator. In case
          where the VPN1 VRF has exceeded its prefix limit and VPN2 VRF has
          not yet exceeded its prefix limit, PE1 should not send out the
          trigger message. Otherwise, the VPN2 VRF can't receive the VPN
          routes too (RR will filter all the VPN prefixes that contain RT1).
          PE1 should just discard the offending VPN routes locally. PE1 should
          only generate a BGP ROUTE-REFRESH message contains a VPN Prefix ORF
          entry(RD31, min(prefix limit of VPN1 VRF, prefix limit of VPN2 VRF),
          RT1, RT2, comes from PE3) in case where the prefix limit has
          exceeded for both the VRFs.</t>

          <t>b) PE2</t>

          <t>If quota value is not set on PE2, when the prefix limit of VPN1
          VRF is exceeded, due to there is no other VRFs on PE2 need the VPN
          routes with RT1, PE2 will send VPN Prefix ORF message to RR and send
          warning to operator. The message will carry the prefix limit of VPN1
          VRF, the RD value is set to RD31 and the RT value is set to RT1. RR
          will withdraw and stop advertising such offending VPN routes to
          PE2.</t>

          <t>If quota value is set on PE2, due to there is only one VRF
          imports VPN routes with RT1. If it overflows, it will trigger VPN
          Prefix ORF (RD31, the prefix limit of VPN1 VRF, RT1, comes from PE3)
          mechanisms. RR will withdraw and stop advertising such offending VPN
          routes to PE2.</t>
        </section>

        <section anchor="scenario-3"
                 title="Scenario-3 and Solution (Universal RD)">
          <t>In this scenario, PE1-PE4 and RR are iBGP peers. RD is allocated
          per VPN. One/Multiple RTs are associated with the offending VPN
          routes, and be imported into different VRFs in other devices. We
          assume the network topology is shown in Figure 3.<figure>
              <artwork align="center"><![CDATA[ +------------------------------------------------------------------------+
 |                                                                        |
 |                                                                        |
 |        +-------+                                       +-------+       |
 |        |  PE1  +----------------+    +-----------------+  PE4  |       |
 |        +-------+                |    |                 +-------+       |
 |     VPN1(RD1,RT1)               |    |              VPN2(RD12,RT2)     |
 |     VPN2(RD12,RT2)              |    |                                 |
 |                               +-+----+-+                               |
 |                               |   RR   |                               |
 |                               +-+----+-+                               |
 |                                 |    |                                 |
 |                                 |    |                                 |
 |        +-------+                |    |                 +-------+       |
 |        |  PE2  +----------------+    +-----------------+  PE3  |       |
 |        +-------+                                       +-------+       |
 |     VPN1(RD1,RT1)                                   VPN1(RD1,RT1,RT2)  |
 |                                                     VPN2(RD32,RT2)     |
 |                                                                        |
 |                                 AS 100                                 |
 |                                                                        |
 +------------------------------------------------------------------------+
                  Figure 3 Network Topology of Scenario-3
]]></artwork>
            </figure></t>

          <t>When PE3 sends excessive VPN routes with RD1 and attached RT1 and
          RT2, while both PE1 and PE2 import VPN routes with RT1, the process
          of offending VPN routes will influence performance of VRFs on
          PEs.</t>

          <t>a) PE1</t>

          <t>If quota value is not set on PE1, when the prefix limit of VPN1
          VRF is exceeded, PE1 cannot trigger VPN Prefix ORF mechanism
          directly, because VPN2 VRF needs the VPN routes with RT2. PE1
          triggers the mechanism only when the prefix limit for both, the VPN1
          and VPN2 VRF has exceeded, and send warning to operator. The message
          will carry the VRF Prefix Limit = min(prefix limit of VPN1 VRF,
          prefix limit of VPN2 VRF), the RD value is set to RD1 and the RT
          value is set to RT1, RT2. RR will withdraw and stop advertising such
          offending VPN routes to PE1.</t>

          <t>If quota value is set on PE1, when routes associated with
          &lt;RD1, PE3&gt; tuple pass the quota but the prefix limit of VPN1
          VRF is not exceeded, PE1 sends a warning to the operator. When the
          prefix limit of VPN1 VRF is exceeded, if the VPN2 VRF does not reach
          its limit at the same time, PE1 should still not send out the
          trigger message, because if it does so, the VPN2 VRF can't receive
          the VPN routes too (RR will filter all the VPN prefixes that contain
          RT1). PE1 should just discard the offending VPN routes locally. PE1
          should only generate a BGP ROUTE-REFRESH message contains a VPN
          Prefix ORF entry(RD1, min(prefix limit of VPN1 VRF, prefix limit of
          VPN2 VRF), RT1, RT2, comes from PE3) when both the VRFs that import
          such prefixes are overflow.</t>

          <t>b) PE2</t>

          <t>If quota value is not set on PE2, when the prefix limit of VPN1
          VRF is exceeded, due to there is no other VRFs on PE2 need the VPN
          routes with RT1, PE2 will send VPN Prefix ORF message to RR and send
          warning to operator. The message will carry the prefix limit of VPN1
          VRF, the RD value is set to RD1 and the RT value is set to RT1. RR
          will withdraw and stop advertising such offending VPN routes to
          PE2.</t>

          <t>If quota value is set on PE2, due to there is only one VRF
          imports VPN routes with RT1. If it overflows, it will trigger VPN
          Prefix ORF (RD1, the prefix limit of VPN1 VRF, RT1, comes from PE3)
          mechanisms. RR will withdraw and stop advertising such offending VPN
          routes to PE2.</t>

          <t>When PE2 overflows and PE1 does not overflow. PE2 triggers the
          VPN Prefix ORF message (RD1, RT1, comes from PE3). Using Source PE
          and RD, RR will only withdraw and stop advertising VPN routes with
          &lt;RD1, RT1, come from PE3&gt; to PE2. The communication between
          PE2 and PE1 for VPN1 will not be influenced.</t>
        </section>
      </section>
    </section>

    <section title="Source PE Extended Community">
      <t>We usually use NEXT_HOP to identify the source, but it may not useful
      in the following scenarios:<list style="symbols">
          <t>a PE may have multiple addresses so that its BGP peer will
          receive several different NEXT_HOP from the same source.</t>

          <t>In Option B inter-domain scenario, the ASBR will change the
          NEXT_HOP.</t>
        </list></t>

      <t>ORIGINATOR_ID is a non-transitive attribute generated by RR to
      identify the source, but ORIGINATOR_ID cannot be advertised outside the
      local AS. To cover the above scenarios, we define a new Extended
      Community: Source PE Extended Community(SPE EC) to transmit the
      identifier of source. Its value can be set by source PE/RR/ASBR. Once
      set and attached with the BGP UPDATE message, its value should not be
      changed along the advertisement path.</t>

      <t>The format of SPE EC is shown as Figure 4. <figure>
          <artwork align="center"><![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
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      |               0x0d            |    Autonomous System Number   :
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      :     AS Number (cont.)         |         ORIGINATOR_ID         :
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
      :     ORIGINATOR_ID (cont.)     |  
      +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
                  Figure 4 The format of SPE EC
]]></artwork>
        </figure></t>

      <t>For the RR/ASBR, it should perform as following:<list style="symbols">
          <t>Check the existence of the SPE EC. If it exists, does not change
          it.</t>

          <t>If SPE EC does not exist, check the existence of ORIGINATOR_ID.
          If it exists, put it into SPE EC.</t>

          <t>If ORIGINATOR_ID does not exist, put the router-id of source PE
          into SPE EC.</t>
        </list></t>

      <t/>
    </section>

    <section anchor="Encoding" title="VPN Prefix ORF Encoding">
      <t>In this section, we defined a new ORF type called VPN Prefix Outbound
      Route Filter (VPN Prefix ORF). The ORF entries are carried in the BGP
      ROUTE-REFRESH message as defined in <xref target="RFC5291"/>. A BGP
      ROUTE-REFRESH message can carry one or more ORF entries. The
      ROUTE-REFRESH message which carries ORF entries contains the following
      fields:<list style="symbols">
          <t>AFI (2 octets)</t>

          <t>SAFI (1 octet)</t>

          <t>When-to-refresh (1 octet): the value is IMMEDIATE</t>

          <t>ORF Type (1 octet)</t>

          <t>Length of ORF entries (2 octets)</t>
        </list>A VPN Prefix ORF entry contains a common part and type-specific
      part. The common part is encoded as follows:<list style="symbols">
          <t>Action (2 bits): the value is ADD, REMOVE or REMOVE-ALL</t>

          <t>Match (1 bit): the value is PERMIT or DENY</t>

          <t>Offending VPN routes process method (1 bit): if the value is set
          to 0, it means all offending VPN routes on the sender of VPN Prefix
          ORF message should be withdrawn; if the value is set to 1, it means
          the sender of VPN Prefix ORF message refuse to receive new offending
          VPN routes. The default value is 0.</t>

          <t>Reserved (4 bits)</t>
        </list>VPN Prefix ORF also contains type-specific part. The encoding
      of the type-specific part is shown in Figure 5.</t>

      <t><figure>
          <artwork align="center"><![CDATA[ +-----------------------------------------+
 |                                         |
 |            Sequence (4 octets)          |
 |                                         |
 +-----------------------------------------+
 |                                         |
 |             Length (2 octets)           |
 |                                         |
 +-----------------------------------------+
 |                                         |
 |        VRF Prefix Limit (4 octets)      |
 |                                         |
 +-----------------------------------------+
 |                                         |
 |      Route Distinguisher (8 octets)     |
 |                                         |
 +-----------------------------------------+
 |                                         |
 |        Optional TLVs (variable)         |
 |                                         |
 +-----------------------------------------+
 
   Figure 5: VPN Prefix ORF type-specific encoding
]]></artwork>
        </figure><list style="symbols">
          <t>Sequence: identifying the order in which RD-ORF is generated.</t>

          <t>Length: identifying the length of this VPN Prefix ORF entry.</t>

          <t>VRF Prefix Limit: carrying the prefix limt of the overflowed
          VRF.</t>

          <t>Route Distinguisher: distinguish the different user routes. The
          VPN Prefix ORF filters the VPN routes it tends to send based on
          Route Distinguisher. If RD is equal to 0, it means all VPN
          prefixes.</t>

          <t>Optional TLVs: carry the potential additional information to give
          the extensibility of the VPN Prefix ORF mechanism.</t>
        </list>Note that if the Action component of an ORF entry specifies
      REMOVE-ALL, the ORF entry does not include the type-specific part.</t>

      <t>When the BGP ROUTE-REFRESH message carries VPN Prefix ORF entries, it
      must be set as follows:</t>

      <t><list style="symbols">
          <t>The ORF-Type MUST be set to VPN Prefix ORF.</t>

          <t>The AFI MUST be set to IPv4, IPv6, or Layer 2 VPN (L2VPN).</t>

          <t>If the AFI is set to IPv4 or IPv6, the SAFI MUST be set to
          MPLS-labeled VPN address.</t>

          <t>If the AFI is set to L2VPN, the SAFI MUST be set to BGP EVPN.</t>

          <t>The Match field should be set to PERMIT when VRF Prefix Limit =
          0xFFFF and RD=0; otherwise, the Match field should be set to
          DENY.</t>
        </list></t>

      <t/>

      <section anchor="source PE TLV" title="Source PE TLV">
        <t>Source PE TLV is defined to identify the source of the VPN routes.
        For the sender of VPN Prefix ORF, it will check the existence of SPE
        EC. If it exists, the sender will put it into Source PE TLV.
        Otherwise, the value of Source PE TLV should be set to local AS number
        and NEXT_HOP.</t>

        <t>The source PE TLV contains the following types:<list
            style="symbols">
            <t>Type = 1(suggested), Length = 8 octets, value = local AS number
            + NEXT_HOP.</t>

            <t>Type = 2(suggested), Length = 20 octets, value = local AS
            number + NEXT_HOP.</t>

            <t>Type = 3(suggested), Length = 8 octets, value = the value of AS
            number and ORIGINATOR_ID in Source PE Extended Community.</t>
          </list></t>

        <t/>
      </section>

      <section title="Route Target TLV">
        <t>Route Target TLV is defined to identify the RT of the offending VPN
        routes. RT and RD can be used together to filter VPN routes when the
        source VRF contains multiple RTs, and the VPN routes with different
        RTs may be assigned to different VRFs on the receiver. The encoding of
        Route Target TLV is as follow:<list style="empty">
            <t>Type = 4(suggested), Length = 8*n (n is the number of RTs that
            the offending VPN routes attached) octets, value = the RT of the
            offending VPN routes. If multiple RTs are included, there must be
            an exact match.</t>
          </list></t>
      </section>
    </section>

    <section title="Operation process of VPN Prefix ORF mechanism on receiver">
      <t>The receiver of VPN Prefix ORF entries may be a RR or PE. As it
      receives the VPN Prefix ORF entries from the sender, it will check
      &lt;AFI/SAFI, ORF-Type, Sequence, Route Distinguisher&gt; to find if it
      already existed in its ORF-Policy table. If not, the receiver will add
      the VPN Prefix ORF entries into its ORF-Policy table; otherwise, the
      receiver will discard it.</t>

      <t>The RR or PE should determine the sending device and next hop address
      of the stored VPN Prefix ORF entry corresponding to the source PE in the
      filtering condition by looking up in the FIB, including: 1) determining
      the port field corresponding to the stored VPN Prefix ORF entry in the
      export routing filter strategy table; 2) Determine the sending device of
      the stored VPN Prefix ORF entry based on the value of the port field
      corresponding to the stored VPN Prefix ORF entry.</t>

      <t>The filtering conditions for the stored VPN Prefix ORF entries
      contain the RD and RT of the source PE.</t>

      <t>If the sending device of the VPN Prefix ORF entry stored under the
      same filtering condition includes all IBGP neighbors of the RR or PE
      other than the device with the next hop address, the VPN Prefix ORF
      entry is generated, where the next hop address is the next hop address
      sent to the network device in the direction of the source PE in the same
      filtering condition. The filtering condition in the generated VPN Prefix
      ORF entry contain the address, RD and RT of the source PE; Then, the RR
      or PE should send the generated VPN Prefix ORF entry to the device at
      the next hop address via BGP ROUTE-REFRESH message, so that the device
      at the next hop address filters the VPN route sent by the source PE.</t>

      <t>Before the route update is announced, the receiver should check its
      ORF-Policy table with &lt;RD, Source PE&gt; tuple of the VPN route. The
      Route Distinguisher information can be extracted directly from the BGP
      UPDATE message. The source PE information should be compared against the
      Source PE Extended Community if it is contained in BGP UPDATE message,
      or else the NEXT_HOP.</t>

      <t>If there is not a related VPN Prefix ORF entry in ORF-Policy table,
      the receiver will send this VPN route; otherwise, the receiver will
      perform the following operations:</t>

      <t><list style="symbols">
          <t>If the "Offending VPN routes process method" bit is 0, the
          receiver should withdraw all the VPN routes identified by RD, RT and
          information in optional TLVs in the entry, and stop sending the
          corresponding VPN routes to the sender.</t>

          <t>If the "Offending VPN routes process method" bit is 1, the
          receiver withdraw the extra VPN routes according to the value of VRF
          Prefix Limit, RD, RT and information in optional TLVs in the entry,
          and stop sending the corresponding VPN routes to the sender.</t>
        </list></t>
    </section>

    <section title="Withdraw of VPN Prefix ORF entries">
      <t>When the VPN Prefix ORF mechanism is triggered, the alarm information
      will be generated and sent to the network operators. Operators should
      manually configure the network to resume normal operation. Due to
      devices can record the VPN Prefix ORF entries sent by each VRF,
      operators can find the entries needs to be withdrawn, and trigger the
      withdraw process as described in <xref target="RFC5291"/> manually.
      After returning to normal, the device sends withdraw ORF entries to its
      peer who have previously received ORF entries.</t>
    </section>

    <section title="Applicability">
      <t>We take the scenario in <xref target="scenario-1"/> as an example to
      illustrate how to determine each field when the sender generates a VPN
      Prefix ORF entry. We assume it is an IPv4 network. After PE1-PE4 and RR
      advertising the Outbound Route Filtering Capability, each of PE1-PE4
      should send a VPN Prefix ORF entry that means "PERMIT-ALL" as
      follows:<list style="symbols">
          <t>AFI is equal to IPv4</t>

          <t>SAFI is equal to MPLS-labeled VPN address</t>

          <t>When-to-refresh is equal to IMMEDIATE</t>

          <t>ORF Type is equal to VPN Prefix ORF</t>

          <t>Length of ORF entries is equal to 26</t>

          <t>Action is equal to ADD</t>

          <t>Match is equal to PERMIT</t>

          <t>Offending VPN routes process method is equal to 0</t>

          <t>Sequence is equal to 0xFFFFFFFF</t>

          <t>Length is equal to 12</t>

          <t>VRF Prefix Limit is equal to 0xFFFF</t>

          <t>Route Distinguisher is equal to 0</t>
        </list></t>

      <t>When the VPN Prefix ORF mechanism is triggered on PE1, PE1 will
      generate a VPN Prefix ORF contains the following information:<list
          style="symbols">
          <t>AFI is equal to IPv4</t>

          <t>SAFI is equal to MPLS-labeled VPN address</t>

          <t>When-to-refresh is equal to IMMEDIATE</t>

          <t>ORF Type is equal to VPN Prefix ORF</t>

          <t>Length of ORF entries is equal to 44</t>

          <t>Action is equal to ADD</t>

          <t>Match is equal to DENY</t>

          <t>Offending VPN routes process method is equal to 0</t>

          <t>Sequence is equal to 1</t>

          <t>Length is equal to 30</t>

          <t>VRF Prefix Limit is equal to the prefix limit of VPN1 VRF</t>

          <t>Route Distinguisher is equal to RD31</t>

          <t>Optional TLV:<list style="symbols">
              <t>Type is equal to 1 (Source PE TLV)</t>

              <t>Length is equal to 8</t>

              <t>value is equal to PE3's IPv4 address</t>

              <t>Type is equal to 4 (Route Target TLV)</t>

              <t>Length is equal to 8</t>

              <t>value is equal to RT1</t>
            </list></t>
        </list></t>
    </section>

    <section title="Implementation Considerations">
      <t>This draft is experimental in order to determine if the proposed
      mechanism could block the offending routes as expected or not, and
      whether it would cause other potential network failures. The first
      section below describes implementation considerations for the mechanism.
      The second section below provides a short summary of the experimental
      topology and the results.</t>

      <section title="Implementation Considerations">
        <t>Before originating a VPN Prefix ORF message, the device should
        compare the list of RDs carried by VPN routes signaled for filtering
        and the RDs imported by not affected VRF(s). Once they have
        intersection, the VPN Prefix ORF message MUST NOT be originated.</t>

        <t>In deployment, the quota value can be set with different
        granularity, such as &lt;PE&gt;, &lt;RD, Source AS&gt;, etc. If the
        quota value is set to (VRF prefix limit/the number of PEs), whenever a
        new PE access to the network, the quota value should be changed.</t>

        <t>To avoid the frequently change of the quota value, the value can be
        set according to the following formula:</t>

        <t>Quota=MIN[(Margins coefficient)*&lt;PE,CE limit&gt;*&lt;Number of
        PEs within the VPN, includes the possibility expansion in futures&gt;,
        VRF Prefixes Limit]</t>

        <t>It should be noted that the above formula is only an example, the
        operators can use different formulas based on actual needs in
        management plane.</t>

        <t/>
      </section>

      <section title="Implementation status">
        <t>Currently, H3C has implemented VPN Prefix ORF mechanism related
        functions as follows:</t>

        <t><list style="symbols">
            <t>By configuring VRF Prefix limit and quota, achieve the use of
            RD and Source PE to control VPN routing.</t>

            <t>Generating, transmitting and processing Type 1 and Type 2
            Source PE TLV.</t>

            <t>Using the Offending VPN routes process method to revoke all
            routes.</t>
          </list>Besides, we also implemented the following functions based on
        the open-source BGP implementation (FRR):</t>

        <t><list style="symbols">
            <t>VPN Prefix ORF mechanism triggered based on VRF limit in
            intra-domain and inter-domain scenarios.</t>

            <t>RD based VPN routing filtering in intra-domain and inter-domain
            scenarios.</t>
          </list></t>

        <t/>
      </section>

      <section title="Experimental topology">
        <t>The experiments will test whether the VPN Prefix ORF blocks the
        offending routes in the following scenarios:<list style="symbols">
            <t>Intra-domain as a standalone mechanism,</t>

            <t>Inter-domain as a standalone mechanisms,</t>

            <t>Adding the VPN Prefix ORF to existing mechanisms for
            intra-domain VPNs,</t>

            <t>Adding the VPN Prefix ORF to existing mechanisms for
            intra-domain VPNs.</t>
          </list></t>

        <t/>
      </section>

      <section title="Results of Experiments">
        <t>[TBD]</t>
      </section>
    </section>

    <section title="Security Considerations">
      <t>This draft does build upon <xref target="RFC5291"/>. A BGP speaker
      will maintain the VPN Prefix ORF entries in an ORF-Policy table, this
      behavior consumes its memory and compute resources. To avoid the
      excessive consumption of resources, <xref target="RFC5291"/> specifies
      that a BGP speaker can only accept ORF entries transmitted by its
      interested peers.</t>
    </section>

    <section anchor="iana" title="IANA Considerations">
      <t>This document defines a new Outbound Route Filter type - VPN Prefix
      Outbound Route Filter (VPN Prefix ORF). The code point is from the "BGP
      Outbound Route Filtering (ORF) Types". It is recommended to set the code
      point of VPN Prefix ORF to 66.</t>

      <t>This document also define a VPN Prefix ORF TLV type under "Border
      Gateway Protocol (BGP) Parameters", four TLV types are defined:<figure
          align="center">
          <artwork><![CDATA[under "Border Gateway Protocol (BGP) Parameters"
Registry: "VPN Prefix ORF TLV"
Registration Procedure(s): First Come, First Served
Value range:0-255, value 0 is reserved.
 +===========================+=============+===========================+
 | Registry                  |     Type    |       Meaning             |
 +===========================+=============+===========================+
 |IPv4 Source PE TLV         | 1(suggested)|IPv4 address for source PE.|
 +---------------------------+-------------+---------------------------+
 |IPv6 Source PE TLV         | 2(suggested)|IPv6 address for source PE.|
 +---------------------------+-------------+---------------------------+
 |Source PE Extended         | 3(suggested)|Source PE Extended         |
 |Community TLV              |             |Community for source PE    |
 +---------------------------+-------------+---------------------------+
 |Route Target TLV           | 4(suggested)|Route Target of the        |
 |                           |             |offending VPN routes       |
 +---------------------------+-------------+---------------------------+
]]></artwork>
        </figure></t>

      <t>This document also requests a new Transitive Extended Community Type.
      The new Transitive Extended Community Type name shall be "Source PE
      Extended Community".</t>

      <t><figure align="left">
          <artwork><![CDATA[        Under "BGP Transitive Extended Community Types:"
        Registry: "Source PE Extended Community" type
         0x0d(suggested)         Source PE Extended Community
]]></artwork>
        </figure></t>
    </section>

    <section title="Contributor">
      <t>Shunwan Zhuang</t>

      <t>Huawei Technologies</t>

      <t>Huawei Building, No.156 Beiqing Rd.</t>

      <t>Beijing</t>

      <t>Beijing, 100095 China</t>
    </section>

    <section title="Acknowledgement">
      <t>Thanks Robert Raszuk, Jim Uttaro, Jakob Heitz, Jeff Tantsura, Rajiv
      Asati, John E Drake, Gert Doering, Shuanglong Chen, Enke Chen, Srihari
      Sangli and Igor Malyushkin for their valuable comments on this
      draft.</t>
    </section>
  </middle>

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

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

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

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

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

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

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

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

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

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

      <?rfc include='reference.I-D.ietf-bess-evpn-inter-subnet-forwarding'?>

      <?rfc include='reference.I-D.wang-idr-vpn-routes-control-analysis'?>
    </references>

    <section anchor="topology" title="Experimental topology">
      <t>The experimental topology is shown in Figure 6.<figure align="center">
          <artwork><![CDATA[+--------------------------+             +--------------------------+
|                          |             |                          |
|                          |             |                          |
|   +---------+            |             |            +---------+   |
|   |   PE1   |            |             |            |   PE3   |   |
|   +---------+            |             |            +---------+   |
|              \           |             |           /              |
|                \+---------+    EBGP   +---------+/                |
|                 |         |           |         |                 |
|                 |  ASBR1  |-----------|  ASBR2  |                 |
|                 |         |           |         |                 |
|                 +---------+           +---------+                 |
|                /         |             |         \                |
|   +---------+/           |             |           \+---------+   |
|   |   PE2   |            |             |            |   PE4   |   |
|   +---------+            |             |            +---------+   |
|                          |             |                          |
|           AS1            |             |           AS2            |
+--------------------------+             +--------------------------+
                 Figure 6 The experimental topology
]]></artwork>
        </figure></t>

      <t>This topology can be used to verify as follows:<list style="symbols">
          <t>whether the VPN Prefix ORF mechanism could block the offending
          routes in intra-domain scenario.</t>

          <t>whether the VPN Prefix ORF mechanism could block the offending
          routes in inter-domain scenario.</t>

          <t>whether the VPN Prefix ORF mechanism conflicts with the existing
          mechanism and cause failure.</t>

          <t>whether the quota value leads to flapping.</t>

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

      <t/>

      <t/>
    </section>
  </back>
</rfc>
