cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2670
Views
0
Helpful
12
Replies

confused BGP path selection question

davidxiayuan
Level 1
Level 1

Hi Folks,

really confused on following BGP path selections

BGP routing table entry for 1.0.16.0/23, version 18808717

Paths: (3 available, best #3, table default)

  Not advertised to any peer

  Refresh Epoch 1

  1174 21914 22519, (received & used)

    140.60.10.77 from 140.60.10.77 (30.20.1.218)

      Origin IGP, metric 239079, localpref 100, valid, external

      Community: 1174:21000 1174:22013

  Refresh Epoch 1

  18553 1174 21914 2519, (received & used)

    80.90.50.9 from 80.90.50.9 (190.10.250.245)

      Origin IGP, metric 50, localpref 100, valid, external

      Community: 18553:140

  Refresh Epoch 2

  1174 21914 22519, (received & used)

    30.220.90.1 (metric 128512) from 30.220.90.1 (140.60.10.74)

      Origin IGP, metric 238069, localpref 100, valid, internal, best

Network                   Next Hop            Metric     LocPrf Weight Path

*  1.0.16.0/23      140.60.10.77         239079                       0   1174 2914 2519 i

*                             80.90.50.9              50                              0    18553 174 2914 2519 i

*>i                          30.220.90.1         238069    100             0 1174 2914 2519 i

BGP routing table entry for 1.22.24.0/24, version 18808791

Paths: (3 available, best #2, table default)

  Advertised to update-groups:

     3

  Refresh Epoch 1

  1174 6453 4755 45528, (received & used)

    140.60.10.77 from 140.60.10.77 (30.20.1.218)

      Origin IGP, metric 109040, localpref 100, valid, external

      Community: 1174:21100 1174:22012

  Refresh Epoch 1

  18553 15412 18101 45528, (received & used)

    80.90.50.9 from 80.90.50.9 (190.10.250.245)

      Origin IGP, metric 50, localpref 100, valid, external, best

      Community: 18553:160 18553:210

  Refresh Epoch 2

  1174 6453 4755 45528, (received & used)

    30.220.90.1 (metric 128512) from 30.220.90.1 (140.60.10.74)

      Origin IGP, metric 108030, localpref 100, valid, internal

by checking

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml

My understanding for 1.0.16.0/23, the router should go for 140.60.10.77, as in the case of all other conditions are same, the BGP should prefer EBGP route rather than iBGP route, however in the case, router selected 30.220.90.1 as the best path which is a iBGP peering.

for 1.22.24.0/24

I would thought, it should go for 140.60.10.77, however it choosed 80.90.50.9 as the best path even if they have longest AS path.

I leave the MEDs comparison as default, so it shouldn't compare the MEDS it is learned from two different ASs.

Could anyone give me some hints about how the router choose the Best paths in these cases please.

I have updated the topology, the routing table displayed here is the routing table on TCW ASR router.

Much appreciated.

12 Replies 12

perptech1
Level 1
Level 1

Do you mind posting a running config? 

If there could be any specific settings in the configure could impact this routing selections?

Hello David,

Please provide a topology. It would take a while to grasp the architecture with the outputs. Depicting your neighboring AS'es would be a good start. Will wait for your update.

Thanks

Vivek

The reason for the path selection for 1.0.16.0/23 via 30.220.90.1 is probably because of the Metric. Metric via

140.60.10.77 is 239079 whereas metric via 30.220.90.1 is 238069. Now the reason is, router would be comparing the metric from its neighbor which are in the same AS this happens before the order "Prefer eBGP over iBGP".

And yes, about the another route. It compared the metric from a different AS even though MED was left to defaults. Thats weird.

With a topology in hand, it would make things easier to explain & troubleshoot.

Regards

Vivek

Thank you for your reply, I have updated the topology map, Could you take a look again please?

Hello David,

1.0.16.0/23 will surely prefer via 30.220.90.1. Thats because of the Lower MED. As i said earlier, router would be comparing the MED value only from the same AS. So, TCW ASR compares two paths one via 140.60.10.77 & another via 30.220.90.1 as they are from same AS 1174.

Now, the complete theory as said above goes for a toss   as we notice that the route 1.22.24.0/24 is preferred via

80.90.50.9 even though being in a different AS it's MED was compared !! As you said MED config left to default, i assume you haven't issued bgp always-compare-med command under BGP process. If it is not issued, then it's totally weird as to why the router choose the route from this neighbor.

Have you tried clearing the BGP process 

Reason for the strikethrough : If you were to issue bgp always compare-med then even 1.0.16.0/23 would have preferred the path with MED of 50. So, it doesn't hold good.

Regards

Vivek

This is a topic of discussion for sure ! I would call for the experts in forum to join please.

As per my understanding (I may be wrong), Below are the things which happened

Route : 1.0.16.0/23

Router organizes the path it learnt in a order (i.e newest to lowest). Below is your output

Network                   Next Hop            Metric     LocPrf Weight Path

*  1.0.16.0/23      140.60.10.77         239079                       0   1174 2914 2519 i

*                             80.90.50.9              50                              0    18553 174 2914 2519 i

*>i                          30.220.90.1         238069    100             0 1174 2914 2519 i

Now, BGP best path selection process begins, the 2nd most route is withdrawn due to longer AS_PATH in comparison to others. Now begins the MED comparison, Route learnt via 140.60.10.77 is compared with 80.90.50.9 (this is being from a different AS, it drops comparison). Now, the comparison begins with route via 140.60.10.77 to the 30.220.90.1. Lowest MED value wins (i.e route via 30.220.90.1).

Route : 1.22.24.0/24

The same process happens. But looks like the oldest advertisement is from 80.90.50.9 & hence it wins.

As per RFC 4277 :

"Some implementations have hooks to apply temporal behavior in MED-based best path selection.  That is, all things being equal up to MED consideration, preference would be applied to the "oldest" path, without preference for the lower MED value.  The reasoning for this is that "older" paths are presumably more stable, and thus   preferable.  However, temporal behavior in route selection results in non-deterministic behavior, and as such, may often be undesirable."

Can some BGP expert comment on this?

Regards

Vivek

Thank you for your reply Vivek,

That probably explained why, as I did shut down the BGP sessions with140.60.10.77 previously to let BGP peer to carry out some urgent jobs and re-enabled the BGP session with140.60.10.77 after job completed.

If any other people could comment on this, that would be grateful.

I will try to simulate this in my lab tonight. Will let you know the outcome. In the meantime, if someone may comment/help, that would be great.

Hi,

I think that for 1.0.16.0/23 the best path has a lower MED  compared to first entry which won against second one because of shorter AS_PATH

Regards.

Alain.

Don't forget to rate helpful posts.

Don't forget to rate helpful posts.

Ajay Raj
Level 1
Level 1

MED is used, if we have multiple exit points towards as AS.

Here we have multiple exit ponts to AS 1174. Hence the shortest MED value among this is chosen as best.

So the path via 80.90.50.9 is not coming into picture when we compare MED. Because there are no muliple exit point to reach AS 18553

Hello,

1.0.16.0/23  = Local pref is prefered before as-path & med.
1.22.24.0/24-=  lowest Metric ( MED )

res

Paul


Please don't forget to rate this post if it has been helpful.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Review Cisco Networking products for a $25 gift card