You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/wgengine
Joe Tsai 81fd259133
wgengine/magicsock: gather physical-layer statistics (#5925)
There is utility in logging traffic statistics that occurs at the physical layer.
That is, in order to send packets virtually to a particular tailscale IP address,
what physical endpoints did we need to communicate with?

This functionality logs IP addresses identical to
what had always been logged in magicsock prior to #5823,
so there is no increase in PII being logged.

ExtractStatistics returns a mapping of connections to counts.
The source is always a Tailscale IP address (without port),
while the destination is some endpoint reachable on WAN or LAN.
As a special case, traffic routed through DERP will use 127.3.3.40
as the destination address with the port being the DERP region.

This entire feature is only enabled if data-plane audit logging
is enabled on the tailnet (by default it is disabled).

Example of type of information logged:

	------------------------------------  Tx[P/s]    Tx[B/s]  Rx[P/s]   Rx[B/s]
	PhysicalTraffic:                       25.80      3.39Ki   38.80     5.57Ki
	    100.1.2.3 -> 143.11.22.33:41641    15.40      2.00Ki   23.20     3.37Ki
	    100.4.5.6 -> 192.168.0.100:41641   10.20      1.38Ki   15.60     2.20Ki
	    100.7.8.9 -> 127.3.3.40:2           0.20      6.40      0.00     0.00

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2 years ago
..
bench all: fix more resource leaks found by staticmajor 2 years ago
filter all: fix spelling mistakes 2 years ago
magicsock wgengine/magicsock: gather physical-layer statistics (#5925) 2 years ago
monitor envknob: support changing envknobs post-init 2 years ago
netlog wgengine/magicsock: gather physical-layer statistics (#5925) 2 years ago
netstack wgengine/netstack: enable TCP SACK (#6066) 2 years ago
router wgengine/router: [linux] add before deleting interface addrs 2 years ago
wgcfg wgengine/wgcfg: plumb down audit log IDs (#5855) 2 years ago
wgint go.mod, wgengine/wgint: bump wireguard-go 2 years ago
wglog all: use syncs.AtomicValue 2 years ago
winnet wgengine/winnet: invoke some COM methods directly instead of through IDispatch. 2 years ago
mem_ios.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 3 years ago
pendopen.go wgengine: remove all peer status from open timeout diagnostics 2 years ago
userspace.go wgengine/magicsock: gather physical-layer statistics (#5925) 2 years ago
userspace_ext_test.go go.mod: upgrade wireguard-windows, de-fork wireguard-go 3 years ago
userspace_test.go all: convert more code to use net/netip directly 2 years ago
watchdog.go wgengine: print in-flight operations on watchdog trigger (#5447) 2 years ago
watchdog_js.go wasm: drop pprof dependency 2 years ago
watchdog_test.go wgengine: remove all peer status from open timeout diagnostics 2 years ago
wgengine.go wgengine: fix typo in Engine.PeerForIP (#5912) 2 years ago