BGP PATH SELECTION



I BGP PATH SELECTION

[pic][pic]

In this module, you will continue to learn the concepts and terminology of Border Gateway Protocol (BGP4). You will also continue to learn Cisco IOS® Software BGP commands. You will also continue to configure basic settings on Cisco routers in simulated lab for creating BGP loop-free interdomain routing between one autonomous system (AS) and another.

This module covers the following topics of BGP:

• How BGP selects a path

• BGP decision algorithm

• Weight attribute [pic]

• Local preference attribute [pic]

• Metric attribute (Multi-Exit Discriminator) [pic]

• Origin attribute [pic]

• Community attribute [pic]

• AS Path attribute [pic]

• BGP Nexthop attribute

• BGP Nexthop (multiaccess networks)

• BGP Nexthop (nonbroadcast multiaccess)

• Nexthopself

[pic][pic]

After completing this module, you will be able to:

• Explain how BGP uses various configurable attributes to decide upon the best path to a destination.

• Identify and explain how the weight attribute is used for a best path selection process.

• Describe the local preference attribute and how it is used within the AS.

• Explain how the MED attribute influences an AS as to how to choose to reach a certain route.

• Differentiate between local preference attribute and Multi-Exit Discriminator (MED) attribute

• Identify and describe the origin attribute and how it defines the origin of the path information.

• List and define the three values for the origin attribute.

• Illustrate how the community attribute is a way to group destinations in a certain community and how it applies routing decisions according to those communities.

• Describe the AS-PATH attribute and explain what this list of AS numbers actually is.

• Recognize the BGP nexthop attribute and demonstrate how it is used to reach a certain destination.

[pic][pic]

The Configuration Labs are hands-on exercises that focus on specific configuration processes. These labs will rely on the CIM-SE, the Cisco interactive, Java-based, internetworking simulation environment, to reinforce concepts and commands taught in the tutorial. You will be provided with audio instructions to help you through the exercises. This module contains six Configuration Labs using the CIM-SE router simulation environment; the labs focus on the following procedures:

• Using each of the user levels and command modes on a Cisco router

• Using the context-sensitive help features of the Cisco IOS command-line interface (CLI)

• Configuring BGP basics on a clustered network

• Lab 1 (Weight Attribute) covers:

o Configuring the weight attribute for a BGP network

o Changing paths from the chosen path to a new path by using the neighbor weight attribute command

• Lab 2 (Local Preference Attribute) covers:

o Configuring all routers in an AS to use a particular router as the preferred exit point for networks

o Setting a better local preference attribute

• Lab 3 (Multi-Exit Discriminator) covers:

o Making a router in a particular AS choose all the paths through another AS

o Configuring a router to advertises a better metric to a certain AS than another AS

o Configuring the bgp always-compare-med command

• Lab 4 (Origin Attribute) covers:

o Verifying the origin attribute

o Changing the origin attribute from IGP (I) to incomplete (?), and vice versa

• Lab 5 (Community Attribute) covers:

o Having an AS set a policy such that its neighbor will not advertise its network to any of its peers

o Configuring a router such that it advertises a community attribute along with this network, thereby preventing another router from advertising this network

• Lab 6 (AS-Path [prepend] Attribute) covers:

o Using the set as-path (prepend) command

 

[pic]

[pic][pic]

In this section of BGP Path Selection, the following topics are covered:

• BGP decision algorithm

• How Border Gateway Protocol (BGP) selects a path

[pic][pic]

After BGP receives updates about different destinations from different autonomous systems (ASs), the protocol will have to decide which paths to choose in order to reach a specific destination. BGP will choose only a single path to reach a specific destination. However, note that if you have multiple physical connections between eBGP neighbors, using a loopback interface and static routes to the loopback interface allows load balancing across the connections.

The decision process is based on different attributes, such as next hop, administrative weights, local preference, the route origin, path length, origin code, metric, and so on.

This section explains the decision process BGP uses to propagate the best path to its neighbors, called the Best Path Selection Algorithm.

[pic]Description

BGP routers typically receive multiple paths to the same destination. The BGP best path algorithm decides which is the best path to install in the IP routing table and to use for forwarding traffic.

Let's begin by assuming that all received paths for a particular prefix are arranged in a list, similar to the output of the show ip bgp longer-prefixes command. Some paths received by the router aren't considered as candidates for the best path. Such paths typically don't have the valid flag in the output of the show ip bgp longer-prefixes command. The following is a list of reasons that cause routers to ignore paths.

• Paths marked as "not synchronized" in the show ip bgp longer-prefixes output. If BGP synchronization is enabled, which it is by default in Cisco IOS® Software, there must be a match for the prefix in the IP routing table in order for an internal BGP (iBGP) path to be considered a valid path. If the matching route is learned from an OSPF neighbor, its OSPF router ID must match the BGP router ID of the iBGP neighbor. Most users prefer to disable synchronization using the no synchronization BGP subcommand.

• Paths for which the NEXT_HOP is inaccessible. This is why it's important to have an IGP route to the NEXT_HOP associated with the path.

• Paths from an external (eBGP) neighbor if the local autonomous system (AS) appears in the AS_path. Such paths are denied upon ingress into the router, and are not even installed in the BGP routing-information base (RIB). The same applies to any path denied by routing policy implemented via access, prefix, AS-PATH, or community lists, unless you've configured soft-reconfiguration inbound for the neighbor.

• If you enabled bgp enforce-first-as and the UPDATE doesn't contain the AS of the neighbor as the first AS number in the AS_Sequence, the router sends a notification and closes the session.

• Paths marked as "(received-only)" in the show ip bgp longer-prefixes output. These paths have been rejected by policy, but have been stored by the router because soft-reconfiguration inbound has been configured for the neighbor sending the path.

[pic]How the Best Path Algorithm Works

BGP assigns the first valid path as the current best path. It then compares the best path with the next path in list, until it reaches the end of the list of valid paths. Following is a list of rules used to determine the best path:

1. Prefer the path with the largest WEIGHT. WEIGHT is a Cisco-specific parameter, local to the router on which it's configured.

2. Prefer the path with the largest Local _Preference.

3. Prefer the path that was locally originated via a network or aggregate BGP subcommand, or through redistribution from an IGP. Local paths sourced by network and redistribute commands are preferred over local aggregates sourced by the aggregate-address command.

4. Prefer the path with the shortest AS-PATH. Note the following:

o This step is skipped if bgp bestpath as-path ignore is configured.

o An AS-SET counts as 1, no matter how many ASs are in the set. Recall that an AS-SET attribute is a mathematical set of ASs.

o The AS_Confed_Sequence is not included in the AS-PATH length.

5. Prefer the path with the lowest origin type: IGP is lower than EGP, and EGP is lower than INCOMPLETE.

6. Prefer the path with the lowest Multi-Exit Discriminator (MED), also called the metric attribute. Note the following:

o This comparison is only done if the first (neighboring) AS is the same in the two paths; any confederation sub-ASs are ignored. In other words, MEDs are compared only if the first AS in the AS_Sequence is the same for multiple paths. Any preceding AS_Confed_Sequence is ignored.

o If bgp always-compare-med is enabled, MEDs are compared for all paths. This option needs to be enabled over the entire AS, otherwise routing loops can occur.

o If bgp bestpath med-confed is enabled, MEDs are compared for all paths that consist only of AS_Confed_Sequence (paths originated within the local confederation).

o Paths received from a neighbor with a MED of 4,294,967,295 will have the MED changed to 4,294,967,294 before insertion into the BGP table.

o Paths received with no MED are assigned a MED of 0, unless bgp bestpath missing-as-worst is enabled, in which case they are assigned a MED of 4,294,967,294.

o The bgp deterministic med command can also influence this step as demonstrated in the How BGP Routers Use the Multi-Exit Discriminator for Best Path Selection.

7. Prefer external (eBGP) over internal (iBGP) paths. Paths containing AS_Confed_Sequence are local to the confederation, and therefore treated as internal paths. There is no distinction between Confederation External and Confederation Internal.

8. Prefer the path with the lowest IGP metric to the BGP next hop.

9. If maximum-paths n is enabled, and there are multiple external or confederation-external paths from the same neighboring AS or sub-AS, BGP inserts up to n most recently received paths in the IP routing table. This allows eBGP multipath load sharing. The maximum value of n is currently 6. The default value, when this option is disabled, is 1. The oldest received path is marked as the best path in the output of show ip bgp longer-prefixes, and the equivalent of next-hop-self is performed before forwarding this best path to internal peers.

10. If both paths are external, prefer the path that was received first (the oldest one). This step minimizes route-flap, since a newer path won't displace an older one, even if it was the preferred route based on the additional decision criteria below. It's better practice to apply the additional decision steps below to iBGP paths only, in order to ensure a consistent best path decision within the network, and thereby avoid loops. This step is skipped if any of the following is true:

o The bgp bestpath compare-routerid command is enabled.

o The router ID is the same for multiple paths, since the routes were received from the same router.

o There is no current best path. An example of losing the current best path occurs when the neighbor offering the path goes down.

11. Prefer the route coming from the BGP router with the lowest router ID. The router ID is the highest IP address on the router, with preference given to loopback addresses. It can also be set manually using the bgp router-id command. (If a path contains route-reflector (RR) attributes, the originator ID is substituted for the router ID in the path selection process.)

12. If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster ID length. This will only be present in BGP route-reflector environments. It allows clients to peer with RRs or clients in other clusters. In this scenario, the client must be aware of the RR-specific BGP attribute.

13. Prefer the path coming from the lowest neighbor address. This is the IP address used in the BGP neighbor configuration, and corresponds to the remote peer used in the TCP connection with the local router.

Subsequent sections of this module discuss these attributes one by one, and contain Configuration Lab exercises that let you practice various path selection techniques.

[pic][pic]

Now that you are familiar with the BGP attributes and terminology, the following summary indicates how BGP selects the best path for a particular destination. Remember that BGP selects one path only as the best path. That path is placed in the routing table and propagated it to the BGP neighbors.

Path selection is based on the following:

1. If NextHop is inaccessible, do not consider it

2. Prefer the largest weight.

3. If the same weight, prefer the largest local preference.

4. If the same local preference, prefer the route that the specified router has originated.

5. If no route was originated, prefer the shorter AS path.

6. If all paths are external, prefer the lowest origin code (IGP ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download