<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
<!ENTITY I-D.ietf-sidrops-aspa-verification SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-sidrops-aspa-verification.xml">

<!ENTITY I-D.ietf-sidrops-aspa-profile SYSTEM "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-sidrops-aspa-profile.xml">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.39 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-zhang-sidrops-aspa-egress-04" category="std" consensus="true" submissionType="IETF" version="3">
  <!-- xml2rfc v2v3 conversion 3.18.0 -->
  <front>
    <title abbrev="ASPA-based AS_PATH Verification for BGP Export">ASPA-based AS_PATH Verification for BGP Export</title>
    <!--  [REPLACE/DELETE] abbrev. The abbreviated title is required if the full title is longer than 39 characters -->

    <seriesInfo name="Internet-Draft" value="draft-zhang-sidrops-aspa-egress-04"/>
   

    <author initials="J." surname="Zhang" fullname="Jia Zhang">
        <organization>Zhongguancun Laboratory</organization>
        <address>
          <postal>
            <city>Beijing</city>
            <country>China</country>
          </postal>
          <email>zhangj@mail.zgclab.edu.cn</email>
        </address>
      </author>

    <author initials="Y." surname="Wang" fullname="Yangyang Wang">
        <organization>Tsinghua University</organization>
        <address>
          <postal>
            <city>Beijing</city>
            <country>China</country>
          </postal>
          <email>wangyy@cernet.edu.cn</email>
        </address>
      </author>
    
    <author initials="M." surname="Matejka" fullname="Maria Matejka">
        <organization>CZ.NIC</organization>
        <address>
          <postal>
            <country>Czechia</country>
          </postal>
          <email>maria.matejka@nic.cz</email>
        </address>
      </author>
    
    <author initials="M." surname="Xu" fullname="Mingwei Xu">
        <organization>Tsinghua University</organization>
        <address>
          <postal>
            <city>Beijing</city>
            <country>China</country>
          </postal>
          <email>xmw@cernet.edu.cn</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>
     <author initials="N." surname="Geng" fullname="Nan Geng">
        <organization>Huawei</organization>
        <address>
          <postal>
            <city>Beijing</city>
            <country>China</country>
          </postal>
          <email>gengnan@huawei.com</email>
        </address>
      </author>
  

    <date year="2026"/>
    <!-- On draft subbmission:
         * If only the current year is specified, the current day and month will be used.
         * If the month and year are both specified and are the current ones, the current day will
           be used
         * If the year is not the current one, it is necessary to specify at least a month and day="1" will be used.
    -->

    <area>Operations and Management Area (OPS)</area>
    <workgroup>SIDR Operations Working Group</workgroup>
    <!-- "Internet Engineering Task Force" 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 RFC Series. -->

    <keyword>BGP</keyword>
    <keyword>ASPA</keyword>
    <keyword>Route leak</keyword>
    <!-- [REPLACE/DELETE]. Multiple allowed.  Keywords are incorporated into HTML output files for 
         use by search engines. -->

    <abstract>
      <t>This document describes AS_PATH verification based on Autonomous System Provider Authorization (ASPA) for egress eBGP speakers.
      ASPA is a Resource Public Key Infrastructure (RPKI) object that allows an AS to register its transit provider ASes.
      Performing ASPA-based AS_PATH verification at egress can prevent the propagation of route leaks to external peers, check for local misconfigurations, and help detect potential ASPA registration errors.
      This approach complements ingress-side verification; it ensures coverage should ASPA deployment be absent at the ingress eBGP router of the AS.   
      </t>
    </abstract>
 
  </front>

  <middle>
    
    <section>
      <name>Introduction</name>
        <t>Autonomous System Provider Authorization (ASPA) objects in the Resource Public Key Infrastructure (RPKI) can be used to verify BGP AS_PATH for detection and mitigation of route leaks 
            and certain prefix hijacks involving forged origins or forged path-segments <xref target="I-D.ietf-sidrops-aspa-verification"/>. The ASPA object profile is defined in <xref target="I-D.ietf-sidrops-aspa-profile"/>. </t>

        <t> The procedures described in Section 5 of <xref target="I-D.ietf-sidrops-aspa-verification"/> perform ASPA-based BGP AS_PATH verification at eBGP ingress.
        Performing BGP AS_PATH verification at eBGP egress (this document) can be beneficial as follows: (1) Ensure coverage should ASPA deployment be absent at the ingress eBGP router of the AS, and 
        (2) Check whether the AS_PATH (with the local AS added) as received by the eBGP neighbor at egress router would be Invalid and, if so, avoid sending the BGP Update.
        The egress AS_PATH verification inherently detects and alerts the local AS operator if there were any eBGP peering misconfiguration or error in the ASPA registration of the eBGP neighbor on the ingress side.
        </t>
        
        <t>This document does not change the semantics or procedures of ASPA-based BGP AS_PATH verification defined in <xref target="I-D.ietf-sidrops-aspa-verification"/>.
        It explains important use cases and specifics of correct implementation 
            of ASPA-based path verification at eBGP egress, as <xref target="RFC8893"/> did with RPKI route origin validation (RPKI-ROV) for BGP export.
            The verification procedure at eBGP egress is a little different from the procedure at the eBGP ingress.
        </t>      
      <section>
        <name>Requirements Language</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>
      <!-- [CHECK] The 'Requirements Language' section is optional -->
    </section>
    
  <section>
    <name>Suggested Reading</name>
    <t>
      It is assumed that the reader understands BGP<xref target="RFC4271"/>, RPKI<xref target="RFC6480"/>,  
      ASPA object profile<xref target="I-D.ietf-sidrops-aspa-profile"/>, 
      ASPA-based BGP AS_PATH verification<xref target="I-D.ietf-sidrops-aspa-verification"/>, and RPKI-ROV for BGP export<xref target="RFC8893"/>.
    </t>
  </section>

    <section anchor="method">
      <name>Procedure of ASPA-based AS_PATH Verification at eBGP Egress</name>

      <t>When a BGP speaker advertises a route to an external peer through eBGP egress, the BGP speaker prepends its own AS number to the AS_PATH of 
        the route, and performs ASPA-based AS_PATH verification before sending the route to the external peer. </t>

        <t>Suppose the BGP router is at AS X, and its external peer is at AS Y, and the AS_PATH P of the route to be advertised to external peer 
            by the BGP speaker is represented by {AS X, AS(N), ..., AS(2), AS(1)}, where AS(1) is the origin AS, and AS X is the local AS number 
            added by the BGP speaker of AS X at eBGP egress (see <xref target="fig1"/>).
            In this AS_PATH, the AS number (ASN) used for AS X MUST be the ASN of the router's BGP configuration (see <xref target="RFC8481"/> <xref target="RFC8893"/>).
        </t>
        <figure anchor="fig1" align="left" suppress-title="false" pn="figure-1">
            <name slugifiedName="secnario">Illustration of the eBGP egress.</name>
            <artwork align="left" name="" type="" alt="">
    <![CDATA[
                        +------------------------+              
                        |          AS X          |              
                        |                        |              
        +-------+  eBGP |  +----+  iBGP  +----+  | eBGP  +--------+
        | AS(N) |-------->>| R1 |------>>| R2 |-------->>|  AS Y  |
        +-------+       | /+----+        +----+\ |       +--------+
                        |/                      \|                        
                        /------------------------\              
           eBGP ingress/                          \eBGP egress         
    ]]>
    </artwork>
          </figure>   
        
        
        <t>The method of ASPA-based AS_PATH verification at the eBGP egress of the BGP speaker is described as follows:</t>
        <ol>
        <li>Regard the external neighbor AS Y as the virtual receiving/validating AS point. </li>

        <li>The BGP roles of AS X and AS Y, including Customer, Provider, Route Server (RS), Route Server Client (RS-client) and Peer, are defined in <xref target="RFC9234"/>, and they can be 
            configured locally and used for the path verification.</li>

        <li>If AS X is a Customer or Peer to AS Y, or AS Y is a (transparent or non-transparent) Route Server (RS) and AS X is an RS-client,
            or, AS Y is an RS-client and AS X is a (transparent or non-transparent) RS, 
            use the algorithm for upstream paths (Sec. 5.4 of <xref target="I-D.ietf-sidrops-aspa-verification"/>) to verify the AS_PATH P. </li>

        <li>If AS X is a Provider to AS Y, use the algorithm for downstream paths
            (Sec. 5.5 of <xref target="I-D.ietf-sidrops-aspa-verification"/>) to verify the AS_PATH P.</li>
        </ol>

      <section anchor = "otc"> <name>Utility of Only to Customer (OTC) Attribute</name>
       <t>
         The egress verification procedure described above can produce incorrect results at R2 in some cases (see <xref target="fig1"/>). This is because at R1 there is direct knowledge (based on local configuration) of AS X's peering relation with the neighbor AS(N) while at R2 the procedure must rely on the ASPA data. But the ASPA data may be absent or insufficient. For example, let the  AS(N) to AS X relationship be complex consisting of a C2P session and a p2p session. AS(N) has an ASPA that attests that AS X is a provider (per ASPA specification). Let the AS X to AS Y relationship be C2P or p2p. Then for a route originated by AS(N) and sent to AS X on the p2p session, the egress verification at R2 produces a Valid outcome. Only R1 knows that the route made ingress on a p2p session; R2 does not. In order that R2 does not forward the route to AS Y, it cannot rely on the outcome of the egress verification in this example. It is imperative that R1 attaches the Only to Customer (OTC) Attribute <xref target="RFC9234"/> to the route on ingress. Even if the ingress router R1 is not upgraded to perform ASPA verification (partial deployment of ASPA within an AS), it must be upgraded to do OTC (or minimally an intra-AS BGP Community that emulates the OTC Attribute for route leak prevention).
       </t>
      </section>
      <section>
      <name>Consideration of Complex BGP Sessions</name>
       <t>
          There can be a complex peering relationship on either side of AS X (with AS(N) or with AS Y).  
       </t>
        <t>
          If multiple eBGP sessions can segregate the Complex peering relationship into eBGP sessions with normal peering relationships the receiving/verifying AS SHOULD select the appropriate algorithm (for upstream or downstream paths per Sec. 5.4 or Sec. 5.5, respectively, in <xref target="I-D.ietf-sidrops-aspa-verification"/>) for each of the normal sessions based on its peering relation type.
        </t>
        <t>
          If a Complex peering relation cannot be segregated (i.e., when a Complex BGP relationship occurs within one single BGP session), an operator may want to achieve an equivalent outcome by applying an appropriate algorithm (for upstream or downstream paths) on a per-prefix basis corresponding to the peering relation for the prefix.
          If this option is not feasible, then an operator MAY apply the algorithm for downstream paths to avoid false positive outcomes.
        </t>

      </section>
      </section>

      <section>
      <name>Optimizations</name>
       <t>
       There would be concerns about the extra workload or redundancy of processing due to performing verification at both ingress and egress. There should be some optimizations implemented or available for use when appropriate so that redundant processing can be minimized. Examples of optimizations are:
       </t>
       <ol>
         <li>
          Consider the full table is received from a provider at an un-upgraded ingress border router and the full tables are advertised to multiple customer ASes. Process egress ASPA verification centrally for all customer AS facing interfaces if possible and then push the verified full table to RIBs-out of all such interfaces. Significant egress ASPA processing savings can result by doing this.
         </li>
         <li>
          Network operators should have a switch that they can use to turn off egress ASPA verification when it is appropriate. For example, when the adoption of ingress ASPA verification + OTC (or an intra-AS BGP community like OTC) is complete on all their border routers.
         </li>
         <li>
          For routes that have OTC (or an intra-AS BGP community like OTC) attached when received from iBGP at an egress router, then the egress ASPA verification must not be performed on them if the egress router is connected only to provider ASes and/or lateral peer ASes.
         </li>
       </ol>
      </section>

    <section>
    <name>Necessity and Beneficial Cases</name>
    <t>Performing ASPA-based egress AS_PATH verification allows an eBGP router, in some cases, to prevent local route leaks and to help diagnose local peering misconfigurations and ASPA registration errors.
    The cases where these benefits may not materialize are: (1) eBGP peering relations are complex, or (2) the eBGP neighbor on the ingress side has no ASPA registration, 
    or (3) the local AS is in an AS migration state.
    In the first and second cases, the egress ASPA algorithm (<xref target="method"/>) could produce a false negative result but never a false positive 
    and hence the behavior would be conservative (i.e., a valid route is not dropped). 
    When there is AS migration, it is necessary that the local AS has conveyed to its customer ASes all the relevant AS numbers (temporary as well as the global AS ID) for correct ASPA registrations.</t>
    <section>
    <name>Prevent Local Misconfigurations</name>
    <t>Egress AS_PATH verification will prevent misconfigurations of the egress router. If the local AS has multiple AS numbers, it is necessary to ensure 
    that the AS number added to the AS_PATH at the egress is correct and whether it could lead to neighbors validating it as Invalid. Additionally, the 
    local AS needs to check if any modifications to the AS_PATH in export policy are legitimate. Verification at the egress will prevent the local AS from 
    advertising routes with invalid AS_PATHs, allowing for quick detection of issues and correction of local configuration errors.</t>
    </section>
    <section>
    <name>Complementing the ASPA-based Ingress Verification Method</name>
    <t>Performing AS_PATH verification at the ingress can detect route leaks 
    in the routes received from eBGP neighbors, but additional measures are needed to prevent local route leaks.
    As discussed in <xref target="otc"/>), the OTC Attribute helps prevent local routes leaks .
    Egress ASPA verification can also detect some (but not all) local route leaks.</t>
    <!-- I am uncomfortable beating up on OTC here unnecessarily. This material below seems to do that and also has technical errors in the stements made. IMO, better to not include it. -->
    <!--
    <t>Even though OTC, defined in <xref target="RFC9234"/>, can address local route leaks, it is tightly coupled with BGP, which increases 
    the likelihood of configuration errors. In contrast, ASPA provides an out-of-band verification solution that decouples from BGP protocol configuration, 
    making the chances of simultaneous configuration errors much lower. 
    Additionally, ASPA has advantages in both security and operability. OTC lacks built-in tamper-proof mechanisms and integrity verification, leaving it 
    vulnerable to malicious attackers or misconfigurations. ASPA achieves secure verification through the distribution of resource certificates and authentication.
    In terms of operational complexity, OTC requires BGP role configuration per router per session, increasing configuration complexity. Furthermore, to 
    implement OTC as specified in <xref target="RFC9234"/>, both the local AS and remote peers need router updates, while ASPA only requires that neighbors 
    have records in ASPA for local verification.</t>
    -->
    </section>

    <section>
    <name>Detect ASPA Registration Errors</name>
    <t>If the local AS or customers have registration errors or omissions, they can be detected at the egress, allowing for 
    quick identification of the issue. This mainly includes the following two scenarios:</t>

      <t>(1) Case of local AS: If the local AS has omitted one or more providers in the Set of Provider ASes (SPAS) in its ASPA, the local AS may end up advertising routes with 
      ASPA-invalid AS_PATH to its customers.</t>

      <t>(2) Case of Customer AS: If a Customer of the local AS forgets to include the local AS in their SPAS, the local AS may end up advertising 
      their routes with ASPA-invalid AS_PATH to its neighbors.</t>

    <t>Performing AS_PATH verification at the egress could detect such registration errors immediately and point to its actual source clearly and noticeably; 
    otherwise, routes advertised by the local AS may be filtered by other ASes, leaving the local AS unaware of the issue.</t>
    </section>
    </section>

    <section anchor="operation">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Operational Considerations</name>
      <t>
         The peering relationships between the local AS and its external neighbor ASes, including Customer-Provider/Provider-Customer, Peer-Peer, 
         Route Server (RS) and RS-client, mutual-transit, are used in path verification procedures to determine whether upstream or downstream procedures 
         should be applied. There are the following possible ways to know the relations between the local AS and its external neighbor AS: (1) The first way 
         is to use the BGP Role Capabilities exchanged in the BGP OPEN message as specified in <xref target="RFC9234"/>; (2) The second way is to use ASPA objects 
         registered by the local AS and its external neighbor AS; (3) Another way is to use the local BGP peering configuration. 
<!-- IMO, the following is confusing. Let us delete it for now. I think RFC 9234 has talked about it. No neeed to rephrase. -->
<!--         
         When the relation of two neighboring 
         ASes is mutual-transit, they are Customers of each other in BGP roles. It can be confirmed by BGP roles advertised in the BGP OPEN message, or 
         configuration in local file. If a mutual-transit relation is identified as Cutomer-Provider, a false positive of route leak may be generated in path 
         verification.
-->
      </t>
    </section>


    <section anchor="Security">
      <!-- All drafts are required to have a security considerations section. See RFC 3552 for a guide. -->
      <name>Security Considerations</name>
      <t>
        The security considerations that apply to ASPA-based AS_PATH verification (see <xref target="I-D.ietf-sidrops-aspa-verification"/>) also apply to 
        the procedure described in this document.
      </t>
    </section>

    <section anchor="IANA">
    <!-- All drafts are required to have an IANA considerations section. See RFC 8126 for a guide.-->
      <name>IANA Considerations</name>
      <t>This document has no IANA actions</t>
    </section>
    

    
    <!-- NOTE: The Acknowledgements and Contributors sections are at the end of this template -->
  </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.8174.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.6480.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.4271.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8893.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.8481.xml"/>
        <xi:include href="https://www.rfc-editor.org/refs/bibxml/reference.RFC.9234.xml"/>

        &I-D.ietf-sidrops-aspa-profile;
        &I-D.ietf-sidrops-aspa-verification;

        
        <!-- The recommended and simplest way to include a well known reference -->

      </references>
 
    </references>
    
    
    <!--
    <section>
      <name>Appendix 1 [REPLACE/DELETE]</name>
      <t>This becomes an Appendix [REPLACE]</t>
    </section>
    -->

    <section anchor="Acknowledgements" numbered="false"> 
      <!-- [REPLACE/DELETE] an Acknowledgements section is optional -->
      <name>Acknowledgements</name>
      <t>The authors thank Nan Geng, Sriram Kotikalapudi and Randy Bush for their valuable suggestions and comments.</t>
    </section>

 <!--     <section anchor="Contributors" numbered="false">-->
      <!-- [REPLACE/DELETE] a Contributors section is optional -->
 <!--     <name>Contributors</name>
      <t>Thanks to all of the contributors. [REPLACE]</t>-->
      <!-- [CHECK] it is optional to add a <contact> record for some or all contributors -->
  <!--   </section>
-->


 </back>
</rfc>
