fix: correct UFTP/BitTorrent nDPI misclassification + DPI accuracy disclaimer#89
Conversation
- Re-introduce correctMisclassification() in NdpiService to override nDPI's DPI result when port evidence is unambiguous: UDP 1044 (IANA UFTP) wrongly tagged BitTorrent, TCP 1720 (H.225) wrongly tagged Cassandra as a belt-and-suspenders guard - Fix hardcoded color: '#fff' on app badge in AnalysisOverview — use luminance-based getTextColor() for accessibility - Add info alert on overview explaining nDPI's probabilistic nature and advising users to cross-reference unexpected labels Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a backend correction mechanism for nDPI misclassifications and adds an informational alert in the frontend regarding DPI heuristics. It also enhances the UI by dynamically setting text colors for application badges. Feedback includes adding 'rel="noopener"' for security, improving null safety and maintainability in the backend logic, and optimizing frontend performance by caching color values.
Use SGDS OverlayTrigger + Popover (click-to-open, rootClose) instead of a persistent alert banner. Info icons sit inline next to the "Applications Detected" heading and the "Protocol Distribution" heading. Each popover explains the probabilistic nature of nDPI DPI and when to cross-reference results. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… DPI Protocol breakdown comes from IP packet headers (TCP/UDP/ICMP/ARP), not nDPI. Popover now accurately says it's deterministic and points users to the Applications section for nDPI-based identification. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Categories are derived from nDPI application detection and inherit the same probabilistic limitations. Popover explains this and mirrors the pattern used in Applications Detected and Protocol Distribution. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Each popover now fully explains its own detection method without assuming the user has read the others. Protocol popover no longer points to 'Applications Detected above'. Category popover spells out nDPI's probabilistic nature instead of saying 'same limitations'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nDPI 5.0.0 labels all H.323 suite flows as 'H323' without distinguishing sub-protocols. correctMisclassification() now splits them using IANA port assignments: - H323 + TCP + port 1720 → H225 (call signaling, IANA-registered) - H323 + TCP + any other port → H245 (media control, always dynamic) - H323 + UDP (RAS/gatekeeper on 1719) → left unchanged Pass transport protocol string to correctMisclassification() to prevent the H245 rule from firing on UDP flows. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'Cannot be misidentified' was too absolute. Tunnelled traffic (GRE, VXLAN, IP-in-IP) shows the outer transport, not the inner protocol. Reworded to 'accurately reflects what is declared in each packet's header' with an explicit tunnelling caveat. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a mechanism to correct known nDPI misclassifications for protocols like UFTP and H.225, and adds informational UI components to explain the probabilistic nature of deep packet inspection. Review feedback highlights the need for stricter transport protocol checks in the correction logic, the removal of a placeholder URL in the documentation, and a minor performance optimization in the frontend color rendering.
- correctMisclassification: add transport checks to UFTP (UDP) and Cassandra→H225 (TCP) rules; extract PORT_UFTP/PORT_H225 constants; use Integer.equals() for null-safe port comparison - AnalysisOverview: cache getAppColor() result to avoid double call - Add rel="noopener noreferrer" to all target="_blank" links (AnalysisOverview, CategoryBreakdownChart) - Remove placeholder XXXX bug link from NdpiService Javadoc Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
correctMisclassification()inNdpiServiceto override nDPI's DPI result when port evidence is unambiguous: UDP 1044 (IANA-registered for UFTP) misclassified as BitTorrent, and TCP 1720 (H.225) misclassified as Cassandra as a belt-and-suspenders guardcolor: '#fff'on app name badges inAnalysisOverview— now usesgetTextColor()for luminance-based accessibility (follow-up from fix: replace hardcoded colour maps with color-hash for consistent, scalable colouring #87)Root cause (UFTP)
UFTP_v3_transfer.pcapng— flows carrying binary file-transfer payloads trigger nDPI's BitTorrent DPI heuristics, overriding port-based detection. UDP port 1044 is IANA-registered for UFTP. This is a known DPI false-positive pattern in nDPI 5.0.0 (upstream bug filed separately with ntop).Test plan
UFTP_v3_transfer.pcapng— conversations should now show UFTP, not BitTorrentdocker compose build && docker compose up -d— clean build🤖 Generated with Claude Code