Bug 2074

Summary: DCE Linux memory defaults too low to allow Linux TCP to have >32767 byte window
Product: dce Reporter: Chip Webb <ns3>
Component: kernelAssignee: Hajime Tazaki <tazaki>
Status: PATCH PENDING ---    
Severity: major CC: ns-bugs, ns3
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   
Bug Depends on: 2129    
Bug Blocks:    
Attachments: test case for checking DCE-Linux TCP memory and perf TCP window size and simulations with different node types

Description Chip Webb 2015-03-06 09:58:26 EST
The default behavior of TCP in DCE Linux is to allow a maximum window size of around 32kB. 

This is because requests by the Linux sockets/TCP code to allocate additional buffer memory fail.

In kernel code file ./net/core/sock.c (sk_init), the value of totalram_pages is zero, so the sysctl wmem and rmem values (default & max) are set to 32767. totalram_pages is set to zero in kernel code file ./arch/sim/glue.c.

Since one of the main reasons for using DCE Linux is to have realistic network code behavior, it is disappointing for the default behavior to be crippled in this way.

I would recommend changing it so that the default behavior is more realistic. This can be achieved in many ways, but I would request that it not require extra code on the part of the NS3 user (e.g. running sysctl commands or calling other functions to set the memory available). My reason for this request is that this would be an extra step that a user should not have to take.
Comment 1 Hajime Tazaki 2015-03-07 10:31:15 EST
Thanks Chip for the report, and I fully agree with the proposed change.

do you mind to provide a simulation script (minimum reproducible one is the best) so that I can confirm the issue ? the script will be also useful to avoid a future regression during nightly tests.

thanks again.
Comment 2 Hajime Tazaki 2015-05-25 09:56:09 EDT
I tentatively fixed an issue.

https://github.com/direct-code-execution/net-next-sim/commit/840e3c6dd9428b742bbda7cb60228acb7747b314

Since I don't have reproduced this issue yet in my local environment, I kept this issue opened until we come up with a test program.
Comment 3 Chip Webb 2015-05-29 13:00:00 EDT
Thank you very much for proposing a fix. I confirm that the proposed patch works for me. 

Sorry it took so long to make a test case. I am attaching one in a minute, but using it requires fixing another bug that I will report in another minute.
Comment 4 Chip Webb 2015-05-29 13:01:46 EDT
Created attachment 2050 [details]
test case for checking DCE-Linux TCP memory and perf TCP window size and simulations with different node types
Comment 5 Hajime Tazaki 2015-05-31 09:00:19 EDT
I added a couple of commits to the net-next-sim.

https://github.com/direct-code-execution/net-next-sim/commits/sim-ns3-2.6.36-branch

with this version, the example 'dce-iperf-heterogeneous-multihop.cc' gives the following goodput with the default sysctl values (rmem/wmem).

[  3] 117.0-118.0 sec  2.00 MBytes  16.8 Mbits/sec
[  3] 118.0-119.0 sec  2.00 MBytes  16.8 Mbits/sec
[  3] 119.0-120.0 sec  1.88 MBytes  15.7 Mbits/sec
[  3]  0.0-120.0 sec   236 MBytes  16.5 Mbits/sec

before the fix, it was like below.

[  3] 115.0-116.0 sec   640 KBytes  5.24 Mbits/sec
[  3] 116.0-117.0 sec   640 KBytes  5.24 Mbits/sec
[  3] 117.0-118.0 sec   640 KBytes  5.24 Mbits/sec
[  3] 118.0-119.0 sec   640 KBytes  5.24 Mbits/sec
[  3] 119.0-120.0 sec   640 KBytes  5.24 Mbits/sec
[  3]  0.0-120.2 sec  75.0 MBytes  5.24 Mbits/sec

let me know if you still see any issue.