In this post, we will discuss about BGP Attributes and BGP route selection process.
The Border Gateway Protocol (BGP) is an inter-autonomous system routing protocol. An autonomous system is a network or group of networks under a common administration and with common routing policies. BGP is used to exchange routing information for the Internet and is the protocol used between Internet service providers (ISP).
When BGP is used between autonomous systems (AS), the protocol is referred to as External BGP (EBGP). If a service provider is using BGP to exchange routes within an AS, then the protocol is referred to as Interior BGP (IBGP).
BGP Attributes
Routes learned by BGP have associated attributes, which are used to determine the best route to a destination when multiple paths exist to a particular destination.BGP attributes influence route selection.
Well- Known Attributes: - Mandatory & Discretionary
Mandatory Attributes: Mandatory attributes are once that must be including in every single BGP routing updates.
Discretionary Attributes: Discretionary are up to the router and up to you as an administrator weather you want that attribute in BGP update. (Attributes May be present in update or not)
Optional Attributes: - Transitive & Non –Transitive
Transitive Attributes: Transitive are the once that will continue traveling through AS weather they are recognized by other BGP router or not.
Non – Transitive Attributes: Non transitive attribute are the attribute that will be strip of by the router if it does not understand or choose as not to propagate that attribute.
Attributes:
Weight Attribute
Weight is a Cisco proprietary attribute that is local to a router. The weight attribute is not advertised to neighboring routers. If the router learns about more than one route to the same destination, the route with the highest weight will be preferred. Local Preference Attribute
The local preference attribute is used to prefer an exit point from the local autonomous system (AS). The local preference attribute is propagated throughout the local AS. If there are multiple exit points from the AS, the local preference attribute is used to select the exit point for a specific route. Higher local preference is preferred. MED – Multi- Exit Discriminator Attribute
Multi –Exit Discriminator is an Optional Non -Transitive attribute. Used to suggest an entry point into your AS. If you have two connections with single service provider so you can suggest the entry point into your AS. Lower is better
Origin Attribute
The origin attribute indicates how BGP learned about a particular route. IGP (i) —route is interior to the originating AS or advertised via network command. EGP (e) —route is learned via the Exterior Border Gateway Protocol (EBGP). Incomplete (?) —incomplete occurs when a route is redistributed into BGP. AS-Path Attribute
When a route advertisement travels through an autonomous system, the AS number is added to an ordered list of AS numbers that the route advertisement has travelled. This attribute is mandatory attribute and it is used to avoid loop. Next-Hop Attribute
The EBGP next-hop attribute is the IP address that is used to reach the advertising router, which advertises the routes. Typically the IP address of the advertising routers. If receiving routers is on same subnet, next hop remains the same and in IBGP also.
Atomic Aggregate Attribute
Atomic Aggregate is a Well- Known Discretionary attributes that has not to be in every single routing update been summarized. Inform router that a route has been summarized.
Aggregator Attribute
Aggregator is an Optional Transitive attribute Aggregator tells you who summarized that route. What router or what is the IP add of that router who summarized that route.
Community Attribute
The community attribute provides a way of tagging of routes, called communities, to which routing decisions (such as acceptance, preference, and redistribution) can be applied. Route maps are used to set the community attribute. Predefined Community: No-Advertise, No-export, Internet , Local-as.
BGP Path Selection Process –
In BGP Protocol, it could receive multiple advertisements for the same route from multiple sources (ex: Internet/Multihomed networks). BGP selects only one path as the best path. When the path is selected, BGP puts the selected path in the IP routing table and propagates the path to its neighbors. The path selection process is :
1. If the path specifies a next hop that is inaccessible, drop the update. 2. Prefer the path with the largest weight. 3. If the weights are the same, prefer the path with the highest local preference. 4. If the local preferences are the same, prefer the path that was originated by BGP running on this router. 5. If no route was originated, prefer the route that has the shortest AS-path. 6. If all paths have the same AS-path length, prefer the path with the lowest origin type (where IGP is lower than EGP and EGP is lower than incomplete). 7. If the origin codes are the same, prefer the path with the lowest MED attribute. 8. If the paths have the same MED, prefer the external path over the internal path. 9. If the paths are still the same, prefer the path through the closest IGP neighbor. 10. Prefer the path with the lowest IP address, as specified by the BGP router ID.
Hope this information will helpful for you.