<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC8214 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8214.xml">
<!ENTITY RFC4271 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC4364 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4364.xml">
<!ENTITY RFC2119 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC8174 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY RFC4360 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4360.xml">
<!ENTITY RFC7606 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7606.xml">
<!ENTITY RFC9014 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9014.xml">
<!ENTITY I-D.ietf-bess-evpn-ipvpn-interworking SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-ipvpn-interworking.xml">
<!ENTITY I-D.ietf-bess-rfc7432bis SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-rfc7432bis.xml">
<!ENTITY RFC9012 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9012.xml">
<!ENTITY RFC6472 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6472.xml">
<!ENTITY RFC9135 SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9135.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="std" docName="draft-sr-bess-evpn-dpath-01" ipr="trust200902"
     submissionType="IETF">
  <!--Generated by id2xml 1.5.0 on 2019-12-01T14:22:31Z -->

  <?rfc strict="yes"?>

  <?rfc compact="yes"?>

  <?rfc subcompact="no"?>

  <?rfc symrefs="yes"?>

  <?rfc sortrefs="no"?>

  <?rfc text-list-symbols="o-*+"?>

  <?rfc toc="yes"?>

  <front>
    <title abbrev="D-PATH for Layer2 EVPN">Domain Path (D-PATH) for Ethernet
    VPN (EVPN) Interconnect Networks</title>

    <author fullname="J. Rabadan" initials="J." role="editor"
            surname="Rabadan">
      <organization>Nokia</organization>

      <address>
        <postal>
          <street>520 Almanor Avenue</street>

          <city>Sunnyvale</city>

          <region>CA</region>

          <code>94085</code>

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

        <email>jorge.rabadan@nokia.com</email>
      </address>
    </author>

    <author fullname="S. Sathappan" initials="S." surname="Sathappan">
      <organization>Nokia</organization>

      <address>
        <postal>
          <street>520 Almanor Avenue</street>

          <city>Sunnyvale</city>

          <region>CA</region>

          <code>94085</code>

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

        <email>senthil.sathappan@nokia.com</email>
      </address>
    </author>

    <author fullname="M. Gautam " initials="M." surname="Gautam">
      <organization>Nokia</organization>

      <address>
        <postal>
          <street>520 Almanor Avenue</street>

          <city>Sunnyvale</city>

          <region>CA</region>

          <code>94085</code>

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

        <email>mallika.gautam@nokia.com</email>
      </address>
    </author>

    <author fullname="P. Brissette" initials="P." surname="Brissette">
      <organization>Cisco Systems</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

          <country>Canada</country>
        </postal>

        <phone/>

        <facsimile/>

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

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

    <author fullname="W. Lin" initials="W." surname="Lin">
      <organization>Juniper</organization>

      <address>
        <postal>
          <street/>

          <city/>

          <region/>

          <code/>

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

        <phone/>

        <facsimile/>

        <email>wlin@juniper.net</email>

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

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

    <workgroup>BESS Workgroup</workgroup>

    <abstract>
      <t>The BGP Domain PATH (D-PATH) attribute is defined for Inter-Subnet
      Forwarding (ISF) BGP Sub-Address Families that advertise IP prefixes.
      When used along with EVPN IP Prefix routes or IP-VPN routes, it
      identifies the domain(s) through which the routes have passed and that
      information can be used by the receiver BGP speakers to detect routing
      loops or influence the BGP best path selection. This document extends
      the use of D-PATH so that it can also be used along with other EVPN
      route types.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="sect-1" title="Introduction">
      <t>The BGP Domain PATH (D-PATH) attribute <xref
      target="I-D.ietf-bess-evpn-ipvpn-interworking"/> is defined for
      Inter-Subnet Forwarding (ISF) BGP Sub-Address Families that advertise IP
      prefixes. When used along with EVPN IP Prefix routes or IP-VPN routes,
      it identifies the domain(s) through which the routes have passed and
      that information can be used by the receiver BGP speakers to detect
      routing loops or influence the BGP best path selection. This document
      extends the use of D-PATH so that it can also be used along with other
      EVPN route types.</t>

      <t>The D-PATH attribute can be used to prevent control plane loops for
      EVPN routes, or to provide full path visibility of all the EVPN
      Interconnect Gateways through which a route has gone and modify the best
      path selection based on it. Some use cases in which D-PATH can be used
      along with (non-IP Prefix) EVPN routes follow, but the use cases are not
      limited to the ones described in this section.</t>

      <section anchor="sect-1.1"
               title="D-PATH to Prevent Loops for EVPN Routes">
        <t><xref target="loop"/> illustrates an EVPN Interconnect case where
        EVPN MAC/IP Advertisement routes can be looped indefinitely. The three
        Gateways (GW1, GW2 and GW3) and PE1 in the diagram are attached to the
        same EVPN Broadcast Domain (BD1). However, BD1 is extended throughout
        three different domains that are interconnected by the Gateways, which
        follow <xref target="RFC9014"/> procedures. Suppose a host with MAC
        address M1 is learned on GW1 and GW1 advertises an EVPN MAC/IP
        Advertisement route for M1 into Domain-1 and Domain-2. When the route
        gets imported by GW2 and GW3 and later exported into Domain-3, GW2 and
        GW3 may redistribute each other's route for M1 back into Domain-1 and
        Domain-2, respectively, creating a loop. D-PATH can be used by the
        Gateways when redistributing the route between Domains, to identify
        the Domains through which the route for M1 has gone. When GW1 receives
        an EVPN MAC/IP Advertisement route for M1 that contains a D-PATH with
        a domain-id locally assigned, GW1 identifies the route as "looped".
        </t>

        <t><figure anchor="loop" title="Loops for EVPN routes">
            <artwork><![CDATA[          +----------------+ GW2
          |   EVPN        +-------+
          |   Domain-1    | +---+ |
          |               | |BD1| |---------------+
          |               | +---+ |               |
     GW1  |               +-------+               |    PE1
   +-------+               |     |    EVPN       +-------+
   | +---+ |---------------+     |    Domain-3   | +---+ |
   | |BD1| |                     |               | |BD1| |
   | +---+ |---------------+     |               | +---+ |
   +---|---+               | GW3 |               +---|---+
       |  |   EVPN        +-------+               |  |
   M1--+  |   Domain-2    | +---+ |               |  +--M2
          |               | |BD1| |---------------+
          |               | +---+ |
          |               +-------+
          +----------------+]]></artwork>
          </figure>Similar examples are possible with EVPN VPWS services on
        the Gateways and PEs, where loop prevention for the redistributed A-D
        per EVI routes is needed. D-PATH provides the end to end path
        visibility that is required to prevent the loop.</t>
      </section>

      <section anchor="sect-1.2"
               title="Add Path Visibility and Influence Best Path Selection for EVPN Routes">
        <t><xref target="best-path"/> illustrates another <xref
        target="RFC9014"/> EVPN Interconnect case where, in addition to using
        D-PATH to prevent EVPN MAC/IP Advertisement route loops when
        redistributing routes between domains, the D-PATH attribute can also
        influence the best path selection for the routes. For example, if all
        the Gateways in the diagram are attached to the same BD1, an EVPN
        MAC/IP Advertisement route for MAC address M1 advertised by GW1 is
        advertised into Domain-1 and Domain-4. Two routes for M1 will arrive
        at GW3 with different Route Distinguishers and BGP Next Hops. If
        D-PATH is used by all the Gateways, the two routes arriving at GW3
        will have a different sequence of domain-ids in the D-PATH attribute.
        GW3 can use the length of the D-PATH as a way of influencing the
        selection (i.e., the shortest D-PATH route is selected). D-PATH
        improves the path visibility of the route since it provides
        information about all the Domains through which the route has
        passed.</t>

        <t><figure anchor="best-path"
            title="Influence Best Path Selection for EVPN routes">
            <artwork><![CDATA[        +----------+ GW11  +----------+  GW2  +----------+
        | EVPN     +-------+ EVPN     +-------+ EVPN     |
        | Domain-1 | +---+ | Domain-2 | +---+ | Domain-3 |
        |          | |BD1| |          | |BD1| |          |
        |          | +---+ |          | +---+ |          | 
   GW1  |          +-------+          +-------+          |  GW3
 +-------+         |       |          |       |         +-------+
 | +---+ |---------+       +----------+       +---------| +---+ |
 | |BD1| |                                              | |BD1| |
 | +---+ |---------+       +----------------------------| +---+ |
 +---|---+         | GW12  |                            +---|---+
     |  | EVPN     +-------+      EVPN                   |  |
 M1--+  | Domain-4 | +---+ |      Domain-5               |  +--M2
        |          | |BD1| |                             |
        |          | +---+ |                             |
        |          +-------+                             |
        +----------+       +-----------------------------+]]></artwork>
          </figure></t>
      </section>
    </section>

    <section anchor="sect-2" title="Conventions used in this document">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
      "OPTIONAL" in this document are to be interpreted as described in BCP 14
      <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when,
      they appear in all capitals, as shown here.</t>
    </section>

    <section anchor="sect-3" title="Terminology">
      <t>This section summarizes the terminology that is used throughout the
      rest of the document.</t>

      <t><list style="symbols">
          <t>AC: Attachment Circuit or logical interface associated to a given
          BT. To determine the AC on which a packet arrived, the PE examines
          the combination of a physical port and VLAN tags (where the VLAN
          tags can be individual c-tags, s-tags or ranges of both).</t>

          <t>BD and BT: a Broadcast Domain and Bridge Table, as defined in
          <xref target="I-D.ietf-bess-rfc7432bis"/>. A BD is a group of PEs
          attached to the same EVPN layer-2 multipoint service. A BT is the
          instantiation of a Broadcast Domain in a PE. When there is a single
          Broadcast Domain in a given EVI, the MAC-VRF in each PE contains a
          single BT. When there are multiple BTs within the same MAC-VRF, each
          BT is associated to a different Ethernet Tag. The EVPN routes
          specific to a BT indicate which Ethernet Tag the route corresponds
          to.</t>

          <t>ES and ESI: Ethernet Segment and Ethernet Segment Identifier, as
          defined in <xref target="I-D.ietf-bess-rfc7432bis"/>.</t>

          <t>EVPN Domain: two PEs are in the same EVPN Domain if they are
          attached to the same service and the packets between them do not
          require a data path lookup of the inner frame (e.g., in the BT of a
          MAC-VRF) in any intermediate router. An EVPN Domain Gateway PE is
          always configured with multiple Domain identifiers (EVPN Domain-ID)
          in the MAC-VRF or VPWS that connects those EVPN Domains, each EVPN
          Domain-ID representing an EVPN Domain. <vspace
          blankLines="1"/>Example: <xref
          target="ure-interworking-composite-pe-example"/> illustrates an
          example where PE1 and PE2 belong to different EVPN Domains since
          packets between them (for flows between hosts with MAC addresses M1
          and M2) require a MAC lookup in two of the gateways that are
          connecting the three EVPN Domains. E.g., if frames from M1 to M2 go
          through PE1, GW1, GW3 and PE2, a MAC lookup is performed at GW1 and
          GW3.<figure anchor="ure-interworking-composite-pe-example"
              title="EVPN Domain Interconnect Example">
              <artwork><![CDATA[
                        GW1------------GW3
                      +------+       +------+
        +-------------| BD1  |       | BD1  |-------------+
       PE1            +------+       +------+            PE2
     +------+            |              |             +------+
  M1-| BD1  |   EVPN     |     EVPN     |     EVPN    |  BD1 |-M2
     +------+           GW2            GW4            +---+--+
        |             +------+       +------+             |
        +-------------| BD1  |       | BD1  |-------------+
                      +------+       +------+
                         +--------------+
         EVPN Domain 1     EVPN Domain 2  EVPN Domain 3
        <---------------> <------------> <---------------->]]></artwork>
            </figure></t>
        </list></t>

      <t><list style="symbols">
          <t>EVPN Domain Gateway: a PE where a service (BD or VPWS instance)
          is instantiated and is attached to two or more EVPN Domains. An
          example of EVPN Domain Gateway is a PE following the procedures in
          section 4.4 or section 4.6 of <xref target="RFC9014"/>. In the
          example in <xref target="ure-interworking-composite-pe-example"/>,
          GW1 and GW2 connect EVPN Domains 1 and 2, whereas GW3 and GW4
          connect EVPN Domains 2 and 3. GW1 and GW2 import the MAC/IP
          Advertisement route for M1 coming from the EVPN Domain 1 into the
          MAC-VRF for BD1, and redistribute it into EVPN Domain 2. Likewise,
          GW3 and GW4 import the route into their MAC-VRF and re-advertise it
          into EVPN Domain 3.</t>

          <t>MAC-VRF: a MAC Virtual Routing and Forwarding table, as defined
          in <xref target="I-D.ietf-bess-rfc7432bis"/>. It is also the
          instantiation of an EVI (EVPN Instance) in a PE.</t>
        </list></t>
    </section>

    <section anchor="sect-4"
             title="Use of Domain Path Attribute (D-PATH) with EVPN routes">
      <t>This document extends the use of the D-PATH attribute specified in
      <xref target="I-D.ietf-bess-evpn-ipvpn-interworking"/> so that D-PATH
      can be advertised and processed along with the following EVPN route
      types:</t>

      <t><list style="symbols">
          <t>EVPN MAC/IP Advertisement routes that are not used for
          Inter-Subnet Forwarding (ISF). Note that if the EVPN MAC/IP
          Advertisement route is used for Inter-Subnet Forwarding as in <xref
          target="RFC9135"/>, the procedures for the D-PATH advertisement and
          processing are described in <xref
          target="I-D.ietf-bess-evpn-ipvpn-interworking"/>.</t>

          <t>EVPN A-D per EVI routes that are used for EVPN VPWS <xref
          target="RFC8214"/>. Advertised A-D per EVI routes not used for EVPN
          VPWS SHOULD NOT contain D-PATH.</t>

          <t>EVPN Inclusive Multicast Ethernet Tag routes <xref
          target="I-D.ietf-bess-rfc7432bis"/>.</t>
        </list></t>

      <t>As discussed, the use of D-PATH with EVPN IP Prefix routes is
      specified in <xref target="I-D.ietf-bess-evpn-ipvpn-interworking"/>.
      When used along with EVPN routes other than IP Prefix routes, the D-PATH
      attribute is characterized as follows:</t>

      <t><list style="numbers">
          <t>D-PATH is composed of a sequence of Domain segments following the
          format specified in <xref
          target="I-D.ietf-bess-evpn-ipvpn-interworking"/> where each Domain
          is represented as &lt;DOMAIN-ID:ISF_SAFI_TYPE&gt;. In this
          specification, DOMAIN-ID is an EVPN Domain identifier configured in
          an EVPN Domain Gateway and ISF_SAFI_TYPE is set to either 70 (EVPN)
          or 0 (local route). To simplify the explanation, this document
          represents the domains for EVPN routes as
          &lt;Domain-ID:TYPE&gt;.</t>

          <t>D-PATH identifies the sequence of EVPN Domains the route has gone
          through, with the last &lt;Domain-ID:TYPE&gt; entry (rightmost)
          identifying the first PE or EVPN Domain Gateway that added the
          D-PATH attribute.</t>

          <t>For non-ISF MAC/IP Advertisement routes or A-D per EVI routes,
          D-PATH SHOULD be added/modified by a EVPN Domain Gateway that
          redistributes the route between EVPN Domains and MAY be added by a
          PE or EVPN Domain Gateway that originates the route, as
          follows:<list style="letters">
              <t>An EVPN Domain Gateway that connects two EVPN Domains "X" and
              "Y", and receives a route on a EVPN Domain identified by a
              Domain-ID "X" SHOULD append a domain &lt;X:EVPN&gt; to the
              existing (or newly added) D-PATH attribute when redistributing
              the route to EVPN Domain "Y". The route is redistributed if it
              is first imported in a MAC-VRF (or VPWS instance), the MAC (or
              Ethernet Tag) is active, and policy allows the re-export of the
              route to a BGP neighbor.</t>

              <t>An EVPN Domain Gateway MAY also add the D-PATH attribute for
              locally learned MACs or MAC/IP pairs. In this case, the domain
              added would be &lt;A:0&gt;, where "A" is the Domain-ID
              configured on the Gateway's MAC-VRF that is specific to local
              routes (MAC/IP learned via local AC), and "0" is the TYPE of the
              EVPN Domain and indicates that the route is locally originated
              and not redistributed after receiving it from a BGP-EVPN
              neighbor. The EVPN Domain-ID for local routes MAY be shared by
              all the EVPN Domain Gateways of the same redundancy group for
              local routes, or each EVPN Domain Gateway of the redundancy
              group can use its own Domain-ID.</t>

              <t>A PE that is connected to a single EVPN Domain (therefore the
              PE is not an EVPN Domain Gateway) MAY add the D-PATH with a
              domain &lt;B:0&gt;, where "B" is the Domain-ID configured on the
              PE's MAC-VRF (or VPWS) for locally learned MAC/IPs (or Ethernet
              Tag IDs for VPWS). "0" is the TYPE that indicates the route is
              not re-advertised, but originated in the PE.</t>
            </list></t>

          <t>For EVPN Inclusive Multicast Ethernet Tag routes, an EVPN Domain
          Gateway must not redistribute routes between Domains as specified in
          <xref target="RFC9014"/>. An EVPN Domain Gateway originates an EVPN
          Inclusive Multicast Ethernet Tag route per Domain to which the
          Gateway is attached, so that BUM traffic can be attracted from one
          Domain to the rest. Therefore, only the above point 3.b. applies to
          EVPN Domain Gateways. That is, an EVPN Domain Gateway MAY add a
          &lt;A:0&gt; D-PATH attribute for the Inclusive Multicast Ethernet
          Tag routes generated for the EVPN Domains, where "A" is the
          configured local Domain-ID, and "0" is the TYPE that indicates the
          route is locally originated and not redistributed across EVPN
          Domains. When two EVPN Domain Gateways of the same redundancy group
          connect two EVPN Domains "X" and "Y" and D-PATH is used for EVPN
          Inclusive Multicast Ethernet Tag routes, it is RECOMMENDED to add
          the D-PATH attribute with the same local Domain-ID and only on "X"
          or "Y" but not on both Domains. </t>

          <t> On received EVPN routes, D-PATH is processed and used for loop
          detection (<xref target="sect-4.4"/>) as well as to influence the
          best path selection (<xref target="sect-4.1"/>, <xref
          target="sect-4.2"/> and <xref target="sect-4.3"/>).</t>
        </list></t>

      <section anchor="sect-4.1"
               title="D-PATH and Best Path Selection for MAC/IP Advertisement routes">
        <t>When two (or more) MAC/IP Advertisement routes with the same route
        key (and same or different RDs) are received, a best path selection
        algorithm is used to select and install only one route. This section
        summarizes the best path selection for MAC/IP Advertisement routes,
        which extends the rules in <xref target="I-D.ietf-bess-rfc7432bis"/>
        by including D-PATH in the tie-breaking algorithm. While the algorithm
        may be implemented in different ways, the selection result SHOULD be
        the same as the result of the rules that follow.</t>

        <t>The tie-breaking algorithm begins by considering all EVPN MAC/IP
        Advertisement routes equally preferable routes to the same
        destination, and then selects routes to be removed from consideration.
        The process terminates as soon as only one route remains in
        consideration.</t>

        <t><list style="numbers">
            <t>When the Default Gateway extended community is present in some
            of the routes, the MAC/IP Advertisement routes without the Default
            Gateway indication are removed from consideration, as defined in
            <xref target="I-D.ietf-bess-rfc7432bis"/>.</t>

            <t>Then the routes with the Static bit set in the MAC Mobility
            extended community are preferred, and the routes without the
            Static bit set are removed from consideration, as defined in <xref
            target="I-D.ietf-bess-rfc7432bis"/>. Note that this rule does not
            apply to routes with the Default Gateway extended community, since
            these routes SHALL NOT convey the MAC Mobility extended community
            <xref target="I-D.ietf-bess-rfc7432bis"/>. Therefore if two or
            more routes with the Default Gateway extended community remain in
            consideration, the selection process skips this step.</t>

            <t>Then the routes with the highest MAC Mobility Sequence number
            are preferred, hence the routes that are not tied for having the
            highest Sequence number are removed from consideration, as defined
            in <xref target="I-D.ietf-bess-rfc7432bis"/>. If two or more
            routes with the Default Gateway extended community remain in
            consideration, the selection process skips this step (for the same
            reason as in step 2).</t>

            <t>Then routes with the highest Local Preference are preferred,
            hence routes that are not tied for having the highest Local
            Preference are removed from consideration, as defined in <xref
            target="RFC4271"/>.</t>

            <t>Then routes with the shortest D-PATH are preferred, hence
            routes not tied for the shortest D-PATH are removed. Routes
            without D-PATH are considered zero-length D-PATH.</t>

            <t>Then routes with the numerically lowest left-most Domain-ID are
            preferred, hence routes not tied for the numerically lowest
            left-most Domain-ID are removed from consideration.</t>

            <t>If the steps above do not produce a single route, the rest of
            the rules after the highest Local Preference in <xref
            target="RFC4271"/> apply after step 6.</t>
          </list>The above selection criteria is followed irrespective of the
        ESI value in the routes. EVPN Multi-Homing procedures for Aliasing or
        Backup paths in <xref target="I-D.ietf-bess-rfc7432bis"/> are applied
        to the selected MAC/IP Advertisement route.</t>
      </section>

      <section anchor="sect-4.2"
               title="D-PATH and Best Path Selection for Ethernet A-D per EVI routes">
        <t>When two (or more) EVPN A-D per EVI routes with the same route key
        (and same or different RDs) are received for a VPWS, a best path
        selection algorithm is used. The selection algorithm follows the same
        steps as in <xref target="sect-4.1"/> except for steps 1-3 which do
        not apply since the Default Gateway and MAC Mobility extended
        community are irrelevant to the EVPN A-D per EVI routes.</t>

        <t>The above selection is followed for A-D per EVI routes with ESI=0.
        For non-zero ESI routes, the EVPN Multi-Homing procedures in <xref
        target="RFC8214"/> for Aliasing and Backup path are followed to select
        the routes (P and B flags are considered for the selection of the
        routes when sending traffic to a remote Ethernet Segment). If the
        mentioned Multi-Homing procedures do not produce a single route to
        each of the remote PEs attached to the same ES, steps 4-7 in <xref
        target="sect-4.1"/> are followed.</t>
      </section>

      <section anchor="sect-4.3"
               title="D-PATH and Best Path Selection for Inclusive Multicast Ethernet Tag routes">
        <t>When two (or more) EVPN Inclusive Multicast Ethernet Tag routes
        with the same route key (and same or different RDs) are received for a
        MAC-VRF, a best path selection algorithm is used. The selection
        algorithm follows the same steps as in <xref target="sect-4.1"/>
        except for steps 1-3 which do not apply.</t>
      </section>

      <section anchor="sect-4.4" title="Loop Detection">
        <t>An EVPN route received by a PE with a D-PATH attribute that
        contains one or more of its locally associated Domain-IDs for the
        MAC-VRF or VPWS instance is considered to be a looped route. A looped
        route MUST NOT be redistributed to a different domain and SHOULD be
        flagged as "looped".</t>

        <t>EVPN A-D per EVI looped routes and Inclusive Multicast Ethernet Tag
        looped routes MUST NOT be installed, where "install" means "create
        forwarding state" in this document. An EVPN MAC/IP Advertisement
        looped route MAY be installed if selected as the best route. </t>

        <t>For instance, in the example of <xref
        target="ure-interworking-composite-pe-example"/>, assuming PE1
        advertises M1's MAC/IP and does not add the D-PATH attribute, the EVPN
        Domain Gateway GW1 receives two MAC/IP Advertisement routes for M1's
        MAC/IP:</t>

        <t><list style="symbols">
            <t>A MAC/IP Advertisement route with next-hop PE1 and no
            D-PATH.</t>

            <t>A MAC/IP Advertisement route with next-hop GW2 and
            D-PATH={length=1,&lt;6500:1:EVPN&gt;}, assuming that the Domain-ID
            for EVPN Domain 1 is 6500:1.</t>
          </list>In this case, EVPN Domain Gateway GW1 flags the MAC/IP
        Advertisement route with D-PATH as "looped", and does not install the
        MAC in the BT of the MAC-VRF and does not redistribute the route back
        to EVPN Domain 1 (since the route includes one of GW1's Domain-IDs).
        In case the MAC/IP Advertisement route with next-hop PE1 is withdrawn,
        GW1 may install the route with next-hop GW2 and D-PATH
        &lt;6500:1:EVPN&gt;; this may help speed up convergence in case of
        failures.</t>
      </section>

      <section anchor="sect-4.5" title="Error Handling">
        <t>The error handling for the D-PATH attribute is described in <xref
        target="I-D.ietf-bess-evpn-ipvpn-interworking"/>. This document
        extends the use of D-PATH to non-ISF EVPN routes.</t>
      </section>
    </section>

    <section anchor="sect-5" title="Use-Case Examples">
      <t>This section illustrates the use of D-PATH in EVPN routes with
      examples.</t>

      <t><xref target="use-case-1"/> and <xref target="use-case-2"/>
      illustrate an integrated interconnect solution for an EVPN BD, as
      described in section 4.4 and section 4.6 of <xref target="RFC9014"/>.
      GW1 and GW2 are EVPN Domain Gateways connecting two EVPN Domains
      identified by D-PATH domain {1:1:EVPN} and {1:2:EVPN}, respectively.
      Received Ethernet A-D routes, ES routes, and Inclusive Multicast routes
      from the routers in one EVPN Domain are consumed and processed by GW1
      and GW2, but not redistributed to the other EVPN Domain. However, MAC/IP
      Advertisement routes received by GW1 and GW2 in one EVPN Domain are
      processed and, if installed, redistributed into the other EVPN
      Domain.<figure anchor="use-case-1" title="EVPN Interconnect">
          <artwork><![CDATA[         +----EVPN Domain-1---+      +----EVPN Domain-2--+
         |     1:1:EVPN       | GW1  |    1:2:EVPN       |
         |                   +---------+                 |
         |                   | +-----+ |                 |
         |                   | | BD1 | X <-+             |
        PE1                  | +-----+ |   |            PE2
     +---------+             +---------+   |         +---------+
     | +-----+ |              |      |     |         | +-----+ |
M1-----| BD1 | |              |      |     |         | | BD1 |-----M2
     | +-----+ |  ------->    |      |     |         | +-----+ |
     +---------+ (RT2)M1/IP1  |      |     |         +---------+
         |                   +---------+   |             |
         |                   | +-----+ |   |(RT2)M1/IP1  |
         |                   | | BD1 | | --+ <1:1:EVPN>  |
         |                   | +-----+ |                 |
         |                   +---------+                 |
         |                     | GW2 |                   |
         +---------------------+     +-------------------+]]></artwork>
        </figure></t>

      <t>Consider the example of <xref target="use-case-1"/>, where PE1
      advertises a MAC/IP Advertisement route for M1/IP1. The route is
      processed and installed by GW1 and GW2 in BD1, and both redistribute the
      routes into the EVPN Domain-2. By using D-PATH in GW1 and GW2, when the
      route is received on PE2, PE2 has the visibility of the EVPN Domains
      through which the route has gone, and can also use the D-PATH for best
      path selection. In addition, GW1 and GW2 can compare the D-PATH of the
      incoming routes with their local list of EVPN Domain-IDs, and detect
      looped routes if any of the local EVPN Domain-IDs matches a domain in
      the received D-PATH. This procedure prevents the redistribution of the
      route back into EVPN Domain-1. For example, when GW1 receives the MAC/IP
      Advertisement route for M1/IP1 with D-PATH &lt;1:1:EVPN&gt;, GW1
      identifies the route as looped and it does not redistribute it back to
      Domain-1. The M1/IP1 route with Next Hop PE1 is installed. If M1/IP1
      with Next Hop PE1 is withdrawn, GW1 MAY install the route M1/IP1 with
      Next Hop GW2, as specified in <xref target="sect-4.4"/>.</t>

      <t>The example of <xref target="use-case-2"/> illustrates how GW1 and
      GW2 can also have local ACs in BD1 and learn local MAC (or MAC/IP)
      addresses from devices connected to the ACs. <figure anchor="use-case-2"
          title="EVPN Interconnect local AC">
          <artwork><![CDATA[         +----EVPN Domain-1---+      +----EVPN Domain-2--+
         |     1:1:EVPN       | GW1  |    1:2:EVPN       |
         |                   +---------+                 |
         |                   | +-----+ |                 |
         |              +-->X| | BD1 | |X<--+            |
        PE1             |    | +-----+ |    |           PE2
     +---------+        |    +---------+    |        +---------+
     | +-----+ |        |     |      |      |        | +-----+ |
M1-----| BD1 | |        |     |      |      +--->    | | BD1 |-----M2
     | +-----+ |        |     |      |      |        | +-----+ |
     +---------+        |     |      |      |        +---------+
         |              |     | GW2  |      |            |
         |          <---+--  +---------+ (RT2)M3/IP3     |
         |       (RT2)M3/IP3 | +-----+ |  {1:3:0}        |
         |        {1:3:0}    | | BD1 | |    |            |
         |                   | +-----+ | ---+            |
         |                   +----|----+                 |
         |                     |  |  |                   |
         +---------------------+  |  +-------------------+
                                  +
                                  M3]]></artwork>
        </figure></t>

      <t>Assuming GW2 learns M3/IP3 via local AC, GW2 advertises a MAC/IP
      Advertisement route for M3/IP3 into each of the EVPN Domains that GW2 is
      connected to. As described in <xref target="sect-4"/>, GW2 can advertise
      these two MAC/IP Advertisement routes with a configured EVPN Domain-ID
      for local MAC/IPs routes that can be shared with GW1. Consider this EVPN
      Domain-ID is 1:3 and it is configured on both, GW1 and GW2. When GW2
      advertises the route into each EVPN Domain, it adds the D-PATH attribute
      with a domain {1:3:0}. These routes are flagged by GW1 as "looped" since
      1:3 is configured as a local EVPN Domain-ID in GW1. In addition, PE1 and
      PE2 receive the routes with the D-PATH and they have the visibility of
      the origin of the routes, in this case local EVPN Domain Gateway routes.
      This information can be used to influence the best path selection in
      case of multiple routes for M3/IP3 are received on PE1 or PE2 for
      BD1.</t>

      <t>As an alternative solution to configuring the same EVPN Domain-ID for
      local routes on both EVPN Domain Gateways, GW2 can be configured with
      EVPN Domain-ID 1:3 for local routes, and GW1 can use a different EVPN
      Domain-ID, e.g., 1:4. In this case, GW2 advertises the route for M3/IP3
      into each EVPN Domain as before, but now GW1 does not flag the route as
      "looped" since 1:3 is not on the list of GW1's local EVPN Domain-IDs.
      GW1 receives the routes from both EVPN Domains, and GW1 selects the
      route from e.g., EVPN Domain-1. GW1 then installs the route in its BT
      and redistributes the route into EVPN Domain-2 with D-PATH {1:1:EVPN,
      1:3:0}. When PE2 receives two routes for M3/IP3, one from GW2 with
      D-PATH {1:3:0} and another from GW1 with D-PATH {1:1:EVPN, 1:3:0}, PE2
      uses best path selection and choose to send its traffic to GW2. Also GW2
      receives the route for M3/IP3 from GW1 and mark it as "looped" since
      that route conveys its own EVPN Domain-IDs 1:1 and 1:3.</t>

      <t>In a nutshell, the use of D-PATH in MAC/IP Advertisement routes helps
      prevent loops and influences the best path selection so that PEs choose
      the shortest paths to the destination PEs.</t>
    </section>

    <section anchor="sect-11" title="Security Considerations">
      <t>Most of the considerations included in <xref
      target="I-D.ietf-bess-evpn-ipvpn-interworking"/> apply to this document.
      </t>
    </section>

    <section anchor="sect-12" title="IANA Considerations">
      <t>None.</t>
    </section>

    <section anchor="sect-13" title="Acknowledgments">
      <t/>
    </section>

    <section anchor="sect-14" title="Contributors"/>
  </middle>

  <back>
    <references title="Normative References">
      &RFC4271;

      &RFC2119;

      &RFC8174;

      &I-D.ietf-bess-evpn-ipvpn-interworking;

      &I-D.ietf-bess-rfc7432bis;

      &RFC9014;

      &RFC8214;
    </references>

    <references title="Informative References">
      &RFC9135;
    </references>
  </back>
</rfc>
