<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-bess-orf-covering-prefixes-05"
     ipr="trust200902">
  <front>
    <title abbrev="Covering Prefixes ORF">Covering Prefixes Outbound Route
    Filter for BGP-4</title>

    <author fullname="Huajin Jeng" initials="H." surname="Jeng">
      <organization>AT&amp;T</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <email>hj2387@att.com</email>
      </address>
    </author>

    <author fullname="Luay Jalil" initials="L." surname="Jalil">
      <organization>Verizon</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country/>
        </postal>

        <phone/>

        <facsimile/>

        <email>luay.jalil@verizon.com</email>

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

    <author fullname="Ron Bonica" initials="R." surname="Bonica">
      <organization>Juniper Networks</organization>

      <address>
        <postal>
          <street>2251 Corporate Park Drive</street>

          <city>Herndon</city>

          <code>20170</code>

          <region>Virginia</region>

          <country>USA</country>
        </postal>

        <email>rbonica@juniper.net</email>
      </address>
    </author>

    <author fullname="Keyur Patel" initials="K" surname="Patel">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street>170 W. Tasman Drive</street>

          <city>San Jose</city>

          <region>California</region>

          <code>95134</code>

          <country>USA</country>
        </postal>

        <email>keyupate@cisco.com</email>

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

    <author fullname="Lucy Yong" initials="L" surname="Yong">
      <organization>Huawei Technologies</organization>

      <address>
        <postal>
          <street/>

          <city>Austin</city>

          <region>Texas</region>

          <code/>

          <country>USA</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>lucy.yong@huawei.com</email>

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

    <date day="6" month="March" year="2015"/>

    <area>Routing Area</area>

    <workgroup>BESS Working Group</workgroup>

    <keyword>ORF</keyword>

    <keyword>VPN</keyword>

    <abstract>
      <t> This document defines a new Outbound Route Filter (ORF) type, called
      the "Covering Prefixes ORF (CP-ORF)". CP-ORF is applicable in Virtual
      Hub-and-Spoke VPNs. It also is applicable in BGP/MPLS Ethernet VPN
      (EVPN) networks.</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>A <xref target="RFC4271">BGP</xref> speaker can send <xref
      target="RFC5291">Outbound Route Filters (ORF)</xref> to a peer. The peer
      uses ORFs to filter routing updates that it sends to the BGP speaker.
      Using ORF, a BGP speaker can realize a "route pull" paradigm, in which
      the BGP speaker, on demand, pulls certain routes from the peer.</t>

      <t>This document defines a new ORF-type, called 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.
      <xref target="LCPORF"/> provides a more complete description of covering
      prefix selection criteria.</t>

      <t>CP-ORF is applicable in <xref target="RFC7024">Virtual Hub-and-Spoke
      VPNs </xref> <xref target="RFC4364"/>. It also is applicable <xref
      target="I-D.ietf-l2vpn-evpn"> BGP/MPLS Ethernet VPN (EVPN) </xref>
      networks.</t>

      <section title="Terminology">
        <t>This document uses the following terms:</t>

        <t><list style="symbols">
            <t>Address Family Identifier (AFI) - defined in <xref
            target="RFC4760"/></t>

            <t>Subsequent Address Family Identifier (SAFI) - defined in <xref
            target="RFC4760"/></t>

            <t>VPN IP Default Route - defined in <xref target="RFC7024"/>.</t>

            <t>V-Hub - defined in <xref target="RFC7024"/>.</t>

            <t>V-Spoke - defined in <xref target="RFC7024"/>.</t>

            <t>BGP/MPLS Ethernet VPN (EVPN) - defined in <xref
            target="I-D.ietf-l2vpn-evpn"/></t>

            <t>EVPN Instance (EVI) - defined in <xref
            target="I-D.ietf-l2vpn-evpn"/></t>

            <t>Unknown MAC Route (UMR) - A regular EVPN MAC/IP Advertisement
            route where the MAC Address Length is set to 48 and the MAC
            address to 00:00:00:00:00:00</t>

            <t>Default MAC Gateway (DMG) - An EVPN PE that advertises a
            UMR</t>
          </list></t>
      </section>
    </section>

    <section anchor="encode" title="CP-ORF Encoding">
      <t>RFC 5291 augments the BGP ROUTE-REFRESH message so that it can carry
      ORF entries. When the ROUTE-REFRESH message carries ORF entries, it
      includes the following fields:</t>

      <t><list style="symbols">
          <t><xref target="IANA.AFI">AFI</xref></t>

          <t><xref target="IANA.SAFI">SAFI</xref></t>

          <t>When-to-refresh (IMMEDIATE or DEFERRED)</t>

          <t>ORF Type</t>

          <t>Length (of ORF entries)</t>
        </list> The ROUTE-REFRESH message also contains a list of ORF entries.
      Each ORF entry contains the following fields:</t>

      <t><list style="symbols">
          <t>Action (ADD, REMOVE, or REMOVE-ALL)</t>

          <t>Match (PERMIT or DENY)</t>
        </list></t>

      <t>The ORF entry may also contain Type-specific information.
      Type-specific information is present only when the Action is equal to
      ADD or REMOVE. It is not present when the Action is equal to
      REMOVE-ALL.</t>

      <t>When the BGP ROUTE-REFRESH message carries CP-ORF entries, the
      following conditions MUST be true:</t>

      <t><list style="symbols">
          <t>ORF Type MUST be equal to CP-ORF (65).</t>

          <t>The AFI MUST be equal to IPv4, IPv6 or L2VPN</t>

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

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

          <t>Match field MUST be equal to PERMIT</t>
        </list> <xref target="encodeFig"/> depicts the encoding of the CP-ORF
      type-specific information.</t>

      <t><figure anchor="encodeFig" title="CP-ORF Type-specific Encoding">
          <artwork align="center"><![CDATA[    
                  +--------------------------------+
                  |  Sequence (32 bits)            |
                  +--------------------------------+
                  |  Minlen   (8 bits)             |
                  +--------------------------------+
                  |  Maxlen   (8 bits)             |
                  +--------------------------------+
                  |  VPN Route Target (64 bits)    |
                  +--------------------------------+
                  |  Import Route Target (64 bits) |
                  +--------------------------------+
                  |  Route Type (8 bits)           |
                  +--------------------------------+
                  |  Host Address                  |
                  |    (0, 32, 48 or 128 bits)     |
                  |           ....      
                  +--------------------------------+
]]></artwork>
        </figure></t>

      <t>The CP-ORF recipient uses the following fields to select routes
      matching the CP-ORF:</t>

      <t><list style="symbols">
          <t>Sequence: Relative position of CP-ORF entry among other CP-ORF
          entries</t>

          <t>Minlen: Minimum length of selected route (measured in bits)</t>

          <t>Maxlen: Maximum length of selected route (measured in bits)</t>

          <t>VPN Route Target : VPN Route Target carried by selected route</t>

          <t>Route Type: Type of selected route</t>

          <t>Host Address: Address covered by selected route</t>
        </list></t>

      <t>See <xref target="LCPORF"/> for details.</t>

      <t>The CP-ORF recipient marks routes that match CP-ORF with the Import
      Route Target before advertising those routes to the CP-ORF originator.
      See <xref target="LCPORF"/> for details.</t>

      <t>If the ROUTE-REFRESH AFI is equal to IPv4:</t>

      <t><list style="symbols">
          <t>The value of Minlen MUST be less than or equal to 32</t>

          <t>The value of Maxlen MUST be less than or equal to 32</t>

          <t>The value of Minlen MUST be less than or equal to the value of
          Maxlen</t>

          <t>The value of Route Type MUST be 0 (i.e., RESERVED)</t>

          <t>The Host Address MUST contain exactly 32 bits</t>
        </list></t>

      <t>If the ROUTE-REFRESH AFI is equal to IPv6:</t>

      <t><list style="symbols">
          <t>The value of Minlen MUST be less than or equal to 128</t>

          <t>The value of Maxlen MUST be less than or equal to 128</t>

          <t>The value of Minlen MUST be less than or equal to the value of
          Maxlen</t>

          <t>The value of Route Type MUST be 0 (i.e., RESERVED)</t>

          <t>The Host Address MUST contain exactly 128 bits</t>
        </list></t>

      <t>If the ROUTE-REFRESH AFI is equal to L2VPN, the value of Route Type
      MUST be one of the following values, taken from <xref
      target="IANA.EVPN">IANA EVPN Registry</xref>:</t>

      <t><list style="symbols">
          <t>1 - Ethernet Autodiscovery Route</t>

          <t>2 - MAC/IP Advertisement Route</t>

          <t>3 - Inclusive Multicast Route</t>

          <t>4 - Ethernet Segment Route</t>
        </list></t>

      <t>If the ROUTE-REFRESH AFI is equal to L2VPN and the value of Route
      Type is equal to Ethernet Autodiscovery Route, Inclusive Multicast
      Route, or Ethernet Segment Route:</t>

      <t><list style="symbols">
          <t>The value of Minlen MUST be equal to 0</t>

          <t>The value of Maxlen MUST be equal to 0</t>

          <t>The Host Address MUST be absent (i.e., contain 0 bits)</t>
        </list></t>

      <t>If the ROUTE-REFRESH AFI is equal to L2VPN and the value of Route
      Type is equal to MAC/IP Advertisement Route:</t>

      <t><list style="symbols">
          <t>The value of Minlen MUST be less than or equal to 48</t>

          <t>The value of Maxlen MUST be less than or equal to 48</t>

          <t>The value of Minlen MUST be less than or equal to the value of
          Maxlen</t>

          <t>The Host Address MUST contain exactly 48 bits.</t>
        </list></t>
    </section>

    <section anchor="LCPORF" title="Processing Rules">
      <t hangText="yes">According to <xref target="RFC4271"/>, every BGP
      speaker maintains a single Loc-RIB. For each of its peers, the BGP
      speaker also maintains an Outbound Filter and an Adj-RIB-Out. The
      Outbound Filter defines policy that determines which Loc-RIB entries are
      processed into the corresponding Adj-RIB-Out. Mechanisms such as <xref
      target="RFC4684">RT-Contstrain </xref> and <xref target="RFC5291">ORF
      </xref> enable a router's peer to influence the Outbound Filter.
      Therefore, the Outbound Filter for a given peer is constructed using a
      combination of the locally configured policy and the information
      received via RT-Constrain and ORF from the peer.</t>

      <t>Using this model we can describe the operations of CP-ORF as
      follows:</t>

      <t>When a BGP speaker receives a ROUTE-REFRESH message that contains a
      CP-ORF, and that ROUTE-REFRESH message violates any of the encoding
      rules specified in <xref target="encode"/>, the BGP speaker MUST ignore
      the entire ROUTE-REFRESH message. It SHOULD also log the event. However,
      an implementation MAY apply logging thresholds to avoid excessive
      messaging or log file overflow.</t>

      <t>Otherwise, the BGP speaker processes each CP-ORF entry as indicated
      by the Action field. If the Action is equal to ADD, the BGP speaker adds
      the CP-ORF entry to the Outbound Filter associated with the peer in the
      position specified by the Sequence field. If the Action is equal to
      REMOVE, the BGP speaker removes the CP-ORF entry from the Outbound
      Filter. If the Action is equal to REMOVE-ALL, the BGP speaker removes
      all CP-ORF entries from the Outbound Filter.</t>

      <t>Whenever the BGP speaker applies an Outbound Filter to a route
      contained in its Loc-RIB, it evaluates the route in terms of the CP-ORF
      entries first. It then evaluates the route in terms of the remaining,
      non-CP-ORF entries. The rules for the former are described below. The
      rules for the latter are outside the scope of this document.</t>

      <t>The following route types can match a CP-ORF:</t>

      <t><list style="symbols">
          <t>IPv4-VPN</t>

          <t>IPv6-VPN</t>

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

      <t>In order for an IPv4-VPN route or IPv6-VPN route to match a CP-ORF,
      all of the following conditions MUST be true:</t>

      <t><list style="symbols">
          <t>the route carries an RT whose value is the same as the CP-ORF VPN
          Route Target</t>

          <t>the route prefix length is greater than or equal to the CP-ORF
          Minlen plus 64 (i.e., the length of a VPN Route Distinguisher)</t>

          <t>the route prefix length is less than or equal to the CP-ORF
          Maxlen plus 64 (i.e., the length of a VPN Route Distinguisher)</t>

          <t>ignoring the Route Distinguisher, the leading bits of the route
          prefix are identical to the leading bits of the CP-ORF Host Address.
          CP-ORF Minlen defines the number of bits that must be identical.</t>

          <t>Loc-RIB does not contain a more specific route that also
          satisfies all of the above listed conditions.</t>
        </list></t>

      <t>The BGP speaker ignores Route Distinguishers when determining whether
      a prefix matches a host address. For example, assume that a CP-ORF
      carries the following information:</t>

      <t><list style="symbols">
          <t>Minlen equal to 1</t>

          <t>Maxlen equal to 32</t>

          <t>Host Address equal to 192.0.2.1</t>
        </list>Assume also that Loc-RIB contains routes for the following
      IPv4-VPN prefixes, and that all of these routes carry an RT whose value
      is the same as the CP-ORF VPN Route Target:</t>

      <t><list style="symbols">
          <t>1:0.0.0.0/64.</t>

          <t>2:192.0.2.0/88</t>

          <t>3:192.0.2.0/89</t>
        </list>Only the prefix 3:192.0.2.0/89 matches the CP-ORF. The prefix
      1:0.0.0.0/64 does not match, because its length (64) is less than the
      CP-ORF Minlen (1) plus the length of an L3VPN Route Distinguisher (64).
      If Loc-RIB did not contain the prefix 3:192.0.2.0/89, 2:192.0.2.0/88
      would match the CP-ORF. However, because Loc-RIB also contains a more
      specific covering route (3:192.0.2.0/89), 2:192.0.2.0/88 does not match.
      Only 3:192.0.2.0/89 satisfies all of the above listed match criteria.
      Note that the matching algorithm ignored Route Distinguishers.</t>

      <t>In order for an EVPN route to match a CP-ORF, all of the following
      conditions MUST be true:</t>

      <t><list style="symbols">
          <t>the EVPN route type is equal to the CP-ORF Route Type</t>

          <t>the route carries an RT whose value is equal to the CP-ORF VPN
          Route Target</t>
        </list></t>

      <t>In addition, if the CP-ORF Route Type is equal to MAC/IP
      Advertisement Route, the following conditions also MUST be true:</t>

      <t><list style="symbols">
          <t>the EVPN Route MAC Address Length is greater than or equal to the
          CP-ORF Minlen plus 64 (i.e., the length of a VPN Route
          Distinguisher)</t>

          <t>the EVPN Route MAC Address Length is less than or equal to the
          CP-ORF Maxlen plus 64 (i.e., the length of a VPN Route
          Distinguisher)</t>

          <t>ignoring the Route Distinguisher, the leading bits of the EVPN
          Route MAC Address are identical to the leading bits of the CP-ORF
          Host Address. CP-ORF Minlen defines the number of bits that must be
          identical.</t>
        </list></t>

      <t>If a route matches the selection criteria of a CP-ORF entry, and it
      does not violate any subsequent rule specified by the Outbound Filter
      (e.g., rules that reflect local policy, or rules that are due to
      RT-Constrains), the BGP speaker places the route into the Adj-RIB-Out.
      In Adj-RIB-Out, the BGP speaker adds the CP-ORF Import Route Target to
      the list of Route Targets that the route already carries. The BGP
      speaker also adds a <xref target="RFC4360">Transitive Opaque Extended
      Community</xref> with subtype equal to CP-ORF (0x03). As a result of
      being placed in Adj-RIB-Out, the route is advertised to the peer
      associated with the Adj-RIB-Out.</t>

      <t>Receiving CP-ORF entries with REMOVE or REMOVE-ALL Actions may cause
      a route that has previously been installed in a particular Adj-RIB-Out
      be excluded from that Adj-RIB-Out. In this case, as specified in
      [RFC4271], "the previously advertised route in that Adj-RIB-Out MUST be
      withdrawn from service by means of an UPDATE message".</t>

      <t>RFC 5291 states that a BGP speaker should respond to a ROUTE REFRESH
      message as follows:</t>

      <t>"If the When-to-refresh indicates IMMEDIATE, then after processing
      all the ORF entries carried in the message the speaker re-advertises to
      the peer routes from the Adj-RIB-Out associated with the peer that have
      the same AFI/SAFI as what is carried in the message, and taking into
      account all the ORF entries for that AFI/SAFI received from the peer.
      The speaker MUST re-advertise all the routes that have been affected by
      the ORF entries carried in the message, but MAY also re-advertise the
      routes that have not been affected by the ORF entries carried in the
      message."</t>

      <t>When the ROUTE-REFRESH message includes only CP-ORF entries, the BGP
      speaker MUST re-advertise routes that have been affected by these CP-ORF
      entries. It is RECOMMENDED not to re-advertise the routes that have not
      been affected by the CP-ORF entries.</t>

      <t> The behavior when the ROUTE-REFRESH message includes one or more
      CP-ORF entries and one or more ORF entries of a different type remains
      unchanged from that described in RFC 5291.</t>
    </section>

    <section title="Applicability In Virtual Hub-and-Spoke VPNs">
      <t>In a Virtual Hub-and-Spoke environment, VPN sites are attached to
      Provider Edge (PE) routers. For a given VPN, a PE router acts in exactly
      one of the following roles:</t>

      <t><list style="symbols">
          <t>As neither a V-hub nor a V-Spoke</t>

          <t>As a V-hub</t>

          <t>As a V-spoke</t>
        </list></t>

      <t>To illustrate CP-ORF operation in conjunction with Virtual
      Hub-and-Spoke assume the following:</t>

      <t><list style="symbols">
          <t>One of the sites in a particular VPN, RED-VPN, is connected to a
          PE that acts as neither a V-hub nor a V-Spoke for RED-VPN. We refer
          to this PE as PE1.</t>

          <t>Another site in RED-VPN is connected to another PE, and that PE
          acts as a V-hub for RED-VPN. We refer to this PE as V-hub1.</t>

          <t>Yet another site in RED-VPN is connected to another PE, and that
          PE acts as a V-spoke for RED-VPN. We refer to this PE as
          V-spoke1.</t>
        </list></t>

      <t>All of these PEs advertise RED-VPN routes to a route reflector (RR).
      They mark these routes with a route target, which we will call RT-RED.
      In particular, PE1 advertises a RED-VPN route to a prefix that we will
      call P. P covers a host address, that we will call H.</t>

      <t>For the purpose of illustration also assume that the PEs and the RRs
      use <xref target="RFC4684">Route Target Constraint</xref>.</t>

      <t>V-hub1 serves the RED-VPN. Therefore, V-hub1 advertises a VPN IP
      default route for the RED-VPN to the RR, carrying the route target
      RT-RED-FROM-HUB1.</t>

      <t>V-spoke1 establishes a BGP session with the RR, negotiating the
      CP-ORF capability, as well as the Multiprotocol Extensions Capability
      <xref target="RFC4760"/>. Upon establishment of the BGP session, the RR
      does not advertise any routes to V-spoke1. The RR will not advertise any
      routes until it receives either a ROUTE-REFRESH message or a BGP UPDATE
      message containing a Route Target Membership NLRI <xref
      target="RFC4684"/>.</t>

      <t>Immediately after the BGP session is established, V-spoke1 sends the
      RR a BGP UPDATE message containing a Route Target Membership NLRI. The
      Route Target Membership NLRI specifies RT-RED-FROM-HUB1 as its route
      target. In response to the BGP-UPDATE message, the RR advertises the VPN
      IP default route for the RED-VPN to V-spoke1. This route carries the
      route target RT-RED-FROM-HUB1. V-spoke1 subjects this route to its
      import policy and accepts it because it carries the route target
      RT-RED-FROM-HUB1.</t>

      <t>Now, V-spoke1 begins normal operation, sending all of its RED-VPN
      traffic through V-hub1. At some point, V-spoke1 determines that it might
      benefit from a more direct route to H. (Criteria by which V-spoke1
      determines that it needs a more direct route to H are beyond the scope
      of this document.)</t>

      <t>In order to discover a more direct route, V-spoke1 assigns a unique
      numeric identifier to H. V-spoke1 then sends a ROUTE-REFRESH message to
      the RR, containing the following information:</t>

      <t><list style="symbols">
          <t>AFI is equal to IPv4 or IPv6, as appropriate</t>

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

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

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

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

          <t>ORF Type is equal to CP-ORF</t>

          <t>CP-ORF Sequence is equal to the identifier associated with H</t>

          <t>CP-ORF Minlen is equal to 1</t>

          <t>CP-ORF Maxlen is equal to 32 or 128, as appropriate</t>

          <t>CP-ORF VPN Route Target is equal to RT-RED</t>

          <t>CP-ORF Import Route Target is equal to RT-RED-FROM-HUB1</t>

          <t>CP-ORF Route Type is equal to 0 (i.e., undefined)</t>

          <t>CP-ORF Host Address is equal H</t>
        </list></t>

      <t>Upon receipt of the ROUTE-REFRESH message, the RR MUST ensure that it
      carries all routes belonging to the RED-VPN. In at least one special
      case, where all of the RR clients are V-spokes and none of the RR
      clients are V-hubs, the RR will lack some or all of the required RED-VPN
      routes. So, the RR sends a BGP UPDATE message containing a Route Target
      Membership NLRI for VPN-RED to all of its peers. This causes the peers
      to advertise VPN-RED routes to the RR, if they have not done so
      already.</t>

      <t>Next, the RR adds the received CP-ORF to the Outbound Filter
      associated with V-spoke1. Using the procedures in <xref
      target="LCPORF"/>, the RR determines whether any of the routes in its
      Loc-RIB satisfy the selection criteria of the newly updated Outbound
      Filter. If any routes satisfy the match criteria, they are added to the
      Adj-RIB-Out associated with V-spoke1. In Adj-RIB-Out, the RR adds
      RT-RED-FROM-HUB1 to the list of Route Targets that the route already
      carries. The RR also adds a <xref target="RFC4360">Transitive Opaque
      Extended Community</xref> with subtype equal to CP-ORF. Finally, RR
      advertises the newly added routes to V-spoke1. In this example, the RR
      advertises P to V-Spoke1 with a next-hop of PE1.</t>

      <t>V-spoke1 subjects the advertised routes to its import policy and
      accepts them because they carry the route target RT-RED-FROM-HUB1.</t>

      <t>V-spoke1 may repeat this process whenever it discovers another flow
      that might benefit from a more direct route to its destination.</t>

      <section title="Multicast Considerations">
        <t>When applying <xref target="RFC6513">Multicast VPN</xref><xref
        target="RFC6514"/> procedures, routes bearing a <xref
        target="RFC4360">Transitive Opaque Extended Community</xref> with
        subtype equal to CP-ORF MUST NOT be used to determine Eligible
        Upstream Multicast Hops (UMH).</t>
      </section>
    </section>

    <section title="Applicability In BGP/MPLS Ethernet VPN (EVPN)">
      <t>In a EVPN environment, CE devices are attached to Provider Edge (PE)
      routers. A CE can be a host, a router or a switch. For a given EVPN
      Instance (EVI), a PE router acts in exactly one of the following
      roles:</t>

      <t><list style="symbols">
          <t>As neither a Default MAC Gateway (DMG) nor a Spoke</t>

          <t>As a DMG</t>

          <t>As a Spoke</t>
        </list></t>

      <t>To illustrate CP-ORF operation in the EVPN environment assume the
      following:</t>

      <t><list style="symbols">
          <t>A CE device in a particular EVI, RED-EVI, is connected to a PE
          that acts as neither a DMG nor a Spoke for RED-EVI. We refer to this
          PE as PE1.</t>

          <t>Another CE device in RED-EVI is connected to another PE, and that
          PE acts as a DMG for RED-EVI. We refer to this PE as DMG1.</t>

          <t>Yet another CE device in RED-EVI is connected to another PE, and
          that PE acts as a Spoke for RED-EVI. We refer to this PE as
          Spoke1.</t>
        </list>All of these PEs advertise RED-EVI routes to a RR. They mark
      these routes with a route target, which we will call RT-RED. In
      particular, PE1 advertises a RED-EVI route to a MAC Address that we will
      call M.</t>

      <t>The RED-EVI VRFs on all of these PEs are provisioned to import EVPN
      routes that carry RT-RED.</t>

      <t>Since DMG1 acts as a DMG for RED-EVI, DMG1 advertises a Unknown MAC
      Route (UMR) for the RED-EVI to the RR, carrying the route target RT-
      RED. The UMR is characterized as follows:</t>

      <t><list style="symbols">
          <t>EVPN Route Type is equal to MAC/IP Advertisement Route</t>

          <t>MAC address length is equal to 0</t>

          <t>IP address length is equal to 0</t>
        </list></t>

      <t>Spoke1 establishes a BGP session with the RR, negotiating the CP-ORF
      capability, as well as the Multiprotocol Extensions Capability <xref
      target="RFC4760"/>. Upon establishment of the BGP session, the RR does
      not advertise any routes to Spoke1. The RR will not advertise any routes
      until it receives a ROUTE-REFRESH message.</t>

      <t>Immediately after the BGP session is established, Spoke1 sends the RR
      a ROUTE REFRESH message containing the following information:</t>

      <t><list style="symbols">
          <t>AFI is equal to L2VPN</t>

          <t>SAFI is equal to BGP EVPN</t>

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

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

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

      <t>The ROUTE REFRESH message also contains four ORF entries. The first
      ORF entry contains the following information:</t>

      <t><list style="symbols">
          <t>ORF Type is equal to CP-ORF</t>

          <t>CP-ORF Sequence is equal 1</t>

          <t>CP-ORF Minlen is equal to 0</t>

          <t>CP-ORF Maxlen is equal to 0</t>

          <t>CP-ORF VPN Route Target is equal to RT-RED</t>

          <t>CP-ORF Import Route Target is equal to RT-RED</t>

          <t>CP-ORF Route Type is equal to 1 (Ethernet Autodiscovery
          Route)</t>
        </list>The second ORF entry contains the following information:</t>

      <t><list style="symbols">
          <t>ORF Type is equal to CP-ORF</t>

          <t>CP-ORF Sequence is equal 2</t>

          <t>CP-ORF Minlen is equal to 0</t>

          <t>CP-ORF Maxlen is equal to 0</t>

          <t>CP-ORF VPN Route Target is equal to RT-RED</t>

          <t>CP-ORF Import Route Target is equal to RT-RED</t>

          <t>CP-ORF Route Type is equal to 2 (MAC/IP Advertisement Route)</t>
        </list>The third ORF entry contains the following information:</t>

      <t><list style="symbols">
          <t>ORF Type is equal to CP-ORF</t>

          <t>CP-ORF Sequence is equal 3</t>

          <t>CP-ORF Minlen is equal to 0</t>

          <t>CP-ORF Maxlen is equal to 0</t>

          <t>CP-ORF VPN Route Target is equal to RT-RED</t>

          <t>CP-ORF Import Route Target is equal to RT-RED</t>

          <t>CP-ORF Route Type is equal to 3 (Inclusive Multicast Route)</t>
        </list>The fourth ORF entry contains the following information:</t>

      <t><list style="symbols">
          <t>ORF Type is equal to CP-ORF</t>

          <t>CP-ORF Sequence is equal 4</t>

          <t>CP-ORF Minlen is equal to 0</t>

          <t>CP-ORF Maxlen is equal to 0</t>

          <t>CP-ORF VPN Route Target is equal to RT-RED</t>

          <t>CP-ORF Import Route Target is equal to RT-RED</t>

          <t>CP-ORF Route Type is equal to 4 (Ethernet Segment Route)</t>
        </list></t>

      <t>In response to the ROUTE REFRESH message, the RR advertises the
      following to V-spoke1:</t>

      <t><list style="symbols">
          <t>All Ethernet Autodiscovery Routes belonging to RED-EVI</t>

          <t>A UMR advertised by DMG1 and belonging to RED-EVI</t>

          <t>All Inclusive Multicast Routes belonging to RED-EVI</t>

          <t>All Ethernet Segment Routes belonging to RED-EVI</t>
        </list></t>

      <t>All of these routes carries the route target RT-RED. Spoke1 subjects
      these routes to its import policy and accepts them because they carry
      the route target RT-RED.</t>

      <t>Now, Spoke1 begins normal operation, sending all of its RED-VPN
      traffic through DMG1. At some point, Spoke1 determines that it might
      benefit from a more direct route to M. (Criteria by which Spoke1
      determines that it needs a more direct route to M are beyond the scope
      of this document.)</t>

      <t>In order to discover a more direct route, Spoke1 assigns a unique
      numeric identifier to M. V-spoke1 then sends a ROUTE-REFRESH message to
      the RR, containing the following information:</t>

      <t><list style="symbols">
          <t>AFI is equal to L2VPN</t>

          <t>SAFI is equal to BGP EVPN</t>

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

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

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

          <t>ORF Type is equal to CP-ORF</t>

          <t>CP-ORF Sequence is equal to the identifier associated with M</t>

          <t>CP-ORF Minlen is equal to 1</t>

          <t>CP-ORF Maxlen is equal to 48</t>

          <t>CP-ORF VPN Route Target is equal to RT-RED</t>

          <t>CP-ORF Import Route Target is equal to RT-RED</t>

          <t>CP-ORF Route Type is equal to 2 (i.e., MAC/IP Advertisement
          Route)</t>

          <t>CP-ORF Host Address is equal M</t>
        </list></t>

      <t>Next, the RR adds the received CP-ORF to the Outbound Filter
      associated with Spoke1. Using the procedures in <xref target="LCPORF"/>,
      the RR determines whether any of the routes in its Loc-RIB satisfy the
      selection criteria of the newly updated Outbound Filter. If any routes
      satisfy the match criteria, they are added to the Adj-RIB-Out associated
      with Spoke1. The RR adds a <xref target="RFC4360">Transitive Opaque
      Extended Community</xref> with subtype equal to CP-ORF. Note that as
      these routes are added to the Adj-RIB-Out, the RR does not change the
      list of Route Targets that the route already carries. Finally, RR
      advertises the newly added routes to V-spoke1. In this example, the RR
      advertises M to V-Spoke1 with a next-hop of PE1.</t>

      <t>Spoke1 subjects the advertised routes to its import policy and
      accepts them because they carry the route target RT-RED.</t>

      <t>Spoke1 may repeat this process whenever it discovers another flow
      that might benefit from a more direct route to its destination.</t>

      <t>Note that in general an EVI may have more than one DMG, in which case
      each spoke would receive a UMR from each of them. The spoke should
      follow its local route selection procedures to select one of them as the
      "best", and use the selected one.</t>
    </section>

    <section title="Clean-up">
      <t>Each CP-ORF consumes memory and compute resources on the device that
      supports it. Therefore, in order to obtain optimal performance, BGP
      speakers periodically evaluate all CP-ORFs that they have originated and
      remove unneeded CP-ORFs. The criteria by which a BGP speaker identifies
      unneeded CP-ORF entries is a matter of local policy, and is beyond the
      scope of this document.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This memo uses code points from the first-come-first-served range of
      the following registries:</t>

      <texttable>
        <preamble/>

        <ttcol>Registry</ttcol>

        <ttcol>Code Point</ttcol>

        <c>BGP Outbound Route Filtering (ORF) Types</c>

        <c>CP-ORF (65)</c>

        <c>Transitive Opaque Extended Community Sub-Type</c>

        <c>CP-ORF (0x03)</c>
      </texttable>

      <t>IANA is requested to update the above mentioned registry entries so
      that they include a stable reference to this memo.</t>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>Each CP-ORF consumes memory and compute resources on the device that
      supports it. Therefore, a device supporting CP-ORF takes the following
      steps to protect itself from oversubscription:</t>

      <t><list style="symbols">
          <t>When negotiating the ORF capability, advertise willingness to
          receive the CP-ORF only to known, trusted iBGP peers. See Section 5
          of RFC 5291 for negotiation details.</t>

          <t>Enforce a per-peer limit on the number of CP-ORFs that can be
          installed at any given time. Ignore all requests to add CP-ORFs
          beyond that limit</t>
        </list></t>

      <t>Security considerations for BGP are presented in RFC4271 while
      further security analysis of BGP is found in <xref
      target="RFC6952"/>.</t>
    </section>

    <section title="Contributors">
      <t>The following individuals contributed to the development of this
      document:</t>

      <t><list style="symbols">
          <t>Yakov Rekhter</t>

          <t>Xiaohu Xu</t>
        </list></t>
    </section>

    <section anchor="Acknowledgements" title="Acknowledgements">
      <t>The authors wish to acknowledge Han Nguyen, James Uttaro and Alvaro
      Retana for their comments and contributions.</t>
    </section>
  </middle>

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

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

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

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

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

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

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

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

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

      <?rfc include="reference.I-D.ietf-l2vpn-evpn.xml"?>
    </references>

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

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

      <reference anchor="IANA.AFI"
                 target="http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml">
        <front>
          <title>Address Family Numbers</title>

          <author>
            <organization>IANA</organization>
          </author>

          <date/>
        </front>
      </reference>

      <reference anchor="IANA.SAFI"
                 target="http://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml#safi-namespace-2">
        <front>
          <title>Subsequent Address Family Identifiers (SAFI)
          Parameters</title>

          <author>
            <organization>IANA</organization>
          </author>

          <date/>
        </front>
      </reference>

      <reference anchor="IANA.EVPN"
                 target="http://www.iana.org/assignments/evpn/evpn.xhtml">
        <front>
          <title>Ethernet VPN (EVPN)</title>

          <author>
            <organization>IANA</organization>
          </author>

          <date/>
        </front>
      </reference>
    </references>
  </back>
</rfc>
