Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

confused BGP path selection question

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.

  • WAN Routing and Switching
Everyone's tags (2)
12 REPLIES
New Member

confused BGP path selection question

Do you mind posting a running config? 

New Member

confused BGP path selection question

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

confused BGP path selection question

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

Re: confused BGP path selection question

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

New Member

confused BGP path selection question

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

Re: confused BGP path selection question

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

Re: confused BGP path selection question

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

New Member

Re: confused BGP path selection question

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.

confused BGP path selection question

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.

1578
Views
0
Helpful
12
Replies