<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std" docName="draft-abraitis-idr-addpath-paths-limit-01" ipr="trust200902" consensus="true" obsoletes="" updates="" submissionType="IETF" xml:lang="en" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.12.8 -->
  <front>
    <title abbrev="Paths Limit for Multiple Paths in BGP">Paths Limit for Multiple Paths in BGP</title>
    <seriesInfo name="Internet-Draft" value="draft-abraitis-idr-addpath-paths-limit-01"/>
    <author fullname="Donatas Abraitis" surname="Abraitis">
      <organization>NetDef</organization>
      <address>
        <email>donatas@opensourcerouting.org</email>
      </address>
    </author>
    <author fullname="Alvaro Retana" surname="Retana">
      <organization>Futurewei Technologies, Inc.</organization>
      <address>
        <email>aretana@futurewei.com</email>
      </address>
    </author>
    <author fullname="Jeffrey Haas" surname="Haas">
      <organization>Juniper Networks</organization>
      <address>
        <postal>
          <street>1133 Innovation Way</street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94089</code>
          <country>US</country>
        </postal>
        <email>jhaas@juniper.net</email>
      </address>
    </author>
    <date year="2024"/>
    <area>Routing</area>
    <workgroup>Inter-Domain Routing</workgroup>
    <keyword>BGP ADD-PATH</keyword>
    <abstract>
      <t>
        This document specifies a BGP capability that complements the
        ADD-PATH Capability by indicating the maximum number of paths a
        BGP speaker can receive from a peer, optimizing the
        transmission of BGP routes by selectively relaying pertinent
        routes instead of the entire set.
      </t>
    </abstract>
  </front>
  <middle>
    <section>
      <name>Introduction</name>
      <t>
        BGP ADD-PATH <xref target="RFC7911"/> defines a BGP extension
        that allows the advertisement of multiple paths for the same address
        prefix without the new paths implicitly replacing any previous ones.
      </t>
      <t>
        Multiple paths for a large number of prefixes may be received by a BGP
        speaker, potentially depleting memory resources or even causing
        network-wide instability. Such instability could be considered a denial-of-service
        attack. Without knowing the maximum number of paths the receiver wants to receive,
        the sender may send more than that number of paths.
        <xref target="I-D.ietf-idr-add-paths-guidelines"/> provides
        recommendations for the use of BGP ADD-PATH while implementing
        specific applications.
      </t>
      <t>
        This document specifies a BGP capability
        <xref target="RFC5492"/> that complements the
        ADD-PATH Capability <xref target="RFC7911"/> by indicating the
        maximum number of paths a BGP speaker can receive from a peer.
        This indication allows the sender to optimize the transmission
        of BGP routes by selectively relaying pertinent routes instead
        of the entire set.
      </t>
    </section>
    <section anchor="simple_list">
      <name>Specification of Requirements</name>
      <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>
      <name>PATHS-LIMIT Capability</name>
      <t>
       The PATHS-LIMIT Capability is a BGP capability
       <xref target="RFC5492"/>, with Capability Code TBD.  The
       Capability Length field of this capability is variable.  The
       Capability Value field consists of one or more of the following
       tuples:
      </t>
      <figure anchor="paths_limit_capability">
        <artwork align="center"><![CDATA[
    +------------------------------------------------+
    | Address Family Identifier (2 octets)           |
    +------------------------------------------------+
    | Subsequent Address Family Identifier (1 octet) |
    +------------------------------------------------+
    | Paths Limit (2 octet)                          |
    +------------------------------------------------+
            ]]></artwork>
      </figure>
      <t>
        The meaning and use of the fields are as follows:
      </t>
      <ul empty="true">
       <li>
       <dl newline="true">
        <dt>Address Family Identifier (AFI):</dt>
        <dd>This field is the same as the one used in
        <xref target="RFC4760"/>.</dd>

        <dt>Subsequent Address Family Identifier (SAFI):</dt>
        <dd>This field is the same as the one used in
        <xref target="RFC4760"/>.</dd>
        <dt>Paths Limit:</dt>
        <dd>This field indicates the maximum paths limit the receiver
        wants to receive from its peer. If the received Paths Limit is
        zero (0), the tuple SHOULD be ignored.</dd>
       </dl>
       </li>
      </ul>

      <t>
        A BGP speaker that wishes to indicate support for multiple AFI/SAFIs MUST
        do so by including the information in a single instance of the
        PATHS-LIMIT capability.
      </t>
      <t>
        The PATHS-LIMIT capability MUST be ignored if the ADD-PATH capability is not present.
      </t>
      <t>
        If the PATHS-LIMIT capability is empty (i.e. the Capability
        Length field is set to 0), it means that the sender doesn't
        have any specific limits to communicate.
      </t>
      <t>
       An AFI/SAFI tuple MUST be ignored if the same tuple was not received in the ADD-PATH capability.
      </t>
      <t>
       If more than one tuple is received for the same AFI/SAFI pair, only the first tuple should be considered.  All others MUST be ignored.
      </t>
      <t>
        A sender advertising multiple paths for the same prefix SHOULD send only the specified maximum number of paths indicated in the PATHS-LIMIT capability.
      </t>
      <t>
        An implementation SHOULD provide a configuration knob to specify
        the maximum number of paths to accept from a sender.
      </t>
    </section>
    <section anchor="IANA">
      <name>IANA Considerations</name>
      <t>
        IANA has assigned capability number 76 for the PATHS-LIMIT Capability
        described in this document. This registration is in the BGP Capability Codes
        registry.
      </t>
      <table anchor="table_ex">
        <name>PATHS-LIMIT Capability</name>
        <thead>
          <tr>
            <th align="center">Value</th>
            <th align="center">Description</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="center">76</td>
            <td align="center">PATHS-LIMIT Capability</td>
          </tr>
        </tbody>
      </table>
    </section>
    <section anchor="security">
      <name>Security Considerations</name>
      <t>
       This document defines a BGP extension that allows a receiver to
       better control the number of routes it receives when using BGP
       ADD-PATH <xref target="RFC7911"/>.  Use of the PATHS-LIMIT
       capability can then mitigate some of the security-related
       concerns expressed in <xref target="RFC7911"/>.
      </t>
      <t>
       A rogue node or misconfiguration can result in the advetisement
       of a Paths Limit value that is too low for the application being
       used.  This can result in inconsistent forwarding.  Describing
       applications for BGP ADD-PATH is outside the scope of this
       document.  Users of the PATHS-LIMIT Capability are encouraged to
       examine the behavior and potential impact by studying the best
       practices described in
       <xref target="I-D.ietf-idr-add-paths-guidelines"/>.
      </t>
    </section>
    <section anchor="Acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>
        TBD
      </t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
      <name>Normative References</name>
        <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.4760.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.5492.xml"/>
	      <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.7911.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references>
      <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml3/reference.I-D.ietf-idr-add-paths-guidelines.xml"/>
      </references>
    </references>

    <section title="Implementation Report">
      <t>
        According to RFC 7942, "This will allow reviewers and working groups to assign
        due consideration to documents that have the benefit of running code, which may
        serve as evidence of valuable experimentation and feedback that have made the
        implemented protocols more mature".
      </t>
      <t>
        <eref target="https://github.com/opensourcerouting/frr/commit/786cf4d2b488f38fcb43e3ea8e49de06a69ef175">FRRouting</eref> implementation.
      </t>
    </section>

  </back>
</rfc>
