[systemd-devel] slow systemd-networkd DHCP client on wlan0 with systemd v217

Charles Devereaux systemd at guylhem.net
Sun Jan 11 15:45:17 PST 2015


Hello

With dhcpcd5 and the following options, once wpa_supplicant is done,  I
have a connection within the same second if I ignore ARP.

With systemd-network, it's much much slower.

$ systemd-analyze blame
          3.923s systemd-networkd-wait-online.service
(...)

I tried to measure the time taken on wlan0, to see where the problem came
from::

Jan 11 17:53:01 thinkpad wpa_supplicant at wlan0[391]: started
Jan 11 17:53:02 thinkpad kernel: IPv6: ADDRCONF(NETDEV_UP): wlan0: link is
not ready
Jan 11 17:53:03 thinkpad kernel: wlan0: authenticate with ea:fc:af:f6:dd:cd
Jan 11 17:53:03 thinkpad kernel: wlan0: send auth to ea:fc:af:f6:dd:cd (try
1/3)
Jan 11 17:53:03 thinkpad kernel: wlan0: authenticated
Jan 11 17:53:03 thinkpad kernel: wlan0: associate with ea:fc:af:f6:dd:cd
(try 1/3)
Jan 11 17:53:03 thinkpad kernel: wlan0: RX AssocResp from ea:fc:af:f6:dd:cd
(capab=0x411 status=0 aid=2)
Jan 11 17:53:03 thinkpad kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link
becomes ready
Jan 11 17:53:03 thinkpad kernel: wlan0: associated
Jan 11 17:53:03 thinkpad systemd-networkd[419]: wlan0           : gained
carrier
Jan 11 17:53:04 thinkpad avahi-daemon[403]: Joining mDNS multicast group on
interface wlan0.IPv6 with address fe80::xxx
Jan 11 17:53:04 thinkpad avahi-daemon[403]: New relevant interface
wlan0.IPv6 for mDNS.
Jan 11 17:53:04 thinkpad avahi-daemon[403]: Registering new address record
for fe80::xxx on wlan0.IPv6.
Jan 11 17:53:06 thinkpad systemd-networkd[419]: wlan0           : DHCPv4
address 192.168.1.19/16 via 192.168.1.1
Jan 11 17:53:06 thinkpad systemd-networkd[419]: wlan0           : link
configured
Jan 11 17:53:06 thinkpad avahi-daemon[403]: Joining mDNS multicast group on
interface wlan0.IPv4 with address 192.168.1.19.
Jan 11 17:53:06 thinkpad avahi-daemon[403]: New relevant interface
wlan0.IPv4 for mDNS.
Jan 11 17:53:06 thinkpad avahi-daemon[403]: Registering new address record
for 192.168.1.19 on wlan0.IPv4.
Jan 11 17:53:09 thinkpad systemd-resolved[428]: Switching to DNS server
192.168.1.1 for interface wlan0.

You can see wpa_supplicant is started at :01 (I'm using a udev rule so that
it's started when wlan0 appears), and is done at :03. That's slow but normal

What's not is the time it takes to systemd-networkd : 1 second for IPv6 is
acceptable (I'm using SLAAC with radvd on the other end), but for ipv4 it's
more like 3 seconds, plus another 3 to use the proper DNS server (!!)

>From https://plus.google.com/+TomGundersen/posts/eztZWbwmxM8, I understand
it should be done much faster.

What am I doing wrong here?

After manually checking the .c files, commits mentionned on google plus,
#66a67effcc5beaf8a61e1c1147c3114b02a96439 and
#d23c45bfccb3ed6e2628e6d12b4ea12b8c920ab9 seem to have been applied to the
systemd-stable v217 I'm using.

Nothing in the code suggestssection 4.4.1 has become an opt-in, which was
mentioned in the comments.

The .network I'm using is very simple.

$ cat /etc/systemd/network/wireless.network
[Match]
Name=w*
Virtualization=no

[Network]
DHCP=both

[DHCP]
UseHostname=false

So basically, I don't know why it's so slow, except that it comes from DHCP
IPv4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20150111/a8fa6198/attachment.html>


More information about the systemd-devel mailing list