BGP Attributes are ways you can "label" prefixes learned from BGP. You can modify both incoming and outgoing prefix attributes.
Some attributes are well-known, while some others are optional. Well-known means that every vendor must support it. Attributes can also be mandatory or discretionary. Mandatory attributes are well-known attributes that are compulsory. Finally, some attributes can be transitive while others are non-transitive. Transitive attributes are attributes that can travel through the routers distributing the prefixes.
The Major Well-Known Attributes (all vendors must support them) are:
-Autonomous System Path (AS-PATH) (Mandatory)
-Next Hop Address (Mandatory)
-Origin (Mandatory)
-Local Preference
-Atomic Aggregate
Cisco's Optional Attributes are:
-Aggregator
-Multi-Exit Discriminator (MED)
The Autonomous System Path is the attribute that contains a list of all the Autonomous Systems the particular prefix traversed. The lowest AS_PATH is preferred. As such, this behaves like Hop Counts.
The Next Hop Address is the "gateway" to get to the prefix. This qualifies or disqualifies a route depending on whether the Next Hop Address is reachable or not. (Recall that the routes are ignored when IBGP didn't change the next-hop to itself in the previous articles).
Origin is the Autonomous System where the prefix came from. Local Preference is how preferred the route is within the local Autonomous System.
Now, that's just 7 out of the countless Attributes a prefix can have. The BGP process actually decides on which route to keep based on the following:
0. Ignore routes with an inaccessible next hop address
1. Prefer the path with the highest WEIGHT.
2. Prefer the path with the highest LOCAL_PREF.
3. Prefer the path that is local to the router (via a "network", "redistribute" or "aggregate" command).
4. Prefer the path with the shortest AS_PATH.
5. Prefer the path with the lowest origin type.
6. Prefer the path with the lowest multi-exit discriminator.
7. Prefer eBGP over iBGP paths.
8. Prefer the path with the lowest IGP metric to the next hop address.
9. Determine if multiple paths require installation in the routing table for BGP Multipath.
11. Prefer the route that comes from the BGP router with the lowest router ID.
12. Prefer the path with minimum cluster list length if the originator is the same for multiple paths.
13. Prefer the path that comes from the lowest neighbor address.
WEIGHT is a Cisco proprietary attribute that is local to a router. Yes, it does not leave the router at all, so it can be seen as a ROUTER_PREFERENCE instead.
LOCAL_PREF is a Well-Known Mandatory attribute that is advertised to routers in the same AS. LOCAL_PREF and WEIGHT are tied by default so it must be set by an Administrator for it to work.
The BSCI examination focuses on the first 4 steps in the Best Path Selection Algorithm.
Lets begin a more detailed study of the BGP process using the following topology:
We'll be focusing on the 172.16.1.0/24 prefix as received on R1. After the network stabilizes, R1 will eventually receive two different paths to the 172.16.1.0/24 network. We can see this information using:
show ip bgp
Path 1 goes to R2 then to AS 2 3 4 i
Path 2 goes to R3 then to AS 3 4 i
Both paths have the Next Hop set to the respective routers due to the "next-hop-self" command. By default, Metric (0), LocPrf (100) and Weight (0) are all set to default so the path with the shortest AS_PATH gets selected. In this case, Path 2 is marked with the > symbol which means it's preferred.
All routers in the BGP process typically have the same routing table when it comes to routing to external routes. In this case, traffic originating from R1, R2 and R3 destined for the 172.16.1.0/24 network would always cross the link to R6.
As this would result in a full-blown discussion, I'll elaborate more on this topology in the next article where we'll play around with the attributes.
No comments :
Post a Comment