[quagga-users 9903] Re: Question about Quagga's BGP Decision Making Process for tie breakers

Peter Mitter peter.mitter1 at gmail.com
Tue Sep 16 22:35:35 IST 2008


Steve and Andy,

The bgp_route.c code says:

    476
    477   /* 10. If both paths are external, prefer the path that was received
    478      first (the oldest one).  This step minimizes route-flap, since a
    479      newer path won't displace an older one, even if it was the
    480      preferred route based on the additional decision criteria
below.  */
    481   *if* (! bgp_flag_check
<http://src.opensolaris.org/source/s?defs=bgp_flag_check> (bgp,
BGP_FLAG_COMPARE_ROUTER_ID
<http://src.opensolaris.org/source/s?defs=BGP_FLAG_COMPARE_ROUTER_ID>)
    482       && peer_sort
<http://src.opensolaris.org/source/s?defs=peer_sort> (*new*->peer) ==
BGP_PEER_EBGP <http://src.opensolaris.org/source/s?defs=BGP_PEER_EBGP>
    483       && peer_sort
<http://src.opensolaris.org/source/s?defs=peer_sort> (exist
<http://src.opensolaris.org/source/s?defs=exist>->peer) ==
BGP_PEER_EBGP <http://src.opensolaris.org/source/s?defs=BGP_PEER_EBGP>)
    484     {
    485       *if* (CHECK_FLAG
<http://src.opensolaris.org/source/s?defs=CHECK_FLAG> (*new*->flags
<http://src.opensolaris.org/source/s?defs=flags>, BGP_INFO_SELECTED
<http://src.opensolaris.org/source/s?defs=BGP_INFO_SELECTED>))
    486 	*return* 1;
    487       *if* (CHECK_FLAG
<http://src.opensolaris.org/source/s?defs=CHECK_FLAG> (exist
<http://src.opensolaris.org/source/s?defs=exist>->flags
<http://src.opensolaris.org/source/s?defs=flags>, BGP_INFO_SELECTED
<http://src.opensolaris.org/source/s?defs=BGP_INFO_SELECTED>))
    488 	*return* 0;
    489     }
    490

If the .97 comes in first, Quagga would prefer it since it came first and
the .94 won't displace the .97. If both of them come in at the exact same
time, then
Step 11: Least Router ID
Step 12: minimum cluster list length.
Step 13: Lowest router IP

will be processed.


Does that explain why I see 97 sometimes and 94 sometimes?

Thanks
Peter


On Tue, Sep 16, 2008 at 5:18 PM, Alexis Rosen <
quagga-users at alexis.users.panix.com> wrote:

> On ciscos there's a command to allow equal-cost multipathing in BGP -
> "maximum-paths N" in the BGP stanza.
>
> Perhaps quagga's got that turned on by default?
>
> /a
>
>
> On Sep 16, 2008, at 5:04 PM, Peter Mitter wrote:
>
>  Steve,
>>
>> These commands were executed when .97 is preferred over .94. I waited for
>> a 15 minutes to see if .94 overrides .97 in the RIB without any user
>> intervention. It doesn't.
>>
>>
>>
>>  At Tue Sep 16 20:28:55 GMT 2008 Routes are going to: 172.22.10.97 for
>> 10.10.100.0 instead of 172.22.10.94
>>
>>
>>  *********** show ip bgp 10.10.100.0 ********
>> BGP routing table entry for 10.10.100.0/24
>> Paths: (1 available, best #1, table Default-IP-Routing-Table)
>>  Not advertised to any peer
>>  400
>>    172.22.10.97 from 172.22.10.97 (172.22.10.97)
>>      Origin IGP, metric 0, localpref 100, valid, external, best
>>      Last update: Tue Sep 16 20:28:53 2008
>>
>>
>> Doing a stop a start a few more times and waited till .97 is preferred.
>> Did a show ip bgp again:
>>
>> *********** show ip bgp 10.10.100.0 ********
>> BGP routing table entry for 192.168.100.0/24
>> Paths: (2 available, best #2, table Default-IP-Routing-Table)
>>  Not advertised to any peer
>>  400
>>    172.22.10.94 from 172.22.10.94 (172.22.10.97)
>>      Origin IGP, metric 0, localpref 100, valid, external
>>      Last update: Tue Sep 16 20:54:11 2008
>>
>>  400
>>    172.22.10.97 from 172.22.10.97 (172.22.10.97)
>>      Origin IGP, metric 0, localpref 100, valid, external, best
>>      Last update: Tue Sep 16 20:54:05 2008
>>
>> *********** show ip bgp sum *********
>> BGP router identifier 172.22.10.25, local AS number 300
>> RIB entries 33, using 1848 bytes of memory
>> Peers 3, using 7392 bytes of memory
>> Peer groups 2, using 32 bytes of memory
>>
>> Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down
>>  State/PfxRcd
>> 172.22.10.94     4   400      17      20        0    0    0 00:01:16
>>   17
>> 172.22.10.97     4   400      18      21        0    0    0 00:01:22
>>   17
>>
>> Total number of neighbors 2
>>
>>
>>  *********** show ip bgp sum *********
>> BGP router identifier 172.22.10.25, local AS number 300
>> RIB entries 33, using 1848 bytes of memory
>> Peers 3, using 7392 bytes of memory
>> Peer groups 2, using 32 bytes of memory
>>
>> Neighbor        V    AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down
>>  State/PfxRcd
>> 172.22.10.94     4   400       0       1        0    0    0 never
>>  Active
>> 172.22.10.97     4   400       3       4        0    0    0 00:00:04
>>   17
>>
>> Total number of neighbors 2
>>
>>  *********** show ip bgp nei *********
>> BGP neighbor is 172.22.10.94, remote AS 400, local AS 300, external link
>>  Member of peer-group peerB for session parameters
>>  BGP version 4, remote router ID 0.0.0.0
>>  BGP state = Active
>>  Last read 00:00:10, hold time is 16, keepalive interval is 4 seconds
>>  Message statistics:
>>    Inq depth is 0
>>    Outq depth is 0
>>                         Sent       Rcvd
>>    Opens:                  1          0
>>    Notifications:          0          0
>>    Updates:                0          0
>>    Keepalives:             0          0
>>    Route Refresh:          0          0
>>    Capability:             0          0
>>    Total:                  1          0
>>  Minimum time between advertisement runs is 30 seconds
>>
>>  For address family: IPv4 Unicast
>>  peerB peer-group member
>>  Inbound soft reconfiguration allowed
>>  NEXT_HOP is always this router
>>  Community attribute sent to this neighbor(both)
>>  0 accepted prefixes
>>
>>  Connections established 0; dropped 0
>>  Last reset never
>> Local host: 172.22.10.25, Local port: 37272
>> Foreign host: 172.22.10.94, Foreign port: 179
>> Nexthop: 172.22.10.25
>> Next connect timer due in 114 seconds
>> Read thread: off  Write thread: off
>>
>> BGP neighbor is 172.22.10.97, remote AS 400, local AS 300, external link
>>  Member of peer-group peerA for session parameters
>>  BGP version 4, remote router ID 172.22.10.97
>>  BGP state = Established, up for 00:00:04
>>  Last read 00:00:03, hold time is 16, keepalive interval is 5 seconds
>>  Neighbor capabilities:
>>    Route refresh: advertised and received(old & new)
>>    Address family IPv4 Unicast: advertised and received
>>  Message statistics:
>>    Inq depth is 0
>>    Outq depth is 0
>>                         Sent       Rcvd
>>    Opens:                  1          1
>>    Notifications:          0          0
>>    Updates:                1          1
>>    Keepalives:             2          1
>>    Route Refresh:          0          0
>>    Capability:             0          0
>>    Total:                  4          3
>>  Minimum time between advertisement runs is 30 seconds
>>
>>  For address family: IPv4 Unicast
>>  peerA peer-group member
>>  Inbound soft reconfiguration allowed
>>  NEXT_HOP is always this router
>>  Community attribute sent to this neighbor(both)
>>  17 accepted prefixes
>>
>>  Connections established 1; dropped 0
>>  Last reset never
>> Local host: 172.22.10.25, Local port: 37273
>> Foreign host: 172.22.10.97, Foreign port: 179
>> Nexthop: 172.22.10.25
>> Read thread: on  Write thread: off
>>
>>
>> These show command was executed when 172.22.10.97 is preferred over
>> 172.22.10.94.
>>
>> quagga at localhost# show ip bgp nei 172.22.10.97 received-routes
>> BGP table version is 0, local router ID is 172.22.10.25
>> Status codes: s suppressed, d damped, h history, * valid, > best, i -
>> internal,
>>              r RIB-failure, S Stale, R Removed
>> Origin codes: i - IGP, e - EGP, ? - incomplete
>>
>>   Network          Next Hop            Metric LocPrf Weight Path
>> *> 10.10.50.0     172.22.10.97              0             0 400 i
>> *> 10.10.60.0     172.22.10.97              0             0 400 i
>> *> 10.10.70.0     172.22.10.97              0             0 400 i
>> *> 10.10.80.0     172.22.10.97              0             0 400 i
>> *> 10.10.90.0     172.22.10.97              0             0 400 i
>> *> 10.10.100.0    172.22.10.97              0             0 400 i
>> *> 10.10.110.0    172.22.10.97              0             0 400 i
>> *> 10.10.120.0    172.22.10.97              0             0 400 i
>> *> 10.10.130.0    172.22.10.97              0             0 400 i
>> *> 10.10.140.0    172.22.10.97              0             0 400 i
>> *> 10.10.150.0    172.22.10.97              0             0 400 i
>> *> 10.10.160.0    172.22.10.97              0             0 400 i
>> *> 10.10.170.0    172.22.10.97              0             0 400 i
>> *> 10.10.180.0    172.22.10.97              0             0 400 i
>> *> 10.10.190.0    172.22.10.97              0             0 400 i
>> *> 10.10.200.0    172.22.10.97              0             0 400 i
>> *> 10.10.210.0    172.22.10.97              0             0 400 i
>>
>> Total number of prefixes 17
>>
>>
>> quagga at localhost# show ip bgp nei  172.22.10.94 received-routes
>> BGP table version is 0, local router ID is 172.22.10.25
>> Status codes: s suppressed, d damped, h history, * valid, > best, i -
>> internal,
>>              r RIB-failure, S Stale, R Removed
>> Origin codes: i - IGP, e - EGP, ? - incomplete
>>
>>   Network          Next Hop            Metric LocPrf Weight Path
>> *> 10.10.50.0     172.22.10.94              0             0 400 i
>> *> 10.10.60.0     172.22.10.94              0             0 400 i
>> *> 10.10.70.0     172.22.10.94              0             0 400 i
>> *> 10.10.80.0     172.22.10.94              0             0 400 i
>> *> 10.10.90.0     172.22.10.94              0             0 400 i
>> *> 10.10.100.0    172.22.10.94              0             0 400 i
>> *> 10.10.110.0    172.22.10.94              0             0 400 i
>> *> 10.10.120.0    172.22.10.94              0             0 400 i
>> *> 10.10.130.0    172.22.10.94              0             0 400 i
>> *> 10.10.140.0    172.22.10.94              0             0 400 i
>> *> 10.10.150.0    172.22.10.94              0             0 400 i
>> *> 10.10.160.0    172.22.10.94              0             0 400 i
>> *> 10.10.170.0    172.22.10.94              0             0 400 i
>> *> 10.10.180.0    172.22.10.94              0             0 400 i
>> *> 10.10.190.0    172.22.10.94              0             0 400 i
>> *> 10.10.200.0    172.22.10.94              0             0 400 i
>> *> 10.10.210.0    172.22.10.94              0             0 400 i
>>
>> Total number of prefixes 17
>>
>>
>> # netstat -rn
>>
>> Routing Table: IPv4
>>  Destination           Gateway           Flags  Ref     Use     Interface
>> -------------------- -------------------- ----- ----- ---------- ---------
>> default            172.22.10.1           UG        1       5189
>> 172.22.10.0        172.22.10.25          U         1       3077 bge0
>> 10.10.60.0         172.22.10.97          UG        1          0
>> 10.10.70.0         172.22.10.97          UG        1          0
>> 10.10.80.0         172.22.10.97          UG        1          0
>> 10.10.90.0         172.22.10.97          UG        1          0
>> 10.10.100.0        172.22.10.97          UG        1          0
>> 10.10.110.0        172.22.10.97          UG        1          0
>> 10.10.120.0        172.22.10.97          UG        1          0
>> 10.10.130.0        172.22.10.97          UG        1          0
>> 10.10.140.0        172.22.10.97          UG        1          0
>> 10.10.150.0        172.22.10.97          UG        1          0
>> 10.10.160.0        172.22.10.97          UG        1          0
>> 10.10.170.0        172.22.10.97          UG        1          0
>> 10.10.180.0        172.22.10.97          UG        1          0
>> 10.10.190.0        172.22.10.97          UG        1          0
>> 10.10.200.0        172.22.10.97          UG        1          0
>> 10.10.210.0        172.22.10.97          UG        1          0
>> 224.0.0.0          172.22.10.25          U         1          0 bge0
>> 127.0.0.1          127.0.0.1            UH       35       2958 lo0
>>
>>
>> On Tue, Sep 16, 2008 at 4:14 PM, Steve Bertrand <steve at ibctech.ca> wrote:
>> Peter Mitter wrote:
>> > Steve,
>> >
>> > I want to see 172.22.10.94 <http://172.22.10.94> as my preferred route
>> > for the BGP learnt routes since it has a lower IP over 172.22.10.97
>> > <http://172.22.10.97>. Please see the details listed below.
>>
>> Ok, everything looks fine.
>>
>> What does 'sh ip bgp' look like after .97 appears in the route table,
>> and also, what does 'sh ip bgp sum' look like at that time?
>>
>> I'm wondering if the BGP session for .94 is re-establishing in a timely
>> fashion, or at all.
>>
>> Steve
>>
>> _______________________________________________
>> Quagga-users mailing list
>> Quagga-users at lists.quagga.net
>> http://lists.quagga.net/mailman/listinfo/quagga-users
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.quagga.net/pipermail/quagga-users/attachments/20080916/835ae546/attachment-0001.html 


More information about the Quagga-users mailing list