12.07.2015 Views

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

set src [new Agent/UDP]set sink [new Agent/UDP]$<strong>ns</strong>_ <strong>at</strong>tach-agent $node_(s1) $src$<strong>ns</strong>_ <strong>at</strong>tach-agent $node_(k1) $sink$<strong>ns</strong>_ connect $src $sinkset e [new Applic<strong>at</strong>ion/Traffic/Exponential]$e <strong>at</strong>tach-agent $src$e set packetSize_ 210$e set burst_time_ 500ms$e set idle_time_ 500ms$e set r<strong>at</strong>e_ 100k$<strong>ns</strong>_ <strong>at</strong> 0.0 "$e start"38.4 Simul<strong>at</strong>ed applic<strong>at</strong>io<strong>ns</strong>: Telnet <strong>and</strong> FTP<strong>The</strong>re are currently two “simul<strong>at</strong>e applic<strong>at</strong>ion” classes derived from Applic<strong>at</strong>ion: Applic<strong>at</strong>ion/FTP <strong>and</strong> Applic<strong>at</strong>ion/Telnet.<strong>The</strong>se classes work by advancing the count of packets available to be sent by a TCP tra<strong>ns</strong>port agent. <strong>The</strong> actual tra<strong>ns</strong>missionof available packets is still controlled by TCP’s flow <strong>and</strong> congestion control algorithm.Applic<strong>at</strong>ion/FTP Applic<strong>at</strong>ion/FTP, implemented in OTcl, simul<strong>at</strong>es bulk d<strong>at</strong>a tra<strong>ns</strong>fer. <strong>The</strong> following are methods of theApplic<strong>at</strong>ion/FTP class:<strong>at</strong>tach-agentstartstop<strong>at</strong>taches an Applic<strong>at</strong>ion/FTP object to an agent.start the Applic<strong>at</strong>ion/FTP by calling the TCP agent’s send(-1) function, which causes TCP tobehave as if the applic<strong>at</strong>ion were continuously sending new d<strong>at</strong>a.stop sending.produce n set the counter of packets to be sent to n.producemore n increase the counter of packets to be sent by n.send n similar to producemore, but sends n bytes i<strong>ns</strong>tead of packets.Applic<strong>at</strong>ion/Telnet Applic<strong>at</strong>ion/Telnet objects gener<strong>at</strong>e packets in one of two ways. If the member variable interval_is non-zero, then inter-packet times are chosen from an exponential distribution with average equal to interval_. Ifinterval_ is zero, then inter-arrival times are chosen according to the tcplib distribution (see tcplib-telnet.cc). <strong>The</strong> startmethod starts the packet gener<strong>at</strong>ion process.38.5 Applic<strong>at</strong>io<strong>ns</strong> objectsAn applic<strong>at</strong>ion object may be of two types, a traffic gener<strong>at</strong>or or a simul<strong>at</strong>ed applic<strong>at</strong>ion. Traffic gener<strong>at</strong>or objects gener<strong>at</strong>etraffic <strong>and</strong> can be of four types, namely, exponential, pareto, CBR <strong>and</strong> traffic trace.Applic<strong>at</strong>ion/Traffic/Exponential objects Exponential traffic objects gener<strong>at</strong>e On/Off traffic. During "on" periods, packetsare gener<strong>at</strong>ed <strong>at</strong> a co<strong>ns</strong>tant burst r<strong>at</strong>e. During "off" periods, no traffic is gener<strong>at</strong>ed. Burst times <strong>and</strong> idle times are takenfrom exponential distributio<strong>ns</strong>. Configur<strong>at</strong>ion parameters are:338

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!