cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1650
Views
5
Helpful
3
Replies

bgp deterministic-med

Kashish_Patel
Level 2
Level 2

I am confused as to why bgp deterministic-med command is needed in the first place. As I understand it, MED is compared (by default) for advertisements coming from same AS.... bgp deterministic-med also says to compare updates from same AS. Then why is the command needed at all? Isn't it the bgp default behavior in the first place? Maybe I am missing something basic. Could any expert please help?

1 Accepted Solution

Accepted Solutions

daniel.dib
Level 7
Level 7

By default the BGP best path algorithm when involving MED is not deterministic.

Assume that you have the following entries in the BGP RIB:

entry1: AS(PATH) 500, med 100, external
entry2: AS(PATH) 100, med 200, external
entry3: AS(PATH) 500, med 150, external

Entries are ordered in BGP RIB according to age. So entry1 is the newest. The key thing here is that the paths are compared in pairs starting with newest path. So entry 1 and entry 2 get compared first, MED is not compared unless always-compare-med is enabled. Everything else equal entry 2 will win because it is older.

Entry2 moves on to face entry3. Everything else equal entry 3 will win because it is the oldest. This is not what AS 500 intended to do, traffic will follow the wrong path. With deterministic-med the paths from same AS are compared first which makes the selection deterministic.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094925.shtml#examp1

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

View solution in original post

3 Replies 3

daniel.dib
Level 7
Level 7

By default the BGP best path algorithm when involving MED is not deterministic.

Assume that you have the following entries in the BGP RIB:

entry1: AS(PATH) 500, med 100, external
entry2: AS(PATH) 100, med 200, external
entry3: AS(PATH) 500, med 150, external

Entries are ordered in BGP RIB according to age. So entry1 is the newest. The key thing here is that the paths are compared in pairs starting with newest path. So entry 1 and entry 2 get compared first, MED is not compared unless always-compare-med is enabled. Everything else equal entry 2 will win because it is older.

Entry2 moves on to face entry3. Everything else equal entry 3 will win because it is the oldest. This is not what AS 500 intended to do, traffic will follow the wrong path. With deterministic-med the paths from same AS are compared first which makes the selection deterministic.

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094925.shtml#examp1

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.

Daniel,

Thanks...

In above example, if deterministic-med is enabled, then entry 1 and 3 will be compared to each other. MED will be used and based on MED, entry 1 wins...entry 1 will now be compared with entry 2..MED is not compared then...entry 1 will win because it is older...Does that sound right?

Hi,

If deterministic MED is enabled then 1 and 3 are compared first, 1 wins. Then 1 and 2 are compared and 2 wins because it's older. We would have to enable always-compare-med to make 1 win over 2.

Daniel Dib
CCIE #37149

Please rate helpful posts.

Daniel Dib
CCIE #37149
CCDE #20160011

Please rate helpful posts.
Review Cisco Networking products for a $25 gift card