[Babel-users] babeld slashes kernel route manipulation performance by 17000%

Toke Høiland-Jørgensen toke at toke.dk
Thu Apr 14 09:50:17 BST 2022


Juliusz Chroboczek <jch at irif.fr> writes:

>> As for why you're seeing this in particular when Babel is running, now
>> that we know the route dump is the culprit, it's quite obvious: While
>> Babel listens for new route notifications from the kernel, it doesn't
>> actually use those notifications directly; instead, it just sets a flag
>> (see kernel_route_notify() in babeld.c), and does a full dump whenever
>> it gets a notification.
>
> You're right, as usual.

:)

>> Bird does things a bit differently: it will directly update its internal
>> routing table from the netlink notification messages, and only does a
>> full dump at intervals (by default once every minute, but it can be
>> configured to run entirely without dumps).
>
> Yeah, that's the right way.  Could you please point me at the place in
> BIRD where you parse a netlink notification?

All the netlink code is in sysdep/linux/netlink.c. The notification
socket is setup in nl_open_async() and packets are received in
nl_async_hook(), which calls nl_async_msg() that in turn uses
nl_parse_route() to do the actual parsing. This is the same parsing
function that is used to parse the route dump (called from
krt_do_scan())). The parsing function will fill in the parse state
structure and call nl_announce_route() with the result, either directly
or from nl_parse_end() after parsing ends.

-Toke



More information about the Babel-users mailing list