Monitor the network¶
vNet has three sources of information: the conductor’s state dump, the switches’ counters, and the logs. None needs extra software.
The state dump¶
The conductor writes its view of the network every 60 seconds
(VNET_DUMP_SEC) and on SIGUSR1, to /var/vnet-dump.bin
(VNET_DUMP_PATH). Read it with vnet-state; given the auth file, it
also lists the machines that should be there and are not:
$ sudo systemctl kill -s USR1 vnet-conductor
$ sudo vnet-state /var/vnet-dump.bin /etc/vnet/auth.txt
The output is described in During an event and
Programs, signals and services. vnet-state reads a copied file as well,
so the dump can be watched from another machine.
The switch counters¶
Every switch prints one statistics line every 60 seconds
(VNET_STATS_SEC; 0 turns it off), and on SIGUSR1 the same line
followed by one line per machine:
$ sudo systemctl kill -s USR1 vnet-switch
$ journalctl -u vnet-switch -n 5
[Switch] Stats: agents=1 routes=1 local=16 to-switch=16 to-internet=2 waited-for-route=8 dropped=6 acl=6 link-full-drops=0 tun-write-errors=0 peers=1 pending-tokens=0 conductor=up
[Switch] Agents:
agent1 10.0.1.1 fd=7 in=30/2520B out=16/1344B dropped=4
The counters count since the switch started.
Field |
Meaning |
|---|---|
|
machines attached to this switch now |
|
machines on other switches this switch knows how to reach |
|
packets delivered to a machine of this switch |
|
packets sent to another switch |
|
packets sent to the internet |
|
packets held because the destination’s route was not known yet (The data plane) |
|
packets dropped, all reasons together; then one field per reason
that occurred: |
|
packets dropped because the link to their destination was full |
|
packets that could not be written to the internet interface |
|
links to other switches that are up or being dialed |
|
joins announced by the conductor that have not completed yet |
|
|
And per machine:
Field |
Meaning |
|---|---|
name, address |
the machine and its virtual address |
|
the socket of its link, as in the |
|
packets/bytes received from the machine |
|
packets/bytes delivered to the machine |
|
packets from this machine that were dropped |
What healthy looks like¶
conductor=upon every switch, andpeersequal to the number of other switches that hold machines (a switch links to another one when it first learns a route through it).routeson each switch equal to the number of machines on the other switches (vnet-stategives both).pending-tokensback to 0 a few seconds after machines join.acldrops growing slowly: machines trying what the rules forbid (software updates, telemetry, a contestant exploring). A sudden rise from one machine is worth a look.No
spoof,unknown-sourceormalformed: these mean a machine sends packets it should not be able to make, or a broken agent.rate-limitedonly on machines you expect to be busy.link-full-dropsandtun-write-errorsat 0. A growing value means a link or the uplink cannot keep up.
To watch the counters over time, collect the [Switch] Stats: lines
from the journal of every switch; each line is self-contained.
Debug output¶
VNET_DEBUG=1 on a switch logs every dropped packet with its reason,
every packet held for a route, and every write that failed. It is meant
for a lab: on a busy switch it writes a line per packet. Set it in
/etc/vnet/switch.env and restart the switch.