Incorrect value of s->pref_routes in nest/proto.c
Hello! While experimenting with tables I've noticed that number of preferred routes in 'show protocol all ...' output is shown incorrectly. Configuration is simple: table T_ITCONS; protocol bgp ITCONS { table T_ITCONS; passive; local as MyASN; neighbor 193.25.180.17 as 25372; rs client; prefer older on; import all; export none; } protocol pipe P_ITCONS { table master; mode transparent; peer table T_ITCONS; import where bgp_path.last = 28773; export none; } I got 9 routes in T_ITCONS table, 2 of them are exported to master table: bird> show route 195.78.38.0/23 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 188.190.160.0/19 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] bird> show route table T_ITCONS 109.68.40.0/21 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS25372i] 80.78.63.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS60359i] 185.102.164.0/22 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS29242i] 185.102.164.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS29242i] 194.247.174.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS196831i] 194.247.175.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS196831?] 193.84.72.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS39851i] 195.78.38.0/23 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 188.190.160.0/19 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 'show protocol all ITCONS' shows sum of them, i.e. 11 preferred routes and that is incorrect: bird> show protocol all ITCONS name proto table state since info ITCONS BGP T_ITCONS up 2016-03-31 18:11:33 Established Description: IT Consulting LLC Preference: 100 Input filter: ACCEPT Output filter: REJECT Routes: 9 imported, 0 exported, 11 preferred [...] I'm trying to figure out what's happening in nest/rt-table.c. Any help will be kindly appreciated! Thank you! -- Alexander Shikov Technical Staff, Digital Telecom IX Tel.: +380 44 201 14 07 http://dtel-ix.net/
On Fri, Apr 01, 2016 at 01:41:10PM +0300, Alexander Shikov wrote:
Hello!
I got 9 routes in T_ITCONS table, 2 of them are exported to master table:
bird> show route 195.78.38.0/23 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 188.190.160.0/19 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] bird> show route table T_ITCONS 109.68.40.0/21 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS25372i] 80.78.63.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS60359i] 185.102.164.0/22 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS29242i] 185.102.164.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS29242i] 194.247.174.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS196831i] 194.247.175.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS196831?] 193.84.72.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS39851i] 195.78.38.0/23 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 188.190.160.0/19 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i]
'show protocol all ITCONS' shows sum of them, i.e. 11 preferred routes and that is incorrect:
Hi This is an expected value, BIRD just counts the number of preferred pairs (route, table). If a route is preferred in multiple tables, it is counted multiple times. The 'preferred' stat is a bit odd, we will probably remove it in the future. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@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."
On Fri, Apr 01, 2016 at 01:12:19PM +0200, Ondrej Zajicek wrote:
On Fri, Apr 01, 2016 at 01:41:10PM +0300, Alexander Shikov wrote:
Hello!
I got 9 routes in T_ITCONS table, 2 of them are exported to master table:
bird> show route 195.78.38.0/23 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 188.190.160.0/19 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] bird> show route table T_ITCONS 109.68.40.0/21 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS25372i] 80.78.63.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS60359i] 185.102.164.0/22 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS29242i] 185.102.164.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS29242i] 194.247.174.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS196831i] 194.247.175.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS196831?] 193.84.72.0/24 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS39851i] 195.78.38.0/23 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i] 188.190.160.0/19 via 193.25.180.17 on vlan777 [ITCONS 2016-03-31 18:11:33] * (100) [AS28773i]
'show protocol all ITCONS' shows sum of them, i.e. 11 preferred routes and that is incorrect:
Hi
This is an expected value, BIRD just counts the number of preferred pairs (route, table). If a route is preferred in multiple tables, it is counted multiple times.
The 'preferred' stat is a bit odd, we will probably remove it in the future.
Eeemmm... Remove or replace with something different? If you remove it how then to count/display BGP best routes for example? -- Alexander Shikov Technical Staff, Digital Telecom IX Tel.: +380 44 201 14 07 http://dtel-ix.net/
participants (2)
-
Alexander Shikov -
Ondrej Zajicek