Add an on-demand traffic monitor to the tray and Android

Show bidirectional IP conversations with network and peer names, ports,
traffic roles, packet totals and directional rates. Aggregate ICMP echoes
by address pair. Attribute exit requests and replies from each endpoint's
perspective and match VIP traffic on the client-facing side of NAT. Keep
authenticated control sessions and opaque relay pairs in a transport view.

Each open window owns a bounded interval subscription. The idle path only
checks whether a reader exists. Contended writers can use another lane,
and observations lost under load are counted without delaying forwarding.
Use a dedicated local control connection on desktop and a service handle
on Android. Closing or backgrounding the Android screen releases capture.
The local IPC format advances to 28. Existing mesh peers and databases
remain compatible.

Accumulate intervals off the render thread in a private temporary SQLite
database. Expire inactive rows after a minute or retain them until close.
Indexed, cursor-based pages keep long sessions out of UI memory. Closing
the window interrupts pending queries and releases the scratch database.

On macOS arm64, workspace formatting and strict Clippy passed. The locked
all-targets workspace suite passed 641 tests with five opt-in tests ignored.
Coverage includes real WireGuard exit traffic in both directions, local IPC
lifetime, Android pause/resume, relay opacity, VIP translation, bounded
capture, simulated three-day retention and 320–900 point layouts. The
Windows GNU workspace cross-check and the offline Android arm64 debug APK
build passed. Windows and Android hardware were not exercised.
This commit is contained in:
Aleksandr Bogomiakov committed 2026-11-25 20:19:40 +02:00
1 parent 7afed15f76
commit e3b74babba
42 files changed
+2476 -31

No files matched your search

+18
View File
@@ -193,6 +193,24 @@ when they reconnect. It does not ban the device: a newer signed claim can return
Online nodes and the currently selected exit node cannot be forgotten.
[State and limits](docs/sync-model.md#offline-node-cleanup).
### Traffic monitor
Open **Traffic monitor** (the pulse icon in the tray window or Android header) to
start an empty live capture. **IP flows** groups both directions of a TCP or UDP
address/port pair and repeated ICMP echoes for an address pair into one row. Select a network and peer, protocol or
role to narrow it down. **Via exit node** shows your outgoing internet traffic.
**Serving exit** shows traffic your device forwards for another peer.
**Transport** shows authenticated control sessions and encrypted datagrams
forwarded between two other endpoints. For relay rows the arrows follow the
two displayed endpoints in order. Rates update once per second. Select a row
to see its packet counts. The monitor records header metadata and counters only.
Inactive rows expire after 60 seconds. **Keep until close** retains flows in a
private temporary table owned by the window. Closing it discards the table and
ends collection. Android pauses collection while the activity is in the background.
Under heavy load the monitor displays the number of missed observations.
## Platforms
| Platform | Build | CLI `tsng` | Tray | Exit node: offer / use | Packages |