# chatradhara007/bigpac architecture

> Architecture diagram of the GitHub repository chatradhara007/bigpac, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chatradhara007/bigpac
- Repository: https://github.com/chatradhara007/bigpac

## Overview

BigPAC classifies encrypted QUIC applications from early packet sizes, directions and timing. Its primary workflow captures QUIC flows, derives SNI labels for training data, trains the v2 model, then predicts from live or replayed traffic; the web demo separately replays held-out flows. The graph also preserves the documented CESNET/original-model evaluation and legacy live classifier. Some wiring is based on README descriptions because those modules were not sampled.

Main entry points: [`live_capture_v2.py`](https://github.com/chatradhara007/bigpac/blob/main/live_capture_v2.py) (Live classifier), [`train_v2.py`](https://github.com/chatradhara007/bigpac/blob/main/train_v2.py) (v2 training), [`app.py`](https://github.com/chatradhara007/bigpac/blob/main/app.py) (Web demo), [`pcap_to_dataset.py`](https://github.com/chatradhara007/bigpac/blob/main/pcap_to_dataset.py) (Capture converter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Capture and labels"]
  node_pcap[("Capture files")]
  node_converter["Capture converter<br/>[pcap_to_dataset.py]"]
  node_livecsv[("Labelled live flows")]
  node_capture["Live capture<br/>[live_capture_v2.py]"]
  node_sni["QUIC SNI reader<br/>[quic_sni.py]"]
end

subgraph group_model["Features and training"]
  node_cesnet[("CESNET flows")]
  node_features["Shared features<br/>[features.py]"]
  node_trainer["v2 training<br/>[train_v2.py]"]
  node_modelstore[("Trained model")]
  node_eval["Live evaluation<br/>[eval_live.py]"]
end

subgraph group_runtime["Prediction runtime"]
  node_liveclass["Live classifier<br/>[live_capture_v2.py]"]
  node_livepred[("Prediction log<br/>[live_log.csv]")]
  node_web["Web demo<br/>[app.py]"]
  node_samples[("Held-out flows")]
  node_ui["Demo interface<br/>[script.js]"]
end

subgraph group_legacy["Original pipeline"]
  node_legacytrain["Original training<br/>[model_pipeline.py]"]
  node_legacydata[("Processed flows")]
  node_oldlive["Original live classifier<br/>[live_capture.py]"]
  node_visualizer["Accuracy visualizer<br/>[visualizer.py]"]
end

node_operator(("Operator"))
node_network(("QUIC traffic"))
node_browser(("Demo user"))
node_tshark["tshark"]

node_operator -->|"converts captures"| node_converter
node_pcap -->|"reads captures"| node_converter
node_converter -->|"extracts packet fields"| node_tshark
node_converter -->|"writes labelled flows"| node_livecsv
node_network -->|"supplies packets"| node_capture
node_capture -->|"reads Initials"| node_sni
node_cesnet -->|"training input"| node_trainer
node_livecsv -->|"training input"| node_trainer
node_trainer -->|"computes features"| node_features
node_trainer -->|"saves model"| node_modelstore
node_operator -->|"runs training"| node_trainer
node_network -->|"supplies packets"| node_liveclass
node_liveclass -.->|"reads server name"| node_sni
node_liveclass -->|"computes features"| node_features
node_liveclass -->|"loads model"| node_modelstore
node_liveclass -->|"writes predictions"| node_livepred
node_browser -->|"uses demo"| node_ui
node_ui -->|"requests samples and predictions"| node_web
node_web -->|"loads held-out flows"| node_samples
node_web -->|"computes features"| node_features
node_web -->|"loads model"| node_modelstore
node_legacydata -->|"training input"| node_legacytrain
node_legacytrain -->|"saves original models"| node_modelstore
node_network -->|"supplies packets"| node_oldlive
node_oldlive -.->|"collects flow samples"| node_legacydata
node_operator -->|"runs evaluation"| node_eval
node_livecsv -->|"evaluation input"| node_eval
node_modelstore -->|"loads model"| node_eval
node_operator -->|"runs visualization"| node_visualizer
node_legacytrain -.->|"provides experiment results"| node_visualizer

click node_converter "https://github.com/chatradhara007/bigpac/blob/main/pcap_to_dataset.py"
click node_capture "https://github.com/chatradhara007/bigpac/blob/main/live_capture_v2.py"
click node_sni "https://github.com/chatradhara007/bigpac/blob/main/quic_sni.py"
click node_features "https://github.com/chatradhara007/bigpac/blob/main/features.py"
click node_trainer "https://github.com/chatradhara007/bigpac/blob/main/train_v2.py"
click node_legacytrain "https://github.com/chatradhara007/bigpac/blob/main/model_pipeline.py"
click node_eval "https://github.com/chatradhara007/bigpac/blob/main/eval_live.py"
click node_liveclass "https://github.com/chatradhara007/bigpac/blob/main/live_capture_v2.py"
click node_livepred "https://github.com/chatradhara007/bigpac/blob/main/results/live_log.csv"
click node_web "https://github.com/chatradhara007/bigpac/blob/main/app.py"
click node_ui "https://github.com/chatradhara007/bigpac/blob/main/static/script.js"
click node_oldlive "https://github.com/chatradhara007/bigpac/blob/main/live_capture.py"
click node_visualizer "https://github.com/chatradhara007/bigpac/blob/main/visualizer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pcap,node_converter,node_livecsv,node_capture,node_sni,node_browser toneBlue
class node_cesnet,node_features,node_trainer,node_modelstore,node_eval toneAmber
class node_liveclass,node_livepred,node_web,node_samples,node_ui toneMint
class node_legacytrain,node_legacydata,node_oldlive,node_visualizer toneRose
class node_operator,node_network,node_tshark toneIndigo
```

## Components

### Capture and labels

- **Capture files**
- [Capture converter](https://github.com/chatradhara007/bigpac/blob/main/pcap_to_dataset.py): `pcap_to_dataset.py`
- **Labelled live flows**
- [Live capture](https://github.com/chatradhara007/bigpac/blob/main/live_capture_v2.py): `live_capture_v2.py`
- [QUIC SNI reader](https://github.com/chatradhara007/bigpac/blob/main/quic_sni.py): `quic_sni.py`

### Features and training

- **CESNET flows**
- [Shared features](https://github.com/chatradhara007/bigpac/blob/main/features.py): `features.py`
- [v2 training](https://github.com/chatradhara007/bigpac/blob/main/train_v2.py): `train_v2.py`
- **Trained model**
- [Live evaluation](https://github.com/chatradhara007/bigpac/blob/main/eval_live.py): `eval_live.py`

### Prediction runtime

- [Live classifier](https://github.com/chatradhara007/bigpac/blob/main/live_capture_v2.py): `live_capture_v2.py`
- [Prediction log](https://github.com/chatradhara007/bigpac/blob/main/results/live_log.csv): `results/live_log.csv`
- [Web demo](https://github.com/chatradhara007/bigpac/blob/main/app.py): `app.py`
- **Held-out flows**
- [Demo interface](https://github.com/chatradhara007/bigpac/blob/main/static/script.js): `static/script.js`

### Original pipeline

- [Original training](https://github.com/chatradhara007/bigpac/blob/main/model_pipeline.py): `model_pipeline.py`
- **Processed flows**
- [Original live classifier](https://github.com/chatradhara007/bigpac/blob/main/live_capture.py): `live_capture.py`
- [Accuracy visualizer](https://github.com/chatradhara007/bigpac/blob/main/visualizer.py): `visualizer.py`

### Other components

- **Operator**
- **QUIC traffic**
- **Demo user**
- **tshark**

## Connections

- Operator → Capture converter: converts captures
- Capture files → Capture converter: reads captures
- Capture converter → tshark: extracts packet fields
- Capture converter → Labelled live flows: writes labelled flows
- QUIC traffic → Live capture: supplies packets
- Live capture → QUIC SNI reader: reads Initials
- CESNET flows → v2 training: training input
- Labelled live flows → v2 training: training input
- v2 training → Shared features: computes features
- v2 training → Trained model: saves model
- Operator → v2 training: runs training
- QUIC traffic → Live classifier: supplies packets
- Live classifier → QUIC SNI reader: reads server name
- Live classifier → Shared features: computes features
- Live classifier → Trained model: loads model
- Live classifier → Prediction log: writes predictions
- Demo user → Demo interface: uses demo
- Demo interface → Web demo: requests samples and predictions
- Web demo → Held-out flows: loads held-out flows
- Web demo → Shared features: computes features
- Web demo → Trained model: loads model
- Processed flows → Original training: training input
- Original training → Trained model: saves original models
- QUIC traffic → Original live classifier: supplies packets
- Original live classifier → Processed flows: collects flow samples
- Operator → Live evaluation: runs evaluation
- Labelled live flows → Live evaluation: evaluation input
- Trained model → Live evaluation: loads model
- Operator → Accuracy visualizer: runs visualization
- Original training → Accuracy visualizer: provides experiment results
