Skip to the content.

Weak classification heuristics surfaced in Phase 2

Part of the MMT-DPI Master Improvement Plan — Phase 7 (M9, issue #75).

The Phase 7 task “revisit weak heuristics surfaced in Phase 2” (MASTER_IMPROVEMENT_PLAN.md §3 line 214 — an internal, repo-local planning document) was deliberately deferred until they were enumerated: the heuristics were previously uncatalogued, and the plan requires this list to exist before any behaviour-changing code lands. This document is that catalogue.

Phase 2 (“memory-safety hardening of packet parsers”) audited the transport and application parsers line by line. Alongside the memory-safety fixes it surfaced a number of classification heuristics that are weak, magic-number-driven, or carry standing TODOs but are out of scope for a memory-safety change. They are recorded here with file/line, what makes them weak, and a recommended next step. No code is changed by this document — each item below is a candidate for its own measured, fingerprint-gated follow-up.

How to act on an item: reproduce it under the precision/recall harness (tools/phase0/ci/check_precision.sh), add a labelled capture that exercises it, then make the change behind a default-off flag (as #75 did for port-only demotion) so the golden classification fingerprint holds until the gain is proven.

Catalogue

H1 — No graded classification confidence (best_effort) — highest impact

H2 — Port-only attribution accepted without payload evidence — mitigated by #75

H3 — Stale compiled-in IP ranges — mitigated by #26 / #74 / #75

H4 — Magic-number classification window, asymmetric TCP vs UDP

H5 — tcp_retransmission == 0 gate on UDP packets

H6 — GTP forced re-classification special-case

H7 — flow == NULL early return drops UDP classification

H8 — Speculative memset of the flow on SYN

Priority

Item Theme Status Suggested order
H1 confidence model open (ABI) after H2 proven
H2 port-only demotion flag landed (#75) enable-by-default once measured
H3 stale IP ranges data file landed (#75) ongoing refresh
H4 magic window open measure then tune
H5 UDP retransmission bit open low risk cleanup
H6 GTP special-case open document first
H7 NULL-flow drop open investigate
H8 SYN memset open low risk cleanup

H1–H3 are the substantive accuracy levers and are the M9 focus; H2 and H3 are addressed (behind a flag / as a data file) by issue #75. H4–H8 are smaller, mostly-documentation or low-risk cleanups suitable as standalone follow-ups.