networkd waits 10 seconds for ipv6 network discovery by default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* On ipv6 less hosts, boot stalls for 10s
* This is due to implicit RA being on, and wait-online awaiting for RA to timeout
* Expectation is, that since explicit request for RA was not done, it should not block network-
[Test Case]
* lxc network set lxdbr0 ipv6.address none
* lxc launch ubuntu-daily:bionic lp1765173
* sleep 20 && lxc exec lp1765173 systemd-analyze blame | head
Bad result is:
12.157s systemd-
Good result is:
739ms systemd-
[Regression Potential]
* If explicit IPv6 dhcp/ra was enabled in .network file, the boot will be blocked awaiting RA response
* Only kernel implicit RA configuration will now become "async"
* This is inline with behaviour of xenial systems
[Other Info]
* Original bug report
1.
$ lsb_release -rd
Description: Ubuntu Bionic Beaver (development branch)
Release: 18.04
2.
$ apt-cache policy systemd
systemd:
Installed: 237-3ubuntu8
Candidate: 237-3ubuntu8
Version table:
*** 237-3ubuntu8 500
500 http://
100 /var/lib/
3. systemd-
4. systemd-networkd sends at least two RA solicitation packets waiting for a response before setting the link to configured. This blocks the boot for every Ubuntu system where it does not have a IPV6 router responding to solicitations. THis includes bionic containers, cloud instances, vms and physical machines.
--
We can see that we're spending 13 seconds waiting for networkd to say the network is up.
% systemd-analyze blame
13.326s systemd-
999ms cloud-init-
954ms cloud-init.service
887ms cloud-config.
749ms dev-vda1.device
666ms cloud-final.service
248ms keyboard-
175ms systemd-
171ms lxd-containers.
165ms snapd.service
154ms apparmor.service
147ms ssh.service
144ms systemd-
133ms grub-common.service
130ms systemd-
130ms accounts-
99ms systemd-
98ms systemd-
94ms apport.service
92ms rsyslog.service
88ms systemd-
80ms lvm2-monitor.
75ms iscsid.service
64ms ebtables.service
62ms user@1000.service
54ms dev-mqueue.mount
53ms ufw.service
52ms systemd-
52ms kmod-static-
34ms systemd-
34ms polkit.service
32ms systemd-
27ms systemd-
26ms systemd-
26ms systemd-
25ms systemd-
21ms dev-hugepages.mount
17ms sys-kernel-
16ms console-
15ms plymouth-
15ms snapd.socket
15ms plymouth-
14ms systemd-
10ms systemd-
9ms boot-efi.mount
8ms sys-fs-
8ms systemd-
8ms lxd.socket
7ms blk-availabilit
5ms systemd-
3ms setvtrgb.service
3ms plymouth-
3ms sys-kernel-
Here we can see that we start networking at 18:30:51.69, and then IPv6 NDISC runs for 10 seconds
and then the link is configured at 18:31:05. *AND* we see NDISC stays around and continues to see if it gets a RA packet.
$ journalctl -o short-precise -u systemd-
Apr 18 18:30:51.691532 rharper-b1 systemd[1]: Starting Network Service...
Apr 18 18:30:53.031041 rharper-b1 systemd-
Apr 18 18:30:53.031306 rharper-b1 systemd-
Apr 18 18:30:53.031612 rharper-b1 systemd-
Apr 18 18:30:57.092282 rharper-b1 systemd-
Apr 18 18:31:05.040895 rharper-b1 systemd-
Apr 18 18:31:05.040932 rharper-b1 systemd-
Apr 18 18:31:05.041099 rharper-b1 systemd-
Apr 18 18:31:05.484261 rharper-b1 systemd-
Apr 18 18:31:21.550612 rharper-b1 systemd-
Apr 18 18:31:54.706283 rharper-b1 systemd-
Apr 18 18:33:00.232685 rharper-b1 systemd-
Apr 18 18:35:15.436376 rharper-b1 systemd-
Apr 18 18:39:48.111413 rharper-b1 systemd-
networkd runs ndisc if your host is configured with ipv6 forwarding disabled and accept_ra enabled.
% sysctl net.ipv6.
net.ipv6.
% sysctl net.ipv6.
net.ipv6.
So ndisc path is expected per systemd code. We should be able to disable the NDISC link timeout; especially since NDISC stays around to process RA packets later on anyhow. Nothing is gained by blocking boot waiting for an RA packet. This is also a change in behavior on previous LTS, Xenial where the RA handling is done in the kernel rather than netowkrd.
Full debug output of systemd-networkd during this boot.
% journalctl -o short-precise -u systemd-
-- Logs begin at Wed 2018-04-18 18:30:19 UTC, end at Wed 2018-04-18 18:35:15 UTC. --
Apr 18 18:30:34.371090 rharper-b1 systemd[1]: Stopping Network Service...
Apr 18 18:30:34.399603 rharper-b1 systemd[1]: Stopped Network Service.
-- Reboot --
Apr 18 18:30:51.691532 rharper-b1 systemd[1]: Starting Network Service...
Apr 18 18:30:51.714593 rharper-b1 systemd-
Apr 18 18:30:51.714736 rharper-b1 systemd-
Apr 18 18:30:51.714754 rharper-b1 systemd-
Apr 18 18:30:51.714795 rharper-b1 systemd-
Apr 18 18:30:51.715122 rharper-b1 systemd-
Apr 18 18:30:51.715134 rharper-b1 systemd-
Apr 18 18:30:51.715144 rharper-b1 systemd-
Apr 18 18:30:51.715334 rharper-b1 systemd-
Apr 18 18:30:51.715342 rharper-b1 systemd-
Apr 18 18:30:51.715375 rharper-b1 systemd-
Apr 18 18:30:51.715382 rharper-b1 systemd-
Apr 18 18:30:51.715389 rharper-b1 systemd-
Apr 18 18:30:51.715397 rharper-b1 systemd-
Apr 18 18:30:51.715573 rharper-b1 systemd-
Apr 18 18:30:51.715603 rharper-b1 systemd-
Apr 18 18:30:51.717227 rharper-b1 systemd-
Apr 18 18:30:51.717240 rharper-b1 systemd-
Apr 18 18:30:51.717552 rharper-b1 systemd-
Apr 18 18:30:51.717585 rharper-b1 systemd-
Apr 18 18:30:51.717597 rharper-b1 systemd-
Apr 18 18:30:51.717628 rharper-b1 systemd-
Apr 18 18:30:51.717869 rharper-b1 systemd-
Apr 18 18:30:51.717900 rharper-b1 systemd-
Apr 18 18:30:51.717987 rharper-b1 systemd-
Apr 18 18:30:51.717998 rharper-b1 systemd-
Apr 18 18:30:51.718115 rharper-b1 systemd-
Apr 18 18:30:51.718293 rharper-b1 systemd-
Apr 18 18:30:51.718444 rharper-b1 systemd-
Apr 18 18:30:51.718493 rharper-b1 systemd[1]: Started Network Service.
Apr 18 18:30:51.720311 rharper-b1 systemd-
Apr 18 18:30:51.720850 rharper-b1 systemd-
Apr 18 18:30:51.720915 rharper-b1 systemd-
Apr 18 18:30:51.720974 rharper-b1 systemd-
Apr 18 18:30:51.721574 rharper-b1 systemd-
Apr 18 18:30:51.721778 rharper-b1 systemd-
Apr 18 18:30:51.721792 rharper-b1 systemd-
Apr 18 18:30:51.721799 rharper-b1 systemd-
Apr 18 18:30:51.721808 rharper-b1 systemd-
Apr 18 18:30:51.722017 rharper-b1 systemd-
Apr 18 18:30:51.727823 rharper-b1 systemd-
Apr 18 18:30:51.727831 rharper-b1 systemd-
Apr 18 18:30:51.727838 rharper-b1 systemd-
Apr 18 18:30:51.727852 rharper-b1 systemd-
Apr 18 18:30:51.727965 rharper-b1 systemd-
Apr 18 18:30:51.728263 rharper-b1 systemd-
Apr 18 18:30:51.729279 rharper-b1 systemd-
Apr 18 18:30:51.729361 rharper-b1 systemd-
Apr 18 18:30:51.730084 rharper-b1 systemd-
Apr 18 18:30:51.730212 rharper-b1 systemd-
Apr 18 18:30:51.730221 rharper-b1 systemd-
Apr 18 18:30:51.730229 rharper-b1 systemd-
Apr 18 18:30:51.730314 rharper-b1 systemd-
Apr 18 18:30:51.730375 rharper-b1 systemd-
Apr 18 18:30:51.730385 rharper-b1 systemd-
Apr 18 18:30:51.730676 rharper-b1 systemd-
Apr 18 18:30:51.731002 rharper-b1 systemd-
Apr 18 18:30:53.030808 rharper-b1 systemd-
Apr 18 18:30:53.030877 rharper-b1 systemd-
Apr 18 18:30:53.031041 rharper-b1 systemd-
Apr 18 18:30:53.031306 rharper-b1 systemd-
Apr 18 18:30:53.031612 rharper-b1 systemd-
Apr 18 18:30:57.092282 rharper-b1 systemd-
Apr 18 18:31:05.040895 rharper-b1 systemd-
Apr 18 18:31:05.040932 rharper-b1 systemd-
Apr 18 18:31:05.041099 rharper-b1 systemd-
Apr 18 18:31:05.484261 rharper-b1 systemd-
Apr 18 18:31:05.495751 rharper-b1 systemd-
Apr 18 18:31:05.495842 rharper-b1 systemd-
Apr 18 18:31:05.495870 rharper-b1 systemd-
Apr 18 18:31:05.928832 rharper-b1 systemd-
Apr 18 18:31:05.928914 rharper-b1 systemd-
Apr 18 18:31:05.928935 rharper-b1 systemd-
Apr 18 18:31:06.014785 rharper-b1 systemd-
Apr 18 18:31:06.015036 rharper-b1 systemd-
Apr 18 18:31:06.017290 rharper-b1 systemd-
Apr 18 18:31:06.017532 rharper-b1 systemd-
Apr 18 18:31:06.017581 rharper-b1 systemd-
Apr 18 18:31:06.017598 rharper-b1 systemd-
Apr 18 18:31:06.027908 rharper-b1 systemd-
Apr 18 18:31:06.028491 rharper-b1 systemd-
Apr 18 18:31:06.051721 rharper-b1 systemd-
Apr 18 18:31:06.051767 rharper-b1 systemd-
Apr 18 18:31:06.051782 rharper-b1 systemd-
Apr 18 18:31:06.051794 rharper-b1 systemd-
Apr 18 18:31:06.051807 rharper-b1 systemd-
Apr 18 18:31:06.051819 rharper-b1 systemd-
Apr 18 18:31:06.051831 rharper-b1 systemd-
Apr 18 18:31:06.051842 rharper-b1 systemd-
Apr 18 18:31:06.051854 rharper-b1 systemd-
Apr 18 18:31:06.051868 rharper-b1 systemd-
Apr 18 18:31:06.051881 rharper-b1 systemd-
Apr 18 18:31:06.051893 rharper-b1 systemd-
Apr 18 18:31:06.051905 rharper-b1 systemd-
Apr 18 18:31:06.051916 rharper-b1 systemd-
Apr 18 18:31:06.053073 rharper-b1 systemd-
Apr 18 18:31:06.053092 rharper-b1 systemd-
Apr 18 18:31:06.053151 rharper-b1 systemd-
Apr 18 18:31:06.053163 rharper-b1 systemd-
Apr 18 18:31:06.053186 rharper-b1 systemd-
Apr 18 18:31:06.053246 rharper-b1 systemd-
Apr 18 18:31:06.053364 rharper-b1 systemd-
Apr 18 18:31:06.053409 rharper-b1 systemd-
Apr 18 18:31:06.053419 rharper-b1 systemd-
Apr 18 18:31:06.053502 rharper-b1 systemd-
Apr 18 18:31:06.053511 rharper-b1 systemd-
Apr 18 18:31:06.229740 rharper-b1 systemd-
Apr 18 18:31:21.550612 rharper-b1 systemd-
Apr 18 18:31:54.706283 rharper-b1 systemd-
Apr 18 18:33:00.232685 rharper-b1 systemd-
Apr 18 18:35:15.436376 rharper-b1 systemd-
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: systemd 237-3ubuntu8
ProcVersionSign
Uname: Linux 4.15.0-15-generic x86_64
ApportVersion: 2.20.9-0ubuntu4
Architecture: amd64
Date: Wed Apr 18 18:25:53 2018
Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 04/01/2014
dmi.bios.vendor: SeaBIOS
dmi.bios.version: 1.10.2-1ubuntu1
dmi.chassis.type: 1
dmi.chassis.vendor: QEMU
dmi.chassis.
dmi.modalias: dmi:bvnSeaBIOS:
dmi.product.name: Standard PC (i440FX + PIIX, 1996)
dmi.product.
dmi.sys.vendor: QEMU
Status changed to 'Confirmed' because the bug affects multiple users.