Commit 83ce366b authored by Shashi Guruprasad's avatar Shashi Guruprasad
Browse files

NSE Traffic Generation examples

parent 830df5f5
......@@ -27,6 +27,20 @@ adhere to the syntax and operational model of
<a href="">TG Tool Set</a> to generate
traffic (usermode programs running on FreeBSD 4.3 endpoints).
<li> Traffic Generation using <a href="">
NS Emulation (NSE)</a>: Emulab supports TCP traffic generation
using NS's Agent/TCP/FullTcp which is a BSD Reno derivative and
its subclasses namely Newreno, Tahoe and Sack. Currently two
application classes are supported: Application/FTP and
Application/Telnet. The former drives the FullTcp agent to send
bulk-data according to connection dynamics. The latter uses the
NS's <a href="">
tcplib</a> telnet distribution for telnet-like data. For
configuration parameters and commands allowed on the objects,
refer to NS documentation <a href="">
<li> Event System: Emulab supports limited use of the NS "at"
syntax, allowing you to define a static set of events in your NS
file, to be delivered to agents running on your nodes.
......@@ -114,6 +128,37 @@ on nodeB:
$ns connect $tcp0 $null1</code></pre>
Here is a good example for NSE FullTcp traffic generation. The
following code snippet attaches an FTP agent that drives a Reno
FullTcp on NodeA:
set tcpfull0 [new Agent/TCP/FullTcp]
$ns attach-agent $nodeA $tcpfull0
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcpfull0</code></pre>
You must then define the sink FullTcp endpoint and call the method
"listen" making this agent wait for an incoming connection:
set tcpfull1 [new Agent/TCP/FullTcp/Sack]
$tcpfull1 listen
$ns attach-agent $nodeB $tcpfull1</code></pre>
Like all other source-sink traffic generators, you need to connect
$ns connect $tcpfull0 $tcpfull1</code></pre>
Lastly, a set of events to control your applications and link
......@@ -125,12 +170,19 @@ characteristics:
$ns at 100.0 "$link0 down"
$ns at 110.0 "$link0 up"
$ns at 115.0 "$cbr0 stop"
$ns at 120.0 "$ftp0 start"
$ns at 140.0 "$tcpfull0 set segsize_ 256; $tcpfull0 set segsperack_ 2"
$ns at 145.0 "$tcpfull1 set nodelay_ true"
$ns at 150.0 "$ftp0 stop"
$ns at 120.0 "$cbr1 start"
$ns at 130.0 "$cbr1 set packetSize_ 512"
$ns at 130.0 "$cbr1 set interval_ 0.01"
$ns at 140.0 "$link0 down"
$ns at 150.0 "$cbr1 stop"</code></pre>
$ns at 150.0 "$cbr1 stop"
......@@ -154,10 +206,15 @@ Time Node Agent Type Event Arguments
120.000 nodeA cbr1 TRAFGEN START PACKETSIZE=500
120.000 nodeA ftp0 NSETRAFGEN MODIFY $ftp0 start
130.000 nodeA cbr1 TRAFGEN MODIFY PACKETSIZE=512
130.000 nodeA cbr1 TRAFGEN MODIFY INTERVAL=0.01
140.000 tbsdelay0 link0 LINK DOWN
140.000 nodeA tcpfull0 NSETRAFGEN MODIFY $tcpfull0 set segsize_ 256
140.000 nodeA tcpfull0 NSETRAFGEN MODIFY $tcpfull0 set segsperack_ 2
145.000 nodeB tcpfull1 NSETRAFGEN MODIFY $tcpfull1 set nodelay_ true
150.000 tbsdelay0 link0 LINK UP
150.000 nodeA ftp0 NSETRAFGEN MODIFY $ftp0 stop
160.000 nodeA cbr1 TRAFGEN STOP </code></pre>
......@@ -261,17 +318,19 @@ example:
<li> Links:
<li> $link0 up
<li> $link0 down
<li> $link0 bandwidth 10Mb duplex
<li> $link0 delay 10ms
<li> $link0 plr 0.1
<li> $link0 plr 0.1</code></pre>
<li> Queues: Queues are special. In your NS file you modify the actual
queue, while on the command line you use the link that queue is
part of.
<li> $queue0 set queue-in-bytes_ 0
<li> $queue0 set limit_ 75
<li> $queue0 set maxthresh_ 20
......@@ -282,11 +341,16 @@ example:
<li> CBR
<li> $cbr0 start
<li> $cbr0 set packetSize_ 512
<li> $cbr0 set interval_ 0.01
<li> $cbr0 set rate_ 10Mbs
<li> $cbr0 stop
<li> $cbr0 stop </code></pre>
<li> FullTcp, FTP and Telnet: Refer NS documentation <a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment