Related Documentation
- M, MX, PTX, T Series
- 4-Byte Autonomous System Numbers Overview
- Configuring 4-Byte AS Numbers and BGP Extended Community Attributes
- Configuring 4-Byte Autonomous System Numbers
- Establishing a Peer Relationship Between a 4-Byte Capable Router and a 2-Byte Capable Router Using a 2-Byte AS Number
- Establishing a Peer Relationship Between a 4-Byte Capable Router and a 2-Byte Capable Router Using a 4-Byte AS Number
- Juniper Networks Implementation of 4-Byte Autonomous System Numbers
- Prepending 4-Byte AS Numbers in an AS Path
- Understanding 4-Byte AS Numbers and Route Distinguishers
- Understanding a 4-Byte Capable Router AS Path Through a 2-Byte Capable Domain
- M, PTX, QFX, T Series
- Disabling Attribute Set Messages on Independent AS Domains for BGP Loop Detection
Understanding 4-Byte AS Numbers and Route Loop Detection
One of the most important functions in BGP is route loop detection at the autonomous system level using the AS_PATH attribute. A simple way of thinking of the AS_PATH is that it is the list of autonomous systems that a route goes through to reach its destination. Loops are detected and avoided by the router checking for its own AS number in the AS_PATH received from a neighboring AS.
This section describes how route loop detection works with a mix of routers that support and do not support 4-byte AS numbers. Figure 1 shows a small network with the potential for BGP loops.
Figure 1: 4-Byte AS Numbers and Loop Detection

In the first example, an EBGP route, route 1.2.3.4, is first advertised by Router 1. The first AS in the path is AS 12596 as configured on Router 1. The second AS that is in the path is AS 1000000 as configured on Router 2. AS 1000000 is sent in the AS4_path attribute and the AS_TRANS number, AS 23456, is sent in the AS_PATH attribute to Router 3. The third AS that is in the path is AS 60000, as configured on Router 3.
The show route command output shows the AS path for route 1.2.3.4 as advertised by Router 3 to Router 4. In the show route command output, you see AS 12596 first. Because Router 3 does not support 4-byte AS numbers, you see AS 23456 second. Because Router 2 used a local AS of 65000 to establish a peer relationship with Router 3, you see AS 65000 third. AS 60000 is not in the show route command output because the command was entered on the router configured with AS 60000.
user@Router3# show route advertising-protocol
bgp 192.168.1.2
... Prefix Nexthop MED Lclpref AS path 10.255.14.172/32 Self 65000 23456 12596 I
In this case, when Router 4 sees its own AS number, AS 12596, in the path, it detects a routing loop.
In the second example, an EBGP route, route 4.3.2.1, is first advertised by Router 4. The first AS in the path is AS 12596 as configured on Router 4. The second AS in the path is AS 60000 as configured on Router 3. The third AS is in the path is AS 1000000 as configured on Router 2.
The show route command output shows the AS path for route 4.3.2.1 as advertised by Router 2 to Router 1. In the show route command output, you see AS 12596 first and AS 60000 second. AS 1000000 is not in the show route command output because the command was entered on the router configured with AS 1000000.
user@Router2# show route advertising-protocol
bgp 192.168.1.10
... Prefix Nexthop MED Lclpref AS path 10.255.14.172/32 Self 60000 12596 I
When Router 1 sees its own AS number, AS 12596, in the path, it detects a routing loop.
Related Documentation
- M, MX, PTX, T Series
- 4-Byte Autonomous System Numbers Overview
- Configuring 4-Byte AS Numbers and BGP Extended Community Attributes
- Configuring 4-Byte Autonomous System Numbers
- Establishing a Peer Relationship Between a 4-Byte Capable Router and a 2-Byte Capable Router Using a 2-Byte AS Number
- Establishing a Peer Relationship Between a 4-Byte Capable Router and a 2-Byte Capable Router Using a 4-Byte AS Number
- Juniper Networks Implementation of 4-Byte Autonomous System Numbers
- Prepending 4-Byte AS Numbers in an AS Path
- Understanding 4-Byte AS Numbers and Route Distinguishers
- Understanding a 4-Byte Capable Router AS Path Through a 2-Byte Capable Domain
- M, PTX, QFX, T Series
- Disabling Attribute Set Messages on Independent AS Domains for BGP Loop Detection
Published: 2012-11-14
Related Documentation
- M, MX, PTX, T Series
- 4-Byte Autonomous System Numbers Overview
- Configuring 4-Byte AS Numbers and BGP Extended Community Attributes
- Configuring 4-Byte Autonomous System Numbers
- Establishing a Peer Relationship Between a 4-Byte Capable Router and a 2-Byte Capable Router Using a 2-Byte AS Number
- Establishing a Peer Relationship Between a 4-Byte Capable Router and a 2-Byte Capable Router Using a 4-Byte AS Number
- Juniper Networks Implementation of 4-Byte Autonomous System Numbers
- Prepending 4-Byte AS Numbers in an AS Path
- Understanding 4-Byte AS Numbers and Route Distinguishers
- Understanding a 4-Byte Capable Router AS Path Through a 2-Byte Capable Domain
- M, PTX, QFX, T Series
- Disabling Attribute Set Messages on Independent AS Domains for BGP Loop Detection