A Python tool that simulates the evolution of the TCP Congestion Window (cwnd) and Slow Start Threshold (ssthresh) based on network events. It generates a detailed PDF report containing an evolution graph and a step-by-step event trace table.
usage: congestion.py [-h] [--mss MSS] [--rwnd RWND] (--evolution {ok,mild,severe} [{ok,mild,severe} ...] | --random) [--steps STEPS] [--template TEMPLATE] [--output OUTPUT]
- TCP Logic Simulation: Implements standard TCP congestion control logic:
- Slow Start: Exponential growth.
- Congestion Avoidance: Linear growth.
- Mild Congestion (3 Duplicate ACKs): Fast Recovery logic.
- Severe Congestion (Timeout): Reset to MSS (Restart Slow Start).
- Gilbert-Elliott Model: Optional random event generation using a bursty loss model.
You need Python 3.x and the following dependencies:
``bash pip install -r requirements.txt
python3 congestion.py --mss 1460 --rwnd 40000 --steps 10 --evolution ok ok ok ok mild ok ok severe ok ok ok ok ok
Will produce a document with a graph of the congestion window size, and a grid where the student can fill in the events that took place during the protocol evolution.
In the next page, a solution is provided.

