Bug 280190 - net/zerotier: drops all networking
Summary: net/zerotier: drops all networking
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Dave Cottlehuber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-08 11:08 UTC by Tim Preston
Modified: 2024-09-23 09:55 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (dch)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Preston 2024-07-08 11:08:11 UTC
With zerotier enabled and running networking appears to stop on two separate machines.

On a laptop with the iwlwifi driver the wireless network either fails to start or drops after boot, and again periodically if the laptop is kept running.

On a desktop with the re driver the network fails or drops at boot, but remains stable after being reset.

Bringing the physical interface down and up will fix the issue, eg: ifconfig wlan0 down && ifconfig wlan0 up

Both machines are set up with bridges for either bhyve or bastille, and both run pf.

This only started to occur in the last couple of months.
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2024-07-08 15:24:18 UTC
Its a little confusing to refer to "networking" here, if that means "all networking"
or just "zerotier networking" is not clear to me.

Running zerotier is unlikely to bring down the wireless network stack, zerotier is
just creating a tap device, and shovelling some packets around.

What FreeBSD release / patch version is this from?
What h/w is reported for these 2 NICs?
Does this happen without zerotier?

This sounds more like an iwlwifi issue than a zerotier one. If the underlying device
or network disappears, zerotier may not recover correctly. I can only reproduce that
behaviour by suspending and resuming on a laptop though.

Does dmesg or /var/log/messages show any iwlwifi messages?

For the laptop, if you switch to use the older iwm driver (if that's possible), do
you still see this issue?

For the desktop, try fiddling with netwait_* settings in https://man.freebsd.org/rc.conf
and see if you can get zerotier to wait until after the rc driver is up, before
trying to establish itself. perhaps we can do something smarter in the zerotier rc.d
script to accommodate this.
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2024-07-08 15:28:30 UTC
if you can, try 14-STABLE, maybe in a boot environment, as it contains
https://reviews.freebsd.org/D45293 among other fixes not yet in a main release.

FWIW even on 15-CURRENT I still have regular issues with wifi dropouts on
iwlwifi driver and a rather old intel 8265fw. On iwm its stable.
Comment 3 Tim Preston 2024-07-11 11:23:15 UTC
(In reply to Dave Cottlehuber from comment #2)
Ah yes, I realized there wasn't enough information when I typed out the description, but wasn't sure what else to include, so here goes.

By networking, I mean everything. At least the physical interface stops being able to send and receive packets, so all other interfaces stop as well. ie. `ping 1.1.1.1` gives "no route to host". 

When zerotier is not running both machines networking is rock solid. I can run the laptop for days without a problem. I've now disabled zerotier, but I can reliably get the network to stop by running `service zerotier onestart`.

When this happens I can't see anything in /var/logs/messages or dmesg. ifconfig also looks fine.

The details for each machine:

Laptop
driver: iwlwifi
hardware: Intel(R) Wi-Fi 6 AX201 160MHz, REV=0x351
patch level: FreeBSD 14.1-STABLE stable/14-n268065-342053a66c16

Desktop
driver: re
hardware: RealTek 8168/8111 B/C/CP/D/DP/E/F/G PCIe Gigabit Ethernet
patch level: FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8
Comment 4 Tim Preston 2024-07-12 01:06:19 UTC
Regarding versions, this is happening on zerotier 1.14.0. I have a third machine running 1.12.2 which is unaffected.
Comment 5 Dave Cottlehuber freebsd_committer freebsd_triage 2024-07-22 21:59:16 UTC
can you recompile the port with debug on (run `make config` in the port directory),
and then run the daemon in the foreground?

This should show all the commands that zerotier issues, and we can then re-issue
them manually to see which one is dropping all the things.

Its tap based networking is basically issuing ifconfig & route commands:

https://github.com/zerotier/ZeroTierOne/blob/dev/osdep/BSDEthernetTap.cpp#L111

was there any change/improvement using a newer stable?
Comment 6 Tim Preston 2024-09-23 09:55:43 UTC
Sorry for the long delay, Dave!

Just tried to build it now, v1.14.0 and it failed with:

osdep/PortMapper.cpp:233:27: error: no matching function for call to 'UPNP_GetValidIGD'