Skip to content

feat: add opt-in UDP/QUIC socket traffic accounting - #2143

Closed
Tarkiin wants to merge 1 commit into
henrypp:masterfrom
Tarkiin:codex/udp-quic-accounting
Closed

Tarkiin wants to merge 1 commit into
henrypp:masterfrom
Tarkiin:codex/udp-quic-accounting

Conversation

@Tarkiin

@Tarkiin Tarkiin commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

UDP rows currently remain empty in the download/upload/total columns because TCP EStats does not cover UDP. This change adds optional UDP socket-I/O accounting, which also covers QUIC.

Behavior

  • Adds Measure UDP/QUIC traffic (experimental, restart required) to Options.
  • Disabled by default. Toggling the option only changes configuration; it does not reapply filters.
  • Reuses the existing speed and total columns for UDP rows.
  • Displays unavailable data as an em dash instead of a false zero.

Implementation

A dedicated real-time Microsoft-Windows-Winsock-AFD ETW session maps UDP socket creation and bind events to the owning PID/address/port, then counts successful send and receive completions. Storage is bounded and stale rows are removed after successful owner-table refreshes. A second Simplewall instance cannot replace an active collector, and shutdown stops only this collector's own session.

The values are completed Winsock UDP payload bytes. QUIC encryption and protocol overhead are included; IP/link headers, unread datagrams, raw/non-Winsock paths and RIO are outside the metric. Sockets opened before the collector starts must be reopened. The option remains experimental for these reasons.

Validation

Tested on Windows 11 build 26200 with the x64 Release build and warnings treated as errors:

  • Static analysis and AddressSanitizer checks passed.
  • IPv4/IPv6 UDP loopback, wildcard and connected sockets matched exact independent byte counts, including 12,000,000 bytes in each direction.
  • Encrypted aioquic 1.3 traffic matched independent counters for both endpoints and directions.
  • The production network update and display callback showed the measured totals.
  • TCP IPv4/IPv6 EStats behavior remained unchanged.
  • Non-admin failure, pre-existing sockets, competing collectors, stop/restart and ETW cleanup passed.
  • Full WinMain/DialogProc startup passed with UDP enabled and disabled using a test WFP object that cannot open the filtering engine or toggle Windows Firewall. The enabled run measured 120,000 bytes exactly in both directions and closed cleanly.

This revision removes the public-SDK compatibility layer, test harnesses and long-form test documentation from the PR. The PR now contains only the production change and localization entries.

@henrypp

henrypp commented Aug 31, 2026

Copy link
Copy Markdown
Owner

rework it

@henrypp

henrypp commented Aug 31, 2026

Copy link
Copy Markdown
Owner

artificall idiot is complete useless, am i wrong?

@henrypp

This comment was marked as spam.

@Tarkiin
Tarkiin force-pushed the codex/udp-quic-accounting branch from b72c13a to 34abfaf Compare September 1, 2026 04:32
@Tarkiin

Tarkiin commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Reworked: removed the public-SDK adapter, test harnesses, and documentation from the PR, reducing the diff from 2,540 added lines to 698 production/localization lines. The branch is now one production-only commit; the full validation was rerun before this update.

@Tarkiin

Tarkiin commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

I reduced the PR to production-only changes and reran the full validation. Could you clarify the preferred technical direction for the rework? In particular, is the AFD ETW approach itself unsuitable, or should it be implemented through an existing routine API or another Windows API? If possible, please point out the main area you want changed (event decoding, session/lifetime management, network-table integration, or project style) so I can align the implementation instead of guessing.

@henrypp

henrypp commented Sep 2, 2026 •

Copy link
Copy Markdown
Owner

sorry, cant merge this PR, because of style is out of my general (main) code

ps: i mean - it doesnt suit my style

@Tarkiin

Tarkiin commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Okay no problem, thanks! ❤️

@Tarkiin Tarkiin closed this Sep 3, 2026
@henrypp

henrypp commented Sep 4, 2026

Copy link
Copy Markdown
Owner

да не растраивайся, мне нужно просто очень сильно переработать этот PR, к следующей версии включу

@henrypp

henrypp commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

вон, я даже объяснение почему routine больше никогда не будет обновлятся запилил, но там только с переводчиком понимание придет, а PR я в ближайшие 2 дня закомичу, не сердись только

henrypp added a commit that referenced this pull request Sep 18, 2026
@henrypp

henrypp commented Sep 18, 2026

Copy link
Copy Markdown
Owner

now it is done!

PhilopaterSh added a commit to PhilopaterSh/simplewall that referenced this pull request Nov 7, 2026
… export + RSK-01 cited update

T008 (DEC-09): _r_update_verifysignature un-static'd + rapp.h decl - the
preflight gate exercises the REAL production code path.
T009: tools/preflight.c + preflight.vcxproj - 2957-line C port, clean
build (0 errors/warnings), byte-for-byte verdict parity with
release-preflight.py in pass AND fail states, --ci/--json/--app-h/
--thumbprint/--feed-dir parity, DEC-11 minimal-JSON ground-truth reader
(fail-closed outside subset, provenance cross-checked), SWC1 via
loadlibrary-as-image + _r_sys_decompressbuffer + _r_xml_* count, native
imports/flags/key-scan, CryptCATAdmin+WinVerifyTrust Authenticode, and
the b-feed check: production verifier PASS on the true feed pair,
tampered rejected (0xC000A000). Timing 0.5-2.3s (NFR-02 <5s).
imports.json: RSK-01 cited-diff update - WS2_32.dll via 482893b
(upstream henrypp#2143 traffic feature; src/udpstats.c first winsock consumer).
Ledger: rows 16-18 (cross-exam, DEC-11 reader catch, sharing-violation
fail-closed). routine-hardening DEC-05 body propagated to match the r4
header (BIG-endian) - roadmap item 7 applied.
Verified: --ci 9/9 green exit 0 on a stable copy; tamper -> exit 1.
dnsrig/feedserver (T010/T011) in flight by a second agent.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants