As a part of GSoC 2019, I developed a framework in ns-3 DCE to validate the alignment of ns-3 TCP against Linux TCP. ns-3 DCE is a framework built over ns-3 which allows the users to use kernel space protocols and applications inside the simulator. Leveraging this feature of DCE, I first validated the ns-3 implementation of TCP New Reno congestion control algorithm with Linux. The ns-3 implementation of TCP New Reno follows the RFC 2581 standards which is different from Linux implementation of TCP New Reno. The main difference between the implementation of TCP New Reno in ns-3 and Linux was that in slow start and congestion avoidance phases, presence and absence of delayed acknowledgment does not alter the window growth. Also, in the congestion avoidance phase, the arithmetic for counting the number of segments acked and deciding when to increment the congestion window was different. So, I created a new module for Linux Reno in ns-3 with necessary examples, tests, and documentation.
The next important feature of TCP that was validated was the Proportional Rate Reduction (PRR) recovery algorithm. PRR is the defacto recovery algorithm in Linux kernel. Also, the default congestion control in Linux kernel is TCP CUBIC. So, validating the alignment of PRR and CUBIC with Linux is important for the ns-3 community as these are the most widely used TCP algorithms in the real world. Also, producing results that show the ns-3 implementation of TCP is completely aligned with Linux kernel will give users the confidence that the simulator gives realistic results.
I first validated the alignment of ns-3 PRR with Linux PRR and found out that the ns-3 implementation of PRR is different from Linux. ns-3 follows RFC standards whereas Linux implementation was different from RFC. So, I created a new module for Linux PRR in ns-3 with validation results, tests, and documentation. Next, I validated the alignment of ns-3 implementation of TCP CUBIC with Linux. The ns-3 implementation of CUBIC is close to Linux kernel but not completely aligned. The observed differences are documented and the reasons for those differences are partially resolved. More work is required for the complete alignment of TCP CUBIC.
This project was split into three phases and at the end of each phase, a TCP feature in ns-3 was aligned with Linux. Also, implemented new modules for providing Linux like TCP implementation in ns-3. My patch for Linux Reno is submitted as a merge request in ns-3-dev and patch for Linux PRR is also ready. CUBIC is in the testing phase.
Implemented a new TCP variant called Linux Reno in ns-3 with documentation of valiadtion results and differences from RFC-complaint ns-3 New Reno. Also provided a test suite and example program for users to contrast the differences in congestion window of ns-3 New Reno and Linux Reno
Implemented new recovery
algorithm called Linux PRR in ns-3 with the documentation of validation results and differences from RFC-complaint ns-3 PRR. A test suite and example program (same for Linux Reno and Linux PRR) was also provided.
Validated the alignment of ns-3 implementation of TCP Cubic with Linux using ns-3 Direct Code Execution (DCE). Documented the observed differences between ns-3 CUBIC and Linux CUBIC. Graphs after aligning these differences are close but not completely overlapping.
This project can be extended further as suggested below:
More details about this project, source code and project wiki page are available on the links given below: