1 2 Previous Next 25 Replies Latest reply: Apr 20, 2012 8:29 AM by Stephen RSS

    Is this a bug?

    Stephen

      Hi guys,

       

      I'm using gns3.  Just come across a situation where I think BGP picked the wrong best path.  Check the BGP 100.100.100.0/24 entry below (I included the bgp config so you can see that I don't have deterministic med, always-compare med, or bgp best path compare router-id on).

       

      R1#sh run | s bgp

      router bgp 10

      no synchronization

      bgp router-id 1.1.1.1

      bgp log-neighbor-changes

      network 12.12.12.0 mask 255.255.255.252

      network 13.13.13.0 mask 255.255.255.252

      network 14.14.14.0 mask 255.255.255.252

      neighbor 12.12.12.2 remote-as 20

      neighbor 13.13.13.2 remote-as 30

      neighbor 14.14.14.2 remote-as 30

      no auto-summary

       

      R1#sh ip bgp 100.100.100.0/24

      BGP routing table entry for 100.100.100.0/24, version 55

      Paths: (3 available, best #1, table Default-IP-Routing-Table)

        Advertised to update-groups:

           1

        30 40

          13.13.13.2 from 13.13.13.2 (3.3.3.3)

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

        20 40

          12.12.12.2 from 12.12.12.2 (2.2.2.2)

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

        30 40

          14.14.14.2 from 14.14.14.2 (4.4.4.4)

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

       

      So the first two paths are compared.  AS_PATHs are different, so med is ignored.  The best-path should be via the oldest route (2.2.2.2).  This should then be compared against the entry below via the router 4.4.4.4.  The bottom entry should then win because of age. 

       

      Can anyone tell me why it's picked the first path please, is it a bug?

        • 1. Re: Is this a bug?
          Marek

          I think the decision is made using IGP metric:

           

          Prefer the path with the lowest IGP metric to the BGP next hop.

           

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

           

          Or am I wrong?

           

          Marek

          • 2. Re: Is this a bug?
            Martin

            MED is 100, which is smaller than 150 or 200, so it is picked as the best. btw. this is not IGP metric to neighbor.

             

            AS Path -  in terms of Hops of AS - the shortest path is the Best.

            • 3. Re: Is this a bug?
              Marek

              Thanks Martin for the clarification - I was wrong. A good resource for the MED topic:

               

              http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094934.shtml#med

               

              Marek

              • 4. Re: Is this a bug?
                Stephen

                Hi Martin,

                 

                Can you explain why MED was evaluated?  The top two entries are using different AS_PATHs, since the best selection compares the top two paths first (i think?), med would only get evaluated by using the #bgp always-compare-med (because the top two paths have non-identical AS_PATHs!).  So this should cause my top two paths to be compared by age, and not med.  So why does it consider med in the evaluation?

                 

                If the best path selection starts by the bottom up, then the output would make sense.  But im so sure thats not the case right? because if you take another example, such as the one below; you would have thought the path via 2.2.2.2 would be best (comparing the bottom two paths = 3.3.3.3 is the winner because he is older.  Then 3.3.3.3 vs the 4.4.4.4 = 3.3.3.3 is the winner still, because lower med.  then 3.3.3.3 vs 2.2.2.2  = 2.2.2.2 is the winner because his med is lower.  So there is definately something weird going off in my topology!

                 

                Rack1R1#show ip bgp 24.1.1.0/24

                BGP routing table entry for 24.1.1.0/24, version 2

                Paths: (4 available, best #4, table Default-IP-Routing-Table)

                Advertised to update-groups:

                       2

                200 400

                   54.1.12.2 from 54.1.12.2 (2.2.2.2)

                     Origin incomplete, metric 200, localpref 100, valid, external

                200 400

                   54.1.14.4 from 54.1.14.4 (4.4.4.4)

                     Origin incomplete, metric 400, localpref 100, valid, external

                300 400

                   54.1.15.5 from 54.1.15.5 (5.5.5.5)

                     Origin incomplete, metric 500, localpref 100, valid, external

                200 400

                   54.1.13.3 from 54.1.13.3 (3.3.3.3)

                    Origin incomplete, metric 300, localpref 100, valid, external, best

                Rack1R1#

                • 5. Re: Is this a bug?
                  Martin

                  Yes, but I see two paths with 30 40; and one 20, 40; total 3 paths;

                  so I guess 100 is compared with 200, skipping 150; no skipping allowed

                   

                  Try this: remove 1st one with 100 so that u have 150 and 200 or 30 40 and 20 40;

                  what happens?

                   

                  btw. this  might depend on IOS version or even a Bug; what is your IOS?

                  • 6. Re: Is this a bug?
                    Stephen

                    R1#sh ver

                    Cisco IOS Software, 3600 Software (C3660-A3JK9S-M), Version 12.4(25c), RELEASE SOFTWARE (fc2)

                    • 7. Re: Is this a bug?
                      Martin

                      You are right about comparing 1st two paths from top, then next one and so on - default Cisco way is my understanding.

                      Let me read the link Marek posted and make sense out of it.

                       

                      No idea why your outputs are different than expected. if u attach gns3 configs and .net files here, I can try it later. Try it on another IOS.

                      of course, order of booting routers will matter here as well.

                       

                      Message was edited by: Martin

                      • 8. Re: Is this a bug?
                        Stephen

                        Hey Martin,

                         

                        What's interesting is that i deleted the 13.13.13.2 neighbor, and it's still choosing the path with the lowest med.  Again, I've included the bgp output so you can see that always-compare med & bestpath compare router-id is turned off.

                         

                        BGP routing table entry for 100.100.100.0/24, version 20

                        Paths: (2 available, best #1, table Default-IP-Routing-Table)

                          Advertised to update-groups:

                             1

                          20 40

                            12.12.12.2 from 12.12.12.2 (2.2.2.2)

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

                          30 40

                            14.14.14.2 from 14.14.14.2 (4.4.4.4)

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

                         

                         

                        R1(config-router)#do sh run | s bgp

                        router bgp 10

                        no synchronization

                        bgp router-id 1.1.1.1

                        bgp log-neighbor-changes

                        network 12.12.12.0 mask 255.255.255.252

                        network 13.13.13.0 mask 255.255.255.252

                        network 14.14.14.0 mask 255.255.255.252

                        neighbor 12.12.12.2 remote-as 20

                        neighbor 14.14.14.2 remote-as 30

                        no auto-summary

                         

                         

                        Also,  I've tried 3 different IOS versions & got the same result each time

                        • 9. Re: Is this a bug?
                          Erick

                          It looks like it's choosing the path received from the neighbor with the lowest router ID.

                          • 10. Re: Is this a bug?
                            Stephen

                            What about the output in the inital post though?  Surely it's a big bad bug!

                            • 11. Re: Is this a bug?
                              Erick

                              It's not a bug.  In your initial post MED was used because you have two paths being receive from the same AS. (1st & 3rd entries).  It chose the path with the best MED.  In this example, that was the path with the MED value of 100.

                              • 12. Re: Is this a bug?
                                Stephen

                                Okay.  So what is the point of the command #bgp deterministic-med?  Also, if that is the case, why in the output below did the first entry not win?  I feel like my in initial post that it shouldn't have selected med as the best path because the top two AS_PATHs are different.  This means entry 2 should win because its older, and should be compared vs the 3rd entry .

                                 

                                 

                                Rack1R1#show ip bgp 24.1.1.0/24

                                BGP routing table entry for 24.1.1.0/24, version 2

                                Paths: (4 available, best #4, table Default-IP-Routing-Table)

                                Advertised to update-groups:

                                       2

                                200 400

                                   54.1.12.2 from 54.1.12.2 (2.2.2.2)

                                     Origin incomplete, metric 200, localpref 100, valid, external

                                200 400

                                   54.1.14.4 from 54.1.14.4 (4.4.4.4)

                                     Origin incomplete, metric 400, localpref 100, valid, external

                                300 400

                                   54.1.15.5 from 54.1.15.5 (5.5.5.5)

                                     Origin incomplete, metric 500, localpref 100, valid, external

                                200 400

                                   54.1.13.3 from 54.1.13.3 (3.3.3.3)

                                    Origin incomplete, metric 300, localpref 100, valid, external, best

                                Rack1R1#

                                • 13. Re: Is this a bug?
                                  Erick

                                  You can check the release notes for the IOS you are using to see if there is a bug related to this, but it looks like BGP deterministic-med is enabled by default in the IOS.  When you said you tried 3 different IOS versions, did you try 3 different router model IOSs or 3 different sub releases of the 3600 model?

                                   

                                  What happens if you issue the command no bgp deterministic-med and update your policy?

                                  • 14. Re: Is this a bug?
                                    Stephen

                                    Hey again,

                                     

                                    Yeah I used a 3745 and a 7200 model, same version tho (which was a bit silly).  I did that cmd btw, i also did #no bgp always-compare-med and #no bgp bestpath router-id too, just to be sure.  I thought exactly the same thing as what you did!   But in the show output, it doesn't show anything, so I can't conclude that this is definately off unless you know a command that can check it?

                                    1 2 Previous Next