[PATCH] babel: Send out low-interval hello on shutdown

Ondrej Zajicek santiago at crfreenet.org
Fri Apr 22 17:01:34 CEST 2022


On Wed, Apr 20, 2022 at 01:43:21AM +0200, Toke Høiland-Jørgensen wrote:
> When shutting down a Babel instance we send a wildcard retraction to make
> sure all peers can quickly switch to other route origins. Add another small
> optimisation borrowed from babeld: sending a Hello message (along with the
> retraction) with a very low interval.
> 
> This will cause neighbours to modify their expiry timers for the node's
> state to quickly time it out, thus conserving resources in the network.

Hi

Thanks, merged. Just changed BABEL_TIME_UNITS to BABEL_MIN_INTERVAL.

BTW, when we added CI tests for Babel authentication, we noticed that it
has rather slow convergence after reconfiguration. The reason is that
when authentication changed to become non-matching, it took many missed
(misauthenticated) hellos to sufficiently clean up hello_map for neighbor
to go down.

Perhaps there could be some decision in iface reconfiguration that the
change is significant to affect reachability of neighbors and in such
case deprecate some/most items in hello_map.



> Signed-off-by: Toke Høiland-Jørgensen <toke at toke.dk>
> ---
>  proto/babel/babel.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/proto/babel/babel.c b/proto/babel/babel.c
> index 174fc9e26654..4c7f70c3ff66 100644
> --- a/proto/babel/babel.c
> +++ b/proto/babel/babel.c
> @@ -842,14 +842,14 @@ babel_send_ihus(struct babel_iface *ifa)
>  }
>  
>  static void
> -babel_send_hello(struct babel_iface *ifa)
> +babel_send_hello(struct babel_iface *ifa, uint interval)
>  {
>    struct babel_proto *p = ifa->proto;
>    union babel_msg msg = {};
>  
>    msg.type = BABEL_TLV_HELLO;
>    msg.hello.seqno = ifa->hello_seqno++;
> -  msg.hello.interval = ifa->cf->hello_interval;
> +  msg.hello.interval = interval ?: ifa->cf->hello_interval;
>  
>    TRACE(D_PACKETS, "Sending hello on %s with seqno %d interval %t",
>  	ifa->ifname, msg.hello.seqno, (btime) msg.hello.interval);
> @@ -1557,7 +1557,7 @@ babel_iface_timer(timer *t)
>  
>    if (now_ >= ifa->next_hello)
>    {
> -    babel_send_hello(ifa);
> +    babel_send_hello(ifa, 0);
>      ifa->next_hello += hello_period * (1 + (now_ - ifa->next_hello) / hello_period);
>    }
>  
> @@ -1604,7 +1604,7 @@ babel_iface_start(struct babel_iface *ifa)
>    tm_start(ifa->timer, 100 MS);
>    ifa->up = 1;
>  
> -  babel_send_hello(ifa);
> +  babel_send_hello(ifa, 0);
>    babel_send_wildcard_retraction(ifa);
>    babel_send_wildcard_request(ifa);
>    babel_send_update(ifa, 0);	/* Full update */
> @@ -2417,6 +2417,11 @@ babel_iface_shutdown(struct babel_iface *ifa)
>  {
>    if (ifa->sk)
>    {
> +    /*
> +     * Retract all our routes and lower the hello interval so peers' neighbour
> +     * state expires quickly
> +     */
> +    babel_send_hello(ifa, BABEL_TIME_UNITS);
>      babel_send_wildcard_retraction(ifa);
>      babel_send_queue(ifa);
>    }
> -- 
> 2.36.0

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at 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."



More information about the Bird-users mailing list