congestion-control/README.md
2026-10-28 11:03:44 -06:00

43 lines
2.4 KiB
Markdown

# HW 10: congestion control
## What is what
| File | Role |
| :--- | :--- |
| `congestion.py` | given: `FixedWindow`, what your Project 3 sender did, and `Reno`, TCP's rules |
| `run.py` | given: runs the experiments and writes `fixed.csv`, `trace.csv`, `rwnd.csv`, `queue.csv`, `fair.csv` and `mix.csv`; `--p3` runs your own Project 3 `gbn.py` in the fixed-window runs |
| `sender.py` | given: Project 3's Go-Back-N sender, with its window set by the controller |
| `receiver.py` | given: a receiver that keeps early packets, ACKs cumulatively and advertises rwnd |
| `bottleneck.py` | given: the simulated path, a slow link behind a drop-tail queue |
| `packet.py`, `stopwait.py` | given: Project 3's packet format and stop-and-wait, which a Project 3 `gbn.py` imports |
| `analyze/` | given: the experiments as recorded, and `mininet/`, real Linux Reno and CUBIC runs from the course container |
| `plot.py` | given, optional: one SVG line chart from a CSV |
| `mininet/` | optional: the Mininet experiment behind `analyze/mininet/`; runs only in the course container |
## Run
```text
python3 run.py all
python3 run.py fixed --p3 ../p3/gbn.py
python3 plot.py trace.csv t_ms cwnd --out cwnd.svg
```
`run.py all` runs all six experiments; `fixed`, `trace`, `rwnd`, `queue`, `fair` or `mix` runs one.
## Optional: the Mininet experiment
Start the course container in the `mininet/` folder, then run a step inside it:
```text
docker run --rm -it --privileged --network none -v "$PWD":/work cs4220-net
python3 run_experiment.py one reno 1
python3 run_experiment.py capture reno 0
```
`capture` writes `capture-reno-loss0-h1.pcap` (the sender) and `capture-reno-loss0-h3.pcap` (the receiver). Open them in Wireshark on your own computer; its TCP analysis marks retransmissions and duplicate ACKs with no plugin. The other steps (`sweep`, `cwnd`, `fairness`, `summary`) are functions marked `YOUR TASK`.
## Tool references
- [Python csv module](https://docs.python.org/3/library/csv.html)
- [Mininet walkthrough](http://mininet.org/walkthrough/), [iperf3 options](https://software.es.net/iperf/invoking.html), [ss manual](https://man7.org/linux/man-pages/man8/ss.8.html), [tc-netem manual](https://man7.org/linux/man-pages/man8/tc-netem.8.html)
- [tcpdump manual](https://www.tcpdump.org/manpages/tcpdump.1.html) and [Wireshark TCP analysis](https://www.wireshark.org/docs/wsug_html_chunked/ChAdvTCPAnalysis.html)