Feature Request: Preference in bird
Hello, I noticed that when you "mix" routing protocols, it can be useful to change the "preference", but unfortunately there is little documentation in bird about this and no way to view it. Is it possible to view the preference using "birdc"? Is it possible to include the default values (in https://gitlab.nic.cz/labs/bird/-/blob/v2.0.12/nest/route.h#L748-755) in the documentation? Greetings Marek Küthe -- Marek Küthe m.k@mk16.de er/ihm he/him
On 14.06.23 11:29, Marek Küthe wrote:
Hello,
I noticed that when you "mix" routing protocols, it can be useful to change the "preference", but unfortunately there is little documentation in bird about this and no way to view it.
Is it possible to view the preference using "birdc"?
`birdc show route` shows the protocol preference at the end of the line in brackets. Or do you mean something different, like when showing the protocols? `show protocols all`, does show the preference, too.
Is it possible to include the default values (in https://gitlab.nic.cz/labs/bird/-/blob/v2.0.12/nest/route.h#L748-755) in the documentation?
Yes, this blob is my reference, too :) And yes it would be nice if it would be more visible... Bernd
On Wed, 14 Jun 2023 11:52:38 +0200 Bernd Naumann <bernd@kr217.de> wrote:
On 14.06.23 11:29, Marek Küthe wrote:
Hello,
I noticed that when you "mix" routing protocols, it can be useful to change the "preference", but unfortunately there is little documentation in bird about this and no way to view it.
Is it possible to view the preference using "birdc"?
`birdc show route` shows the protocol preference at the end of the line in brackets. Or do you mean something different, like when showing the protocols?
``` unicast [brandweb_v4 17:31:34.208] (100) [AS4242422032i] via 172.20.191.129 on brandweb ``` So that would have a preference of 100, right? ``` fd04:234e:fc31::/128 unicast [inner_network 2023-06-13] (130/1) [00:00:00:00:ac:16:95:e2] via fe80::2923:1 on p2prouter ``` And what would be the preference 130 with a Babel metric of 1?
`show protocols all`, does show the preference, too.
Where exactly? I could not find anything there.
Is it possible to include the default values (in https://gitlab.nic.cz/labs/bird/-/blob/v2.0.12/nest/route.h#L748-755) in the documentation?
Yes, this blob is my reference, too :) And yes it would be nice if it would be more visible...
Bernd
Thanks for the answer! -- Marek Küthe m.k@mk16.de er/ihm he/him
On 14.06.23 12:20, Marek Küthe wrote:
On Wed, 14 Jun 2023 11:52:38 +0200 Bernd Naumann <bernd@kr217.de> wrote:
On 14.06.23 11:29, Marek Küthe wrote:
Is it possible to view the preference using "birdc"?
`birdc show route` shows the protocol preference at the end of the line in brackets. Or do you mean something different, like when showing the protocols?
``` unicast [brandweb_v4 17:31:34.208] (100) [AS4242422032i] via 172.20.191.129 on brandweb ``` So that would have a preference of 100, right?
Yes.
``` fd04:234e:fc31::/128 unicast [inner_network 2023-06-13] (130/1) [00:00:00:00:ac:16:95:e2] via fe80::2923:1 on p2prouter ``` And what would be the preference 130 with a Babel metric of 1?
Yes. 130 is the default preference for babel.
`show protocols all`, does show the preference, too.
Where exactly? I could not find anything there.
``` # birdc show protocols all # Shows all configured protocols, their state, details, etc, including preference. # To view a single protocol: # birdc show protocols all ospf_ipv6 BIRD 2.0.8 ready. Name Proto Table State Since Info ospf_ipv6 OSPF master6 up 2023-04-14 Running Channel ipv6 State: UP Table: master6 Preference: 150 ... ```
Thanks for the answer. What happens when the preference is the same for two different protocol types - which protocol is preferred? For example, if you have the preference of BGP and Babel routes both set to 100, which route will be chosen? BGP and Babel routes can't really be compared since BGP takes the AS path and Babel takes the metric as the main decision criterion. On Wed, 14 Jun 2023 13:05:15 +0200 Bernd Naumann <bernd@kr217.de> wrote:
On 14.06.23 12:20, Marek Küthe wrote:
On Wed, 14 Jun 2023 11:52:38 +0200 Bernd Naumann <bernd@kr217.de> wrote:
On 14.06.23 11:29, Marek Küthe wrote:
Is it possible to view the preference using "birdc"?
`birdc show route` shows the protocol preference at the end of the line in brackets. Or do you mean something different, like when showing the protocols?
``` unicast [brandweb_v4 17:31:34.208] (100) [AS4242422032i] via 172.20.191.129 on brandweb ``` So that would have a preference of 100, right?
Yes.
``` fd04:234e:fc31::/128 unicast [inner_network 2023-06-13] (130/1) [00:00:00:00:ac:16:95:e2] via fe80::2923:1 on p2prouter ``` And what would be the preference 130 with a Babel metric of 1?
Yes. 130 is the default preference for babel.
`show protocols all`, does show the preference, too.
Where exactly? I could not find anything there.
``` # birdc show protocols all # Shows all configured protocols, their state, details, etc, including preference.
# To view a single protocol: # birdc show protocols all ospf_ipv6 BIRD 2.0.8 ready. Name Proto Table State Since Info ospf_ipv6 OSPF master6 up 2023-04-14 Running Channel ipv6 State: UP Table: master6 Preference: 150 ... ```
-- Marek Küthe m.k@mk16.de er/ihm he/him
You basically shouldn't do it. BIRD does something like last-resort pointer comparison and we should probably even add a warning if somebody misconfigures in this way. Maria On 14 June 2023 15:54:13 CEST, "Marek Küthe" <m-k-mailling-list@mk16.de> wrote:
Thanks for the answer.
What happens when the preference is the same for two different protocol types - which protocol is preferred? For example, if you have the preference of BGP and Babel routes both set to 100, which route will be chosen? BGP and Babel routes can't really be compared since BGP takes the AS path and Babel takes the metric as the main decision criterion.
On Wed, 14 Jun 2023 13:05:15 +0200 Bernd Naumann <bernd@kr217.de> wrote:
On 14.06.23 12:20, Marek Küthe wrote:
On Wed, 14 Jun 2023 11:52:38 +0200 Bernd Naumann <bernd@kr217.de> wrote:
On 14.06.23 11:29, Marek Küthe wrote:
Is it possible to view the preference using "birdc"?
`birdc show route` shows the protocol preference at the end of the line in brackets. Or do you mean something different, like when showing the protocols?
``` unicast [brandweb_v4 17:31:34.208] (100) [AS4242422032i] via 172.20.191.129 on brandweb ``` So that would have a preference of 100, right?
Yes.
``` fd04:234e:fc31::/128 unicast [inner_network 2023-06-13] (130/1) [00:00:00:00:ac:16:95:e2] via fe80::2923:1 on p2prouter ``` And what would be the preference 130 with a Babel metric of 1?
Yes. 130 is the default preference for babel.
`show protocols all`, does show the preference, too.
Where exactly? I could not find anything there.
``` # birdc show protocols all # Shows all configured protocols, their state, details, etc, including preference.
# To view a single protocol: # birdc show protocols all ospf_ipv6 BIRD 2.0.8 ready. Name Proto Table State Since Info ospf_ipv6 OSPF master6 up 2023-04-14 Running Channel ipv6 State: UP Table: master6 Preference: 150 ... ```
-- Marek Küthe m.k@mk16.de er/ihm he/him
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
You basically shouldn't do it. BIRD does something like last-resort pointer comparison and we should probably even add a warning if somebody misconfigures in this way.
Why not use the protocol's default preference as a last-resort tie-breaker? It's probably less code than the warning you suggest, and should do something reasonable in most cases. -- Juliusz
On 6/14/23 17:08, Juliusz Chroboczek wrote:
You basically shouldn't do it. BIRD does something like last-resort pointer comparison and we should probably even add a warning if somebody misconfigures in this way. Why not use the protocol's default preference as a last-resort tie-breaker? It's probably less code than the warning you suggest, and should do something reasonable in most cases.
Yes, it's probably a more reasonable tie-break. Low priority in the team for now anyway, we're quite busy. patches welcome for both the documentation updates and this last-resort tie-break. -- Maria Matejka | BIRD Team Leader | CZ.NIC, z.s.p.o.
participants (4)
-
Bernd Naumann -
Juliusz Chroboczek -
Marek Küthe -
Maria Matejka