<?xml version="1.0" encoding="US-ASCII"?>

<?xml-model href="rfc7991bis.rnc"?>

<!-- <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?> --> 
<!-- This third-party XSLT can be enabled for direct transformations in XML processors, including most browsers -->


<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
  <!ENTITY I-D.ietf-bess-evpn-l2gw-proto SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-l2gw-proto.xml">
  <!ENTITY I-D.ietf-bess-evpn-mh-pa SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-mh-pa.xml">
  <!ENTITY I-D.draft-ietf-bess-rfc7432bis SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-rfc7432bis.xml">
  <!ENTITY I-D.ietf-bess-evpn-per-mcast-flow-df-election SYSTEM "https://xml2rfc.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-bess-evpn-per-mcast-flow-df-election.xml">

]>
<!-- If further character entities are required then they should be added to the DOCTYPE above.
     Use of an external entity file is not recommended. -->

<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->

<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->

<rfc category="std"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    docName="draft-kriswamy-bess-evpn-perflow-df-02"
    updates=""
    consensus="true"
    submissionType="IETF"
    ipr="trust200902"
    tocInclude="true"
    tocDepth="4"
    symRefs="true"
    sortRefs="true">

 <!-- ***** FRONT MATTER ***** -->

<front>
   <!-- The abbreviated title is used in the page header - it is only necessary if the 
        full title is longer than 39 characters -->
    <title abbrev="Per-Flow EVPN Designated Forwarder Election">Per-Flow EVPN Designated Forwarder Election</title>
    <seriesInfo name="Internet-Draft" value="draft-kriswamy-bess-evpn-perflow-df-02"/>

    <author fullname="Krishnaswamy Ananthamurthy" initials="K." surname="Ananthamurthy">
     <organization>Cisco</organization>
     <address>
	    <postal>
          <street>170 W. Tasman Drive</street>
          <street/>
          <city>San Jose</city>
          <code>95134</code>
          <region>CA</region>
          <country>USA</country>
        </postal>
       <email>kriswamy@cisco.com</email>
     </address>
   </author>

  <author fullname="Ali Sajassi" initials="A." surname="Sajassi">
     <organization>Cisco</organization>
     <address>
	    <postal>
          <street>170 W. Tasman Drive</street>
          <street/>
          <city>San Jose</city>
          <code>95134</code>
          <region>CA</region>
          <country>USA</country>
        </postal>
       <email>sajassi@cisco.com</email>
     </address>
   </author>
  
  <author fullname="Lukas Krattiger" initials="L." surname="Krattiger">
     <organization>Cisco</organization>
     <address>
	    <postal>
          <street>170 W. Tasman Drive</street>
          <street/>
          <city>San Jose</city>
          <code>95134</code>
          <region>CA</region>
          <country>USA</country>
        </postal>
       <email>lkrattig@cisco.com</email>
     </address>
   </author>   
   <date year="2026" />

   <!-- Meta-data Declarations -->
   <area>Routing</area>
   <workgroup>BESS Working Group</workgroup>

   <!-- WG name at the upperleft corner of the doc,
        IETF is fine for individual submissions. 
	 If this element is not present, the default is "Network Working Group",
        which is used by the RFC Editor as a nod to the history of the IETF. -->

   <keyword>BGP</keyword>

   <abstract>
	<t> The Ethernet Virtual Private Network (EVPN) solution offers procedures for electing a Designated Forwarder (DF) for multihomed Ethernet Segments.
		In this context, the Provider Edge (PE) router is responsible for sending Broadcast, Unknown Unicast, and Multicast (BUM) traffic to a multihomed 
		device or network. This applies in cases of an all-active multihomed Ethernet Segment (ES) as well as for BUM and unicast traffic in the case of 
		single-active multihoming. 
		While the Default Algorithm provides an efficient and automated mechanism for selecting the DF across Ethernet Tags within an Ethernet Segment,
		it does not provide Per-flow DF selection within an EVPN Instance (EVI).
	</t>
	
	<t>
		This document defines a new DF Election Algorithm that performs Per-flow DF selection by defining a new DF Algorithm value.
	</t>
   </abstract>


	<note title="Requirements Language">
		<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>
	</note>
 </front>

 <middle>
	 
	<section anchor="intro" title="Introduction">	
		<t> The EVPN solution offers procedures for electing a Designated Forwarder (DF) for multihomed Ethernet Segments.
			In this context, the PE is responsible for sending BUM traffic to a multihomed 
			device or network. This applies in cases of an all-active multihomed ES as well as for BUM and unicast traffic in the case of 
			single-active multihoming. While the Default Algorithm provides an efficient and automated mechanism for selecting the DF across
			Ethernet Tags within an Ethernet Segment, it does not provide Per-flow DF selection within an EVPN Instance (EVI).
		</t>
		
		<t>
			<xref target="RFC8584"/> and <xref target="I-D.ietf-bess-evpn-per-mcast-flow-df-election"/>  enhance the default DF election by
			introducing the Highest Random Weight (HRW) algorithm and the tuple consisting of Ethernet Segment Identifier (ESI), VLAN, and multicast flow to
			provide more deterministic and stable DF selection respectively.
		</t>
		
		<t>
			Existing DF election procedures maintain state in both the control plane and the forwarding plane.
			These procedures improve the distribution of BUM traffic across the PEs attached to a multihomed Ethernet Segment.
			However, the forwarding responsibility is assigned at the Ethernet Tag or multicast-group granularity and does not provide per-flow load distribution.
		</t>
		
		<t>
			<xref target="I-D.ietf-bess-evpn-per-mcast-flow-df-election"/> extends the DF election procedures to support
			per-flow load distribution for multicast traffic. In that approach, a multicast-group-specific DF election is 
			performed when a host attached to a multihomed Ethernet Segment joins a multicast group using IGMP or MLD. 
			As a result, the participating PEs maintain multicast-group-specific DF election state in the control plane.
		</t>

		<t>
			This document addresses the remaining gap for BUM forwarding by defining a per-flow DF election algorithm 
			that does not require maintaining per-flow control-plane state. Instead, all participating PEs independently 
			derive the same Designated Forwarder for a given flow by applying a common hashing function to the flow key and 
			selecting the DF from the ordered PE list defined in <xref target="RFC8584"/>. 
			This approach distributes flows across the available PEs while ensuring deterministic and consistent forwarding decisions. 
			This document updates <xref target="RFC8584"/> by defining a new DF Algorithm value.
		</t>
	</section>
	
	<section title="Designated Forwarder Election Extended Community" anchor="DFEXT">

		<t> To advertise support for the Per-flow DF election algorithm, this document reuses the Designated Forwarder Election
			Extended Community defined in <xref target="RFC8584"/>
			that is advertised along with the Ethernet Segment route. This document defines a new DF Algorithm type Per-flow.
			A PE can notify other participating PEs in the redundancy group about its support for the Per-flow DF Algorithm
			by signaling a DF Election Extended Community.
			A PE that supports the procedures specified in this document MUST advertise the corresponding DF Alg in its
			Ethernet Segment Route (Route Type 4). This enables all PEs participating in the redundancy group to discover the capability
			and consistently apply the enhanced DF election procedures in a backward-compatible and interoperable manner.
		</t>
		<t>
			The format of the DF Election Extended Community that is used in this document follows:
		</t>
		
		
	<figure anchor="df-election-extended-community"
			 title="DF Election Extended Community">
	<artwork><![CDATA[
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type=0x06     | Sub-Type(0x06)| RSV |  DF Alg |    Bitmap     ~
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~     Bitmap    |   Reserved                                    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>

		<list style="symbols">
			<t> The DF Alg (5 bits) field identifies the DF Election Algorithm used for the Ethernet Segment.
				<list style="symbols">
					<t> This document defines a new DF Algorithm value, Per-flow.
						IANA is requested to assign the value 6 from the "DF Alg" registry defined in  <xref target="RFC8584"/>. 
						The assigned value is encoded in the DF Algorithm field of the DF Election Extended Community.
					</t>
				</list>
			</t>
		
			<t>
				The procedures defined in <xref target="RFC8584"/> to handle Designated Forwarder Election Extended Community are applicable. 
			</t>
			
			<t>
				A PE SHOULD attach the DF Election Extended Community to the ES route and the Extended Community MUST be advertised if the ES is
				locally configured for DF type Per-flow DF election.
			</t>
			<t>
				A PE MUST use the Per-flow DF Algorithm only if all participating PEs advertise the same DF Algorithm value for the Ethernet Segment.
				Otherwise, the procedures of <xref target="RFC8584"/> apply.
			</t>
		</list>
		
		<t>
		Once all participating PEs advertise the Per-flow DF Algorithm, they perform DF selection as specified in <xref target="Per-Flow DF Election Operation"/>.
		</t>
	</section>
	
	<section anchor="Per-Flow DF Election Operation" title="Per-Flow DF Election Operation">
		<t>
			Once all PEs in the redundancy group have advertised support for the Per-flow DF Algorithm, they independently
			compute the Designated Forwarder for each flow using the procedures described in this section. No additional 
			control-plane signaling is required beyond the ordered PE list.
		</t>
		
		<t>
			When operating in Per-flow Designated Forwarder (DF) mode, the ordered (ordinal) PE list defined in <xref target="RFC8584"/> SHALL be used.
			This is the only control plane state maintained.
		</t>
		<t>
			When a BUM packet arrives, the hash is computed using a set of packet header fields
			that are applicable to the packet being processed.
			<list style="symbols">
				<t>
					The selection of fields is dependent on the packet format and protocol type.
				</t>
				<t>
					The exact choice of fields is outside the scope of this document.
				</t>
				<t>
					However, all participating PEs MUST use a consistent set of
					packet header fields for a given packet format to ensure that identical packets produce the same hash value across all participating PEs.
				</t>
			</list>
		</t>
		
		<t>
			The hash function MAY use a Cyclic Redundancy Check 32 (CRC-32) or any other implementation-specific hashing algorithm.
			<list style="symbols">
				<t>
					The choice of hash function is outside the scope of this document.
				</t>
				<t>
					To ensure consistent Per-flow DF selection across all PEs participating in the ES, all such PEs
					MUST use the same hashing algorithm.
				</t>
			</list>
			<t>
				Let H denote the hash value computed over the flow key, and let N denote the number of active PEs in the ordered PE
				list. The value of N is used in the DF selection algorithm.
			</t>
		</t>

		<t>
			The DF index, I, MUST be computed as follows:
	<artwork><![CDATA[
I = H mod N
	]]></artwork>

		The PE at position I in the ordered PE list SHALL be elected as the Designated Forwarder for the corresponding flow.
		<list style="symbols">
			<t>
				This approach allows multiple flows within the same VLAN to be forwarded by different PEs elected as the Designated Forwarder for a given Ethernet Segment.
			</t>
			<t>
				As long as the ordered PE list remains unchanged, a given flow is always mapped to the same DF.
			</t>
			<t>
				Whenever the set of active PEs changes,
				the value of N changes, and the resulting DF assignment for existing flows may also change.
			</t>
		</list>
	</t>
	
	<section anchor="per-flow-df-example" title="Per-Flow DF Election Example">
	  <figure  align="center">
                  <artwork align="center"><![CDATA[

                                         BUM  Source
                                             |
                                             |
                                             |
                                             |
                                         +---------+
                          +--------------+  PE-4   +--------------+
                          |              |         |              |
                          |              +---------+              |
                          |                                       |
                          |                 EVPN                  |
                          |                                       |
                          |                                       |
                          |                                       |
                      +---------+        +---------+         +---------+
                      |  PE1    +--------+  PE2    +---------+ PE3     |
                      |  EVI-1  |        |  EVI-1  |         | EVI-1   |
                      +---------+        +---------+         +---------+
                           |__________________|___________________|     
                         AC-1    ESI-1        | AC-2               AC-3
                                         +---------+
                                         |  CE-1   |
                                         |         |
                                         +---------+
                                              |
                                              |
                                              |
                                              |
                                         BUM Receivers

                      Figure-1 : Multihomed network   
                      ]]></artwork>
                  <postamble></postamble>
              </figure>



			<t>
				Figure-1 illustrates Ethernet Segment ESI-1 multihomed to PE1, PE2, and PE3.
				Assume that all three PEs advertise support for the Per-flow DF Algorithm and derive
				the following ordered PE list according to <xref target="RFC8584"/>:
			</t>

			<artwork><![CDATA[
Ordered PE List = {PE1, PE2, PE3}
N = 3
			]]></artwork>

			<t>
				PE1, PE2 and PE3 receive BUM traffic from the EVPN core for the same VLAN (e.g., VLAN 101)
				and sends the traffic toward the multihomed Ethernet Segment. For each flow, every participating PE computes the
				same hash value over the selected packet header fields and compute the DF index as
				specified in this section. The following example uses representative hash values:
			</t>

			<artwork><![CDATA[
Flow       VLAN    Hash Value (H)    DF Index (H mod 3)    Elected DF
----       -----   --------------    ------------------    ----------
Flow-A      101       101                    2                PE3
Flow-B      101       205                    1                PE2
Flow-C      101       300                    0                PE1
Flow-D      101       401                    2                PE3
			]]></artwork>

			<t>
				Because all participating PEs use the same flow-key fields, hashing algorithm,
				and ordered PE list, they independently elect the same DF for each flow without
				requiring per-flow control-plane signaling. Consequently, Flow-A and Flow-D are
				forwarded toward CE-1 only by PE3, Flow-B only by PE2, and Flow-C only by PE1.
				This distributes different BUM flows within the same VLAN and Ethernet Segment
				across the available PEs while ensuring that each individual flow is forwarded
				by only one DF.
			</t>

			<t>
				If the membership of the redundancy group changes, the participating PEs update
				the ordered PE list and recompute the DF index using the new value of N. For
				example, if PE2 is no longer active, the ordered PE list becomes:
			</t>

			<artwork><![CDATA[
Ordered PE List = {PE1, PE3}
N = 2
			]]></artwork>

			<t>
				As a result, some existing flows may be assigned to a different DF. All remaining
				participating PEs nevertheless continue to derive identical forwarding decisions
				because they use the same ordered PE list, flow-key fields, and hashing algorithm.
			</t>
		</section>
              
	</section>
	
	<section title="Security Considerations">
		<t> 
			This document introduces no new security considerations beyond those discussed in <xref target="RFC7432"/> and <xref target="RFC8584"/>.
		</t>
	</section>
		<section anchor="iana" title="IANA Considerations">
			<t>This document solicits:</t>
			
		
		
		<t><list style="symbols">
          <t>The allocation of one new value in the "DF Alg" registry created
          by <xref target="RFC8584"/> as follows:<figure>
              <artwork><![CDATA[
Alg         Name                               Reference
----        -----------------------------      -------------
6           Per-flow                           This document]]>
              </artwork>
            </figure></t>
        </list></t>
		</section>


</middle>

 <!--  *****BACK MATTER ***** -->

<back>
    <!-- References split into informative and normative -->
    <references title="Normative References">
	    <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7432.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8584.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
        &I-D.ietf-bess-evpn-per-mcast-flow-df-election;

    </references> 

</back>
</rfc>

