How shreemanitcse8095/netsight works
NetSight classifies network traffic from live interfaces or PCAPs, streams flow telemetry to a Python collector, and presents it through a React dashboard. The principal path is packet capture/replay → DPI and flow/rule analysis → NDJSON over TCP → in-memory aggregation and SQLite history → REST/WebSocket telemetry → dashboard views. The README also documents offline PCAP analysis, dynamic rules, and security findings. Edges are limited to relationships shown in excerpts or explicit README statements; unsampled engine internals and dashboard API wiring are represented cautiously.
Main entry points: engine_core.cpp Engine Orchestration · App.tsx Dashboard Shell · main.py Collector API · tcp_ingest.py NDJSON Ingest
Components 28
DPI Engine
- Engine Modes
engine/src/main.cpp - Packet Parsing
engine/src/packet_parser.cpp - PCAP Reader
engine/src/pcap_reader.cpp - Live Capture
engine/src/live_capture.cpp - Flow Analysis
engine/src/connection_tracker.cpp - TLS Classification
engine/src/tls_extractor.cpp - DNS Analysis
engine/src/dns_parser.cpp - Host Profiling
engine/src/host_profiler.cpp - Dynamic Rules
engine/src/rule_manager.cpp - Engine Orchestration
engine/src/engine_core.cpp - Telemetry TCP
engine/src/tcp_server.cpp
Telemetry Collector
- Collector API
collector/main.py - NDJSON Ingest
collector/tcp_ingest.py - Live Flow Cache
collector/flow_cache.py - Telemetry Models
collector/models.py - History Storage
collector/database.py
Dashboard
- Dashboard Shell
dashboard/src/App.tsx - Telemetry State
dashboard/src/hooks/useNetSightTelemetry.ts - Overview
dashboard/src/components/OverviewView.tsx - Flow Explorer
dashboard/src/components/FlowsView.tsx - History View
dashboard/src/components/HistoryView.tsx - DPI Analytics
dashboard/src/components/AnalyticsView.tsx - PCAP Analyzer
dashboard/src/components/AnalyzeView.tsx - Rule Controls
dashboard/src/components/RulesView.tsx - Navigation
dashboard/src/components/Navbar.tsx
Other components
- Network Operator
- Network Interface
- PCAP Input
Connections 32
- Network Operator → Engine Modes: selects mode
- Network Interface → Live Capture: provides packets
- PCAP Input → PCAP Reader: provides capture
- Engine Modes → Engine Orchestration: starts
engine/src/main.cpp - Engine Orchestration → Live Capture: captures from
- Engine Orchestration → PCAP Reader: reads replay
- Engine Orchestration → Packet Parsing: processes packets
- Engine Orchestration → Flow Analysis: tracks flows
- Engine Orchestration → TLS Classification: extracts TLS
- Engine Orchestration → DNS Analysis: parses DNS
- Engine Orchestration → Host Profiling: profiles hosts
- Engine Orchestration → Dynamic Rules: checks rules
- Engine Orchestration → Telemetry TCP: exports telemetry
- Telemetry TCP → NDJSON Ingest: streams NDJSON
- Collector API → NDJSON Ingest: starts client
collector/main.py - NDJSON Ingest → Live Flow Cache: updates records
collector/tcp_ingest.py - NDJSON Ingest → Telemetry Models: parses records
collector/tcp_ingest.py - Collector API → Live Flow Cache: serves telemetry
collector/main.py - Collector API → History Storage: records rollups
collector/main.py - History Storage → Collector API: returns history
collector/main.py - Collector API → Dashboard Shell: serves REST and WS
- Dashboard Shell → Navigation: renders navigation
dashboard/src/App.tsx - Dashboard Shell → Overview: renders overview
dashboard/src/App.tsx - Dashboard Shell → Flow Explorer: renders flows
dashboard/src/App.tsx - Dashboard Shell → History View: renders history
dashboard/src/App.tsx - Dashboard Shell → DPI Analytics: renders analytics
dashboard/src/App.tsx - Dashboard Shell → PCAP Analyzer: renders analyzer
dashboard/src/App.tsx - Dashboard Shell → Rule Controls: renders rules
dashboard/src/App.tsx - Dashboard Shell → Telemetry State: uses telemetry
dashboard/src/App.tsx - Telemetry State → Collector API: fetches and subscribes
- PCAP Analyzer → Collector API: uploads PCAP
- Rule Controls → Collector API: updates rules