Using NSC - TCP congestion control variants, and high speed networks (10 Gbps)

327 views
Skip to first unread message

Vish

unread,
Sep 22, 2011, 1:54:40 PM9/22/11
to ns-3-users
Hi All,

I want to run some experiments using NSC to simulate how TCP (and
variants) work over a 10 Gbps network. Is it possible to simulate a 10
Gbps network? I began with running the "tcp-nsc-lfn", but it failed
with the errors below. I did test that NSC is built properly by
running "./test.py -s ns3 ns3-tcp-interoperability". Can someone
please point me in the right direction. Thank you!


./waf --run tcp-nsc-lfn
Waf: Entering directory `/home/vishal/Desktop/ns-allinone-3.12.1/
ns-3.12.1/build'
Waf: Leaving directory `/home/vishal/Desktop/ns-allinone-3.12.1/
ns-3.12.1/build'
'build' finished successfully (1.182s)
assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName:
ns3::NscTcpL4Protocol not found", file=../src/core/model/type-id.cc,
line=388
Command ['/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/build/
debug/examples/tcp/tcp-nsc-lfn'] terminated with signal SIGSEGV. Run
it under a debugger to get more information (./waf --run <program> --
command-template="gdb --args %s <args>").


./waf --run tcp-nsc-lfn --command-template="gdb"
Waf: Entering directory `/home/vishal/Desktop/ns-allinone-3.12.1/
ns-3.12.1/build'
Traceback (most recent call last):
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/examples/
tcp/../../waf", line 158, in <module>
Scripting.prepare(t, cwd, VERSION, wafdir)
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Scripting.py", line 105, in
prepare
prepare_impl(t,cwd,ver,wafdir)
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Scripting.py", line 98, in
prepare_impl
main()
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Scripting.py", line 133, in
main
fun(ctx)
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Scripting.py", line 278, in
build
return build_impl(bld)
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Scripting.py", line 287, in
build_impl
bld.add_subdirs([os.path.split(Utils.g_module.root_path)[0]])
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Build.py", line 639, in
add_subdirs
self.recurse(dirs,'build')
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/.waf-1.5.16-
e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Utils.py", line 461, in
recurse
f(self)
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/wscript",
line 804, in build
program_name, dummy_program_argv =
wutils.get_run_program(Options.options.run,
wutils.get_command_template(env))
File "/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/wutils.py",
line 200, in get_run_program
tmpl = command_template % (program_node.abspath(env),)
TypeError: not all arguments converted during string formatting

Ivo Calado

unread,
Sep 22, 2011, 4:40:59 PM9/22/11
to ns-3-...@googlegroups.com
Hi,
it seems like the NSC is not compiled properly. Can you execute
other examples with NSC successfully?

> --
> You received this message because you are subscribed to the Google Groups "ns-3-users" group.
> To post to this group, send email to ns-3-...@googlegroups.com.
> To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.
>
>

--
Ivo Calado
PhD candidate in Electrical Engineering
Embedded Systems and Pervasive Computing Lab - http://embeddedlab.org
Electrical Engineering Department - http://dee.ufcg.edu.br/
Federal University of Campina Grande - http://www.ufcg.edu.br
Professor of the Federal Institute of Education, Science and
Technology of Alagoas - http://ifal.edu.br

PGP: 0xD7C3860A pgp.mit.edu
Putt's Law:
       Technology is dominated by two types of people:
               Those who understand what they do not manage.
               Those who manage what they do not understand.

Vishal Ahuja

unread,
Sep 23, 2011, 10:02:31 AM9/23/11
to ns-3-...@googlegroups.com
No, even other examples don't work. Please advise how to procede further.

Ivo Calado

unread,
Sep 23, 2011, 10:09:23 AM9/23/11
to ns-3-...@googlegroups.com
Please, try to install (or reinstall) the following packages: flex,
m4, bison. If this approach don't work, post the compilation output
for nsc and the configure step output.

[]'s

Vishal Ahuja

unread,
Sep 24, 2011, 11:51:56 AM9/24/11
to ns-3-...@googlegroups.com
Have installed all these. Now, should I just follow the steps to build ns3 again. Any special flags to build nsc along with it?

Thank you,
Vishal

Ivo Calado

unread,
Sep 24, 2011, 12:41:32 PM9/24/11
to ns-3-...@googlegroups.com
Just build it! :)

Vishal Ahuja

unread,
Sep 24, 2011, 6:40:54 PM9/24/11
to ns-3-...@googlegroups.com
Thanks a lot! Works now. Can you please help me test the following scenarion:
 
Two machines connected via a 10 Gbps link. I want to be able to configure the following:
 
1. The RTT of the link.
2. The loss rate.
3. TCP congestion control variant (CUBIC, High Speed TCP, etc).
 
The TCP congestion control variants are present as modules. Before running the NSC test, will I have to load them?
 
Thank you. 

Ivo Calado

unread,
Sep 24, 2011, 7:27:03 PM9/24/11
to ns-3-...@googlegroups.com
Please,
take a look on examples/tcp-nsc-lfn.cc. In such example you can see
how to configure all properties that you want.

[]'s

Vishal Ahuja

unread,
Sep 25, 2011, 1:04:46 PM9/25/11
to ns-3-...@googlegroups.com
Hi Ivo,

Thank you for your time! Had a look at the examples, and the code is very easy to understand. Configuring the parameters seems quite easy. But I have a few more questions:

1. How do I compile a particular file, say tcp-nsc-lfn.cc, after modifying it?
2. Can I simulate a 10 Gbps link?
3. The output file is in pcap format. How can I obtain the throughput etc from that file?

Thanks,
Vishal

Ivo Calado

unread,
Sep 25, 2011, 1:51:33 PM9/25/11
to ns-3-...@googlegroups.com
Hi Vishal,
   
On Sun, Sep 25, 2011 at 14:04, Vishal Ahuja <vah...@gmail.com> wrote:
Hi Ivo,

Thank you for your time! Had a look at the examples, and the code is very easy to understand. Configuring the parameters seems quite easy. But I have a few more questions:

1. How do I compile a particular file, say tcp-nsc-lfn.cc, after modifying it?

You just need to call './war --run'  again. The waf script will compile the file as needed. The compilation of files placed on examples dir is configured in the respective wscript files (if you need to create a code with a different name). Although, in my opinion a better approach is to create the file on the scratch dir. The waf build system will look on this directory and compile all files.

2. Can I simulate a 10 Gbps link?
As far as I know you can simulate links on such speed (my test limit was up to 1 gbps). I advise you execute such simulation in a PC with a bunch of memory available! :). Due to the large number of events to be thrown it will consume a lot of memory.

3. The output file is in pcap format. How can I obtain the throughput etc from that file?
You can read retrieve such information on pcap file using some tools to parse pcap files (e.g wireshark can show statistics of a trace file). There are others approaches you can use such as FlowMonitor (Such tool provides a summary of a simulation) or take statistics directly from simulation. The last approach specially useful for plot graphics since you can take several samples of transmission (maybe FlowMonitor can do either, I never tried). Please, take a look on this example. It is a modified version of tcp-nsc-lfn that calculates and show the throughput per second in Mbps.

Regards,
    Ivo
 

Vishal Ahuja

unread,
Sep 25, 2011, 2:50:57 PM9/25/11
to ns-3-...@googlegroups.com
Hi Ivo,

Thank you for the example! It helps. Can you please take a look at the command lines below:

vishal@vishal-desktop:~/Desktop/ns-allinone-3.12.1/ns-3.12.1/examples$ ./waf --run 'tcp-nsc-lfn --TCP_CONGESTION=htcp --runtime=30'
Waf: Entering directory `/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/build'
Waf: Leaving directory `/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/build'
'build' finished successfully (1.280s)

vishal@vishal-desktop:~/Desktop/ns-allinone-3.12.1/ns-3.12.1/examples$ ./waf --run 'tcp-nsc-lfn --TCP_CONGESTION=htcp --runtime=130'
Waf: Entering directory `/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/build'
Waf: Leaving directory `/home/vishal/Desktop/ns-allinone-3.12.1/ns-3.12.1/build'
'build' finished successfully (1.280s)

How come both the runs took the same amount of time to build? Is it not actually running for the time specified using the runtime flag?

Thank you,
Vishal

Ivo Calado

unread,
Sep 25, 2011, 3:11:19 PM9/25/11
to ns-3-...@googlegroups.com
Hi Vishal,
    it's taking eh correct time. This build time is just the time required for waf system to verify all execution files and compile them (if needed) and not to execute the simulation.

Vishal Ahuja

unread,
Sep 26, 2011, 12:51:47 PM9/26/11
to ns-3-...@googlegroups.com
Hi Ivo,

I incorporated the Throughput() function in your example into my code, and got a list of numbers.

void
ReceivedPacket (std::string context, Ptr<const Packet> p, const
Address& addr)
{
        long size = p->GetSize();
        long time = floor(Simulator::Now().GetSeconds());
        if(mapa.find(time) == mapa.end()) {
                mapa[time] = size;
        } else {
                mapa[time] += size;
        }
}

void Throughput() {
        for(map<long, double>::iterator it = mapa.begin(); it != mapa.end(); it++) {
                double value = (it->second * 8)/1000000;
                cout<<it->first<<" "<<value<<endl;
        }

}




I can see that you are storing the packet size in some sort of a hash (am not familiar with C++), but I don't see anything accessing the values stored. In the Throughput() function, what does 'it->second' refer to? Following is the list of numbers I got - please tell me which one is the actual throughput. Is it showing that the throughput achieved is 472 Mbps?


2 134.15
3 220.189
4 241.318
5 255.543
6 264.138
7 268.575
8 269.919
9 269.907
10 270.892
11 271.958
12 276.475
13 285.233
14 299.307
15 320.541
16 350.126
17 389.582
18 440.157
19 472.546
20 472.627
21 472.627
22 472.627
23 472.627
24 472.627
25 472.627
26 472.627
27 472.627
28 472.627
29 472.627
30 472.627
31 472.627
32 1.92102

Thank you for your time,
Vishal

Ivo Calado

unread,
Sep 26, 2011, 2:00:48 PM9/26/11
to ns-3-...@googlegroups.com
Hi Vishal,

On Mon, Sep 26, 2011 at 13:51, Vishal Ahuja <vah...@gmail.com> wrote:
Hi Ivo,

I incorporated the Throughput() function in your example into my code, and got a list of numbers.

void
ReceivedPacket (std::string context, Ptr<const Packet> p, const
Address& addr)
{
        long size = p->GetSize();
        long time = floor(Simulator::Now().GetSeconds());
        if(mapa.find(time) == mapa.end()) {
                mapa[time] = size;
        } else {
                mapa[time] += size;
        }
}

void Throughput() {
        for(map<long, double>::iterator it = mapa.begin(); it != mapa.end(); it++) {
                double value = (it->second * 8)/1000000;
                cout<<it->first<<" "<<value<<endl;
        }

}




I can see that you are storing the packet size in some sort of a hash (am not familiar with C++), but I don't see anything accessing the values stored. In the Throughput() function, what does 'it->second' refer to? Following is the list of numbers I got - please tell me which one is the actual throughput. Is it showing that the throughput achieved is 472 Mbps?


In my example a really use a map. In C++, we define a mas with a pair of types (in the example, long and double). the it object is an iterator where it->fist points to the key of the map and it->second points to second value.
In the values presented below, the first one indicates the second of the sample and the last the throughput achieved in Mbps
 

Vishal Ahuja

unread,
Sep 26, 2011, 2:19:13 PM9/26/11
to ns-3-...@googlegroups.com
Hi Ivo,

Sorry for the array of questions. Just wanted to know if NSC allocates the TCP window size based on the bandwidth delay product using the parameter values in the code?

Thank you,
Vishal

Vishal Ahuja

unread,
Sep 26, 2011, 2:32:42 PM9/26/11
to ns-3-...@googlegroups.com
Hi Ivo,

The machine that I am using is an Intel Nehalem Quadcore. NSC is the only application running, yet am not able to achieve more than 500 Mbps. The error rate is set to 0.0, and RTT is set to 10ms.
Is there a way to better the throughput?

Thank you,
Vishal

Ivo Calado

unread,
Sep 26, 2011, 10:53:14 PM9/26/11
to ns-3-...@googlegroups.com
Hi Vishal,
   as far as I know, the ns-3 generate events following the period defined in application sendrate. For instance, suppose that you are performing transmission with packets with 1000 bits and you defined a application sendrate 1Mbps (on Onoff application and not in the bandwidth link) the ns-3 will generate at each second (in terms of simulation time) one thousand events for send. This send event will make a call for the sendmsg syscall on Tcp implementation of NSC that, according to the network conditions, will pass this packet for the network (i.e. re-inject the packet on the simulator). I think you can have a better understatement of this process reading this page  .

[]'s

Vishal Ahuja

unread,
Sep 27, 2011, 12:59:06 PM9/27/11
to ns-3-...@googlegroups.com
Hi Ivo,

On Mon, Sep 26, 2011 at 7:53 PM, Ivo Calado <ivo.c...@ee.ufcg.edu.br> wrote:
Hi Vishal,
   as far as I know, the ns-3 generate events following the period defined in application sendrate. For instance, suppose that you are
Here is the only line in the code, which defines the rate:
 p2p.SetDeviceAttribute ("DataRate", StringValue ("6000Mbps"));

This has been set to 6 Gbps. Is there anything else that I have to configure. What about the TCP window size?

 

Ivo Calado

unread,
Sep 28, 2011, 10:49:47 AM9/28/11
to ns-3-...@googlegroups.com
Hi Vishal, sorry for the delay.
    Since the implementation of tcp presented in the NSC is one of real stack, you must know how your specifically stack handle this. For instance, Linux stack make use of sysctl entries such "net.ipv4.tcp_congestion_control". Others stacks use similar approaches. You can see which specific keys you should use in [1],[2] or [3].

In order to configure this in you simulation, you should use the Config::Set method
e.g: Config::Set ("/NodeList/*/$ns3::Ns3NscStack<linux2.6.26>/net.ipv4.tcp_congestion_control", StringValue ("cubic"));



[1] http://fasterdata.es.net/fasterdata/host-tuning/linux/
[2] http://proj.sunet.se/E2E/tcptune.html
[3] http://www.psc.edu/networking/projects/tcptune/
Reply all
Reply to author
Forward
0 new messages