deep-packet-inspection/README.md
2026-10-21 11:16:01 -06:00

30 lines
1.3 KiB
Markdown

# DPI censor lab
## What is what
| File | Role |
| :--- | :--- |
| `corpus.py` | given: 600 synthetic connection records, the blocklist, the keywords, the two CDN addresses, the proxy, and `truth()`; the record format is documented at the top |
| `dpi.py` | given: `name_matches`, `dns_filter`, `ip_filter`, `keyword_filter`; `sni_filter` is the extra credit |
| `evade.py` | given: `hide_sni`, `use_doh`, `via_proxy`, the three evasions |
| `selfcheck.py` | given: PASS, FAIL with what it expected, or SKIP per function |
| `experiments.py` | given: the measurement harness, writes `results.json` |
| `report.md` | yours: create it; the Canvas page says what belongs in it |
Keep the given files as they are, except `sni_filter` in `dpi.py` if you do the extra credit.
## Run
Python 3 only, no packages, any computer.
```text
python3 -c "import corpus; [print(r) for r in corpus.records()[:5]]"
python3 selfcheck.py
python3 experiments.py # all four parts
python3 experiments.py corpus # A: what is in the traffic
python3 experiments.py filters # B: the strategies, measured
python3 experiments.py evasion # C: which strategies still catch each evasion
python3 experiments.py escalate # D: the censor's next move, and its cost
```
Each run rewrites `results.json` for the parts it ran.