Network Bulls
www.networkbulls.com
Best Institute for CCNA CCNP CCSP CCIP CCIE Training in India
M-44, Old Dlf, Sector-14 Gurgaon, Haryana, India
Call: +91-9654672192
BGP supports a wide variety of Path Attributes. Some of the PAs exist solely to be used as
part of the litany of options in the BGP best path algorithm, some have nothing to do
with the BGP best path algorithm, and some impact the best path algorithm as well as being
used for other purposes. For example, the Local Preference PA exists to give control to
a single AS regarding their outbound routes from an AS-wide perspective. Conversely, the
BGP Next_Hop PA provides BGP a place to list the next-hop IP address for a path, but it
does not provide a useful means for engineers to set different values for the purpose of influencing
the best path choice.
The term BGP best path algorithm refers to the process by which BGP on a single router
examines the competing BGP paths (routes) in its BGP table, for a single prefix, choosing
one route as the best route. The best path algorithm has many steps, but it eventually results
in the choice of a single route for each prefix as that router’s best BGP path.
The initial major section of this chapter examines the BGP PAs used by the BGP best path
algorithm, the BGP best path algorithm itself, and some related topics.
BGP Path Attributes
BGP Path Attributes define facts about a particular route or path through a network. Each
PA defines something different about the path, so to truly understand BGP PAs, you need
to examine each PA. This section begins by reviewing a few PAs that should now be familiar
to you if you have read the preceding BGP chapters, and then this section introduces a
few new PAs.
BGP uses the Autonomous System Path (AS_Path) PA for several purposes, as already
seen in Chapters 12, 13, and 14. This particular PA lists the ASNs in the end-to-end path.
BGP uses the AS_Path PA as its primary loop-prevention tool: When an eBGP peer receives
an Update, if its own ASN is already in the received AS_Path, then that route has already
been advertised into the local ASN and should be ignored. In addition to loop
prevention, the BGP best path algorithm uses the AS_Path PA to calculate the AS_Path
length, which the algorithm considers as one of its many steps.
BGP also defines the next-hop IP address (Next_Hop) of a route as a PA. BGP may advertise
one of several different IP addresses as a route’s Next_Hop, depending on several factors.
To support such features, BGP needs to list the Next_Hop IP address for each path
(route), and BGP defines this concept in the Next_Hop PA. The best path algorithm includes
a check related to the Next_Hop IP address of the route.
Table 15-2 lists these two PAs, plus a few more PAs, and a related BGP feature (Weight) that
is not a PA but is used by Cisco BGP best path implementation. The table lists the PAs in
the same order that they will be considered by the BGP best path algorithm. The table also
describes each feature listed in the table, relative to whether it is most useful to influence
outbound routes (away from the Enterprise) and inbound routes (toward the Enterprise).
www.CareerCert.info
Chapter 15: BGP Path Control 495
Key
Topic
Table 15-2 BGP Path Attributes That Affect the BGP Best Path Algorithm
PA Description Enterprise Route
Direction (Typical)
NEXT_HOP Lists the next-hop IP address used to reach a
prefix.
N/A
Weight1 A numeric value, range 0 through 216 – 1, set
by a router when receiving Updates, influencing
that one router’s route for a prefix. Not
advertised to any BGP peers.
Outbound
Local Preference (LOCAL_
PREF)
A numeric value, range 0 through 232 – 1, set
and communicated throughout a single AS
for the purpose of influencing the choice of
best route for all routers in that AS.
Outbound
AS_PATH (length) The number of ASNs in the AS_Path PA. Outbound, Inbound
ORIGIN Value implying the route was injected into
BGP; I (IGP), E (EGP), or ? (incomplete information).
Outbound
Multi Exit Discriminator
(MED)
Set and advertised by routers in one AS, impacting
the BGP decision of routers in the
other AS. Smaller is better.
Inbound
1Weight is not a BGP PA; it is a Cisco-proprietary feature that acts somewhat like a PA.
The short descriptions in the table can be helpful for review when doing your final preparation
study, but the table does not hold enough information to truly appreciate how an
engineer might use these PAs effectively. The second and third major sections of this
chapter examine most of these PAs and how to influence the best path choice with each.
To find the current settings of the features in Table 15-2, you can use commands like
show ip bgp and show ip bgp prefix/length. However, picking the values out of the
clutter in the output of the show ip bgp command can be a challenge. Figure 15-1 shows
a sample of this command’s output and some notations on where to find the various PA
settings.
The examples throughout this chapter include examples of these commands, along with
the PA settings as changed by various route maps.
Overview of the BGP Best Path Algorithm
The BGP best path algorithm follows the steps shown in shorthand form in Table 15-3.
The table lists steps 0 through 8, a short descriptive phrase, and a notation about the
criteria for one value to be better than another.
www.CareerCert.info
496 CCNP ROUTE 642-902 Official Certification Guide
Table 15-3 BGP Decision Process Plus Mnemonic: N WLLA OMNI
Step Mnemonic
Letter
Short Phrase Which Is Better?
0 N Next hop: reachable?
If no route to reach Next_Hop, router cannot
use this route.
1 W Weight Bigger.
2 L LOCAL_PREF Bigger.
3 L Locally injected
routes
Locally injected is better than iBGP/eBGP
learned.
4 A AS_PATH length Smaller.
5 O ORIGIN Prefer I over E.
Prefer E over ?
6 M MED Smaller.
7 N Neighbor Type Prefer eBGP over iBGP.
8 I IGP metric to
Next_Hop
Smaller.
R3 #show ip bgp
BGP table version is 12, local router ID is 3.3.3.3
r RIB-failure, S stale
Network Next Hop Metric
0
000000000
65000 1 33333 10 200 44 i
5 1 33333 10 200 44 i
(111)4 1 33333 10 200 44 i
4 1 33333 10 200 44 i
65000 1 33333 10 200 44 i
5 1 33333 10 200 44 i
(111) 4 1 33333 10 200 44 i
4 1 33333 10 200 44 i
(111) 4 {1, 404, 303, 202} i
0
0
100
100
100
LocPrf Weight Path
NEXT_HOP
MED Weight
LOCAL_PREF
AS_Path Origin
10.1.36.6
10.1.35.5
10.1.14.4
10.1.34.4
10.1.36.6
10.1.35.5
10.1.14.4
10.1.34.4
10.1.14.4
Neighbor
Type
11.0.0.0
12.0.0.0
>
>
i
i
i
*********
16.0.0.0/4
Comments: To Discover Other Details…
Neighbor Type: No Letter Means “EBGP”
IGP Metric: show ip route next-hop-address
RID: show ip bgp n/ri
Origin codes: i - IGP, e - EGP, ? - incomplete
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
Figure 15-1 Finding PA Settings in the Output of the show ip bgp Command
Note: The step numbering of the BGP best path steps does not exist in the BGP RFCs.
The steps are numbered in this book for easier reference. Because the RFCs do not dictate
Key
Topic
Key
Topic
www.CareerCert.info
Chapter 15: BGP Path Control 497
a particular step numbering, other references likely use different step numbers; do not be
concerned about memorizing the step numbers.
Starting with a Step 0 may seem odd, but it helps make an important point about the logic
listed at this step. Some BGP best path references include the logic in this step as a best
path step, and some just list this same information as a side note. Regardless, the step 0
concept is important. For step 0, a router looks at the BGP route and compares the
Next_Hop IP address to the IP routing table.
If that router does not have a matching IP route for the BGP route’s Next_Hop IP address,
then that router will not know how to forward packets for that particular prefix, using that
particular route. To avoid using such a route, at Step 0, the BGP best path algorithm removes
such routes from consideration.BGP then uses the following eight steps, in order,
until one best route is chosen for a given prefix.
If a router still did not determine a best route when finishing Step 8, the router takes several
other small steps to break the tie. At this point, the competing routes are considered
to be just as good as each other. However, unlike IGPs, BGP needs to choose one and only
one route as best, in part because BGP advertises only the best routes to its neighbors. In
such cases, BGP breaks the tie with these additional steps, which would be considered
Steps 9-11:
Step 9. Oldest (longest-known) eBGP route
Step 10. Lowest neighbor BGP RID
Step 11. Lowest neighbor IP address
Taking a more detailed view of the entire best path algorithm, BGP begins by choosing
the oldest known route for a given prefix as the best route. It then takes the next longestknown
route for that same prefix and compares the two routes using the best path algorithm.
The router eventually chooses one of the two BGP routes as the best path (route). If
another route exists for the same prefix, the router repeats the process, using the winner
of the previous comparisons and the new route, choosing one of those as the better route.
The process continues until all routes have been considered, with one route being listed as
best in the BGP table.
For example, if Router R1 were considering two routes for prefix 181.0.0.0/8, it would first
make sure that both routes had reachable Next_Hop IP addresses. The router would then
compare the weight settings, choosing the route with the bigger weight. If they tied on
weight, the router would prefer the route with a bigger Local_Pref. If again a tie, the router
would prefer the one route that was injected into BGP locally (using the network command
or using route redistribution). If neither or both routes were locally injected, the
router moves on to AS_Path length, and so on, until the router chooses one of the two as
the better route.
As soon as one of the steps determines a best route, the comparison of those two
routes stops.
www.CareerCert.info
498 CCNP ROUTE 642-902 Official Certification Guide
Key
Topic
Perspectives on the Core 8 Best Path Steps
Some of the BGP best path steps purposefully give the engineer a tool for influencing the
choice of best path, whereas other steps have a different purpose, often simply being a
side effect of some BGP feature. So, when an engineer starts building a BGP implementation
plan, only a subset of the core 8 BGP best path steps need be considered, as follows:
■ Weight (Step 1)
■ Local_Pref (Step 2)
■ AS_Path Length (Step 4)
■ MED (often called metric) (Step 6)
Because the ROUTE exam focuses on the more practical aspects of BGP for Enterprises,
it gives much more attention to these four features and less attention to the other BGP
best path steps. This chapter describes each of these four features to some depth in the
context of best path selection. However, before focusing on these four items, it can be
helpful to see a small glimpse into the meaning of the other steps, which can be helpful as
you work to memorize the steps in the BGP best path algorithm.
Step 3 compares the source from which the routes were added to the BGP table. When the
BGP best path algorithm compares two routes at this step, if one were injected into BGP
locally, and the other were not (it was learned from a BGP peer), the router chooses the
route that was injected locally. Chapter 13, “External BGP,” section “Injecting Routes into
BGP for Advertisement to the ISPs,” describes the two ways to locally inject these routes,
the network command and redistribution from an IGP.
Step 5 refers to the BGP Origin PA. The Origin PA attempts to identify the source from
outside BGP from which the route was injected into BGP. The three Origin code values
are
■ I: Injected from an IGP (for example, redistribution from EIGRP)
■ E: Injected from Exterior Gateway Protocol (EGP)
■ ?: Undetermined
Although the original intent of the Origin PA is to identify the source from which BGP
learned the route, routers can also set the Origin PA as part of a strategy to influence the
BGP best path.
Step 7 refers to the Neighbor type: iBGP or eBGP. Remembering that BGP compares two
routes at a time, if one is learned with eBGP, and the other with iBGP, the router chooses
the eBGP route as best. Using this feature to influence the best path choice would be difficult,
because the ASN in which a router resides is fixed by the BGP design.
Finally, Step 8 refers to the IGP metric to the Next_Hop address. At this step, the router
compares the metrics of the IP routes for each Next_Hop IP address and chooses the BGP
route with the lower IGP metric to its Next_Hop. (If an IGP-learned route is not used, for
example, if both use connected routes, BGP considers the metrics to tie.) It is conceivable
that an engineer might tune the IGP to manipulate BGP’s best path choice, but this step is
so far into the algorithm that the earlier and more flexible settings would be much better
options.
www.CareerCert.info
Chapter 15: BGP Path Control 499
Memorization Tips for BGP Best Path
This short section suggests a mnemonic tool to help you memorize Steps 0 through 8 of
the BGP best path algorithm. Feel free to skim this section for now, or ignore it
entirely–there is no requirement that you memorize the best path algorithm using the
mnemonics in this section. (However, you may want to at least review upcoming Figure
15-2, which gives a good visual reference for some of the information summarized in Table
15-3.) But you should plan on memorizing the list at some point before the exam, even if
you ignore the mnemonic device.
First, if you refer back to the BGP best path algorithm as listed in table 15-3, you see that
the second column lists a single-letter mnemonic letter. These letters match the first letter
of the description in the third column of that table. Then, take these initial letters and
group them as follows:
■ N
■ WLLA
■ OMNI
The N is listed separately because it represents the “is the next-hop reachable” logic of
Step 0 and is somewhat separate from the other steps.
The mnemonic groups the eight main steps as two sets of four letters for a couple of reasons.
Both sets can be pronounced, even if they don’t spell words. It should be easier to
memorize as two sets of four. And maybe most important, the first set of four letters, representing
Steps 1 through 4, include all the features that engineers typically use to influence
outbound routes from the Enterprise:
■ WLLA: Refers to the three steps that an engineer might use to influence outbound
routes: Weight, Local_Pref, and AS_Path length. (Additionally, the second L, in
WLLA for Step 3, represents the “Locally injected routes” choice.)
W L L A O M N I
Popular to
Influence
Outbound
Routes
Popular to
Influence
Inbound
Routes
N
Figure 15-2 BGP Best Path Mnemonics
www.CareerCert.info
500 CCNP ROUTE 642-902 Official Certification Guide
■ OMNI: As listed in Table 15-3, the letters represent Origin (I or ?), MED, neighbor
type (eBGP over iBGP), and IGP metric to Next-hop.
So, if you can memorize N WLLA OMNI, by the time you’ve read this chapter you can
probably pick out which of those correlate to the four bigger topics later in this chapter:
Weight, Local_Pref, AS_Path length, and MED. Hopefully with a little more study, you
can memorize the rest of the list.
Figure 15-2 shows the mnemonic letters in graphical form just as another aid in memorizing
the steps. It also shows a reminder of which features are most likely to be used to influence
outbound routes from the Enterprise, and the one setting (MED) most likely to be
used to influence inbound routes into the Enterprise.
The rest of this chapter focuses on a deeper explanation of the four best path steps that
engineers typically use to influence the choice of best path.
No comments:
Post a Comment