iwd: simplifying WiFi management
proving its superiority in the area of crappy wireless (WiFi) support". Happily, the situation has improved somewhat since then, but that doesn't mean that things can't get better yet. During the Embedded Linux Conference portion of the 2018 Open Source Summit Europe, Marcel Holtmann described the work being done to create iwd, a new system for configuring and managing WiFi connections. If this project has its way, future users will have little room for complaint about how WiFi works on Linux systems.
At the moment, Holtmann said, WiFi on Linux is far too complicated for users to deal with; it asks them for far too much information. Users have to contend with complicated configuration dialogs to provide details that, much of the time, the system should be able to figure out for itself. The situation is bad even on basic open networks, but it gets worse on corporate networks, where it is often not possible to create dialogs that can work right in all settings.
The problem comes down to the old wpa_supplicant daemon, which is a complex "Swiss army knife". It is "awesome work", he said, but it has two big problems. One is that the wpa_supplicant project doesn't make releases, with the result that nobody picks up the bug fixes that are made. And there are no usable APIs for controlling it, so users have to figure out everything themselves. It is a great tool, but few people have any idea of how to use it.
For some time, Holtmann and his collaborators thought that they could improve wpa_supplicant and turn it into a proper management daemon. But the upstream project does not want things to go that way; they have, he said, a lot more interest in producing a toolbox that can be used for tasks like testing new protocol specifications. This focus and the lack of proper releases mean that everybody ships their own version of wpa_supplicant, with unpleasant consequences. There is, for example, no Linux distribution support for the WPA3 protocol, even though wpa_supplicant has that support.
Developing iwd
Thus the decision was made to develop iwd instead. Its task is to manage all WiFi network connections used by a machine with a goal of only asking for information that it cannot figure out for itself — often only the network to connect to and the passphrase. It "remembers everything" so users do not need to repeat themselves. Iwd will be the only program that performs WiFi scanning on systems where it is running; that differs from systems using wpa_supplicant, where higher-level software must also scan for networks. With iwd, that work has all been pushed to a single level where good decisions can be made. Iwd is meant to support fast and reliable roaming; it can ask an access point for information about its neighbors and use that to maintain connectivity as the system moves.
An explicit decision has been made to not care about running on anything
except Linux. The D-Bus API is used for communication, and the kernel's
cryptographic interfaces are used for encryption functionality. Iwd,
Holtmann claimed, has readable source code — another thing that
wpa_supplicant lacks. There is a large battery of unit tests to go along
with it. Version 0.1 was released in February, and 0.10 came out on
October 20.
Iwd has been designed to deal with multiple clients from the outset. With wpa_supplicant, instead, only one client at a time can be handled, so systems have had to put a wrapper around it to make things work. On an iwd system, tools like ConnMan, iwctl, and user agents can all talk to the daemon directly, at the same time.
Support for iwd has been in ConnMan since version 1.34, and in NetworkManager since version 1.12. Integration with NetworkManager took some work, since it had to be convinced to not worry about many WiFi details and let iwd handle them. Iwd works well now for personal networks; support for enterprise networks is under development but not really ready yet. A number of distributions have packaged it, and there is "rough" support for ChromeOS as well.
Developing iwd required fixing a number of things in the kernel along the way. There had only been one user of the WiFi-control API so far, so a lot of things didn't work right, Holtmann said. Those problems have been fixed, and most of the patches are already in the mainline kernel.
Iwd offers a long list of features, starting with support for the station, ad hoc, and access-point modes. Modern features like SSID grouping and scanning with hidden SSIDs are supported; the four-way handshake for pairwise transient keys is coming soon. A lot of enterprise methods are being added, including support for the extensible authentication protocol (EAP). Configuration for EAP is not done through a graphical interface, though; it is too complex for users to be able to realistically deal with it, so it will instead use a configuration file provided by the network administrator. Making this work requires asymmetric_key keyring support in the kernel, which is set to be part of the 4.20 release. For extra security, this key can be stored in the Trusted Platform Module (TPM).
Toward 1.0
There are a number of features missing, but they are not expected to stop the 1.0 release from happening around the end of the year. These include pairwise master key caching, and an opportunistic wire encryption mode that prevents eavesdropping but doesn't bother with authenticating the other end. Support for the device provisioning protocol is in the works, as is WiFi P2P support, which is almost done. Work that can be expected in the 1.0 release includes an API review of the Embedded Linux Library and D-Bus interfaces.
Holtmann concluded by saying that iwd is not just about WiFi; it is also expected to work with Ethernet connections. Corporations are increasingly locking down their Ethernet ports, requiring authentication before they can be used. To work with such systems, iwd is gaining an Ethernet authentication daemon that can work with the TCP; initial support is already present.
The audience asked whether iwd would ever work without D-Bus; Holtmann replied in the negative. It would be better to optimize any inefficiencies out of D-Bus, he said, than to try to get iwd to work without it. When asked about supporting 802.11s mesh networks, he said that it was something that the project needed to do, but it will not happen right away; contributions are welcome, he added. The last question was about integration with systemd-networkd; he replied that things mostly just work now, but there are still some details to take care of.
[Thanks to the Linux Foundation, LWN's travel sponsor, for supporting my travel to the event.]
| Index entries for this article | |
|---|---|
| Conference | Embedded Linux Conference Europe/2018 |
| Conference | Open Source Summit Europe/2018 |
