<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc4271 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY rfc5065 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5065.xml">
<!ENTITY rfc3779 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3779.xml">
<!ENTITY rfc6472 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6472.xml">
<!ENTITY rfc6482 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6482.xml">
<!ENTITY rfc6480 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6480.xml">
<!ENTITY rfc6811 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6811.xml">
<!ENTITY rfc6907 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.6907.xml">
<!ENTITY rfc7606 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7606.xml">
<!ENTITY rfc8205 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8205.xml">
<!ENTITY rfc8174 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml">
<!ENTITY rfc9319 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.9319.xml">
]>

<rfc submissionType="IETF" category="std" docName="draft-ietf-idr-deprecate-as-set-confed-set-09" updates="4271 5065" obsoletes="6472" ipr="trust200902">
  <?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
  <?rfc toc="yes" ?>
  <?rfc symrefs="yes" ?>
  <?rfc sortrefs="yes"?>
  <?rfc iprnotified="no" ?>
  <?rfc strict="yes" ?>
  <?rfc compact="yes" ?>

  <!-- Don't put each section on its own page -->

  <front>
    <title abbrev="AS_SET use deprecation">Deprecation of AS_SET in BGP</title>

    <author fullname="Warren Kumari" initials="W" surname="Kumari">
      <organization>Google, Inc.</organization>

      <address>
        <postal>
          <street>1600 Amphitheatre Parkway</street>
          <city>Mountain View</city>
          <region>CA</region>
          <code>94043</code>
          <country>US</country>
        </postal>

        <phone>+1 571 748 4373</phone>

        <email>warren@kumari.net</email>
      </address>
    </author>

    <author fullname="Kotikalapudi Sriram" initials="K" surname="Sriram">
      <organization>USA NIST</organization>

      <address>
        <postal>
          <street>100 Bureau Drive</street>
          <city>Gaithersburg</city>
          <region>MD</region>
          <code>20899</code>
          <country>US</country>
        </postal>

        <phone>+1 301 975 3973</phone>

        <email>ksriram@nist.gov</email>
      </address>
    </author>

    <author fullname="Lilia Hannachi" initials="L" surname="Hannachi">
      <organization>USA NIST</organization>

      <address>
        <postal>
          <street>100 Bureau Drive</street>
          <city>Gaithersburg</city>
          <region>MD</region>
          <code>20899</code>
          <country>US</country>
        </postal>

        <phone>+1 301 975 3259</phone>

        <email>lilia.hannachi@nist.gov</email>
      </address>
    </author>

    <author fullname="Jeffrey Haas" initials="J." surname="Haas">
      <organization>Juniper Networks, Inc.</organization>
      <address>
        <postal>
          <street>1133 Innovation Way</street>
          <city>Sunnyvale</city>
          <region>CA</region>
          <code>94089</code>
          <country>United States of America</country>
        </postal>
        <email>jhaas@juniper.net</email>
      </address>
    </author>

   <date year="" />

  <!-- [rfced] Please insert any keywords (beyond those that appear in the
title) for use on http://www.rfc-editor.org/rfcsearch.html. 
 BGP, BGP-4, Network Operator, RPKI, Aggregation, RPKI-based Route Origin Validation, RPKI-ROV -->

    <abstract>
      <t>BCP 172 (i.e., RFC 6472) recommends not using AS_SET and AS_CONFED_SET
      in the Border Gateway Protocol. This document advances this recommendation
      to a standards requirement in BGP; it proscribes the use of the AS_SET
      type of path segments in the AS_PATH.  This is done to simplify the design
      and implementation of BGP and to make the semantics of the originator of a
      route clearer. This will also simplify the design, implementation, and
      deployment of various BGP security mechanisms. This document (if approved)
      updates RFC 4271 and RFC 5065, and obsoletes RFC 6472.</t> </abstract>
      </front>

  <middle>
    <section title="Introduction">

      <t>BCP 172 <xref target="RFC6472"></xref> makes a recommendation for not
      using AS_SET (see <xref target="RFC4271"></xref>) and AS_CONFED_SET (see
      <xref target="RFC5065"></xref>) in the Border Gateway Protocol (BGP).
      This document advances the BCP recommendation to a standards requirement
      in BGP; it proscribes the use of the AS_SET types of path segments in the
      AS_PATH. The purpose is to simplify the design
      and implementation of BGP and to make the semantics of the originator of a
      route clearer. This will also simplify the design, implementation, and
      deployment of various BGP security mechanisms. In particular, the proscription of AS_SETs removes the possibility of ambiguity about origin AS in RPKI-based route origin validation (RPKI-ROV) <xref target="RFC6811"></xref> <xref target="RFC6907"></xref> <xref target="RFC9319"></xref>. </t> 

<!-- KS: RFC 9319 is a new RFC on prudent use of maxLength in ROAs and it discusses several operational aspects of ROAs and RPKI-ROV; it is also the first RFC to formally define RPKI-ROV which is (will be) included in the official IETF Abbreviations list. --> 

<!--
KS: I was going to include the following paragraph here but then I realized that the proper operation of BGPsec requires both AS_SET and AS_CONFED_SET to be deprcated. 

<t> 
While this document proscribes the use of the AS_SET type of path segment 
in the AS_PATH, it does not do so for the AS_CONFED_SET type.
This is because the presence of AS_CONFED_SET does not pose a hinderance for determination the origin AS   when the final segment in an AS_PATH is 
of type AS_CONFED_SET, the origin AS can still be determined for RPKI-ROV
and it is simply the AS Confederation Identifier (see <xref target="5065"> <xref target="6811">).   
</t> 
-->

      <t> The AS_SET path segment in the AS_PATH attribute (Sections 4.3 and
      5.1.2 of <xref target="RFC4271"></xref>) is created by a router that is
      performing route aggregation and contains an unordered set of Autonomous
      Systems (ASes) that contributing prefixes in the aggregate have
      traversed.</t>

<!--
      The AS_CONFED_SET path segment (see <xref
      target="RFC5065"></xref>) in the AS_PATH attribute is created by a router
      that is performing route aggregation and contains an unordered set of
      Member AS Numbers in the local confederation that contributing prefixes
      in the aggregate have traversed. It is very similar to an AS_SET but is
      used within a confederation.</t>
-->

<!-- XXX JMH - confed sets will never confuse the origin AS.  This is because
if only confederation sets are present, we're still operating within the
context of the origin and the confederation stripping procedure will result in
an origin AS via the Confederation Identifier.  In other circumstances,
confederation segments MUST prepend the AS_PATH - and therefore can't be the
origin. -->

      <t>By performing aggregation, a router is combining multiple BGP routes
      for more specific destinations into a new route for a less specific
      destination (<xref target="RFC4271"/>, Section 9.1.2.2.). Aggregation
      may blur the semantics of the origin AS for the prefix being announced by
      producing an AS_SET.  AS_SETs can cause operational issues, such as not
      being able to authenticate a route origin for the aggregate prefix in new
      BGP security technologies such as those that take advantage of X.509
      extensions for IP addresses and AS identifiers 
      (<xref target="RFC3779"/>, <xref target="RFC6480"/>,
      <xref target="RFC6811"/>, <xref target="RFC6907"/>, <xref target="RFC9319"/>,
      <xref target="RFC8205"/>). This in turn could result in reachability
      problems for the aggregated prefix and its components; i.e., more
      specific prefixes.</t> 

      <t>From analysis of historical Internet routing data, it is apparent that
      aggregation that involves AS_SETs is very seldom used in practice on the
      public Internet <xref target="Analysis"/>.  When it is used, it
      is often used incorrectly; only a single AS in the AS_SET are by far
      the most common cases. Also, very often the same AS appears in the
      AS_SEQUENCE and the AS_SET in the BGP update. The occurrence of reserved
      AS numbers (<xref target="IANA-SP-ASN"/>) is also somewhat frequent.</t>

<!-- XXX JMH I am removing the following paragraph because aggregation as a feature is clearly in heavy use.  See the data for when the AGGREGATOR Path Attribute is present.  Aggregation is thus used, but the percentage of it exposing AS_SETs is the very small thing. -->
<!--
      <t>Because the aggregation involving AS_SETs is very rarely used,
      the reduction in table size provided by this is extremely small, and any
      advantage thereof is outweighed by additional complexity in BGP.  As
      noted above, AS_SETs also pose impediments to implementation of new BGP
      security technologies.</t>
-->

<!--
      In the past, AS_SET had been used in a few rare cases to allow route aggregation where two or more providers could form the same aggregate prefix, using the exact match of the other's aggregate prefix in some advertisement and configuring the aggregation differently elsewhere.  The key to configuring this correctly was to form the aggregate at the border in the outbound BGP policy and omit prefixes from the AS that the aggregate was being advertised to. The AS_SET therefore allowed this practice without the loss of BGP's AS_PATH loop protection.  This use of AS_SET served a purpose that fell in line with the original intended use. Without the use of AS_SET, aggregates must always contain only less-specific prefixes (not less than or equal to) and must never aggregate an exact match.
--> 

    </section>

    <section 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 title="Recommendations">
      <t>BGP speakers conforming to this document (i.e., conformant BGP
      speakers) SHOULD NOT locally generate BGP UPDATE messages containing AS_SET. Conformant BGP speakers SHOULD NOT send BGP UPDATE
      messages containing AS_SETs. Upon receipt of such messages, conformant BGP
      speakers SHOULD use the "Treat-as-withdraw" error handling behavior as per
      <xref target="RFC7606"></xref>.</t>

      <t>If a network operator wishes to consider BGP UPDATE messages with
      AS_SETs received from an external BGP peers, they MAY have a feature
      (knob) in their implementation to do so on a per-peer basis. The operator
      should understand the full implications of choosing this option.</t>

<!--
This involves undoing the aggregation that was previously performed (with AS_SETs/CONFED_SETs), and announcing more specific prefixes (without AS_SETs/CONFED_SETs). 

Route aggregation that was previously performed by proxy aggregation without the use of AS_SETs is still possible under some conditions. When doing this, operators MUST form the aggregate at the border in the outbound BGP policy and omit any prefixes from the AS that the aggregate is being advertised to. As with any change, the operator should understand the full implications of the change.
-->   

<!-- XXX JMH - A stub AS can happily absorb routes containing AS_SETs according to local policy, since it has no interest in propagating them to other speakers that may have RPKI origin considerations.  The consideration here applies only to transit ASes and their downstreams. -->

      <t>Network operators SHOULD NOT locally generate any new announcements
      containing AS_SETs.</t>

      <t>BGP security technologies (such as those that take advantage of X.509
      extensions for IP addresses and AS identifiers (<xref target="RFC3779"/>,
      <xref target="RFC6480"/>, <xref target="RFC6811"/>, 
      <xref target="RFC8205"/>) might not support routes with AS_SETs or
      AS_CONFED_SETs in them. Routes with AS_SETs have no possibility of ever being considered RPKI-ROV valid <xref target="RFC6811"/> <xref target="RFC6907"/>. 

</t>
    </section>

    <section title="Updates to Existing RFCs">
      <t>This document deprecates the origination of BGP routes with AS_SET
      (type 1) AS_PATH segments.  (<xref target="RFC4271"/>, Section 4.3.) BGP
      speakers conforming to this document &mdash; i.e., conformant BGP speakers &mdash;
      SHOULD NOT originate BGP UPDATE messages containing AS_SETs.  Upon
      receipt of BGP routes containing AS_SETs, conformant BGP speakers SHOULD
      use the "Treat-as-withdraw" error handling behavior as per <xref
      target="RFC7606"></xref>.</t>

<!-- XXX JMH - As noted above, confed sets don't hurt anything.  This text is commented out. -->

<!--
      <t>This document deprecates the AS_CONFED_SET (type 4) AS_PATH segment
      type from <xref target="RFC5065"></xref>. Conformant BGP speakers MUST
      NOT locally generate BGP UPDATE messages containing AS_CONFED_SET.
      Conformant BGP speakers SHOULD NOT send BGP UPDATE messages containing
      AS_CONFED_SET. Upon receipt of such messages, conformant BGP speakers
      SHOULD use the "Treat-as-withdraw" error handling behavior as per 
      <xref target="RFC7606"></xref>.</t>
-->

<!-- XXX JMH - insert update to aggregation procedures here. -->

      <section title="BGP AS_PATH &quot;Brief&quot; Aggregation">
        <t><xref target="RFC4271"/>, Sections 9.1.4 and 9.2.2.2, describes BGP
        aggregation procedures.  <xref target="RFC4271"/>, Appendix F.6
        describes a generally unimplemented "Complex AS_PATH Aggregation"
        procedure.</t>

        <t><xref target="RFC4271"/>, Section 5.1.6 describing the
        ATOMIC_AGGREGATE Path Attribute notes that:</t>

        <blockquote>
          <t>When a BGP speaker aggregates several routes for the purpose of
          advertisement to a particular peer, the AS_PATH of the aggregated
          route normally includes an AS_SET formed from the set of ASes from
          which the aggregate was formed.  In many cases, the network
          administrator can determine if the aggregate can safely be advertised
          without the AS_SET, and without forming route loops.</t>

          <t>If an aggregate excludes at least some of the AS numbers present in
          the AS_PATH of the routes that are aggregated as a result of dropping
          the AS_SET, the aggregated route, when advertised to the peer, SHOULD
          include the ATOMIC_AGGREGATE attribute.</t>
        </blockquote>

        <t>When BGP AS_PATH aggregation is done according to the Section 9.2.2.2
        procedures and any resulting AS_SETs are discarded, this is typically
        referred to as "brief" aggreation in implementations.  This results in
        an AS_PATH that has the property (from Section 9.2.2.2):</t>

        <blockquote>
          <t>determine the longest leading sequence of tuples (as defined above)
          common to all the AS_PATH attributes of the routes to be aggregated.
          Make this sequence the leading sequence of the aggregated AS_PATH
          attribute.</t>
        </blockquote>

        <t>The ATOMIC_AGGREGATE Path Attribute is subsequently attached to the
        BGP route, if AS_SETs are dropped.</t>
      </section>

      <section title="Issues with &quot;Brief&quot; AS_PATH Aggregation and RPKI-ROV">
        <t>While brief AS_PATH aggregation has the desirable property of not
        containing AS_SETs, the resulting aggregated AS_PATH may contain an
        unpredictable origin AS.  Such an unpredictable origin ASes may result
        in RPKI-ROV validation issues:</t>

        <ul>
          <li>Depending on the contributing routes to the aggregate route, the
          resulting origin AS may vary.</li>
          <li>The presence of expected contributing routes may be unpredictable
          due to route availability from BGP neighbors.</li>
          <li>In the presence of such varying origin ASes, it would be necessary
          for the resource holder to register <xref target="RFC6482">Route
          Origin Authorizations (ROAs)</xref> for each potential origin AS that
          may result from the expected aggregated AS_PATHs.</li>
        </ul>
      </section>

      <section title="Recommendations to Mitigate Unpredictable AS_PATH origins
       for RPKI-ROV Purposes">
        <t>In order to ensure a consistent BGP origin AS is announced for
        aggregate BGP routes for implementations of "brief" BGP aggregation, the
        implementation should be configured to truncate the AS_PATH after the
        right-most instance of the desired origin AS for the aggregate.</t>

        <t>If the resulting AS_PATH would be truncated from the otherwise
        expected result of BGP AS_PATH aggregation (an AS_SET would be
        generated, or ASes are removed from the "longest leading sequence" of
        ASes), the ATOMIC_AGGREGATE Path Attribute SHALL be attached.  This is
        consistent with the intent of Section 5.1.6 of 
        <xref target="RFC4271"/>.</t>
      </section>
    </section>

    <section title="Operational Considerations">
      <t>When aggregating prefixes, network operators MUST use brief
      aggregation. In brief aggregation, the AGGREGATOR attribute is included
      but the AS_SET attribute is not included.</t>

      <t>When doing the above, operators MUST form the aggregate at the border
      in the outbound BGP policy and omit any prefixes from the AS that the
      aggregate is being advertised to. In other words, an aggregate prefix
      MUST NOT be announced to the contributing ASes. Instead, more specific
      prefixes (from the aggregate) MUST be announced to each contributing AS,
      excluding any that were learned from the contributing AS in
      consideration. For illustration, if p1/24 (from AS1), p2/24 (from AS2),
      p3/24 (from AS3) and p4/24 (from AS4) are aggregated to p/22, then p/22
      will not be announced to AS1, AS2, AS3, or AS4. Instead, as further
      illustration, p1/24, p2/24 and p4/24 are announced to AS3. Or, possibly
      q/23 (aggregate of p1/24 and p2/24) and p4/24 are announced to AS3.</t>

      <t>Operators MUST install egress filters to block data packets when the
      destination address belongs to an internal prefix. Similarly, any known
      single-homed customer prefix MUST also be included in the egress filters
      except on the interface for that customer. This mitigates looping in the
      data plane when connection to such an internal or customer prefix is
      lost. This mechanism effectively compensates for the lack of the
      additional loop detection capability accorded by AS_SETs (if they were
      allowed).</t>

    </section>

    <section title="Security Considerations">
      <t>This document obsoletes the use of aggregation techniques that create
      AS_SETs. Obsoleting these path segment types from BGP and removal of the
      related code from implementations would potentially decrease the attack
      surface for BGP. Deployments of new BGP security technologies 
      (<xref target="RFC6480"/>, <xref target="RFC6811"/>, 
      <xref target="RFC8205"/>) benefit greatly if AS_SETs are not used in
      BGP.</t>
    </section>

    <section title="IANA Considerations">
      <t>This document requires no IANA actions.</t>
    </section>

    <section title="Acknowledgements">
      <t>The authors would like to thank John Heasley, Job Snijders, Jared
      Mauch, Jakob Heitz, Keyur Patel, Douglas Montgomery, Randy Bush, Susan
      Hares, John Scudder, Curtis Villamizar, Danny McPherson, Chris Morrow,
      Tom Petch, Ilya Varlashkin, Enke Chen, Tony Li, Florian Weimer, John
      Leslie, Paul Jakma, Rob Austein, Russ Housley, Sandra Murphy, Steve
      Bellovin, Steve Kent, Steve Padgett, Alfred Hoenes, and Alvaro Retana for
      comments and suggestions.</t>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      &rfc2119;
      &rfc4271;
      &rfc5065;
    </references>

    <references title="Informative References">
      &rfc3779; 
      &rfc6472;
      &rfc6811;
      &rfc6480;
      &rfc6482;
      &rfc6907;
      &rfc7606;
      &rfc8205;
      &rfc8174;
      &rfc9319;

      <reference anchor="IANA-SP-ASN"
       target="https://www.iana.org/assignments/iana-as-numbers-special-registry/iana-as-numbers-special-registry.xhtml">
        <front>
          <title>Special-Purpose Autonomous System (AS) Numbers</title>
            <author initials="" surname="">
              <organization />
            </author>
            <date month="" year="" />
        </front>
      </reference>

      <reference anchor="Analysis"
                 target="https://github.com/ksriram25/IETF/blob/main/Detailed-AS_SET-analysis.txt">
        <front>
          <title>Detailed analysis of AS_SETs in BGP updates</title>
          <author initials="L." surname="Hannachi">
            <organization />
          </author>

          <author initials="K." surname="Sriram">
            <organization />
          </author>

          <date month="October" year="2019" />
        </front>

        <seriesInfo name="NIST Robust Inter-domain Routing Project Website" value="" />
      </reference>
    </references>
  </back>
</rfc>
