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="http://www.postel.org/tg">TG Tool Set</a> to generate
traffic (usermode programs running on FreeBSD 4.3 endpoints).
<li> Traffic Generation using <a href="http://www.isi.edu/nsnam/ns/doc/node477.html">
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="http://citeseer.nj.nec.com/danzig91tcplib.html">
tcplib</a> telnet distribution for telnet-like data. For
configuration parameters and commands allowed on the objects,
refer to NS documentation <a href="http://www.isi.edu/nsnam/ns/doc/node351.html">
here.</a>
<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>
</p>
<p>
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:
<code><pre>
set tcpfull0 [new Agent/TCP/FullTcp]
$ns attach-agent $nodeA $tcpfull0
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcpfull0</code></pre>
</p>
<p>
You must then define the sink FullTcp endpoint and call the method
"listen" making this agent wait for an incoming connection:
<code><pre>
set tcpfull1 [new Agent/TCP/FullTcp/Sack]
$tcpfull1 listen
$ns attach-agent $nodeB $tcpfull1</code></pre>
</p>
<p>
Like all other source-sink traffic generators, you need to connect
them:
<code><pre>
$ns connect $tcpfull0 $tcpfull1</code></pre>
</p>
<p>
Lastly, a set of events to control your applications and link
characteristics:
......@@ -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"
</code></pre>
</p>
<p>
......@@ -154,10 +206,15 @@ Time Node Agent Type Event Arguments
120.000 nodeA cbr1 TRAFGEN START PACKETSIZE=500
RATE=100000
INTERVAL=0.005
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>
<p>
......@@ -261,17 +318,19 @@ example:
<ul>
<li> Links:
<ul>
<code><pre>
<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>
</ul>
<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.
<ul>
<code><pre>
<li> $queue0 set queue-in-bytes_ 0
<li> $queue0 set limit_ 75
<li> $queue0 set maxthresh_ 20
......@@ -282,11 +341,16 @@ example:
<li> CBR
<ul>
<code><pre>
<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>
</ul>
<li> FullTcp, FTP and Telnet: Refer NS documentation <a
href="http://www.isi.edu/nsnam/ns/doc/ns_doc.pdf">here</a>.
</ul>
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