Re: [PATCH] BFD: Labeling a manually configured neighbor for tracking
First, numbering the neighbor is weird considering everything else in BIRD is named. I would use regular symbols.
I chose to use numbers since it is easy to implement the PoC. Using symbols instead should be appropriate.
Yes, but it's kinda limited to only your expected use case.
Third, it may be more reasonable to create a regular table with the neighbor type (like what RAdv creates) and export the BFD neighbor state there. That would be way more versatile than labeling by numbers or names.
If I understand it correctly, the neighbor type you mentioned here is a kind of address family which can be processed in a routing table, to reflect the availability of a peer router. This has been used for BGP peers.
Exactly.
However, in this scenario, the mapping between the static route controlled and the bfd peer is arbitrarily specified by the user and thus I don't think exporting bfd neighbor status to to a neighbor table and importing them in the static protocol would fit this usage.
Easy. The mapping may, for example, say something like this: define deadbeef_present = count route 3fff::dead:beef from bfd42 table bfd_neighbors; protocol static { ipv6; route 3fff:67::/42 via 3fff:42::67 if deadbeef_present = 1; } This approach would be then viable to be used with way more things than just BFD peers, e.g. these would be regular conditional routes. There is a branch with this partially done, and while it may need significant reworks, it should be a good pointer into what we'd like to have inside future BIRD versions, feature-wise. I hope this helps. -- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Hi,
2026年11月5日 02:15,Maria Matejka <maria.matejka@nic.cz> 写道:
First, numbering the neighbor is weird considering everything else in BIRD is named. I would use regular symbols.
I chose to use numbers since it is easy to implement the PoC. Using symbols instead should be appropriate.
Yes, but it’s kinda limited to only your expected use case.
Third, it may be more reasonable to create a regular table with the neighbor type (like what RAdv creates) and export the BFD neighbor state there. That would be way more versatile than labeling by numbers or names.
If I understand it correctly, the neighbor type you mentioned here is a kind of address family which can be processed in a routing table, to reflect the availability of a peer router. This has been used for BGP peers.
Exactly.
However, in this scenario, the mapping between the static route controlled and the bfd peer is arbitrarily specified by the user and thus I don’t think exporting bfd neighbor status to to a neighbor table and importing them in the static protocol would fit this usage.
Easy. The mapping may, for example, say something like this: define deadbeef_present = count route 3fff::dead:beef from bfd42 table bfd_neighbors;
protocol static { ipv6; route 3fff:67::/42 via 3fff:42::67 if deadbeef_present = 1; } This approach would be then viable to be used with way more things than just BFD peers, e.g. these would be regular conditional routes. There is a branch with this partially done, and while it may need significant reworks, it should be a good pointer into what we’d like to have inside future BIRD versions, feature-wise. I hope this helps.
Your design sounds really attractive. However, I don't think it is feasible. If I know it correctly, all the filters, functions, expressions, i.e. something where the user can write some code, are lambdas, i.e. stateless. They either evaluate to a constant value upon start, or evaluate to a fixed value given a certain route as the input. The design you proposed here tries to introduce expressions that is stateful, which relies on the current running status. I believe it would be a whole new thing to the current framework. I believe we cannot even ensure routing calculation will finish in a finite time. An example might be: define wicked_counter = count route table main; protocol static { ipv6 table main; route unreachable 3fff:67::1/128; route unreachable 3fff:67::2/128 if wicked_counter < 2; } It seems that if such stateful expressions are introduced, more constrains, if could be found, should be applied to avoid such loops. Cheers, Miao Wang
participants (2)
-
Maria Matejka -
Miao Wang