0% found this document useful (0 votes)
61 views

BGP Path Selection - CCIE Blog

Uploaded by

PA2 kspl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views

BGP Path Selection - CCIE Blog

Uploaded by

PA2 kspl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

BGP path selection | CCIE Blog http://blog.initialdraft.

com/archives/702/

CCIE Blog Search


Initial Draft – Cisco Networking and CCIE Training

FEB

10 BGP Best Path Selection 6 Comments

Algorithm with examples


BGP is the protocol used to announce prefixes throughout the internet. It’s a very robust protocol, and very Subscribe by email
0 4
useful to carry lot of prefixes, such as the Internet prefixes or internal client prefixes of an ISP.
Tweet Enter your email address:
When a prefix is received in BGP, the path passes through two steps before being chosen as candidate to
populate the RIB.

The first step consists on checking if the path is valid. If it is, the prefix will get into the BGP table, and later the second step of
selection will start. Subscribe
Delivered by FeedBurner
In order to pass this first check, the path must meet the following requirements:

The prefix must not been marked as “not-synchronized”


There must be a route in the RIB to reach the next-hop
For prefixes learned through eBGP sessions, the local ASN must not be in the AS_PATH of the prefix
Google+
In the second step, the best path to reach the prefix is selected. If there is only one path, no comparison needed. If there are
many paths to reach the prefix, there is a special algorithm that BGP uses to select the best path, and this is what I want to talk about.
Initial Draft on
This algorithm dictates the following:

1. Prefer the path with the highest WEIGHT


2. Prefer the path with the highest LOCAL PREFERENCE +70
3. Prefer the path that was locally originated via a network o redistribute command over aggregate-address command
4. Prefer the path with the lowest AS_PATH
5. Prefer the path with the lowest ORIGIN type
6. Prefer the path with the lowest MULTI-EXIT DISCRIMINATOR (MED)
7. Prefer eBGP over iBGP Interesting Links
8. Prefer the path with the lowest IGP metric to the BGP next-hop
9. When both path are external, prefer the one that was received first CCIE R/S Expanded Blueprint
10. Prefer the route that comes from the BGP router with the lowest router ID
11. If the originator or router ID is the same for multiple paths, prefer the path with the minimum cluster list length Cisco Documentation CD
12. Prefer the path that comes from the lowest neighbor address
As you can see, the selection process is quite long, although in most cases the selection doesn’t go further than point 8. Firewall Audit

Let’s study points 1 through 8 and how we can influence them within the following lab. The prefix we are going to be working with is INE Blog
100.100.100.0/24, announced by R4 and R6:
Roger's CCIE Blog

INE

1.- PATH WITH HIGHEST WEIGHT

Weight is a Cisco-specific attribute, that means it’s not standard. This attribute is local to the router on witch it’s configured, so it’s not
advertised with the prefix to other peers. This attribute is used to tell the router which path to use to reach the prefix. The highest
value wins.

It’s the first attribute checked by BGP, so if there are two different paths for the same prefix but with different Weight values, the path
with the highest value wins.
Recent Comments
In the lab scenario, R4 and R6 both announce the prefix 100.100.100.0/24, one through an eBGP session and other through an iBGP
session. Let’s check how R2 and R1 see this prefix without changing anything:

R2#show ip bgp
BGP table version is 3, local router ID is 2.2.2.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 100.100.100.0/24 4.4.4.4 0 0 65002 i
*>i 6.6.6.6 0 100 0 i

R2#show ip bgp 100.100.100.0/24


BGP routing table entry for 100.100.100.0/24, version 3
Paths: (2 available, best #2, table default)
Advertised to update-groups:
13 16
65002
4.4.4.4 (metric 11) from 4.4.4.4 (4.4.4.4)
Origin IGP, metric 0, localpref 100, valid, external
Local
6.6.6.6 (metric 11) from 6.6.6.6 (6.6.6.6)
Origin IGP, metric 0, localpref 100, valid, internal, best
R2 gets two paths for the prefix 100.100.100.0/24: one of them from an eBGP peer and the other one from an iBGP peer. So

1 of 7 6/15/2012 9:12 PM
BGP path selection | CCIE Blog http://blog.initialdraft.com/archives/702/

2 of 7 6/15/2012 9:12 PM
BGP path selection | CCIE Blog http://blog.initialdraft.com/archives/702/

3 of 7 6/15/2012 9:12 PM
BGP path selection | CCIE Blog http://blog.initialdraft.com/archives/702/

4 of 7 6/15/2012 9:12 PM
BGP path selection | CCIE Blog http://blog.initialdraft.com/archives/702/

5 of 7 6/15/2012 9:12 PM
BGP path selection | CCIE Blog http://blog.initialdraft.com/archives/702/

The BGP Best Path Selection Algorithm with examples by CCIE Blog, unless otherwise expressly stated, is licensed
under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Tags: as-path, bgp, ccie, routing

Posted in CCIE RS Routing

6 Comments Posted by Jose Miguel Huertas

6 Responses to "BGP Best Path Selection Algorithm with examples"

February 10, 2011 at 12:31 Reply


Hi Jose’
GIO says: excellent review.The Vol 1 INE is also excellent and the RB
Handbook also useful.I have studied these attributes also for the
ROUTE exam.My confusion starts,in a multiple AS scenario,when
I have to decide to WHERE to apply the configuration.It is clear
which attributes work for IN or OUTwards traffic but the
confusion persists.Any simple rule that could help ? It is
frustrating that I have done the right config but nothing happens
because is on the wrong AS ):
Thanks

February 10, 2011 at 12:43 Reply


Give this a look: http://www.pacnog.org/pacnog2/track2/routing
Jose Leitao /b1-1up.pdf and http://cciepursuit.wordpress.com/2008/07
says: /08/bgp-path-manipulation-goofy-mnemonic/

6 of 7 6/15/2012 9:12 PM
BGP path selection | CCIE Blog http://blog.initialdraft.com/archives/702/

Influencing March 28, 2011 at 09:32 Reply


BGP path
selection [...] Cost Community – Cisco How the Best Path Algorithm Works
with – Cisco BGP Best Path Selection Algorithm with examples
extended Bookmark on Delicious Digg this post Recommend on Facebook
community Buzz it up share via Reddit Share with [...]
cost | CCIE
Blog - Initial
Draft says:

Leave a Comment

Name (required)

Email (will not be published) (required)

Website URL

SUBMIT COMMENT

CAPTCHA Code *

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Copyright © 2011-2012 CCIE Blog | eDegree° Theme b y Top Blog Formula on WordPress | Log In

follow:

Become my Facebook friend

RSS

Tweet with me

7 of 7 6/15/2012 9:12 PM

You might also like