Content

| 9.6 |  | BGP Attributes |
| 9.6.5 |  | The AS_Path attribute |

An AS_Path attribute is a well-known mandatory attribute, type code 2. It is the sequence of AS numbers that a route has traversed to reach a destination. The AS that originates the route adds its own AS number when sending the route to its external BGP peers. Thereafter, each AS that receives the route and passes it on to other BGP peers will prepend its own AS number to the list. Prepending is the act of adding the AS number to the beginning of the list. The final list has all the AS numbers that a route has traversed with the AS number of the AS that originated the route at the end of the list. This type of AS_Path list is called an AS_Sequence because all the AS numbers are ordered sequentially.

BGP uses the AS_Path attribute as part of the routing updates, update packet, to ensure a loop free topology on the Internet. Each route that gets passed between BGP peers will carry a list of all AS numbers that the route has already been through. If the route is advertised to the AS that originated it, that AS will see itself as part of the AS_Path attribute list and will not accept the route. BGP speakers prepend their AS numbers when advertising routing updates to other autonomous systems, external peers. When the route is passed to a BGP speaker within the same AS, the AS_Path information is left intact.

Figure illustrates the AS_Path attribute at each instance of the route 172.16.10.0/24, originating in AS1 and passed to AS2, AS3, AS4, and back to AS1. Notice how each AS that passes the route to other external peers adds its own AS number to the beginning of the list. When the route gets back to AS1, the BGP border router will realize that this route has already been through its AS. The AS number one (1) appears in the list, and will not accept the route.

AS_Path information is one of the attributes that BGP looks at to determine the best route to reach a destination. In comparing two or more different routes, given that all other attributes are identical, a shorter path is always preferred. In case of a tie in AS_Path length, other attributes are used to make the decision.

| Web Links Configuring BGP http://www.cisco.com/univercd/cc/td/doc/product/ software/ios122/122cgcr/fipr_c/ipcprt2/1cfbgp.htm