networkd does not set bridge forward delay value correctly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
1) # lsb_release -rd
Description: Ubuntu Artful Aardvark (development branch)
Release: 17.10
2) # apt-cache policy systemd
systemd:
Installed: 234-2ubuntu10
Candidate: 234-2ubuntu10
Version table:
*** 234-2ubuntu10 500
500 http://
100 /var/lib/
3) /sys/class/
4) /sys/class/
Configured a bridge in Artful with netplan with the following config:
% cat /etc/netplan/
network:
version: 2
ethernets:
eth0:
dhcp4: true
match:
eth1:
match:
eth2:
match:
bridges:
br0:
- 192.168.14.2/24
- eth1
- eth2
This generates some runtime network configs:
# cat 10-netplan-
[NetDev]
Name=br0
Kind=bridge
[Bridge]
AgeingTimeSec=250
Priority=22
ForwardDelaySec=1
HelloTimeSec=1
MaxAgeSec=10
STP=true
Note that the value (ForwardDelaySec=1) matches the config yaml; however the system value from sysfs is not in seconds, but some other factor:
# cat /sys/class/
200
And brctl confirms the value in seconds matches the kernel setting
# brctl showstp br0
br0
bridge id 0016.ea251c32d10e
designated root 0016.ea251c32d10e
root port 0 path cost 0
max age 10.00 bridge max age 10.00
hello time 1.00 bridge hello time 1.00
forward delay 2.00 bridge forward delay 2.00
ageing time 250.00
hello timer 0.22 tcn timer 0.00
topology change timer 0.00 gc timer 118.63
flags
I *think* networkd has an update unit conversion bug, looking at the upstream
commit for bridge params support:
https:/
Notice the unit is in Seconds, ForwardDelaySec=288
which results in a 2.88 second setting.
I suspect that our setting of ForwardDelaySec=1 was *too* small
and there is no warning (or it got rounded out in a conversion)
Hrm, I set ForwardDelaySec=150 an I get a sysfs value of 3000, and a brctl value of 30
ForwardDelaySec=
ForwardDelaySec specifies the number of seconds spent in each of the Listening and Learning states before the Forwarding state is entered.
That's the manpage entry for netdev devices in systemd. Is it really being doubled?
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: systemd 234-2ubuntu10
ProcVersionSign
Uname: Linux 4.13.0-12-generic x86_64
ApportVersion: 2.20.7-0ubuntu1
Architecture: amd64
Date: Tue Oct 3 23:06:01 2017
Lsusb: Error: command ['lsusb'] failed with exit code 1:
MachineType: QEMU Standard PC (i440FX + PIIX, 1996)
ProcEnviron:
TERM=vt220
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
It turns out that if STP is enabled, then one cannot disable the forward delay, and a value < 2 is not compatible with STP.
If I set stp: false in netplan, then we get:
# cat /run/systemd/ network/ 10-netplan- br0.netdev
[NetDev]
Name=br0
Kind=bridge
[Bridge]
AgeingTimeSec=250
Priority=22
ForwardDelaySec=1
HelloTimeSec=1
MaxAgeSec=10
STP=false
which results in a proper value in brctl and sysfs matching. (1.00/100 respectively)