BGP AS Path Attribute
AS Path Attribute is another Well-Known and Mandatory BGP Path Attribute. Here, as we have discusssed before, Well-Known means “it is supported by every BGP implementation” and Mandatory means “it must be included in every route entry”.
AS Path Attribute is one of the mosth used BGP Path Attribute by Service Providers.
In AS Path Attribute mechanism, whenever a route passes an AS (Autonomous System), it adds the number of AS it passed. So, AS Path Attribute is a list of AS numbers, that the router traverse.With this mechanism AS Path Attribute is also used for loop detection and loop avoidance. Because, if a router sees its Autonomous Number in the list of AS Path, it rejects that update.
The shortest AS Path is selected as the route in the BGP Path Algorithm. This is like RIP hop count. Less hops are more preferable beceuse of the ease of going throught.
Sometimes additional hops are added manually for AS Path manuplation. By doing this, the path that is determined by network admin, is selected as BGP Best Path.
For the above example, the 184.108.40.206 network is advertised by RouterB. It adds its own AS number to the AS Path list. After that, all the ASs adds their AS numbers to the AS Path list. And when this route reach to RouterA, the AS Path list is like 10 20 30. This is basically the AS Path of that BGP Route.
What is AS Path Prepending?
Sometimes network admins decide the BGP paths and according to this decision, they changes the BGP paths. One of the way of this change that is related with AS Path Attribute is AS Path Prepending. AS Path Prepending is basically manuplating the AS Paths.
In AS Path Prepending, you can add additional AS numbers to the route, and the AS Path become longer after this addition. In other words, by manuplating AS Path List, the shortest path becomes longer.
We can use Route Maps to do AS Path Prepending.
Let’s explain this with an example. Think about the below topology: