Add random number
Hi All, is it possible to add a random number to some variable in the filter? For example, like this: filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10); ...
Hello! No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms. If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request. Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
I think the only usage for random number is for loading balance. *Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus. Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Yes, that's correct. I have same routes come from different routers, and I want to spread the traffic between them, but if one router fails - keep it working using anothers. Okay, is it possible to get the variable as the result of the shell script? Like localpref = `cat prefpeer` On Sun, 11 Feb 2024 18:04:18 +0800 Brandon Zhi <Brandon@huize.asia> wrote:
I think the only usage for random number is for loading balance.
*Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus.
Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Isn't this a problem for multipath/add path to fix? On Sun, Feb 11, 2024, 08:43 Max Tulyev <maxtul@netassist.ua> wrote:
Yes, that's correct. I have same routes come from different routers, and I want to spread the traffic between them, but if one router fails - keep it working using anothers.
Okay, is it possible to get the variable as the result of the shell script? Like
localpref = `cat prefpeer`
On Sun, 11 Feb 2024 18:04:18 +0800 Brandon Zhi <Brandon@huize.asia> wrote:
I think the only usage for random number is for loading balance.
*Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus.
Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
In our case no. We use the route reflector, so it should export the random route to other routers, not just use it by itself. On Sun, 11 Feb 2024 08:55:02 -0500 "Darren O'Connor" <mellow.drifter@gmail.com> wrote:
Isn't this a problem for multipath/add path to fix?
On Sun, Feb 11, 2024, 08:43 Max Tulyev <maxtul@netassist.ua> wrote:
Yes, that's correct. I have same routes come from different routers, and I want to spread the traffic between them, but if one router fails - keep it working using anothers.
Okay, is it possible to get the variable as the result of the shell script? Like
localpref = `cat prefpeer`
On Sun, 11 Feb 2024 18:04:18 +0800 Brandon Zhi <Brandon@huize.asia> wrote:
I think the only usage for random number is for loading balance.
*Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus.
Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Maybe not random, but some sorta hash will be useful here? And it should not break the invariant mentioned by Maria. But for the hash we still need some means to convert IP addresses to integer numbers, because including IP into the hash seems to be reasonable. On Sun, Feb 11, 2024 at 3:12 PM Max Tulyev <maxtul@netassist.ua> wrote:
In our case no. We use the route reflector, so it should export the random route to other routers, not just use it by itself.
On Sun, 11 Feb 2024 08:55:02 -0500 "Darren O'Connor" <mellow.drifter@gmail.com> wrote:
Isn't this a problem for multipath/add path to fix?
On Sun, Feb 11, 2024, 08:43 Max Tulyev <maxtul@netassist.ua> wrote:
Yes, that's correct. I have same routes come from different routers, and I want to spread the traffic between them, but if one router fails - keep it working using anothers.
Okay, is it possible to get the variable as the result of the shell script? Like
localpref = `cat prefpeer`
On Sun, 11 Feb 2024 18:04:18 +0800 Brandon Zhi <Brandon@huize.asia> wrote:
I think the only usage for random number is for loading balance.
*Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus.
Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
In all cases, I'd appreciate a detailed description of the exact use case we are trying to solve. We may then come up with an appropriate solution, a workaround or a well-defined feature request. Thank you for your understanding. Maria On 11 February 2024 09:30:50 GMT-05:00, Alexander Zubkov via Bird-users <bird-users@network.cz> wrote:
Maybe not random, but some sorta hash will be useful here? And it should not break the invariant mentioned by Maria. But for the hash we still need some means to convert IP addresses to integer numbers, because including IP into the hash seems to be reasonable.
On Sun, Feb 11, 2024 at 3:12 PM Max Tulyev <maxtul@netassist.ua> wrote:
In our case no. We use the route reflector, so it should export the random route to other routers, not just use it by itself.
On Sun, 11 Feb 2024 08:55:02 -0500 "Darren O'Connor" <mellow.drifter@gmail.com> wrote:
Isn't this a problem for multipath/add path to fix?
On Sun, Feb 11, 2024, 08:43 Max Tulyev <maxtul@netassist.ua> wrote:
Yes, that's correct. I have same routes come from different routers, and I want to spread the traffic between them, but if one router fails - keep it working using anothers.
Okay, is it possible to get the variable as the result of the shell script? Like
localpref = `cat prefpeer`
On Sun, 11 Feb 2024 18:04:18 +0800 Brandon Zhi <Brandon@huize.asia> wrote:
I think the only usage for random number is for loading balance.
*Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus.
Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
Multipath is the way to go, yes. Introducing external values and variables may become gradually possible with BIRD 3 in future. Not promising anything, but if any of you has any feature request regarding this, feel free to state it, ideally including some explicit use cases for that. We're currently thinking e.g. about adding custom variables to protocols (accessible then from the filters, ofc). Maria On 11 February 2024 14:55:02 CET, Darren O'Connor <mellow.drifter@gmail.com> wrote:
Isn't this a problem for multipath/add path to fix?
On Sun, Feb 11, 2024, 08:43 Max Tulyev <maxtul@netassist.ua> wrote:
Yes, that's correct. I have same routes come from different routers, and I want to spread the traffic between them, but if one router fails - keep it working using anothers.
Okay, is it possible to get the variable as the result of the shell script? Like
localpref = `cat prefpeer`
On Sun, 11 Feb 2024 18:04:18 +0800 Brandon Zhi <Brandon@huize.asia> wrote:
I think the only usage for random number is for loading balance.
*Brandon Zhi* HUIZE LTD www.huize.asia <https://huize.asia/>| www.ixp.su | Twitter
This e-mail and any attachments or any reproduction of this e-mail in whatever manner are confidential and for the use of the addressee(s) only. HUIZE LTD can’t take any liability and guarantee of the text of the email message and virus.
Maria Matejka via Bird-users <bird-users@network.cz>于2024年2月11日 周日06:03写道:
Hello!
No, it's not possible and it makes the filters non-deterministic which would break a critical invariant in BIRD's internal algorithms.
If you better clarify what you are trying to achieve, we may find another way for you to do it, or at least convert it to a viable feature request.
Thank you for your understanding Maria On 2024-02-10 20:56, Max Tulyev wrote:
Hi All,
is it possible to add a random number to some variable in the filter?
For example, like this:
filter myfilter { if net ~ 192.168.11.0/24 then preference = preference + random(10);
...
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
-- Maria Matejka (she/her) | BIRD Team Leader | CZ.NIC, z.s.p.o.
participants (5)
-
Alexander Zubkov -
Brandon Zhi -
Darren O'Connor -
Maria Matejka -
Max Tulyev