<?xml version='1.0' encoding='utf-8'?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->


<!DOCTYPE rfc SYSTEM 'rfc2629-xhtml.ent'[
        <!ENTITY rfc3031 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3031.xml'> 
        <!ENTITY rfc4761 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4761.xml'> 
        <!ENTITY rfc4762 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4762.xml'> 
        <!ENTITY rfc5331 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5331.xml'> 
        <!ENTITY rfc6514 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6514.xml'> 
        <!ENTITY rfc7432 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7432.xml'> 
        <!ENTITY rfc8365 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8365.xml'> 
        <!ENTITY rfc8679 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8679.xml'> 
    	<!ENTITY rfc8665 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8665.xml'> 
		<!ENTITY rfc8666 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8666.xml'> 
    	<!ENTITY rfc8667 PUBLIC '' 
		         'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8667.xml'> 
        <!ENTITY I-D.ietf-bess-evpn-optimized-ir SYSTEM 
		         "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-optimized-ir.xml">
        <!ENTITY I-D.ietf-bess-mvpn-evpn-aggregation-label SYSTEM 
		         "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-mvpn-evpn-aggregation-label.xml">
        <!ENTITY I-D.ietf-bess-evpn-bum-procedure-updates SYSTEM 
		         "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-bum-procedure-updates.xml">
        <!ENTITY I-D.heitz-bess-evpn-option-b SYSTEM 
		         "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.heitz-bess-evpn-option-b.xml">
        <!ENTITY I-D.ietf-bess-evpn-prefix-advertisement SYSTEM 
		         "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-bess-evpn-prefix-advertisement-11.xml">
        <!ENTITY I-D.ietf-bess-evpn-inter-subnet-forwarding SYSTEM 
		         "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-bess-evpn-inter-subnet-forwarding-08.xml">
        <!ENTITY I-D.wang-bess-evpn-context-label SYSTEM 
		         "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.wang-bess-evpn-context-label.xml">
        <!ENTITY I-D.eastlake-bess-evpn-vxlan-bypass-vtep SYSTEM 
		         "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.eastlake-bess-evpn-vxlan-bypass-vtep.xml">
        <!ENTITY I-D.hu-bess-srv6-vpn-bypass-sid SYSTEM 
		         "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.hu-bess-srv6-vpn-bypass-sid.xml">
        <!ENTITY I-D.ietf-rtgwg-srv6-egress-protection SYSTEM 
		         "https://xml2rfc.tools.ietf.org/public/rfc/bibxml3/reference.I-D.draft-ietf-rtgwg-srv6-egress-protection-00.xml">
]>



<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<rfc  category="std"
      docName="draft-wang-bess-evpn-egress-protection-04"
      ipr="trust200902"
	  tocDepth="6"
      version="3">
  <!-- xml2rfc v2v3 conversion 2.38.1 -->
  <!-- category values: std, bcp, info, exp, and historic -->

  <!-- rfc    
       xmlns:xi="http://www.w3.org/2001/XInclude"
       category="std"
       docName="draft-wang-bess-evpn-context-label-04"
       ipr="trust200902"
       obsoletes=""
       updates=""
       submissionType="IETF"
       xml:lang="en"
       tocInclude="true"
       tocDepth="6"
       symRefs="true"
       sortRefs="true"
       version="3" -->    
  
 <!-- ***** FRONT MATTER ***** -->

<front>

    <title abbrev="EVPN Egress Protection">EVPN Egress Protection</title> 

    <!-- add 'role="editor"' below for the editors if appropriate -->
	<author fullname="Yubao Wang" initials="Y." surname="Wang">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street>No.68 of Zijinghua Road, Yuhuatai Distinct</street>   
          <city>Nanjing</city>
          <region></region>
          <code></code>
          <country>China</country>
        </postal>
        <email>wang.yubao2@zte.com.cn</email>
      </address>
    </author>

	<author fullname="Ran Chen" initials="R." surname="Chen">
      <organization>ZTE Corporation</organization>
      <address>
        <postal>
          <street>No. 50 Software Ave, Yuhuatai Distinct</street>   
          <city>Nanjing</city>
          <region></region>
          <code></code>
          <country>China</country>
        </postal>
        <email>chen.ran@zte.com.cn</email>
      </address>
    </author>

	
<date year="2020"/>
<area>Rtg</area>
<workgroup>BESS WG</workgroup>

<keyword>EVPN, Egress, Protection, ESI</keyword>

<abstract>
    <t>A fast reroute framework for egress node protection is specified by <xref target="RFC8679"/> . But it cannot be applied to EVPN directly.
    This document specifies a mechanism to apply Egress Node Protection to EVPN nodes and apply Egress Link Protection to EVPN EAD/EVI routes,
	especially for the convergency of BUM packets and the unified signallings for the MPLS SPEs and TPEs.
	</t>

</abstract>

</front>
<middle>
  
    <section title="Introduction" anchor="Introduce">

     <t>
   A principal feature of EVPN is the ability to support multi-homing
   from a customer equipment (CE) to multiple PE
   with Ethernet segment (ES) links. This draft
   specifies a egress protection mechanism in the
   multi-homed cases and enhance EVPN convergency on the egress PE node failures and egress ES link failures,
   especially for the convergency of BUM packets (<xref target="sect-bum-protect"/>) and the unified signallings (<xref target="sect-MPLS-req"/>) for the MPLS SPEs and TPEs.
	 
	 </t>

	<section title="Terminology and Acronyms">

     <t>
	 This document uses the following acronyms and terms:
	 </t>

<ul empty="false">
     <li>
   All-Active Redundancy Mode - When a device is multihomed to a group
      of two or more PEs and when all PEs in such redundancy group can
      forward traffic to/from the multihomed device or network for a
      given VLAN.
	 </li>
	 
	 <li>
   Backup egress router - Given an egress-protected tunnel and its egress router, this is
      another router that has connectivity with all or a subset of the
      destinations of the egress-protected services carried by the
      egress-protected tunnel.
	  </li>

     <li>
   SPE - Stitching PE, the PEs to do label swapping operation for the EVPN labels. It is similar to the SPE of MS-PWs.
	 </li>

     <li>
   TPE - Target PE, the PEs to do EVPN forwarding for the overlay network.
	 </li>	  
	  
     <li>
   BUM - Broadcast, Unknown unicast, and Multicast.
	 </li>
	 
	 <li>
   CE - Customer Edge equipment.
     </li>
	 
     <li>
   DCI - Data Center Interconnect.
	 </li>

     <li>
   EELP bypass tunnel - Egress ESI Link Protection bypass tunnel - 
      A tunnel used to reroute service packets upon an egress ESI link failure.
	 </li>

     <li>
   Egress failure - An egress node failure or an egress link failure.
	 </li>

     <li>
   Egress link failure - A failure of the egress link (e.g., PE-CE link, attachment
      circuit) of a service. 
	 </li>

     <li>
   Egress loopback - the loopback interface on the Egress router, whose IP address
      is the destination of the Egress-protected tunnel.
	 </li>

     <li>
   Egress node failure - A failure of an egress router.
	 </li>

     <li>
   Egress router - A router at the egress endpoint of a tunnel.  It hosts service
      instances for all the services carried by the tunnel and has
      connectivity with the destinations of the services.
	 </li>

     <li>
   ESI - Ethernet Segment Identifier - A unique non-reserved identifier that
      identifies an Ethernet segment.
	 </li>

     <li>
   NVE - Network Virtualization Edge.
	 </li>

     <li>
   OPE - Originating PE - the original Router of an EVPN route.
	 </li>

     <li>
   PE - Provider Edge equipment. Note that VTEP/NVE are also called as PE in this draft.
	 </li>

     <li>
   PLR - A router at the point of local repair.  In egress node protection,
      it is the penultimate hop router on an egress-protected tunnel.
      In egress link protection, it is the egress router of the egress-
      protected tunnel.
	 </li>

     <li>
   Protector - A role acted by a router as an alternate of a protected egress
      router, to handle service packets in the event of an egress
      failure.  A protector is physically independent of the egress router.
	 </li>

     <li>
   Protector loopback - the loopback interface on the Protector, whose IP address 
      is the destination of the Egress-protected tunnel.     
	 </li>

     <li>
   Single-Active Redundancy Mode - When a device or a network is
      multihomed to a group of two or more PEs and when only a single PE
      in such a redundancy group can forward traffic to/from the
      multihomed device or network for a given VLAN. 
	 </li>

     <li>
   VTEP - VXLAN Tunnel End Point. 
	 </li>

     <li>
   VXLAN - Virtual eXtensible Local Area Network [RFC7348]. 
	 </li>
	 
	 <li>
	 GRT - Global Routing Table.
     </li>

     <li>
	 EVPN SID - SRv6 SID for EVPN Instances, e.g. End.DT2M SID, End.DT2U SID, End.DX2 SID, End.DX2V SID.
     </li>

     <li>
     DF - Designated Forwarder.
     </li>
	 <li>
     NDF - non-DF, non Designated-Forwarder.
     </li> 
	 <li>
	 NDF-Bias - An exception for filtering bypassed BUM packets. It says that when an outgoing AC is a NDF on its ES, the bypass-BUM filter rules will not be applied for that AC.
	 </li>
</ul>

	</section>
	</section>


	<section title="Detailed Problem and Solution Requirement" anchor="sect-problem-req">
   
	<section title="Scenarios and Basic Settings" anchor="sect-scenario">
	<t>
    In the scenario illustrated in <xref target="fig-scenario"/>, where an CE1 is dual-homed
    to PE1 and PE2 to access the VXLAN/SRv6 network, which enhances
    network access reliability.  When one PE fails, services can be
    rapidly switched to the other PE, minimizing the impact on
    services.</t>

	<t>
    As shown in <xref target="fig-scenario"/>, the EVPN instance EVI1 has three PEs, PE1, PE2 and PE3.
	The PE address of PE1 is IP1 and the PE
    address of PE2 is IP2, the PE address of PE3 is IP3, they are
    three different IP addresses.  The BGP update-source of PE1 is
    IP_N1, of PE2 is IP_N2, and of PE3 is IP_N3.  
    </t>
   
    <t>LOC1 is the prefix from which IP1 is allocated, LOC2 is the prefix from which IP2 is allocated, LOC3 is the prefix from which IP3 is allocated.
    </t>
	
    <t>Note that IP_N1 must not be allocated in prefix LOC1, IP_N2 must not be allocated in prefix LOC2. But IP_N3 may be the same as IP3. 
	</t>

	<figure title="Egress Protection Scenario" anchor="fig-scenario"><artwork><![CDATA[
                             +---------+
                             |   PE3   |
                             | (IP_N3) |
                             +----+----+
                                  |    
                             +----+----+     
                             |   PLR   |    
                             +---------+      
                             /        \
                            /          \
                           /     T1     \
               +----------+  BUM tunnel +-----------+
         PE1   |  LOC1_E  |.............|  LOC2_E   |   PE2
       (IP_N1) |          |             |           | (IP_N2)
               |  LOC2_P  |.............|  LOC1_P   |        
               +--+-------+ EELP bypass +--------+--+
                  |        \     T3    /         |
                  |         \         /          |
                  |          \       /           | 
              ES1 |           \ ES2 /            | ES3
                  |            \   /             |
                 CE1            CE2             CE3
]]></artwork>
	</figure>
	
	<t>
   Both PE1 and PE2 will advertise an IGP route for the prefix LOC1. 
   The prefix LOC1 on PE1 is called LOC1_E,
   The prefix LOC1 on PE2 is called LOC1_P.
   Then we make the metric of LOC1_P lower than LOC1_E. 
   Then we do the same for LOC2.  
   </t>
   
   <t>As a result, the PLR node will install an egress-FRR entry for LOC1 and LOC2.
   The primary egress for LOC1 is PE1, the backup egress for LOC1 is PE2.
   So when PE3 send a EVPN data packet to an IP address of LOC1,
   the PLR node will use PE1 as the primary path, and use PE2 as the backup path.
   </t>
   
   <t>The different settings between VXLAN EVPN scenario and SRv6 EVPN scenario are described in the following list:
   </t>
	
<ul>
<li>
	<t>In VXLAN EVPN scenario: 
	LOC1_E is a loopback interface on PE1, LOC1_P is a loopback interface on PE2.
	Both of the two loopback interfaces are configured with the sam IP address IP1.
	LOC1 is the /32 or /128 prefix for IP1. So we also use LOC1 to stand for IP1 in VXLAN context in the remainder of this draft.
	The loopback interface for LOC1_E is IP1's egress loopback interface.
	The loopback interface for LOC1_P is IP1's protector loopback interface.
    Then we do the same for IP2.
	</t>
</li>
<li>	
	<t>In SRv6 EVPN scenario: 
	IP1 is the node SID of PE1, LOC1_E is the SRv6 locator for IP1.
	IP2 is the node SID of PE2, LOC2_E is the SRv6 locator for IP2.
	LOC1_P is the mirror of LOC1_E in PE2's GRT.  
    LOC2_P is the mirror of LOC2_E in PE1's GRT.
	</t>   
</li>
</ul>

	<section title="Common Problems" anchor="sect-common-req">

	<t>
    When PE2 receives an EVPN route R0 whose nexthop matches the prefix LOC1,
    PE2 may discard the route R0 because its nexthop is considered to be PE2's own address.
    Even though PE2 don't disccard R0, 
    PE2 cannot use its nexthop to send an EVPN data packet to PE1. 
	</t>
	<t anchor="DIP-self-problem">Because that a destination IP within prefix LOC1 (in forms of LOC1_P) will be considered to be sent to PE2 itself.
    So we should use IP_N1 and IP_N2 to establish the bypass path between PE1 and PE2 instead of LOC1 and LOC2.
	</t>

    </section>	


    </section>
	
	<section title="VXLAN-Specific Requirements" anchor="sect-vxlan-req">

	<t>
    When PE2 receives the EVPN routes from PE3, only the VXLAN tunnel &lt;LOC2_E, IP_N3&gt; will be installed according to [RFC8365].  
    The VXLAN tunnel &lt;LOC1_P, IP_N3&gt; will not be installed.
    So when PE1 fails, although the packets to PE1 are fast-rerouted to PE2
    by PLR, PE2 may discard these packets because of
    the absent of the corresponding VXLAN tunnel entity for their SIP and
    DIP.</t>

    </section>
	<section title="SRv6-Specific Requirements" anchor="sect-srv6-req">
	
	<t>The PLR will not be expected to support any Segment Routing extensions at all, it is just asummed to be an ordinary IPv6 router.
    </t>
	
	<t anchor="problem-srv6-function-absent">When PE2 receives an EVPN data packet whose bottommost SID is an EVPN SID from LOC1.
	Although the EVPN SID can match the prefix LOC1_P on PE2, the EVPN data packet will be dropped because of the absence of SRv6 function indications.
	</t>

    </section>

	<section title="ESI-Label-Specific Requirements" anchor="sect-Esi-lookup-req">
	
	<t>ESI-label is used for MPLS EVPN, SRv6 EVPN and Geneve EVPN, it is typically downstream-assigned in ingress-replication scenarios.
    </t>
	
	<t anchor="problem-ESI-lookup">When a packet is received from a mirrored End.DT2M SID, the ESI-label in the SID's ARG.FE2 part have to be lookup in a 
	label space that is different from the native ESI-label's label space. Otherwise the packet should be dropped.
	In multi-homing scenarios, the mirrored End.DT2M SIDs for differnt OPE must do ESI-label lookup in defferent label space,
	at the same time, the mirrored End.DT2M SIDs for the same OPE should do ESI-label lookup in the same label space.
	</t>
	
	<t>
	But ESI labels are used only when two PEs from the same egress protection group send BUM packets to each other.
	In such case, they will use the ESI/EVI label of each egress PE to transport these BUM packets accordingly.
	So the context-specific ESI/EVI-label lookup is typically not necessary on that egress PE, even if it is in the MPLS EVPN scenarios.
	But when the egress PE node fails, and the PLR executes egress node protection procedures for that egress PE,
	that ingress PE may perform context-specific EVI-label lookup consequently at that moment. 
	This will be discussed in <xref target="sect-MPLS-req"/> again more detailedly. 
	</t>

    </section>	

	<section title="MPLS-Specific Requirements" anchor="sect-MPLS-req">

	  <figure   title="Anycast SPEs and Egress Protecting TPEs" anchor="Anycast-SPE-Figure"  align="center">
            <artwork align="center"><![CDATA[			
                     (PE3)           (PE1)
                /----SPE1----\  /----TPE2----+  
CE1---TPE1----PLR2           PLR1           CE2
                \----SPE2----/  \----TPE3----+ 
                                     (PE2)
            ]]></artwork>
       
      </figure>		
	
	<t>The above figure is a combination of <xref target="fig-scenario"/> and <xref target="I-D.wang-bess-evpn-context-label"/>'s Figure 6. 
	The TPE1/SPE1/SPE2/TPE2 above is the TPE1/SPE1/SPE2/TPE2 of <xref target="I-D.wang-bess-evpn-context-label"/>'s Figure 6,
	But TPE2 is also the PE1 of <xref target="fig-scenario"/>, and TPE3 is the PE2, SPE1 is the PE3. 
	</t>
	
	<t>When TPE2 advertises an EVPN route (say R9), the same R9 will be advertised to both the two SPEs and TPE3.
	When TPE3 receives R9, they will do EVPN egress protection.
	When SPE1 or SPE2 receives the same R9, SPE1/SPE2 will advertise R9 to TPE1 
	with the same nexthop (the anycast tunnel address of SPE1 and SPE2) 
	following <xref target="I-D.wang-bess-evpn-context-label"/>'s section 5.4.
	</t>
	
	<t>Then the requirement here is clear that we want TPE2 use the same route attributes to advertise R9 to both the SPEs and the TPEs.
	</t>
	
	<t>
	In addition, Note that when the BUM tunnel (T1) from PE1 (TPE2) to PE2 (TPE3) travels through the PLR1, 
	and the PLR1 reroutes these packets (destined to PE2) back to PE1 when PE2 fails, at that moment, 
	PE1 should drop these packets because their EVI label are mirrored EVI labels (in context-specific label space) but their ESI labels are not absent.
	</t>
	
    </section>	


	
</section>

<section title="Encoding the Originating Router's IP Address" anchor="sect-orip">
    <t>This sections describe the extensions specified to meeting the
    requirements given in <xref target="sect-problem-req"/> and enhance VXLAN EVPN convergency.</t>

	<t>
   This document reuse the OPE TLV defined in
   <xref target="I-D.heitz-bess-evpn-option-b"/> section 3.  The OPE TLV carries the
   BGP update-source on corresponding PE.  The PEs with egress
   protection procedures described in this document will add the OPE TLV
   in the EVPN routes that they are about to advertise.</t>

	<t>
   Note that the ESI label or leaf Label is not used in VXLAN packet, so
   the usage for OPE TLV here won't conflict with the usage in
   <xref target="I-D.heitz-bess-evpn-option-b"/>.</t>

	</section>

<section title="Control Plane Processing" anchor="sect-4">

	<section title="Common Procedures" anchor="sect-common-proc">

	<t>We will discuss the common procedures for VXLAN EVPN and SRv6 EVPN first. 
	Then we will discuss the procedures specific to VXLAN EVPN or SRv6 EVPN in the following sections.
	</t>

	<t>Using the topology in <xref target="fig-scenario"/>, the common procedures are described in the following list:</t>

<ol group="common-proc" spacing="normal" type="[C%d]">

	<li anchor="list-1.1">
   PE3 sends a MAC/IP route R1 and an IMET route R2 to PE1 and PE2.
   The nexthop of these routes is IP_N3 (we assume that IP_N3=IP3).  PE3
   won't add the OPE TLV to these routes because it works as a normal EVPN
   PE.</li>

	<li anchor="list-1.2">
   PE1 and PE2 receive R1 and R2 from PE3.</li>

	<li anchor="list-1.3">
   PE1 sends a MAC/IP route R4, an EAD/EVI route R5 and an IMET route R6 to
   PE2 and PE3.  The nexthop of these routes is IP1.  PE2 sends
   a MAC/IP route R7, an EAD/EVI route R8 and an IMET route R9 to PE1 and
   PE3.  The nexthop of these route is IP2.  PE1 and PE2 will both
   add the OPE TLV to these routes because they are configured with
   protector LOCs.  The OPE TLV carries their
   BGP update-source IP address (IP_N1 or IP_N2).</li>

   <li anchor="list-1.4">
   <t>When PE2 receives R4, R5 and R6 from PE1, it
   installs the bypass tunnel &lt;IP_N2, IP_N1&gt;. Because that their nexthops is
   an IP address within the prefix LOC1_P on PE2.  The bypass tunnel &lt;IP_N1, IP_N2&gt; is called Egress
   ESI Link Protection (EELP) bypass tunnel.  and PE2 will apply the
   egress link protection procedures to the received EAD/EVI route R5
   following the second approach of <xref target="RFC8679"/> section 6. 
   Please see [Section <xref target="refer-second-approach" format="counter"/>] for details.
   </t>
   <t>Note that the MAC/IP entries from PE1 is installed in GRT by PE2 as mirrored entries.
   </t>
   <t>The procedures when PE1 receives R7, R8 and R9 are simlar to the above.
   </t>
   </li>

	<li anchor="list-1.5">
   When PE3 receives the EVPN routes from PE1/PE2, it will
   ignore the OPE TLV because the route's tunnel encapsulation is VXLAN or SRv6
   and the nexthop is not a local address on PE3.</li>
   
</ol>

   </section>

	<section title="VXLAN-Specific Procedures" anchor="sect-vxlan-proc">
	
	<t>First of all, we assume that the VNI for the same EVI on PE1 and PE2 must be
    the same.</t>
	
	<t>The VXLAN-specific procedures are defined in the following list:
	</t>

    <ol type="[V%d]">

    <li>In <xref target="list-1.2" format="counter"/>, when PE1 receives the MAC/IP route from
    PE3, it constructs two VXLAN tunnels: &lt;LOC1_E, IP_N3&gt; and &lt;LOC2_P, IP_N3&gt;.
    Because it is configured with egress loopback and protector loopback.
	</li>

    <li>In <xref target="list-1.4" format="counter"/>, the bypass tunnel is a VXLAN tunnel.
	</li>
    </ol>	

    </section>

	<section title="SRv6-Specific Procedures" anchor="sect-srv6-proc">
	
	<t>In VXLAN EVPN, the VXLAN tunnels are constructed for packet-validating purpose. 
	In SRv6 EVPN, there aren't such packet-validating tunnels.
	So when a SRv6 PE receives EVPN routes from other PEs, no packet-validating tunnels will be installed.
	</t>
	<t>But the bypass tunnels aren't constructed for packet-validating purpose,
	they are used to transport flows among the PEs of the same egress protection group.
	So the bypass tunnel between PE1 and PE2 must also be installed in SRv6 EVPN scenarios.
	</t>

    <t>The SRv6-specific procedures are defined in the following list:
	</t>

    <ol type="[6%C]">

    <li>In <xref target="list-1.4" format="counter"/>, The bypass tunnel is a SRv6 tunnel.
	</li>
    <li>
	<t>In <xref target="list-1.4" format="counter"/>, When PE2 receives R4, R5 from PE1, 
	it mirrors the remote EVPN-SID of these routes in the GRT. 
	This is for the requirements from [Section <xref target="problem-srv6-function-absent" format="counter"/>].
	</t>
	<t anchor="dt2m-no-mirror">Note that the End.DT2M SID of IMET route R5 SHOULD not be mirrored by default on PE2.
	The reason will be described in <xref target="sect-bum-protect"/>.
	</t>
	</li>

    <li anchor="UA-SID-control-plane"><t>In <xref target="list-1.4" format="counter"/>, PE2 may apply the
    egress link protection control-plane procedures to the received EAD/EVI route R5
    following the first approach of <xref target="RFC8679"/> section 6.
	The corresponding data-plane details will be described in <xref target="UA-SID-data-plane" format="counter"/>.
	</t></li>

    </ol>	


    </section>

	<section title="MPLS-Specific Procedures" anchor="sect-MPLS-proc">
	
   <t>First of all, We reserve a portion of the label
   space for assignment by a central authority.  We refer to this
   reserved portion as the "Domain-wide Common Block" (DCB) of labels.  
   This is analogous to the DCB that        
   is described in <xref target="I-D.wang-bess-evpn-context-label" />'s section 5.4.  The DCB is taken
   from the same label space that is used for downstream-assigned
   labels, but each PE would know not to allocate local labels from that
   space.  A PE would know by provisioning which label from the DCB
   corresponds to itself, and each of other labels from the DCB corresponds to each PE of the domain.  
   </t>
   
   <t>Note that the PEs don't have to know exactly which label corresponds to a specified PE,
   They just need know which label is for itself, and other labels is not for itself.
   </t>
	
	<t>The MPLS-specific procedures are defined in the following list:
	</t>

    <ol type="[M%d]">

    <li>In <xref target="list-1.3" format="counter"/>, when TPE2(PE1) advertise R4/R5/R6,
    It following <xref target="I-D.wang-bess-evpn-context-label" />'s section 5.4.
	This means that a Downstream-CLS ID EC will be advertised along with R4/R5/R6.
	And this EC carries the label (in DCB) that identifying TPE2(PE1) itself.
	</li>

    <li>In <xref target="list-1.4" format="counter"/>, when TPE3(PE2) receives R4/R5/R6,
    It install the mirrored ILM entry in a context-specific labels space (say CLS23).
	The CLS23 is identified by the Downstream-CLS ID EC (say CIL2) of R4/R5/R6.
	The mirrored ILM entry is called as a CLS-specific ILM entry (CLS-ILM).
	</li>
	
	<li>In <xref target="list-1.5" format="counter"/>, when SPE1(PE3) receives R4/R5/R6,
    It should impose the context-identifying label (CIL) carried in R4/R5/R6's Downstream-CLS ID EC onto the label stack following <xref target="I-D.wang-bess-evpn-context-label" />'s section 5.4.
	That CIL is the outer label of the EVPN label of R4/R5/R6.
	In addition, SPE1(PE3) will aplly the procedures of <xref target="I-D.wang-bess-evpn-context-label" />'s section 5.4 too.
	Although these procedures is not of EVPN egress protection schema, they share the same signalling with EVPN protection.
	This simplifies the signalling procedures, because there no longer will be a requirement to advertise different route attributes to different PEs.
	</li>
    </ol>	

    </section>
	
	
	</section>

	<section title="Protection Procedures" anchor="sect-5">
	<t>
   This section describes how Layer 2 unicast and BUM (Broadcast,
   Unknown unicast, and Multicast) packet forwarding are protected.  A
   description of how Layer 3 packet forwarding are protected will be
   provided in a furture version of this document.</t>

	<section title="EVPN Egress Node Protection (EENP)" anchor="sect-5.1">
	<t>
   The following two subsections discuss EENP procedures for BUM
   forwarding and Unicast Forwarding.</t>

	<section title="BUM Forwarding Protection" anchor="sect-bum-protect">


	<section title="Bypass-BUM Filter" anchor="sect-bum-excess">
	<t>PE3 will do ingress replication to PE1 and PE2 for BUM packets, one copy for each PE.
	So BUM packets need not to be protected by the egress node protection mechanism.
	But there will be another issue along with the BUM packets. It is:
	</t>

    <ul empty="true" spacing="normal">
    <li>
    <t>PE1 and PE2 will receive a copy of BUM packet from PE3
    separately, and the DF node for the &lt;ESI2, EVI&gt; will forward it to the
    CE node.  When the non-DF node of them fails, 
    the BUM packets destined to it will be re-routed to the other one,
    which will be the DF-node for that &lt;ESI2, EVI&gt;, 
    so these BUM packets will be forwarded to CE2.
    But PE3 has sent another copy of BUM packets directly to the DF-node, and this copy will be forwarded to CE2 either.
    So CE2 will receive duplicated BUM packets from the DF-node after the FRR switch of PLR untill the global repair finishes.
    </t>    
	</li>
    </ul>
   
    <t anchor="bypass-bum-filter">In order to avoid the excessive BUM packets, some specific rules are defined in the following list:
    </t>
   
    <ul>
    <li><t>For VXLAN EVPN: The BUM packet received via LOC1_P or LOC2_P will be dropped.
    </t></li>
    <li><t>For SRv6 EVPN: Because the End.DT2M SIDs are not mirrored according to [Section <xref target="dt2m-no-mirror" format="counter"/>],
    those duplicating BUM packets will be dropped due to the absence of SRv6 function indication.
    </t></li>
    </ul>
	
	<t>The bypass-BUM-filter also insures that when PE1 send BUM packet to PE2 but PE2 fails,
	The FRR-switch on PLR node will not bring out duplicated BUM packets to PE1's local CEs. 
	The tunnel address from PE1 to PE2 for BUM packets is called T1,
	The tunnel address from PE3 to PE2 for BUM packets is called T2,
	The bypass-BUM-filter also insures that T1 can be the same as T2.
	</t>
	
	<t>Note that the BUM tunnel T1 may travel through PLR too.
	</t>
	
    </section>
	
	<section title="NDF-Bias Rules for Bypass-BUM filter" anchor="sect-bum-NDF-bias">
    <t>When PE1 node fails, the DF-election between PE1 and PE2 will be restarted, and the PLR will do FRR-switch.
	We assume that the PLR FRR-switch may be faster than the DF re-election.
    So if PE1 is the DF node for &lt;ESI2, EVI1&gt; before its failure, 
	the rules that described in [Section <xref target="bypass-bum-filter"  format="counter"/>] will cause packet drop before the DF re-election finishes.
	Because that PE2 will be the non-DF (NDF) node for &lt;ESI2, EVI1&gt; at that time.
	</t>
	
    <t anchor="ndf-bias-rules">In order to accelerate the convergence of bypass-BUM packets, some specific rules are defined in the following list:
    </t>
   
    <ul>
    <li><t>For VXLAN EVPN: The BUM packet received via LOC1_P or LOC2_P will not be dropped when it is about to forwarded to an AC whose DF-role is NDF.
    </t></li>
    <li><t>For SRv6 EVPN: The End.DT2M SIDs need to be mirrored,
    those BUM packets received via a mirrored End.DT2M SID will not be dropped only when it is about to forwarded to an AC whose DF-role is NDF.
	Note that a single-homing AC is always considered as DF-role, so it will filter all bypass BUM packets.
	</t>
	<t>When BUM packets are received via a mirrored End.DT2M SID, and their Arg.FE2 parts are not empty, such BUM packets will be dropped.
	Because that such BUM packets just originated inside the same protection group of current PE node. 
    </t></li>
    </ul>
	
	<t>These rules are called as "NDF-Bias" rules in this draft.
	</t>

    </section>	

	</section>

	<section title="Unicast Forwarding Protection" anchor="sect-5.1.2"><t>
    When PE1 fails, the data packets (destined to CE2) from PE3 to PE1 are fast-
    rerouted to PE2 by the PLR node in the underlay network, the PE2
    won't discard these packets because of the existence of VXLAN
    tunnel&lt;IP3, IP1_P&gt; or mirrored EVPN SID or mirrored CLS-ILM on PE2 itself.  The PE2 will forward them to CE.</t>
	
	<t>Note that in MPLS scenario (<xref target="Anycast-SPE-Figure"/>), SPE1(PE3) will impose CIL2 onto the label stack,
	so the PLR1 wouldn't impose CIL2 (in fact that CIL2 need not be advertised in the underlay network) again. PLR1 just do ordinary anycast FRR or TI-LFA.
	</t>

	</section>

	</section>

	<section title="Egress ESI Link Protection (EELP)" anchor="sect-eelp">
	<t anchor="refer-second-approach">
    The EELP &lt;ESI, EVI&gt; forwarding entry on PE1 will take the ESI link
    as primary forwarding path, and take the EAD/EVI route from PE2 as
    backup forwarding path.  This procedure follows the second approach
    of <xref target="RFC8679"/> section 6.</t>

	<t>
    When the ESI2 link fails, the backup path will be activated on the
    result of a FRR switch by the overlay network.</t>

	<t>
    Note that even when the ESI is All-Active redundancy mode the EELP
    will follow the FRR behavior.  The EELP behavior is the same for All-
    Active redundancy mode and Single-Active redundancy mode.</t>

	<t>
    When ESI is All-Active redundancy mode PE3 will performing overlay
    ECMP via EAD/EVI routes to PE1/PE2, When the ESI link on PE1
    fails, PE1 will forwarding the packets via EELP bypass tunnel
    before PE3 delete the EAD/EVI routes.  But the bypass forwarding is
    temporary, after PE3 delete the EAD/EVI routes upon the withdraw of
    the EAD/EVI route from PE1, there won't be any bypass forwarding
    again.</t>

	<t>Given that the destination IP address of the EELP bypass tunnel from PE1 to PE2 is called T3,
	note that T3 may be not the same as T1 or T2 of section <xref target="sect-bum-excess" format="counter"/>.
	When T3 is a different IP address, different forwarding behaviors can be applied.
	For example, T3 should not be protected by PLR's egress node protection procedures.
	</t>
	
	<t>When T3 is different from T1/T2, <xref target="UA-SID-control-plane" format="counter"/> can be used. Otherwise,
	only the second approach of <xref target="RFC8679"/> section 6 can be used if the travel from PE1 to PE2 passes the PLR node.
	</t>
	
	<t>
    Note that when ESI is Single-Active redundancy mode, there is no importance
    for PE3 to use the EAD/EVI routes from PE1/PE2. But the EAD/EVI route is
    still useful between PE1 and PE2 for EELP procedures in Single-
    Active redundancy mode.</t>
	
	<section title="Source Squelching Rules" anchor="sect-src-squelch">
	<t>When a PE of an egress protection group receives packets from an EELP bypass tunnel,
	that PE MUST not send it to another PE in the same egress protection group over any of the bypass tunnels.  
	But when a PE receives a VXLAN/SRv6 encapsulated data packet from an ordinary underlay destination IP address,
	that PE can bypass that packet following a bypass tunnel.</t>

	</section>	
	
	
	<section title="SRv6-specific EELP Rules" anchor="sect-srv6-eelp">


	<ol group="SRv6-DP" type="[SID-Hiden%d]" indent="4"><li anchor="SID-data-plane">
    <t>When the ESI2 link on PE1 fails, 
	the bypassed EVPN packet's underlay destination IP adrress can't be the EVPN SID directly.  
	The EVPN SID have to be hiden in the SRH header in order to avoid the problems described in [Section <xref target="DIP-self-problem" format="counter"/>], 
	even if the bypass tunnel is a SR-BE tunnel.
	</t></li>
	<li anchor="SID-data-plane-BUM">
	<t>Note that there are no egress link protection for BUM packets, 
	all the bypass-BUM packets are the result of egress node protection on the PLR.
	</t>
    <t>But when CE1 requests CE3's MAC address, PE1 can't forward the ARP request to PE2 using SRv6 BE encapsualtion. 
	Although these ARP packets are not bypassed packets, the EVPN SID have to be hiden in the SRH header too,
	in order to avoid the same problems as above.
	</t></li></ol>
	
	<ol group="UA-SID" type="[UA-SID%d]" indent="4">
	<li anchor="UA-SID-data-plane">
	<t>When <xref target="UA-SID-control-plane" format="counter"/> is applied, 
	PE1 will use the EVPN SID of itself to encapsulate the bypassed EVPN packet, 
	not use the EVPN SID from the received EAD/EVI route. 
	</t>
	<t>When that bypassed EVPN packet is received by PE2, the packet will match a mirrored EVPN SID on PE2.
	So PE2 will know that the packet is a bypassed data packet. The bypassed data packets will be forwarded to local CEs only.
	</t>
	</li>
	<li>
	<t>When <xref target="UA-SID-control-plane" format="counter"/> is applied, 
	the bypass tunnel's destination must be an IP-address for whom the PLR will not do egress node protection.
	Otherwise micro-loops will arise when the FRR-switch of that egress node protection is triggered on the PLR node.
	</t>
	</li></ol>
	
	
	</section>	

	<section title="MPLS-specific EELP Rules" anchor="sect-mpls-eelp">
	
	<t>The first approach of <xref target="RFC8679" /> section 6 should be applied, 
	and the bypass tunnel's destination must be an IP-address for whom the PLR1 will not do egress node protection.
	Otherwise micro-loops will arise when the FRR-switch for that egress node protection is triggered on the PLR node.
	</t>
	
	<t>It means that the sender TPE will impose the EVPN label and CIL of itself onto the label stack,
	on the failure of local ACs.
	</t>
	
	</section>	
	
	</section>

</section>

<section title="IANA Considerations" anchor="sect-IANA">
	<t>IANA Considerations for OPE TLV following <xref target="I-D.heitz-bess-evpn-option-b"/>.
	</t>
</section>

<section title="Security Considerations" anchor="sect-security">
    <t>This section will be added in future versions.</t>

</section>

<section title="Acknowledgements" anchor="sect-acknowledge">
    <t>The authors would like to thank the following for their comments and
    review of this document:</t>

    <t>Chunning Dai, Bing Song, Zheng Zhou.</t>

</section>


</middle>
<back>

<references title = "References">
<references title='Normative References'>
	&I-D.heitz-bess-evpn-option-b;
	&I-D.ietf-bess-evpn-prefix-advertisement;
	&I-D.ietf-bess-evpn-inter-subnet-forwarding;
	&I-D.wang-bess-evpn-context-label;

    &rfc8679;
    &rfc7432;
    &rfc8365;
</references>
<references title='Informative References'>

	&I-D.ietf-rtgwg-srv6-egress-protection;

</references>
</references>

</back>
</rfc>
