Testing and Alignment of ns-3 TCP with Linux TCP

Student: Apoorva Bhargava

Mentor: Tom Henderson, Vivek Jain

Organization: The ns-3 Network Simulator Project
Project Overview

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.

Deliverables

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.

assignment_turned_in

Phase 1
Implementation and Testing of Linux Reno in ns-3

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

assignment_turned_in

Phase 2
Implementation and Testing of Linux PRR in ns-3

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.

assignment_turned_in

Phase 3
Testing and Aligning ns-3 CUBIC with
Linux

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.

Steps to build the code for Phase 1
  1. Download ns-3-dev from above provided link
  2. Configure ns-3-dev: ./waf configure --enable-tests --enable-examples
  3. Build ns-3-dev: ./waf
  4. To run the test suite: ./test.py --suite=tcp-linux-reno-test
  5. Run the example program: ./waf --run "tcp-linux-reno --congControlVariant=TcpLinuxReno"
Steps to build the code for Phase 2
  1. Download ns-3-dev from above provided link
  2. Configure ns-3-dev: ./waf configure --enable-tests --enable-examples
  3. Build ns-3-dev: ./waf
  4. To run the test suite: ./test.py --suite=tcp-linux-prr-recovery-test
  5. Run the example program: ./waf --run "tcp-linux-reno --recoveryType=TcpLinuxPrrRecovery"
Steps to build the code for Phase 3
  1. Go to the above provided link.
  2. Follow the steps provided in README to reproduce the result.
Possible Extensions

This project can be extended further as suggested below:

  1. Complete the alignment of ns-3 CUBIC with Linux CUBIC.
  2. For this project separate example files and scripts in ns-3-dce were used for testing the alignment of ns-3 TCP against Linux TCP. It can be further automated to produce the results directly by running the example in DCE.
  3. This project can be further extend to test other features of TCP like ECN, RACK, SACK etc.
Online References

More details about this project, source code and project wiki page are available on the links given below: