Shared publicly  - 
 
Networking in +systemd - libsystemd-rtnl

One of the first things we all agreed on was that we will not be calling out to external tools to communicate with the network/kernel, but do it all directly (or via libraries). Also,  from the beginning all calls would have to be asynchronous, both to avoid having to worry about global locks in the kernel and in order to have any hope of decent scalability in the future.

Communicating network configuration to the Linux kernel is done via rtnetlink(7) (or optionally via ioctl's, but those are blocking, and references interfaces by their names, which are not necessarily stable, so don't do that unless you really must). Much to my despair, it turned out that the currently available rtnetlink libraries are not really up to snuff when it comes to asynchronous calls, so the first thing I ended up creating was libsystemd-rtnl, which works similarly to libsystemd-bus, supporting both async and blocking calls. Creating your own rtnetlink library, is apparently what 'everyone' does, and I was very happy to get a lot of helpful hints from +Daniel Wagner  who have been doing the same for ConnMan (hopefully we'll be able to share some code at some point when things calm down). I have updated the sd-rtnl TODO (http://cgit.freedesktop.org/systemd/systemd/tree/TODO#n768), so if anyone are interested in working on, or even testing/reviewing that, please get in touch! I should point out though, that there are no immediate plans of exporting this library, so at least for now it will only be used internally by systemd (and whoever copies the code out manually :) )

I'll follow up with a couple of more posts about the user-visible functionality I have been working on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...
16
2
systemd's profile photoBenjamin Knust's profile photo
Add a comment...