<?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="bcp" docName="draft-chen-grow-enhanced-as-loop-detection-02"
     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>chenhn8.gd@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="Yunan Gu" initials="Y. " surname="Gu">
      <organization>Huawei</organization>

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

          <city>Beijing</city>

          <code>100095</code>

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

        <email>guyunan@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="26" month="October" year="2019"/>

    <abstract>
      <t>This document proposes to enhance AS-Loop Detection for BGP
      Inbound/Outbound Route Processing. It is an enhancement to the current
      BGP's Inbound/Outbound processing and can be implemented directly on the
      device. This could empower networks to quickly and accurately figure out
      they're being victimized.</t>

      <t/>
    </abstract>

    <note title="Requirements Language">
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
      "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
      document are to be interpreted as described in <xref
      target="RFC2119">RFC 2119</xref>.</t>
    </note>
  </front>

  <middle>
    <section title="Introduction">
      <t>The <xref target="RFC4271">Border Gateway Protocol (BGP)</xref>, as
      an inter-Autonomous (AS) routing protocol, is used to exchange network
      reachability information between BGP systems. BGP is widely used by
      Internet Service Providers (ISPs) and large organizations.</t>

      <t>BGP is used to exchange reachable inter-AS routes, establish inter-AS
      paths, avoid routing loops, and apply routing policies between ASs. BGP
      loop detection mechanism is defined in section 9.1.2. of RFC4271:</t>

      <t><list style="empty">
          <t>...</t>

          <t>If the AS_PATH attribute of a BGP route contains an AS loop, the
          BGP route should be excluded from the Phase 2 decision function. AS
          loop detection is done by scanning the full AS path (as specified in
          the AS_PATH attribute), and checking that the autonomous system
          number of the local system does not appear in the AS path.
          Operations of a BGP speaker that is configured to accept routes with
          its own autonomous system number in the AS path are outside the
          scope of this document.</t>

          <t>...</t>
        </list></t>

      <t>In ordinary BGP, every AS announces its route information with
      different prefixes. However, its neighboring ASes cannot validate this
      route information, but rather directly propagate it across the Internet
      or simply discard AS-Loop routes directly. Obviously, this weak trust
      model allows forged route announcement propagations and rarely been
      found, which is a fundamental security weakness of BGP. Forged routes,
      which can be generated by configuration errors or malicious attacks, can
      cause large-scale network connectivity problems.</t>

      <t>Some cases can be worse, hackers exploit this property of BGP to
      achieve their ulterior motives. They can add some providers' AS number
      into the forged AS-Path and attempt to make it look like the route had
      passed through these ASNs, or perhaps they are there to prevent those
      providers from carrying the route.</t>

      <t>For example, the cases shown in Figure 1.</t>

      <t><list style="symbols">
          <t>Forged Case 1: One upstream ISP of AS64596 forged a route with
          the ASN 64596 as the origin ASN in the AS-Path.</t>

          <t>Forged Case 2: One upstream ISP of AS64596 forged a route with
          the ASN 64596 as the transit ASN in the AS-Path.</t>
        </list>After receiving the above routes, AS64596 treats them as normal
      loop routes during the loop detecting phase and discards them directly.
      In most NOSes (Network Operation Systems), such rejected routes are not
      logged and only visible by putting the router into debugging mode. If
      the AS64596 is slightly enhanced, it can find that someone has faked
      himself, which may cause unnecessary trouble for himself.</t>

      <t><figure align="center">
          <artwork><![CDATA[
     AS-Loop-Detecting at this point
     Discard AS-Loop Routes directly that contains AS64596
                 |
                 | 
                 v                                 x.y.z.0/24 Origin AS 64600
AS64595---AS64596---AS64597---AS64598---AS64599----AS64600
                    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

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

      <t/>

      <t>Split-Horizon for EBGP is an optional function that a BGP sender will
      not advertise any routes that were previously received from that same
      AS. In some current implementation, the BGP outbound route processing
      step will simply discard the route if AS-Loop being detected.</t>

      <t>For example, the cases shown in Figure 1.</t>

      <t><list style="symbols">
          <t>Forged Case 1: One upstream ISP of AS64597 forged a route with
          the ASN 64596 as the origin ASN in the AS-Path.</t>

          <t>Forged Case 2: One upstream ISP of AS64597 forged a route with
          the ASN 64596 as the transit ASN in the AS-Path.</t>
        </list>When sending the above routes, AS64597 treats them as normal
      loop routes and discards them directly. If AS64597 is slightly enhanced,
      it can find that someone has faked AS64596, which may cause large-scale
      network connectivity problems.</t>

      <t/>

      <t><figure align="left">
          <artwork><![CDATA[
     Split-Horizon Enable & AS-Loop-Detecting at this point
     Discard AS-Loop Routes directly if sending AS-Path contains AS64596
                   |
                   | 
                   v                               x.y.z.0/24 Origin AS 64600
AS64595---AS64596---AS64597---AS64598---AS64599----AS64600
                    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 2: BGP Outbound Route Processing

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

      <t>Above cases are also being known As-Path Poisoning Attacks. </t>

      <t>ASPA [I-D.ietf-sidrops-aspa-verification] can be used to verify the
      AS_PATH attribute of routes advertised in the Border Gateway Protocol,
      and it is a systematic deployment based on RPKI system. This mechanism
      requires a series of infrastructure implementations.</t>

      <t>This document proposes to enhance AS-Loop Detection for BGP
      Inbound/Outbound Route Processing. It is an enhancement to the current
      BGP's Inbound/Outbound processing and can be implemented directly on the
      device. This could empower networks to quickly and accurately figure out
      they're being victimized.</t>

      <t/>
    </section>

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

      <t>AS: Autonomous System</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/>
    </section>

    <section title="Enhanced AS-Loop Detection for BGP Inbound Route Processing">
      <t>This section proposes to enhance AS Loop Detection for BGP Inbound
      Route Processing.</t>

      <t>As shown in Figure 3, when receiving the routes from AS64597, AS64596
      should check whether its own AS number is already in the AS-Path, If
      yes, it further analyzes the location of the AS Number 64596 in the
      received AS_Path:</t>

      <t>Case 1: AS 64596 is listed as Origin AS in the AS-Path</t>

      <t>Lookup the local resource database (Such as ROA Cache) and determine
      whether the route is originated from the AS 64596.</t>

      <t><list style="symbols">
          <t>Result 1: AS 64596 has no corresponding prefix; it is identified
          as a purely forged AS_Path prefix hijacking event, which is recorded
          as incident type 1.</t>

          <t>Result 2: The corresponding prefix is a sub-prefix of a certain
          prefix of the AS 64596 and the AS 64596 has not advertise it. For
          example, the prefix being hold by the AS 64596 is 10.10.128.0/17,
          and the receiving route prefix is 10.10.192.0/24, the latter is a
          sub-prefix of the former, which indicates that this is a forged
          AS_Path sub-prefix hijacking event, which is recorded as incident
          type 2.</t>

          <t>Result 3: The corresponding prefix is a sub-prefix of a certain
          prefix of the AS 64596 and the AS 64596 has only advertised to some
          special ASNs, and only wants it to be used internally by those ASNs.
          The AS 64596 recognizes that At least one special AS violates the
          route policy. Which is recorded as incident type 3.</t>

          <t>Result 4: The corresponding prefix is originated by the AS 64596,
          this is the normal case.</t>
        </list></t>

      <t>Case 2: AS 64596 is listed as transit AS in the AS-Path</t>

      <t>For example, AS-Path looks like the following form AS64596's
      perspective:</t>

      <t>(possible other ASes), left AS, local AS(64596), right AS, (possible
      other ASes)</t>

      <t>At this point, AS 64596 can lookup the local resource database and
      check whether there is a real AS relationship between the local AS and
      the left AS and the right AS. (From the perspective of the local AS, it
      can manage/hold the AS-relationship database between the local AS and
      each of its neighboring ASs (such as C2P, P2P, P2C, etc.).)</t>

      <t><list style="symbols">
          <t>Result 1: At least one of the AS ( the left AS or the right AS)
          has no actual AS relationship with the local AS (i.e. A never before
          seen AS-AS adjacency). It is a purely forged AS_Path prefix
          hijacking event. Which is recorded as incident type 4.</t>

          <t>Result 2: The AS relationships between the local AS and the left
          AS and the right AS are correct, but the local AS has not previously
          process this prefix , so it can be recognized that this is a forged
          route. We classify this incident type as type 5.</t>

          <t>Result 3: The AS relationships between the AS and the left AS and
          the right AS are correct, and the local AS 64596 has previously
          processed the prefix, this is the normal case.</t>
        </list></t>

      <t><figure align="center">
          <artwork><![CDATA[
     Enhanced AS-Loop-Detecting at this point                            
     To identify the attack/forged information                                     
                 |                                                           
                 |                                                           
                 v                                 x.y.z.0/24 Origin AS 64600
AS64595---AS64596---AS64597---AS64598---AS64599----AS64600                     
                    Normal Case:                                            
                    <-- x.y.z.0/24, AS-Path: 64597 64598 64599 64600                 
                                                                         
                    Forged Case 1:                                          
                    <-- x.y.z.0/24, AS-Path: 64596 64595                         
                                        (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 3: Enhance for BGP Inbound Route Processing

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

      <t>The local AS 64596 inputs the detected result to the route hijacking
      management module, or/and records the log or/and the alarm information,
      and the maintenance team of the local AS 64596 can notify the
      maintenance team of the relevant AS to correct the error in their
      networks .</t>

      <t>After the above steps are added, the stability and security of the
      network can be improved.</t>

      <t/>
    </section>

    <section title="Enhanced AS-Loop Detection for BGP Outbound Route Processing">
      <t>This section proposes to enhance AS Loop Detection for BGP Outbound
      Route Processing.</t>

      <t><figure align="center">
          <artwork><![CDATA[ 
    If Split-Horizon Enable, Enhanced AS-Loop-Detecting at this point                        
    To identify the attack/forged information                                    
                   |                                                        
                   |                                                        
                   v                               x.y.z.0/24 Origin AS 64600
AS64595---AS64596---AS64597---AS64598---AS64599----AS64600                    
                    Normal Case:                                           
                    <-- x.y.z.0/24, AS-Path: 300 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 4: Enhance for BGP Outbound Route Processing

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

      <t>As shown in Figure 4, when sending the routes from AS64597 to
      AS64596, AS64597 will check whether the AS number 64596 is already in
      the AS-Path, If yes, it can further analyzes the location of the AS64596
      in the received AS_Path:</t>

      <t>The remaining processing steps are the same as the previous
      section.</t>

      <t/>
    </section>

    <section title="Benefits">
      <t>After the enhancements of the AS Loop Detection for BGP
      Inbound/Outbound Route Processing are added, the stability and security
      of the network can be improved.</t>

      <t/>
    </section>

    <section title="Acknowledgements">
      <t>The authors would like to acknowledge the review and inputs from Gang
      Yan, Zhenbin Li, Aijun Wang, Jeff Haas, Robert Raszuk, Alexander Asimov,
      Ruediger Volk and the working group.</t>
    </section>

    <section anchor="IANA" title="IANA Considerations">
      <t>This document includes no request to IANA.</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>
    </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.7854'?>

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