Guanzhou Hu @ UW-Madison, CS740, Spring 2022
This is a minimal implementation of the DCTCP congestion control protocol (SIGCOMM paper, RFC 8257) with the ns-3 simulator. Tested on Ubuntu 20.04.
It turns out that ns-3.35 already ships with a default implementation of DCTCP. This repo holds my own minimal implementation based on my understanding of the original SIGCOMM paper.
Due to the design of ns-3, all new components and simulation scripts must be put within the ns-3.35
folder, be built by the default ./waf
toolchain, and be run with ./waf --run
. Hence, ns-3.35 source code is included in-place. I added my new DCTCP component into the source folder and modified the build scripts to involve the new stuff.
Files added or modified:
ns-3.35/src/internet/model/tcp-dctcp-my.cc
: my implementation ofTcpDctcpMy
componentns-3.35/src/internet/model/tcp-dctcp-my.h
: mostly a duplicate oftcp-dctcp.h
ns-3.35/src/internet/test/tcp-dctcp-my-test.cc
: a duplicate oftcp-dctcp.test.cc
ns-3.35/src/internet/wscript
: modified to involveTcpDctcpMy
stuff when buildingns-3.35/scratch/trace-tcp-reno.cc
: simple simulation experiment onTcpLinuxReno
ns-3.35/scratch/trace-dctcp-my.cc
: simple simulation experiment onTcpDctcpMy
ns-3.35/scratch/paper-dctcp-my.cc
: a duplicate ofdctcp-example.cc
Build ns-3, including the new components added:
make clean && make
Run unit tests to ensure all PASSED:
make test
Two simple simulation scripts, trace-tcp-reno.cc
and trace-dctcp-my.cc
, have been provided to test the congestion window adjustment behavior of my DCTCP algorithm and the default Reno algorithm. The simulation involves 20 senders, 1 switch, and 1 receiver. Senders each connect to the switch through 1Gbps link, while the switch is connected to the receiver through 10Gbps link. Each sender inejcts a steady stream of packets at rate 1Gbps to the receiver.
Run the simulation:
make simulation
You will find trace-tcp-reno.log
and trace-dctcp-my.log
at the root directory of this repo once this finished. In both logs, the time region between 2 secs - 3 secs is the meaningful measurement window after convergence.
ns-3 ships with a much more complicated example simulation that mimicks the exepriment originally presented in the DCTCP paper. I also duplicated that one to paper-dctcp-my.cc
.
Run the paper experiment:
make paper-expt # may take long
You will find a bunch of .dat
data logs under ns-3.35/
once this finished.