02-06-2014 12:53 PM - edited 03-07-2019 06:03 PM
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?
Solved! Go to Solution.
02-06-2014 02:25 PM
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.
02-06-2014 02:25 PM
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.
02-06-2014 03:20 PM
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?
02-06-2014 09:39 PM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide