[RESEND PATCH v3] Babel: allow choosing link quality estimation algorithm

Nick Cao nickcao at nichi.co
Thu Nov 9 14:46:21 CET 2023


The presets are still handled, in babel_iface_finish of 
proto/babel/config.Y.

On 11/9/23 05:25, Toke Høiland-Jørgensen wrote:
> Nick Cao via Bird-users <bird-users at network.cz> writes:
> 
>> Resend of the patch in http://trubka.network.cz/pipermail/bird-users/2023-June/017058.html
>>
>> ETX link quality estimation algorithm is useful for link types other than wireless,
>> especially when using babel with tunnels where packet losses do occur.
>> ---
>>   doc/bird.sgml        | 10 ++++++++++
>>   proto/babel/babel.c  |  8 +++-----
>>   proto/babel/babel.h  |  8 ++++++++
>>   proto/babel/config.Y |  8 +++++++-
>>   4 files changed, 28 insertions(+), 6 deletions(-)
>>
>> diff --git a/doc/bird.sgml b/doc/bird.sgml
>> index f2063325..1a9bab87 100644
>> --- a/doc/bird.sgml
>> +++ b/doc/bird.sgml
>> @@ -2209,6 +2209,7 @@ protocol babel [<name>] {
>>   		rx buffer <number>;
>>   		tx length <number>;
>>   		check link <switch>;
>> +		link quality <none|etx>;
>>   		next hop ipv4 <address>;
>>   		next hop ipv6 <address>;
>>   		extended next hop <switch>;
>> @@ -2312,6 +2313,15 @@ protocol babel [<name>] {
>>         hardware drivers or platforms do not implement this feature. Default:
>>         yes.
>>   
>> +      <tag><label id="babel-link-quality">link quality none|etx </tag>
>> +      This option specifies the link quality estimation algorithm for computing
>> +      costs based on Hello history: none or etx. The none (k-out-of-j) algorithm
>> +      is suitable for wired links that are either up, in which case they only
>> +      occasionally drop a packet, or down, in which case they drop all packets.
>> +      The Expected Transmission Cost algorithm, or etx, is suitable for wireless
>> +      links that exhibit continuous variation of the link quality. Default: etx for
>> +      wireless interfaces, none otherwise.
>> +
>>         <tag><label id="babel-next-hop-ipv4">next hop ipv4 <m/address/</tag>
>>         Set the next hop address advertised for IPv4 routes advertised on this
>>         interface. Default: the preferred IPv4 address of the interface.
>> diff --git a/proto/babel/babel.c b/proto/babel/babel.c
>> index 4187d258..f865c089 100644
>> --- a/proto/babel/babel.c
>> +++ b/proto/babel/babel.c
>> @@ -593,10 +593,9 @@ babel_update_cost(struct babel_neighbor *nbr)
>>     if (!rcv || !nbr->ifa->up)
>>       goto done;
>>   
>> -  switch (cf->type)
>> +  switch (cf->link_quality)
>>     {
>> -  case BABEL_IFACE_TYPE_WIRED:
>> -  case BABEL_IFACE_TYPE_TUNNEL:
>> +  case BABEL_IFACE_LINK_QUALITY_NONE:
> 
> Sorry for missing this earlier, but it looks like with your patch bird
> will no longer honour the "wires" or "wireless" setting at all? Which
> will break old configs, so please don't do that.
> 
> The right way to do this is to have "wired" and "wireless" serve as
> "presets", and then have the link quality override that setting. So that
> just setting "wireless" will get the same settings as today, but setting
> "wired + etx" will get you just the ETX setting.
> 
> -Toke


More information about the Bird-users mailing list