<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-chen-grow-enhanced-as-loop-detection-09"
     ipr="trust200902">
  <front>
    <title abbrev="Enhanced AS-Loop Detection">Enhanced AS-Loop Detection for
    BGP</title>

    <author fullname="Huanan Chen" initials="H. " surname="Chen">
      <organization>China Telecom</organization>

      <address>
        <postal>
          <street>109, West Zhongshan Road, Tianhe District</street>

          <city>Guangzhou</city>

          <code>510000</code>

          <country>China</country>
        </postal>

        <email>chenhuan6@chinatelecom.cn</email>
      </address>
    </author>

    <author fullname="Di Ma" initials="D." surname="Ma">
      <organization>ZDNS</organization>

      <address>
        <postal>
          <street>4 South 4th St. Zhongguancun</street>

          <city>Beijing</city>

          <region>Haidian</region>

          <code/>

          <country>China</country>
        </postal>

        <phone/>

        <facsimile/>

        <email>madi@zdns.cn</email>

        <uri/>
      </address>
    </author>

    <author fullname="Nan Geng" initials="N. " surname="Geng">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

          <country>China</country>
        </postal>

        <email>gengnan@huawei.com</email>
      </address>
    </author>

    <author fullname="Shunwan Zhuang" initials="S. " surname="Zhuang">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

          <country>China</country>
        </postal>

        <email>zhuangshunwan@huawei.com</email>
      </address>
    </author>

    <author fullname="Haibo Wang" initials="H. " surname="Wang">
      <organization>Huawei</organization>

      <address>
        <postal>
          <street>Huawei Bld., No.156 Beiqing Rd.</street>

          <city>Beijing</city>

          <code>100095</code>

          <country>China</country>
        </postal>

        <email>rainsword.wang@huawei.com</email>
      </address>
    </author>

    <date day="31" month="August" year="2026"/>

    <area>General</area>

    <workgroup>Global Routing Operations</workgroup>

    <abstract>
      <t>Misconfiguration and malicious manipulation of the BGP `AS_PATH`
      attribute can lead to route hijacking. This document proposes
      enhancements to BGP <xref target="RFC4271"/> inbound and outbound route
      processing when an AS loop is detected. This mechanism can be
      implemented directly on devices or deployed in a centralized
      architecture using the BGP Monitoring Protocol (BMP) <xref
      target="RFC7854"/>. These enhancements empower networks to quickly and
      accurately detect route hijacking and malicious path poisoning.</t>

      <t>Two implementation options are proposed: </t>

      <t><list style="numbers">
          <t>Local validation and checking directly on the routing device.</t>

          <t>Centralized data collection and analysis via a remote network
          controller or server.</t>
        </list></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 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">
      <t>In ordinary BGP operations, every AS announces route information with
      specific prefixes. However, neighboring ASes typically cannot validate
      the authenticity of this route information, leading them to either
      propagate it across the Internet or blindly discard AS-looped routes.
      This weak trust model allows forged route announcements to propagate
      undetected, representing a fundamental security vulnerability in BGP.
      Forged routes, whether generated by configuration errors or malicious
      attacks, can lead to large-scale network connectivity disruptions.</t>

      <t>In more severe scenarios, attackers exploit this BGP property to
      execute **AS-Path Poisoning** attacks. By inserting targeted transit or
      provider AS numbers into a forged `AS_PATH`, attackers attempt to make
      routes appear as though they legitimately traversed those ASes, or
      conversely, to prevent those ASes from accepting and carrying the
      route.</t>

      <t>Autonomous System Provider Authorization (ASPA) <xref
      target="I-D.ietf-sidrops-aspa-verification"/> provides a systematic,
      RPKI-based mechanism to verify the `AS_PATH` attribute of BGP routes.
      However, ASPA requires comprehensive infrastructure deployments across
      the routing ecosystem.</t>

      <t>This document proposes enhancing BGP inbound and outbound route
      processing upon detecting an AS loop to identify potential BGP hijacks
      immediately. By retaining and analyzing routes that trigger AS loop
      detection instead of silently discarding them, operators can gain
      immediate visibility into malicious activities without waiting for full
      global PKI infrastructure adoption. </t>

      <t/>
    </section>

    <section title="Terminology">
      <t>The following terminology is used in this document.</t>

      <t>AS: Autonomous System</t>

      <t>ASPA: Autonomous System Provider Authorization</t>

      <t>BGP: Border Gateway Protocol</t>

      <t>BGP hijacking : is the illegitimate takeover of groups of IP
      addresses by corrupting Internet routing tables maintained using the
      Border Gateway Protocol (BGP). (Sometimes referred to as prefix
      hijacking, route hijacking or IP hijacking)</t>

      <t>EBGP: External BGP</t>

      <t>ISP: Internet Service Provider</t>

      <t>BMP: BGP Monitoring Protocol</t>

      <t>ROA: Route Origin Authorization</t>

      <t/>
    </section>

    <section title="Forged AS_PATH Examples">
      <t/>

      <section title="AS Loop Detected at Inbound Processing">
        <t>The cases below illustrate scenarios where an upstream AS
        advertises an invalid AS_PATH to AS64596:</t>

        <t><list style="symbols">
            <t>Forged Case 1 (Origin Spoofing): An upstream AS of AS64596
            advertises a route with ASN 64596 forged as the origin AS in the
            AS_PATH.</t>

            <t>Forged Case 2 (Transit Spoofing): An upstream AS of AS64596
            advertises a route with ASN 64596 forged as a transit AS in the
            AS_PATH.</t>
          </list><figure align="left">
            <artwork><![CDATA[
   AS-Loop-Detection Applied Here:
   Discard AS-Loop routes directly if AS_PATH contains AS64596
                 |
                 |                                  x.y.z.0/24
                 v                                  Origin AS 64600
AS64595---AS64596---AS64597---AS64598---AS64599----AS64600
                    From AS64597, To AS64596:
                    Normal Case:
                    <-- x.y.z.0/24, AS-Path: 64597 64598 64599 64600

                    Forged Case 1:
                    <-- x.y.z.0/24, AS-Path: 64597 64596
                                        (Or: 64597 64598 64596 etc.)

                    Forged Case 2:
                    <-- x.y.z.0/24, AS-Path: 64597 64596 64600
                                        (Or: 64597 64596 64599 64600 etc.)

    Figure 1: BGP Inbound Route Processing in AS64596

]]></artwork>
          </figure>Upon receiving these updates, standard BGP implementations
        treat them as ordinary routing loops and silently discard them during
        the loop detection phase. In most Network Operating Systems (NOSes),
        such dropped routes are neither logged nor exposed via standard
        management interfaces, remaining visible only when debugging modes are
        enabled. By enhancing the inbound processing mechanism, AS64596 can
        proactively identify instances where its own ASN has been spoofed,
        preventing undetected routing anomalies or path manipulation. </t>

        <t/>
      </section>

      <section title="AS Loop Detected at Outbound Processing">
        <t>eBGP Split-Horizon is an optional policy mechanism wherein a BGP
        speaker suppresses route updates to a peer if that peer's AS is
        already present in the AS_PATH. In existing implementations, outbound
        BGP processing silently drops such updates once an AS loop is
        detected.</t>

        <t><list style="symbols">
            <t>Forged Case 3 (Outbound Origin Spoofing): An upstream AS of
            AS64597 advertises a route to AS64597 that forges ASN 64596 as the
            origin AS in the AS_PATH.</t>

            <t>Forged Case 4 (Outbound Transit Spoofing): An upstream AS of
            AS64597 advertises a route to AS64597 that forges ASN 64596 as a
            transit AS in the AS_PATH.</t>
          </list><figure align="left">
            <artwork><![CDATA[
   Split-Horizon Enabled & AS-Loop-Detection Applied Here:
   Discard AS-Loop routes directly if outbound AS_PATH contains AS64596
                    |
                    |                               x.y.z.0/24
                    v                               Origin AS 64600
AS64595---AS64596---AS64597---AS64598---AS64599----AS64600
                    From AS64597, To AS64596:
                    Normal Case:
                    <-- x.y.z.0/24, AS-Path: 64597 64598 64599 64600

                    Forged Case 3:
                    <-- x.y.z.0/24, AS-Path: 64597 64596
                                        (Or: 64597 64598 64596 etc.)

                    Forged Case 4:
                    <-- x.y.z.0/24, AS-Path: 64597 64596 64600
                                        (Or: 64597 64596 64599 64600 etc.)

    Figure 2: BGP Outbound Route Processing in AS64597

]]></artwork>
          </figure>When preparing outbound advertisements to AS64596, AS64597
        detects the presence of AS64596 in the AS_PATH and silently suppresses
        transmission. With enhanced outbound processing, AS64597 can recognize
        that AS64596 has been spoofed upstream. This allows network operators
        to identify malicious path poisoning or accidental loop creation
        before it impacts downstream connectivity. </t>

        <t/>
      </section>
    </section>

    <section title="Enhancement to BGP Inbound/Outbound Processing">
      <t/>

      <section title="Enhancement for AS Loop Detected at Inbound Processing">
        <t>While Route Origin Validation (ROV) <xref target="RFC6811"/> and
        ASPA verification <xref target="I-D.ietf-sidrops-aspa-verification"/>
        offer systematic protection against BGP route leaks and hijacks,
        conventional inbound processing drops AS-looped updates prior to
        applying validation checks. Consequently, routes matching Forged Cases
        1 and 2 are discarded prematurely.</t>

        <t>This document proposes intercepting and inspecting these looped
        updates before disposal. Additional security mechanisms (e.g., ROV or
        ASPA) can then be applied to evaluate whether the update represents a
        malicious attack or a configuration anomaly. The exact validation
        criteria and remediation actions are outside the scope of this
        document. </t>

        <t>Two deployment models are defined for inbound processing
        enhancements:</t>

        <t><list style="symbols">
            <t>Option 1 (On-Device Inspection): Perform local validation and
            security analysis directly on the router using local threat
            intelligence databases or cache instances.</t>

            <t>Option 2 (Centralized Telemetry): Export the intercepted
            AS-looped updates via the BGP Monitoring Protocol (BMP) to a
            remote network controller or collector for off-box analysis.</t>
          </list></t>

        <t/>
      </section>

      <section title="Enhancement for AS Loop Detected at Outbound Processing">
        <t>Egress ROV and ASPA checks can similarly prevent the propagation of
        hijacked routes. However, when eBGP Split-Horizon or outbound loop
        prevention is active, routes matching Forged Cases 3 and 4 are
        suppressed prior to outbound security validation. </t>

        <t>This document proposes extending outbound processing to capture
        suppressed updates for further security inspection. Evaluating these
        suppressed routes enables network operators to detect path poisoning
        aimed at deliberately blocking route propagation. </t>

        <t>Two deployment models are defined for outbound processing
        enhancements:</t>

        <t><list style="symbols">
            <t>Option 1 (On-Device Inspection): Evaluate outbound suppressed
            routes directly on the local router against configured policy or
            validation databases.</t>

            <t>Option 2 (Centralized Telemetry): Stream suppressed outbound
            update metadata via BMP to a centralized monitoring system or
            security platform for cross-network correlation.</t>
          </list></t>

        <t/>
      </section>
    </section>

    <section title="Centralized AS-Loop Detection for BGP">
      <t>Considering the scaling and management challenges associated with
      maintaining localized validation databases across distributed network
      elements, this section proposes a centralized telemetry framework. The
      approach leverages the BGP Monitoring Protocol (BMP) <xref
      target="RFC7854"/> to stream intercepted AS Path Looped UPDATE messages
      from monitored routing nodes to a centralized BMP server, enabling
      enterprise-wide or provider-wide attack detection and security
      analytics.</t>

      <t>BMP is widely deployed by Internet Content Providers (ICPs),
      Over-The-Top (OTT) service providers, and Tier-1/2 Carriers to monitor
      active BGP routing state, such as monitoring Adj-RIB-In <xref
      target="RFC7854"/> and Adj-RIB-Out <xref target="RFC8671"/>. This
      document extends the BMP Route Mirroring Message framework <xref
      target="RFC7854"/> to mirror UPDATE messages that trigger AS loop
      detection events to the BMP collector. </t>

      <t/>

      <section title="BMP Support for Monitoring AS Path Looped UPDATE Messages">
        <t>Per <xref target="RFC7854"/>, BMP Route Mirroring messages convey
        BGP UPDATE messages that have been discarded or modified due to errors
        (such as treat-as-withdraw <xref target="RFC7606"/>) for offline
        debugging and diagnostic analysis. This document extends Route
        Mirroring to mirror updates suppressed due to AS loop detection.</t>

        <t>This document defines a new code for the BMP Information TLV (Type
        1): </t>

        <t><list style="symbols">
            <t>Code = TBD: AS Path Looped. Indicates that the encapsulated BGP
            UPDATE message in the Route Mirroring message contains an AS loop
            involving the local AS (detected during either inbound or outbound
            processing).</t>
          </list></t>

        <t>The BMP payload structure follows standard RFC 7854 encapsulation:
        the Common BMP Header (Message Type = 6) and Per-Peer Header are
        immediately followed by an Information TLV (Type = 1) with Code = TBD
        (AS Path Looped), which precedes the BGP Message TLV (Type = 0)
        carrying the complete, unedited BGP UPDATE message.</t>

        <t><figure align="left">
            <artwork><![CDATA[ 
+---------------------------------------------------------------+
|         Common BMP Header (Message Type = 6)                  |
+---------------------------------------------------------------+
|                    Per peer Header                            |
+---------------------------------------------------------------+
| Information TLV (Type = 1) with Code = TBD: AS Path Looped    |
+---------------------------------------------------------------+
|         BGP Message TLV (Type = 0)                            |
+---------------------------------------------------------------+

Figure 3: AS Path Looped UPDATE Message Enclosed in BMP Route 
Mirroring  

]]></artwork>
          </figure></t>
      </section>

      <section title="Operational Application Example">
        <t>Figure 4 illustrates a centralized deployment workflow. When router
        R2 in AS64596 receives an UPDATE from an eBGP peer in AS64597 that
        contains AS64596 in the AS_PATH, the inbound AS loop detection logic
        triggers. Rather than silently dropping the update without a trace, R2
        encapsulates the UPDATE message inside a BMP Route Mirroring message
        carrying the "AS Path Looped" Information TLV and streams it to the
        centralized BMP server.</t>

        <t>An external security analyzer consumes the telemetry feed from the
        BMP server to perform real-time threat detection and route leak/hijack
        correlation. <figure align="left">
            <artwork><![CDATA[ 
                        +------------+                                    
                        | BMP server |                                    
                        |     +      |                                    
                        |  Analyzer  |                                    
                        +------+-----+                                    
   BMP Mirroring Message:      \                                          
   AS Path Looped Update Message\to BMP Server                                       
                                 \                                       
                                  \                                       
               ********************|****                                  
               *                   |   *                                  
               *          AS64596  |   *        "AS64597 Send Routes      
               *                   |   *  <----- to AS64596"              
  +-------+    *  +---+         +---+  *  +-------+                       
  +AS64595+-------+ R1+---------+ R2|-----+AS64597+---64598 64599 64600
  +-------+    *  +-+-+\        +---+  *  +-------+                       
               *    |   \\    //  |\   *                                  
               *    |     \\//    | \  *                                  
               *    |     //\     |  \ *      +-------+                   
               *    |   //   \\   |   \+------+AS64593+                   
               *    |  /       \  |    *      +-------+                   
  +-------+    *  +-+-+         +-+-+  *      +-------+                   
  +AS64594+----+--+ R3+---------+ R4+---------+AS64592+                   
  +-------+    *  +---+         +---+  *      +-------+                   
               *                       *                                  
               *************************                                  

Figure 4: Centralized AS-Loop Detection Architecture

]]></artwork>
          </figure></t>

        <t>To detect whether an AS loop indicates malicious AS_PATH forgery or
        legitimate topology traversal, the central analyzer evaluates the
        looped update against a local Autonomous System Relationship Database
        maintained by AS64596 (Figure 5). This database tracks peering
        arrangements (e.g., Customer-to-Provider (C2P), Peer-to-Peer (P2P),
        Provider-to-Customer (P2C), or Sibling-to-Sibling (S2S)).</t>

        <t><figure align="left">
            <artwork><![CDATA[ 
+--------------------------------------------------+
|   Neighboring AS  |  AS-relationship to AS64596  |
+--------------------------------------------------+
|   64592           |  P2P                         |
+--------------------------------------------------+
|   64593           |  S2S                         |
+--------------------------------------------------+
|   64594           |  C2P                         |
+--------------------------------------------------+
|   64595           |  P2C                         |
+--------------------------------------------------+
|   64597           |  P2P                         |
+--------------------------------------------------+
 
Figure 5: AS64596 Local AS-Relationship Database

]]></artwork>
          </figure></t>

        <t>When AS64596 appears as a transit AS within an intercepted AS_PATH,
        the path segment around the local AS exhibits the following
        structure:</t>

        <t>[... Other ASes ...], AS_Left, Local_AS (64596), AS_Right, [...
        Other ASes ...]</t>

        <t>The analyzer looks up `AS_Left` and `AS_Right` in the database to
        verify whether established business relationships authorize adjacency
        with `Local_AS`. If no valid relationship exists between `AS_Left` and
        `Local_AS`, or between `Local_AS` and `AS_Right`, the system
        identifies the route as a spoofed path or unauthorized route leak and
        initiates automated mitigation policies.</t>

        <t/>
      </section>
    </section>

    <section title="Benefits">
      <t>Enhancing BGP inbound and outbound processing to intercept, log, and
      stream AS-looped UPDATE messages yields substantial security and
      operational benefits:</t>

      <t><list style="symbols">
          <t>Immediate Threat Visibility: Eliminates the telemetry blind spot
          caused by silent drops during routine loop checks, providing
          real-time awareness of active AS_PATH forgery and path poisoning
          attacks.</t>

          <t>Incremental Deployment: Enables individual Autonomous Systems to
          detect path manipulation targeting their own ASNs immediately,
          without depending on global adoption of RPKI, ROV, or ASPA
          infrastructure.</t>

          <t>Enhanced Troubleshooting: Provides network engineering and
          security operations teams with detailed diagnostic data to
          differentiate between accidental operator configuration errors and
          deliberate route hijacks.</t>
        </list></t>
    </section>

    <section title="Acknowledgements">
      <t>The authors would like to acknowledge the reviews, feedback, and
      contributions from Gang Yan, Zhenbin Li, Aijun Wang, Jeff Haas, Robert
      Raszuk, Chris Morrow, Alexander Azimov, Ruediger Volk, Jescia Chen, and
      members of the IETF IDR Working Group.</t>

      <t/>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document requests IANA to assign a new code value in the **BMP
      Information TLV - Type 1 (Information) Code** registry:</t>

      <t><list style="symbols">
          <t>Code = TBD: AS Path Looped.</t>
        </list></t>

      <t/>
    </section>

    <section anchor="Security" title="Security Considerations">
      <t>This document does not change the underlying security issues in the
      BGP protocol. It however, does provide an additional mechanism to
      protect against attacks based on the forged AS-Path in the BGP
      routes.</t>

      <t/>
    </section>

    <section title="Contributors">
      <t>The following people made significant contributions to this
      document:</t>

      <t>Yunan Gu</t>

      <t>Huawei Email: guyunan@huawei.com</t>

      <t/>
    </section>
  </middle>

  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?>

      <?rfc include='reference.RFC.4271'?>

      <?rfc include='reference.RFC.4760'?>

      <?rfc include='reference.RFC.6811'?>

      <?rfc include='reference.RFC.7606'?>

      <?rfc include='reference.RFC.7854'?>

      <?rfc include="reference.RFC.8174"?>

      <?rfc include='reference.RFC.8671'?>

      <?rfc include='reference.I-D.ietf-sidrops-aspa-verification'?>
    </references>
  </back>
</rfc>
