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

<!DOCTYPE rfc [
  <!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4271 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml">
<!ENTITY RFC4272 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4272.xml">
<!ENTITY RFC4486 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4486.xml">
<!ENTITY RFC5065 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5065.xml">
<!ENTITY RFC5492 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5492.xml">
<!ENTITY RFC7606 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7606.xml">
<!ENTITY RFC7705 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7705.xml">
<!ENTITY RFC7908 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7908.xml">
<!ENTITY RFC7938 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7938.xml">
<!ENTITY RFC8126 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8126.xml"> nbsp    "&#160;">
  <!ENTITY RFC8174 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml"> zwsp   "&#8203;">
  <!ENTITY RFC8205 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.8205.xml"> nbhy   "&#8209;">
  <!ENTITY nbsp    "&#160;"> 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" xml:lang="en" submissionType="IETF" category="std" docName="draft-ietf-idr-bgp-open-policy-24" ipr="trust200902"> consensus="true" docName="draft-ietf-idr-bgp-open-policy-23" number="9234" ipr="trust200902" tocInclude="true" tocDepth="4" symRefs="true" sortRefs="true" updates="" obsoletes="" version="3">

  <front>
    <title abbrev="Route Leak Prevention">Route Leak Prevention and Detection using Using Roles in UPDATE and OPEN Messages</title>
    <seriesInfo name="RFC" value="9234"/>
    <author fullname="Alexander Azimov" initials="A." surname="Azimov">
      <organization>Qrator Labs &amp; Yandex</organization>
      <address>
        <postal>
          <street>Ulitsa Lva Tolstogo 16</street>
          <city>Moscow</city>
          <code>119021</code>
          <country>Russian Federation</country>
        </postal>
        <email>a.e.azimov@gmail.com</email>
      </address>
    </author>
    <author fullname="Eugene Bogomazov" initials="E." surname="Bogomazov">
      <organization>Qrator Labs</organization>
      <address>
        <postal>
          <street>1-y Magistralnyy tupik 5A</street>
          <city>Moscow</city>
          <code>123290</code>
          <country>Russian Federation</country>
        </postal>
        <email>eb@qrator.net</email>
      </address>
    </author>
    <author fullname="Randy Bush" initials="R." surname="Bush">
      <organization>Internet
      <organization abbrev="IIJ &amp; Arrcus">Internet Initiative Japan &amp; Arrcus, Inc.</organization>
      <address>
        <postal>
          <street>5147 Crystal Springs</street>
          <city>Bainbridge Island</city>
          <region>Washington</region>
          <code>98110</code>
          <country>United States of America</country>
        </postal>
        <email>randy@psg.com</email>
      </address>
    </author>
    <author fullname="Keyur Patel" initials="K." surname="Patel">
      <organization>Arrcus</organization>
      <address>
        <postal>
          <street>2077 Gateway Place, Suite Place</street>
          <street>Suite #400</street>
          <city>San Jose</city>
          <region>CA</region>
          <code>95119</code>
          <country>United States of America</country>
        </postal>
        <email>keyur@arrcus.com</email>
      </address>
    </author>
    <author fullname="Kotikalapudi Sriram" initials="K." surname="Sriram">
      <organization abbrev="USA NIST">USA National Institute of Standards and Technology</organization>
      <address>
        <postal>
          <street>100 Bureau Drive</street>
          <city>Gaithersburg</city>
          <region>MD</region>
          <code>20899</code>
          <country>United States of America</country>
        </postal>
        <email>ksriram@nist.gov</email>
      </address>
    </author>

    <date/>
    <date year="2022" month="April" />
    <area>rtg</area>
    <workgroup>idr</workgroup>
    <keyword>BGP</keyword>
    <keyword>Route leak</keyword>
    <keyword>BGP Role</keyword>
    <abstract>
      <t>
        Route leaks are the propagation of BGP prefixes that violate assumptions of BGP topology relationships, e.g., announcing a route learned from one transit provider to another transit provider or a lateral (i.e., non-transit) peer or announcing a route learned from one lateral peer to another lateral peer or a transit provider.
        These are usually the result of misconfigured or absent BGP route filtering or lack of coordination between autonomous systems (ASes).
        Existing approaches to leak prevention rely on marking routes by operator configuration, with no check that the configuration corresponds to that of the eBGP External BGP (eBGP) neighbor, or enforcement that of the two eBGP speakers agree agreeing on the peering relationship.
        This document enhances the BGP OPEN message to establish an agreement of the peering relationship on each eBGP session between autonomous systems in order to enforce appropriate configuration on both sides.
        Propagated routes are then marked according to the agreed relationship, allowing both prevention and detection of route leaks.
      </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&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> when,
	and only when, they appear in all capitals, as shown here.
      </t>
    </note>

  </front>
  <middle>
    <section title="Introduction" anchor="intro">
      <name>Introduction</name>
      <t>
        Route leaks are the propagation of BGP prefixes that violate assumptions of BGP topology relationships, e.g., announcing a route learned from one transit provider to another transit provider or a lateral (i.e., non-transit) peer or announcing a route learned from one lateral peer to another lateral peer or a transit provider <xref target="RFC7908"/>.
        These are usually the result of misconfigured or absent BGP route filtering or lack of coordination between autonomous systems (ASes).
      </t>
      <t>
        Existing approaches to leak prevention rely on marking routes by operator configuration, with no check that the configuration corresponds to that of the eBGP neighbor, or enforcement that of the two eBGP speakers agree agreeing on the relationship.
        This document enhances the BGP OPEN message to establish an agreement of the relationship on each eBGP session between autonomous systems in order to enforce appropriate configuration on both sides.
        Propagated routes are then marked according to the agreed relationship, allowing both prevention and detection of route leaks.
      </t>
      <t>
        This document specifies a means of replacing the operator-driven configuration-based method of route leak prevention, described above, with an in-band method for route leak prevention and detection.
      </t>
      <t>
        This method uses a new configuration parameter, BGP Role, which is negotiated using a BGP Role Capability in the OPEN message <xref target="RFC5492"/>.
        An eBGP speaker may require the use of this capability and confirmation of the BGP Role with a neighbor for the BGP OPEN to succeed.
      </t>
      <t>
        An optional, transitive BGP Path Attribute, called Only "Only to Customer (OTC), (OTC)", is specified in <xref target="prevention_attribute"/>.
        It prevents ASes from creating leaks and detects leaks created by the ASes in the middle of an AS path.
        The main focus/applicability is the Internet (IPv4 and IPv6 unicast route advertisements).
      </t>
    </section>

    <section>
      <name>Requirements Language</name>

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

    <section anchor="terminology" title="Terminology"> anchor="terminology">
      <name>Terminology</name>
      <t>
        The terms "local AS" and "remote AS" are used to refer to the two ends of an eBGP session.
        The "local AS" is the AS where the protocol action being described is to be performed, and "remote AS" is the AS at the other end of the eBGP session in consideration.
      </t>
      <t>
        The use of the term "route is ineligible" in this document has the same meaning as in <xref target="RFC4271"/>, i.e., "route is ineligible to be installed in Loc-RIB and will be excluded from the next phase of route selection."
      </t>
      <section anchor="defs" title="Peering Relationships"> anchor="defs">
        <name>Peering Relationships</name>
        <t>
        The terms for peering relationships defined and used in this document (see below) do not necessarily represent business relationships based on payment agreements.
        These terms are used to represent restrictions on BGP route propagation, sometimes known as the Gao-Rexford model <xref target="Gao"/>. target="GAO-REXFORD"/>.
        The terms Provider, Customer, "Provider", "Customer", and Peer "Peer" used here are synonymous to the terms "transit provider", "customer", and "lateral (i.e., non-transit) peer", respectively, used in <xref target="RFC7908"/>.
        </t>
        <t>
        The following is a list of BGP Roles for eBGP peering and the corresponding rules for route propagation:
        <list style="hanging">
          <t hangText="Provider:">
            MAY
        </t>
        <dl newline="false" spacing="normal">
          <dt>Provider:</dt>
          <dd>
            <bcp14>MAY</bcp14> propagate any available route to a Customer.
          </t>
          <t hangText="Customer:">
            MAY
          </dd>
          <dt>Customer:</dt>
          <dd>
            <bcp14>MAY</bcp14> propagate any route learned from a Customer, or that is locally originated, to a Provider.
            All other routes MUST NOT <bcp14>MUST NOT</bcp14> be propagated.
          </t>
          <t hangText="Route
          </dd>
          <dt>Route Server (RS):">
            MAY (RS):</dt>
          <dd>
            <bcp14>MAY</bcp14> propagate any available route to a Route Server Client (RS-Client).
          </t>
          <t hangText="Route
          </dd>
          <dt>Route Server Client (RS-Client):">
            MAY (RS-Client):</dt>
          <dd>
            <bcp14>MAY</bcp14> propagate any route learned from a Customer, or that is locally originated, to an RS.
            All other routes MUST NOT <bcp14>MUST NOT</bcp14> be propagated.
          </t>
          <t hangText="Peer:">
            MAY
          </dd>
          <dt>Peer:</dt>
          <dd>
            <bcp14>MAY</bcp14> propagate any route learned from a Customer, or that is locally originated, to a Peer.
            All other routes MUST NOT <bcp14>MUST NOT</bcp14> be propagated.
          </t>
        </list>
      </t>
          </dd>
        </dl>
        <t>
        If the local AS has one of the above Roles (in the order shown), then the corresponding peering relationship with the remote AS is Provider-to-Customer, Customer-to-Provider, RS-to-RS-Client, RS-Client-to-RS, or Peer-to-Peer (i.e., lateral peers), respectively.
        These are called normal peering relationships.
        </t>
        <t>
        If the local AS has more than one peering role Role with the remote AS AS, such a peering relation is called Complex. "Complex".
        An example is when the peering relationship is Provider-to-Customer for some prefixes while it is Peer-to-Peer for other prefixes <xref target="Gao"/>. target="GAO-REXFORD"/>.
        </t>
        <t>
        A BGP speaker may apply policy to reduce what is announced, and a recipient may apply policy to reduce the set of routes they accept.
        </t>
        <t>
        Violation of the route propagation rules listed above may result in route leaks <xref target="RFC7908"/>.
        Automatic enforcement of these rules should significantly reduce route leaks that may otherwise occur due to manual configuration mistakes.
        </t>
        <t>
        As specified in <xref target="prevention_attribute"/>, the Only to Customer (OTC) OTC Attribute is used to identify all the routes in the AS that have been received from a Peer, a Provider, or an RS.
        </t>
      </section>
    </section>
    <section anchor="bgp_role" title="BGP Role"> anchor="bgp_role">
      <name>BGP Role</name>

      <t>
        The BGP Role characterizes the relationship between the eBGP speakers forming a session.
        One of the Roles described below SHOULD <bcp14>SHOULD</bcp14> be configured at the local AS for each eBGP session (see definitions in <xref target="terminology"/>) based on the local AS's knowledge of its Role.
        The only exception is when the eBGP connection is Complex (see <xref target="considerations"/>).
        BGP Roles are mutually confirmed using the BGP Role Capability (described in <xref target="capability"/>) on each eBGP session.
      </t>
      <t>
        Allowed Roles for eBGP sessions are:
        <list style="symbols">
          <t>Provider - the
      </t>

      <dl>
<dt>Provider:
</dt>
<dd>the local AS is a transit Provider provider of the remote AS;</t>
          <t>Customer - the AS;
</dd>

<dt>Customer:
</dt>
<dd>the local AS is a transit Customer customer of the remote AS;</t>
          <t>RS - AS;
</dd>

<dt>RS:
</dt>
<dd> the local AS is a Route Server (usually at an Internet exchange point) point), and the remote AS is its RS-Client;</t>
          <t>RS-Client - the RS-Client;
</dd>

<dt>RS-Client:
</dt>
<dd>the local AS is a client of an RS and the RS is the remote AS;</t>
          <t>Peer - the AS; and
</dd>

<dt>Peer:
</dt>
<dd>the local and remote ASes are Peers (i.e., have a lateral peering relationship).</t>
        </list>
      </t> relationship).
</dd>

</dl>

<section anchor="capability" title="BGP anchor="capability">
        <name>BGP Role Capability"> Capability</name>
        <t>
          The BGP Role Capability is defined as follows:
          <list style="symbols">
            <t>Code - 9</t>
            <t>Length - 1 (octet)</t>
            <t>Value - integer
        </t>
	<dl>
	  <dt>Code:
	  </dt>
	  <dd>9
	  </dd>

	  	  <dt>Length:
	  </dt>
	  <dd>1 (octet)
	  </dd>

	  	  <dt>Value:
	  </dt>
	  <dd>integer corresponding to the speaker's BGP Role (see <xref target="values"/>).</t>
          </list>
        </t>
        <texttable anchor="values" title="Predefined
target="values"/>)
	  </dd>
</dl>

<table anchor="values">
          <name>Predefined BGP Role Values" suppress-title="false">
          <ttcol align="center">Value</ttcol>
          <ttcol Values</name>
          <thead>
            <tr>
              <th align="center">Value</th>
              <th align="left">Role name (for the local AS)</ttcol>
          <c>0</c>
          <c>Provider</c>
          <c>1</c>
          <c>RS</c>
          <c>2</c>
          <c>RS-Client</c>
          <c>3</c>
          <c>Customer</c>
          <c>4</c>
          <c>Peer AS)</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="center">0</td>
              <td align="left">Provider</td>
            </tr>
            <tr>
              <td align="center">1</td>
              <td align="left">RS</td>
            </tr>
            <tr>
              <td align="center">2</td>
              <td align="left">RS-Client</td>
            </tr>
            <tr>
              <td align="center">3</td>
              <td align="left">Customer</td>
            </tr>
            <tr>
              <td align="center">4</td>
              <td align="left">Peer (i.e., Lateral Peer)</c>
          <c>5-255</c>
          <c>Unassigned</c>
        </texttable> Peer)</td>
            </tr>
            <tr>
              <td align="center">5-255</td>
              <td align="left">Unassigned</td>
            </tr>
          </tbody>
        </table>
        <t>
          If the BGP Role is locally configured, the eBGP speaker MUST <bcp14>MUST</bcp14> advertise the BGP Role Capability in the BGP OPEN message.
          An eBGP speaker MUST NOT <bcp14>MUST NOT</bcp14> advertise multiple versions of the BGP Role Capability.
          The error handling when multiple BGP Role Capabilities are received is described in <xref target="correctness"/>.
        </t>
      </section>
      <section anchor="correctness" title="Role Correctness"> anchor="correctness">
        <name>Role Correctness</name>
        <t>
          <xref target="capability"/> described describes how the BGP Role encodes the relationship on each eBGP session between autonomous systems (ASes). ASes.
        </t>

        <t>
          The mere receipt of the BGP Role Capability does not automatically guarantee the Role agreement between two eBGP neighbors.
          If the BGP Role Capability is advertised, and one is also received from the peer, the Roles MUST <bcp14>MUST</bcp14> correspond to the relationships in Table 2. <xref target="allowed"/>.

          If the Roles do not correspond, the BGP speaker MUST <bcp14>MUST</bcp14> reject the connection using the Role Mismatch Notification (code 2, subcode TBD). 11).
        </t>
        <texttable anchor="allowed" title="Allowed
        <table anchor="allowed">
          <name>Allowed Pairs of Role Capabilities" suppress-title="false">
          <ttcol Capabilities</name>
          <thead>
            <tr>
              <th align="left">Local AS Role</ttcol>
          <ttcol Role</th>
              <th align="left">Remote AS Role</ttcol>
          <c>Provider</c>
          <c>Customer</c>

          <c>Customer</c>
          <c>Provider</c>

          <c>RS</c>
          <c>RS-Client</c>

          <c>RS-Client</c>
          <c>RS</c>

          <c>Peer</c>
          <c>Peer</c>
        </texttable> Role</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">Provider</td>
              <td align="left">Customer</td>
            </tr>
            <tr>
              <td align="left">Customer</td>
              <td align="left">Provider</td>
            </tr>
            <tr>
              <td align="left">RS</td>
              <td align="left">RS-Client</td>
            </tr>
            <tr>
              <td align="left">RS-Client</td>
              <td align="left">RS</td>
            </tr>
            <tr>
              <td align="left">Peer</td>
              <td align="left">Peer</td>
            </tr>
          </tbody>
        </table>
        <t>
          For backward compatibility, if the BGP Role Capability is sent but one is not received, the BGP Speaker SHOULD <bcp14>SHOULD</bcp14> ignore the absence of the BGP Role Capability and proceed with session establishment.
          The locally configured BGP Role is used for the procedures described in <xref target="prevention_attribute"/>.
        </t>
        <t>
          An operator may choose to apply a "strict mode" in which the receipt of a BGP Role Capability from the remote AS is required.
          When operating in the "strict mode", if the BGP Role Capability is sent, sent but one is not received, then the connection is rejected using the Role Mismatch Notification (code 2, subcode TBD). 11). See comments in <xref target="Security"/>.
        </t>
        <t>
          If an eBGP speaker receives multiple but identical BGP Role Capabilities with the same value in each, then the speaker considers them to be a single BGP Role Capability and proceeds <xref target="RFC5492"/>.
          If multiple BGP Role Capabilities are received and not all of them have the same value, then the BGP speaker MUST <bcp14>MUST</bcp14> reject the connection using the Role Mismatch Notification (code 2, subcode TBD). 11).
        </t>
        <t>
          The BGP Role value for the local AS (in conjunction with the OTC Attribute in the received UPDATE message) is used in the route leak prevention and detection procedures described in <xref target="prevention_attribute"/>.
        </t>
      </section>
    </section>
    <section anchor="prevention_attribute" title="BGP anchor="prevention_attribute">
      <name>BGP Only to Customer (OTC) Attribute"> Attribute</name>
      <t>
        The Only to Customer (OTC) OTC Attribute is an optional transitive path attribute Path Attribute of the UPDATE message with Attribute Type Code 35 and a length of 4 octets.
        The purpose of this attribute is to enforce that once a route is sent to a Customer, a Peer, or an RS-Client (see definitions in <xref target="defs"/>), it will subsequently go only to the Customers.
        The attribute value is an AS number (ASN) determined by the procedures described below.
      </t>
      <t>
        The following ingress procedure applies to the processing of the OTC Attribute on route receipt:
        <list style="numbers">
          <t>
      </t>
      <ol spacing="normal" type="1"><li>
            If a route with the OTC Attribute is received from a Customer or an RS-Client, then it is a route leak and MUST <bcp14>MUST</bcp14> be considered ineligible (see <xref target="terminology"/>).
          </t>
          <t>
          </li>
        <li>
            If a route with the OTC Attribute is received from a Peer (i.e., remote AS with a Peer Role) and the Attribute has a value that is not equal to the remote (i.e., Peer's) AS number, then it is a route leak and MUST <bcp14>MUST</bcp14> be considered ineligible.
          </t>
          <t>
          </li>
        <li>
            If a route is received from a Provider, a Peer, or RS, an RS and the OTC Attribute is not present, then it MUST <bcp14>MUST</bcp14> be added with a value equal to the AS number of the remote AS.
          </t>
        </list>
      </t>
          </li>
      </ol>
      <t>
        The following egress procedure applies to the processing of the OTC Attribute on route advertisement:
        <list style="numbers">
          <t>
      </t>
      <ol spacing="normal" type="1"><li>
            If a route is to be advertised to a Customer, a Peer, or an RS-Client (when the sender is an RS), and the OTC Attribute is not present, then when advertising the route, an OTC Attribute MUST <bcp14>MUST</bcp14> be added with a value equal to the AS number of the local AS.
          </t>
          <t>
          </li>

        <li>
            If a route already contains the OTC Attribute, it MUST NOT <bcp14>MUST NOT</bcp14> be propagated to Providers, Peers, or RS(s).
          </t>
        </list>
      </t> RSes.
          </li>
      </ol>
      <t>
        The above-described procedures provide both leak prevention for the local AS and leak detection and mitigation multiple hops away.

        In the case of prevention at the local AS, the presence of an OTC Attribute indicates to the egress router that the route was learned from a Peer, a Provider, or an RS, and it can be advertised only to the customers. Customers.
        The same OTC Attribute which that is set locally also provides a way to detect route leaks by an AS multiple hops away if a route is received from a Customer, a Peer, or an RS-Client.
        For example, if an AS sets the OTC Attribute on a route sent to a Peer and the route is subsequently received by a compliant AS from a Customer, then the receiving AS detects (based on the presence of the OTC Attribute) that the route is a leak.
      </t>
      <t>
        The OTC Attribute might be set at the egress of the remote AS or at the ingress of the local AS, i.e., if the remote AS is non-compliant with this specification, then the local AS will have to set the OTC Attribute if it is absent.
        In both scenarios, the OTC value will be the same.
        This makes the scheme more robust and benefits early adopters.
      </t>
      <t>
The OTC Attribute is considered malformed if the length value is not 4. An UPDATE message with a malformed OTC Attribute SHALL <bcp14>SHALL</bcp14> be handled using the approach of "treat-as-withdraw" <xref target="RFC7606"/>.
      </t>
      <t>
        The BGP Role negotiation and OTC Attribute based OTC-Attribute-based procedures specified in this document are NOT RECOMMENDED <bcp14>NOT RECOMMENDED</bcp14> to be used between autonomous systems in an AS Confederation <xref target="RFC5065"/>.
        If an OTC Attribute is added on egress from the AS Confederation, its value MUST <bcp14>MUST</bcp14> equal the AS Confederation Identifier.
        Also, on egress from the AS Confederation, an UPDATE MUST NOT <bcp14>MUST NOT</bcp14> contain an OTC Attribute with a value corresponding to any Member-AS Number other than the AS Confederation Identifier.
      </t>
      <t>
        The procedures specified in this document in scenarios that use private AS numbers behind an Internet-facing ASN (e.g., a data center data-center network <xref target="RFC7938"/> or stub customer) may be used, but any details are outside the scope of this document.
        On egress from the Internet-facing AS, the OTC Attribute MUST NOT <bcp14>MUST NOT</bcp14> contain a value other than the Internet-facing ASN.
      </t>
      <t>
        Once the OTC Attribute has been set, it MUST <bcp14>MUST</bcp14> be preserved unchanged (this also applies to an AS Confederation).
      </t>

      <t>
        The described ingress and egress procedures are applicable only for the address families AFI 1 (IPv4) and AFI 2 (IPv6) with SAFI 1 (unicast) in both cases and MUST NOT <bcp14>MUST NOT</bcp14> be applied to other address families by default.
        The operator MUST NOT <bcp14>MUST NOT</bcp14> have the ability to modify the procedures defined in this section.
      </t>
    </section>

    <section anchor="considerations" title="Additional Considerations"> anchor="considerations">
      <name>Additional Considerations</name>
      <t>
        Roles MUST NOT <bcp14>MUST NOT</bcp14> be configured on an eBGP session with a Complex peering relationship.
        If multiple eBGP sessions can segregate the Complex peering relationship into eBGP sessions with normal peering relationships, BGP Roles SHOULD <bcp14>SHOULD</bcp14> be used on each of the resulting eBGP sessions.
      </t>
      <t>
        An operator may want to achieve an equivalent outcome by configuring policies on a per-prefix basis to follow the definitions of peering relations as described in <xref target="defs"/>.
        However, in this case, there are no in-band measures to check the correctness of the per-prefix peering configuration.
      </t>
      <t>
        The incorrect setting of BGP Roles and/or OTC Attributes may affect prefix propagation.
        Further, this document does not specify any special handling of an incorrect AS number in the OTC Attribute.
      </t>
      <t>
        In AS migration scenarios <xref target="RFC7705"/>, a given router may represent itself as any one of several different ASes.
        This should not be a problem since the egress procedures in <xref target="prevention_attribute"/> specify that the OTC Attribute is to be attached as part of route transmission.
        Therefore, a router is expected to set the OTC value equal to the ASN it is currently representing itself as.
      </t>
      <t>
Section 6 of
<xref target="RFC7606"/> target="RFC7606" sectionFormat="of" section="6"/> documents possible negative impacts of "treat-as-withdraw" behavior.  Such negative impacts may include forwarding loops or blackholes. dropped traffic. It also discusses debugging considerations related to this behavior.
      </t>
    </section>
    <section anchor="IANA" title="IANA Considerations"> anchor="IANA">
      <name>IANA Considerations</name>

      <t>
        IANA has registered a new BGP Capability (<xref target="capability"/>) in the "Capability Codes" registry's registry within the "IETF Review" range <xref target="RFC5492"/>.
        The description for the new capability is "BGP Role".
        IANA has assigned the value 9 [to be removed upon publication: https://www.iana.org/assignments/capability-codes/capability-codes.xhtml]. 9.
        This document is the reference for the new capability.
      </t>

      <t>
        The BGP Role capability includes a Value field, for which
	IANA is requested to create has created and maintain now maintains a new sub-registry subregistry called "BGP Role Value" in within the Capability Codes "Capability Codes" registry.
        Assignments consist of Registrations should include a Value value, a role name, and a corresponding Role name.
        Initially, this registry is reference to be populated with the data contained in <xref target="values"/> found defining document. IANA has registered the values in <xref target="capability"/>. target="role-table"/>. Future assignments may be made by the "IETF Review" policy as defined in <xref target="RFC8126"/>. The registry is as shown in <xref target="role-table"/>.
       </t>
      <texttable anchor="role-table" title="IANA
      <table anchor="role-table">
        <name>IANA Registry for BGP Role" suppress-title="false">
        <ttcol align="center">Value</ttcol>
        <ttcol Role</name>
        <thead>
          <tr>
            <th align="center">Value</th>
            <th align="left">Role name (for the local AS)</ttcol>
        <ttcol align="center">Reference</ttcol>

        <c>0</c>
        <c>Provider</c>
        <c>This document</c>
        <c>1</c>
        <c>RS</c>
        <c>This document</c>
        <c>2</c>
        <c>RS-Client</c>
        <c>This document</c>
        <c>3</c>
        <c>Customer</c>
        <c>This document</c>
        <c>4</c>
        <c>Peer AS)</th>
            <th align="center">Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="center">0</td>
            <td align="left">Provider</td>
            <td align="center">This document</td>
          </tr>
          <tr>
            <td align="center">1</td>
            <td align="left">RS</td>
            <td align="center">This document</td>
          </tr>
          <tr>
            <td align="center">2</td>
            <td align="left">RS-Client</td>
            <td align="center">This document</td>
          </tr>
          <tr>
            <td align="center">3</td>
            <td align="left">Customer</td>
            <td align="center">This document</td>
          </tr>
          <tr>
            <td align="center">4</td>
            <td align="left">Peer (i.e., Lateral Peer)</c>
        <c>This document</c>
        <c>5-255</c>
        <c>To Peer)</td>
            <td align="center">This document</td>
          </tr>
          <tr>
            <td align="center">5-255</td>
            <td align="left">To be assigned by IETF Review </c>
	<c/>
      </texttable> </td>
            <td align="center"/>
          </tr>
        </tbody>
      </table>
      <t>
        IANA has registered a new OPEN Message Error subcode named the "Role Mismatch" (see <xref target="correctness"/>) in the OPEN "OPEN Message Error subcodes subcodes" registry.
        IANA has assigned the value 11 [to be removed upon publication: https://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-parameters-6]. 11. This document is the reference for the new subcode.
      </t>
      <t>
Due

      <t>Due to improper use of the values 8, 9, and 10 in the OPEN Message Error subcodes registry, this document requested IANA to mark these values as "Deprecated". 10, IANA has marked values 8-10 as "Deprecated" in
      the OPEN "OPEN Message Error subcodes subcodes" registry.  This document is listed as
      the reference.
      </t> reference.</t>
      <t>
        IANA has also registered a new path attribute Path Attribute named "Only to Customer (OTC)" (see <xref target="prevention_attribute"/>) in the "BGP Path Attributes" registry.
        IANA has assigned code value 35 [To be removed upon publication: http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#bgp-parameters-2]. 35.
        This document is the reference for the new attribute.
      </t>
    </section>
    <section anchor="Security" title="Security Considerations"> anchor="Security">
      <name>Security Considerations</name>
      <t>
        The security considerations of BGP (as specified in <xref target="RFC4271"/> and <xref target="RFC4272"/>) apply.
      </t>
      <t>
        This document proposes a mechanism using that uses the BGP Role for the prevention and detection of route leaks that are the result of BGP policy misconfiguration.
        A misconfiguration of the BGP Role may affect prefix propagation.
        For example, if a downstream (i.e., towards a Customer) peering link were misconfigured with a Provider or Peer Role, this will it would limit the number of prefixes that can be advertised in this direction.
        On the other hand, if an upstream provider were misconfigured (by a local AS) with the Customer Role, this it may result in propagating routes that are received from other Providers or Peers.
        But the BGP Role negotiation and the resulting confirmation of Roles make such misconfigurations unlikely.
      </t>
      <t>
        Setting the strict mode of operation for BGP Role negotiation as the default may result in a situation where the eBGP session will not come up after a software update.
        Implementations with such default behavior are strongly discouraged.
      </t>
      <t>
        Removing the OTC Attribute or changing its value can limit the opportunity for route leak detection.
        Such activity can be done on purpose as part of an on-path attack.
        For example, an AS can remove the OTC Attribute on a received route and then leak the route to its transit provider.
        This kind of threat is not new in BGP BGP, and it may affect any Attribute (Note: (note that BGPsec <xref target="RFC8205"/> offers protection only for the AS_PATH Attribute).
      </t>
      <t>
        Adding an OTC Attribute when the route is advertised from Customer to Provider will limit the propagation of the route.
        Such a route may be considered as ineligible by the immediate Provider or its Peers or upper layer upper-layer Providers.
        This kind of OTC Attribute addition is unlikely to happen on the Provider side because it will limit the traffic volume towards its Customer.
        On the Customer side, adding an OTC Attribute for traffic engineering traffic-engineering purposes is also discouraged because it will limit route propagation in an unpredictable way.
      </t>
    </section>
  </middle>
  <back>
    <references title="Normative References">
      &RFC2119;
      &RFC4271;
      &RFC5065;
      &RFC5492;
      &RFC7606;
      &RFC7908;
      &RFC8126;
      &RFC8174;
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4271.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5065.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5492.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7606.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7908.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>

    <references title="Informative References">
      &RFC8205;
      &RFC4272;
      &RFC7938;
      &RFC7705;
      <references>
        <name>Informative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8205.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4272.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7938.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7705.xml"/>

        <reference anchor="Gao" anchor="GAO-REXFORD" target="https://ieeexplore.ieee.org/document/974523">
          <front>
            <title>Stable Internet routing without global coordination</title>
            <author initials="L." surname="Gao">
          </author>
            <author initials="J." surname="Rexford">
          </author>
            <date month='December' year='2001' /> month="December" year="2001"/>
          </front>
        <seriesInfo name='' value='IEEE/ACM
	  <refcontent>IEEE/ACM Transactions on Networking, Volume 9, Issue 6, pp 689-692, DOI 10.1109/90.974523' /> pp. 689-692
	  </refcontent>
          <seriesInfo name="DOI" value="10.1109/90.974523"/>
       </reference>

      </references>
    </references>
    <section title="Acknowledgments" numbered="no"> numbered="false">
      <name>Acknowledgments</name>
      <t>
        The authors wish to thank Alvaro Retana, Bruno Decraene, Jeff Haas, John Scudder, Sue Hares, Ben Maddison, Andrei Robachevsky, Daniel Ginsburg, Ruediger Volk, Pavel Lunin, Gyan Mishra, and Ignas Bagdonas <contact fullname="Alvaro Retana"/>, <contact fullname="Bruno Decraene"/>, <contact fullname="Jeff Haas"/>, <contact fullname="John Scudder"/>, <contact fullname="Sue Hares"/>, <contact fullname="Ben Maddison"/>, <contact fullname="Andrei Robachevsky"/>, <contact fullname="Daniel Ginsburg"/>, <contact fullname="Ruediger Volk"/>, <contact fullname="Pavel Lunin"/>, <contact fullname="Gyan Mishra"/>, and <contact fullname="Ignas Bagdonas"/> for review, their reviews, comments, and suggestions during the course of this work.  Thanks are also due to many IESG reviewers whose comments greatly helped improve the clarity, accuracy, and presentation in the document.
      </t>
    </section>
    <section title="Contributors" numbered="no">
      <figure><artwork><![CDATA[

Brian Dickson
Independent
Email: brian.peter.dickson@gmail.com

Doug Montgomery
USA numbered="false">
      <name>Contributors</name>

 <author fullname="Brian Dickson" initials="B" surname="Dickson">
      <organization>Independent</organization>
      <address>
        <email>brian.peter.dickson@gmail.com</email>
      </address>
 </author>

 <author fullname="Doug Montgomery" initials="D" surname="Montgomery">
      <organization>USA National Institute of Standards and Technology
Email: dougm@nist.gov

      ]]></artwork></figure> Technology</organization>
      <address>
        <email>dougm@nist.gov</email>
      </address>
 </author>

    </section>
  </back>
</rfc>