Explain BGP attributes and best-path selection
Exam: Cisco 300-101 - CCNP Implementing Cisco IP Routing (ROUTE v2.0)
BGP (Border Gateway Protocol) is an exterior gateway protocol also known as path vector routing protocol is designed to exchange the routing information between the Autonomous Systems (AS). BGP runs over TCP protocol on port 179 to pass the BGP messages among routers and to allow the neighboring routers to reside on the same subnet.
The BGP attributes help in determining the paths to a remote network. They may further be used to discover the best route to destination from multiple paths available. Some important BGP attributes are described below.
- Weight: Weight is a Cisco specific attribute which is used to identify the preferred path when multiple paths are available for a destination network. The path having the largest weight is preferred. The value of weight ranges from 0 to 65535 and the default weight value for any path is 0. Weight is not advertised to the neighboring BGP routers.
- Local Preference: Local Preference is a discretionary attribute that is used to send updates to IBGP peers through a preferred path when there are many paths to a destination network. It is used to select the outbound external BGP path.The Local Preference attribute is used locally within an AS and is not exchanged between the external BGP routers. It. The path having the highest local preference is preferred. The default local preference value is 100.
- Multi exit discriminator: Multi exit discriminator (MED) attribute is an optional non transitive attribute that is used to suggest the preferred entry path to an AS when more than one entry points are available for a network. This attribute is used to send the information of the preferred network entry point to the neighboring autonomous systems. MED only applies to the routes that are advertised by the single autonomous system. The default value of MED is 0 and the path having lowest MED value is preferred.
- Origin: Origin is a mandatory attribute that shows how a specific route was introduced to BGP . All implementations in BGP must understand and accept the value of the origin attribute. This attribute has one of the three values:
- EGP: Specifies that theroute is originated from an Exterior Border Gateway Protocol session.
- IGP: Specifies that theroute is interior to the originating AS and is the most preferred origin type for a route.
- Incomplete: Specofies that the route is discoved from sources other than BGP and has enterd BGP through manual redistribution such as connected route, static route, or redistributed from IGP protocol.
- AS Path: AS path is a mandatory attribute that describes the path taken on the way to destination. When a route is advertised through an AS, the AS number is added to the sequenced list of AS numbers for the route advertisements traversed. This is the most critical attribute as it is used for routing loop prevention. When BGP peers receive any update containing the local AS numbers in the AS path, they discover a routing loop and ignore the update.
- Next Hop: Next Hop is a mandatory attribute the specifies the IP address taken to reach the destination. This attribute is treated differently in both EBGP and IBGP. In IBGP there is no need to modify the Next Hop attribute until it is told to do so specifically, whereas in EBGP the next hop is modified as the egress interface by its neighbors to reach their EBGP peer.
- Community: BGP community is an optional transitive attribute that defines the way to group routers using the features based on which the routing decisions like redistribution, preference, and acceptance can be used by them. Community attribute is of four octets in which first two octets contains local autonomous system number and last two octets contain locally defined value.
- Atomic Aggregator: It is a discretionary attribute that is used inform the downstream neighbor the path information that may be been lost for specific routes. This loss is caused when more specific paths are aggregated into less specific paths.
- Aggregator: Aggregator is a router ID that is responsible for aggregation. This attribute is not used in route selection process.
BGP Best Path Selection:
A BGP router may receive multiple advertisements for a route from multiple sources. In such a case BGP selects a single path as the best path and puts this path in the routing table so that the path is advertised to its neighbors. To select path, BGP uses following selection criteria.
- Drop the update, if the next hop specified by path is inaccessible.
- Path with the largest weight is preferred.
- If the weight is same then path with the largest local preference is preferred.
- If the local preference for a path is same then the BGP attribute originate will kick in. A BGP router prefers the route if it is locally originated (means that its next hop IP address is 0.0.0.0 in the BGP table).
- If no route was originated then the route with the shortest AS path is preferred.
- If the AS path length is same of all the paths, then the path with the lowest origin type is preferred (where IGP metric is lower than EGP).
- If origin codes are same then the path with the lowest multi exit discriminator (MED) is preferred.
- If paths have same MED, then the external path (external BGP) is preferred over internal path (internal BGP).
- Prefer the path through closest IGP neighbor if paths are still same.
- If everything is the same, then the router ID will be the decision maker. The router with the lowest router ID will be used for path.
Which BGP path attribute is Cisco specific?
- AS path
- Local Preference
- Next hop
Explanation: The weight is a Cisco specific attribute and is local to a router. If the router discovers multiple routes to the same destination, then the route with the highest weight is preferred and will be installed in the routing table. The default value of weight 0 and is range of the weight attribute is from 0 to 65535.
Related IT Guides
- Configure and verify default routing
- Configure and verify IPv4 and IPv6 DHCP
- Configure and Verify network types, area types, and router types
- Configure and Verify RIPv2
- Configure and verify static routing
- Describe administrative distance
- Describe device security using IOS AAA with TACACS+ and RADIUS
- Describe DMVPN (single hub)
- Describe IPv6 NAT
- Describe, configure, and verify BGP peer relationships and authentication
- Explain Frame Relay
- Explain general network challenges
- Layer 3 technologies - Describe administrative distance
- Use Cisco IOS troubleshooting tools