BGP route selection

Arvin Gan AGan at advaoptical.com
Fri Apr 27 04:34:20 CEST 2018


Hi,
   Thanks. I notice this codes in rte_better() in file rt-table.c.  Since iBGP and eBGP have same protocol preference, that mean route preference are also same. In this case, if we have one iBGP instance and one eBGP instance, since instance address are different,  route selection  will entry this branch as blow, yes ? but we cannot ensure address of eBGP is prior than  address of iBGP... is it based on sequence of BGP instance in bird.conf ? 
    
 if (new->attrs->src->proto->proto != old->attrs->src->proto->proto) 
    {
      /*
       *  If the user has configured protocol preferences, so that two different protocols
       *  have the same preference, try to break the tie by comparing addresses. Not too
       *  useful, but keeps the ordering of routes unambiguous.
       */
      return new->attrs->src->proto->proto > old->attrs->src->proto->proto;
    }

Thanks
Arvin

-----Original Message-----
From: Ondrej Zajicek <santiago at crfreenet.org> 
Sent: Wednesday, April 18, 2018 10:58 PM
To: Arvin Gan <AGan at advaoptical.com>
Cc: bird-users at network.cz; Robert Blayzor <rblayzor.bulk at inoc.net>
Subject: Re: BGP route selection

On Wed, Apr 18, 2018 at 03:35:43AM +0000, Arvin Gan wrote:
> Hi all,
>    Sorry, it's my ambiguous description. What I said default value is Cisco's admin distance value, eBGP is 20 and iBGP is 200. We plan to use preference to implement  admin distance. Actually ,in bird,  the preference of channel for BGP is  BGP protocol default preference DEF_PREF_BGP ( = 100). 
>      1)  Since the configuration of preference is in channel ,if the protocol have more than one channel, does mean different channel can configure different preference  in the same protocol ?

Yes

>      2) I also notice that " new->pref = c->preference; " in rte_update2, does mean  the preference of route in route table get from  preference of channel ?    

Yes, the channel preference is just a default value for route preference (could be changed even per-route by filters).

>      3)  When route selection, does mean algorithm selection compare preference of every route firstly , whether compare  the preference of  routes coming from same protocol ?  

Yes

> The global best route selection algorithm is (roughly) as follows:  ---> Does routes selection be processed as below sequence ?
> 
>    *   Preferences of the routes are compared.  ----> what's preference of the route, is preference in channel-config ?
>    *   Source protocol instance preferences are compared. --> what's protocol instance preference, is preference in channel-config for BGP protocol instance?

This is a bit confusing in documentation, there is just route preference (which is compared as a first step). Protocol/channel preference is just a default value for route preference.

>    *   If source protocols are the same (e.g. BGP vs. BGP), the protocol's route selection algorithm is invoked. --->source protocols, iBGP and eBGP are treated as same source protocol ?

Yes

>    *   If source protocols are different (e.g. BGP vs. OSPF), result of the algorithm is undefined.

--
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."



More information about the Bird-users mailing list