<?xml version="1.0" encoding="US-ASCII"?>
<?rfc strict="yes"?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-cheng-idr-ecmp-groupid-00" ipr="trust200902" submissionType="IETF" consensus="true">
  <front>
    <title abbrev="BGP ECMP GroupID">BGP Extension for ECMP Group ID</title>

    <author fullname="Weiqiang Cheng" initials="W." surname="Cheng">
      <organization>China Mobile</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>chengweiqiang@chinamobile.com</email>
      </address>
    </author>

    <author fullname="Changwang Lin" initials="C." surname="Lin">
      <organization>New H3C Technologies</organization>
      <address>
        <postal>
          <city>Beijing</city>
          <country>China</country>
        </postal>
        <email>linchangwang.04414@h3c.com</email>
      </address>
    </author>

    <date year="2026"/>

    <workgroup>IDR Working Group</workgroup>

    <abstract>
      <t>In AI training scenarios, per-flow ECMP is the mainstream load
      balancing technology. However, hash collision issues lead to
      imbalanced traffic distribution, adversely affecting application
      performance.</t>

      <t>This document defines a new BGP Extended Community,
      BGP_EXT-COMM-ECMP-GROUPID, which carries an ECMP Group ID
      associated with a route. The ECMP Group ID allows an ingress
      router to map flows destined for different remote addresses to
      different local ECMP subgroups, providing finer-grained load
      distribution and resolving load imbalance caused by hash
      collisions.</t>
    </abstract>
  </front>

  <middle>
    <section anchor="sec-intro" title="Introduction">
      <t>Currently, there are two granularities for network load
      balancing: per-flow ECMP and per-packet forwarding.</t>

      <t>The per-flow ECMP method employs flow characteristic-based
      hashing (typically using the five-tuple) to distribute traffic
      across multiple ECMP paths. Its primary advantage is the
      elimination of packet reordering issues. However, this method
      presents limitations when dealing with either a limited number
      of flows, or the presence of elephant flows. In such cases,
      five-tuple-based hashing may lead to hash collisions, causing
      disproportionate mapping of oversized flows to the same path.
      This results in suboptimal load balancing performance.</t>

      <t>The per-packet forwarding approach applies hashing to each
      individual packet. Theoretically, it achieves optimal
      load-balancing granularity. However, it introduces severe packet
      reordering within the same flow, necessitating additional
      mechanisms (e.g., reordering buffers or sequence tracking) to
      handle out-of-order delivery.</t>

      <t>In AI training scenarios, the current mainstream load
      balancing technology is per-flow ECMP. However, hash collision
      issues lead to imbalanced traffic distribution, adversely
      affecting application performance.</t>

      <t>To address this problem, an enhanced ECMP method that
      resolves load imbalance caused by hash collisions has been
      proposed in <xref target="I-D.cheng-rtgwg-enhanced-ecmp"/>. In
      one of the proposed methods, the ECMP egress interfaces on the
      ingress router are divided into subgroups, and flows are mapped
      to subgroups based on the remote egress group index carried in
      the route. This requires the route to carry such an egress group
      index.</t>

      <t>This document defines a new BGP Extended Community to carry
      the ECMP Group ID associated with a route, as required by the
      enhanced ECMP mechanism.</t>

      <section anchor="sec-req" 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>
      </section>
    </section>

    <section anchor="sec-proto" title="Protocol Extension">
      <t>This document defines a new extended community attribute type
      <xref target="RFC4360"/> to carry the ECMP ID associated with a
      BGP route <xref target="RFC4271"/>. The ID comprises a
      4-byte Router ID and a 2-byte Group-ID. The format is as
      follows:</t>

      <figure anchor="fig-1" title="ECMP GroupID Extended Community">
        <artwork><![CDATA[
   0                   1                   2                   3
   0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |    0x83       | Sub-Type(TBD) |           Router ID           |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |   Router ID                   |        Group-ID               |
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
]]></artwork>
      </figure>

      <t>Sub-Type: BGP_EXT-COMM-ECMP-GROUPID (TBD)</t>

      <t>Value Structure:</t>

      <ul>
        <li>Local BGP RouterID (4 bytes)</li>
        <li>ECMP-Group-ID Value (2 bytes)</li>
      </ul>

      <t>When a route is advertised with the enhanced ECMP mechanism
      described in <xref target="I-D.cheng-rtgwg-enhanced-ecmp"/>, the
      route MUST carry this extended community. The Router ID field
      MUST be set to the local BGP RouterID of the advertising device,
      and the ECMP-Group-ID field MUST be set to the egress group
      index assigned on the advertising device. A router that receives
      this extended community but does not support the enhanced ECMP
      mechanism MAY ignore it and perform normal ECMP forwarding.</t>
    </section>

    <section anchor="sec-security" title="Security Considerations">
      <t>TBD.</t>
    </section>

    <section anchor="sec-iana" title="IANA Considerations">
      <t>Registry Name: Transitive BGP_EXT-COMM-ECMP-GROUPID Community
      Sub-Types</t>

      <t>TBD: BGP_EXT-COMM-ECMP-GROUPID</t>
    </section>
  </middle>

  <back>
    <references anchor="sec-normref">
      <name>Normative References</name>
      <reference anchor="RFC2119" target="https://www.rfc-editor.org/info/rfc2119">
        <front>
          <title abbrev="RFC2119">Key words for use in RFCs to Indicate Requirement Levels</title>
          <author initials="S." surname="Bradner" fullname="S. Bradner"/>
          <date month="March" year="1997"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174" target="https://www.rfc-editor.org/info/rfc8174">
        <front>
          <title abbrev="RFC8174">Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author initials="B." surname="Leiba" fullname="B. Leiba"/>
          <date month="May" year="2017"/>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="RFC4271" target="https://www.rfc-editor.org/info/rfc4271">
        <front>
          <title abbrev="BGP-4">A Border Gateway Protocol 4 (BGP-4)</title>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter"/>
          <author initials="T." surname="Li" fullname="T. Li"/>
          <author initials="S." surname="Hares" fullname="S. Hares"/>
          <date month="January" year="2006"/>
        </front>
        <seriesInfo name="RFC" value="4271"/>
        <seriesInfo name="DOI" value="10.17487/RFC4271"/>
      </reference>
      <reference anchor="RFC4360" target="https://www.rfc-editor.org/info/rfc4360">
        <front>
          <title abbrev="BGP Extended Communities">BGP Extended Communities Attribute</title>
          <author initials="S." surname="Sangli" fullname="S. Sangli"/>
          <author initials="D." surname="Tappan" fullname="D. Tappan"/>
          <author initials="Y." surname="Rekhter" fullname="Y. Rekhter"/>
          <date month="February" year="2006"/>
        </front>
        <seriesInfo name="RFC" value="4360"/>
        <seriesInfo name="DOI" value="10.17487/RFC4360"/>
      </reference>
    </references>

    <references anchor="sec-inforef">
      <name>Informational References</name>
      <reference anchor="I-D.cheng-rtgwg-enhanced-ecmp" target="https://datatracker.ietf.org/doc/draft-cheng-rtgwg-enhanced-ecmp/">
        <front>
          <title abbrev="Enhanced ECMP for AI Network">Enhanced ECMP for AI Cluster</title>
          <author initials="W." surname="Cheng" fullname="Weiqiang Cheng">
            <organization>China Mobile</organization>
          </author>
          <author initials="C." surname="Lin" fullname="Changwang Lin">
            <organization>New H3C Technologies</organization>
          </author>
          <date month="March" day="25" year="2026"/>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-cheng-rtgwg-enhanced-ecmp-01"/>
      </reference>
    </references>
  </back>
</rfc>
