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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Applic<strong>at</strong>ion FTP FTP objects produce bulk d<strong>at</strong>a for a TCP object to send.$ftp startCauses the source to produce maxpkts_ packets.$ftp produce Causes the FTP object to produce n packets i<strong>ns</strong>tantaneously.$ftp stopCauses the <strong>at</strong>tached TCP object to stop sending d<strong>at</strong>a.$ftp <strong>at</strong>tach agentAttaches a Applic<strong>at</strong>ion/FTP object to agent.$ftp producemore Causes the Applic<strong>at</strong>ion/FTP object to produce count more packets.Configur<strong>at</strong>ion Parameters are:maxpkts <strong>The</strong> maximum number of packets gener<strong>at</strong>ed by the source.TRACEFILE OBJECTS Tracefile objects are used to specify the trace file th<strong>at</strong> is to be used for gener<strong>at</strong>ing traffic (see Applic<strong>at</strong>ion/Traffic/Traceobjects described earlier in this section). $tracefile is an i<strong>ns</strong>tance of the Tracefile Object. $tracefilefilename Set the filename from which the traffic trace d<strong>at</strong>a is to be read to trace-input.<strong>The</strong>re are no configur<strong>at</strong>ion parameters for this object. A trace file co<strong>ns</strong>ists of any number of fixed length records. Each recordco<strong>ns</strong>ists of 2 32 bit fields. <strong>The</strong> first indic<strong>at</strong>es the interval until the next packet is gener<strong>at</strong>ed in microseconds. <strong>The</strong> secondindic<strong>at</strong>es the length of the next packet in bytes.38.6 Comm<strong>and</strong>s <strong>at</strong> a glanceFollowing are some tra<strong>ns</strong>port agent <strong>and</strong> applic<strong>at</strong>ion rel<strong>at</strong>ed comm<strong>and</strong>s commonly used in simul<strong>at</strong>ion scripts:set tcp1 [new Agent/TCP]$<strong>ns</strong>_ <strong>at</strong>tach-agent $node_(src) $tcp1set sink1 [new Agent/TCPSink]$<strong>ns</strong>_ <strong>at</strong>tach-agent $node_(snk) $sink1$<strong>ns</strong>_ connect $tcp1 $sink1This cre<strong>at</strong>es a source tcp agent <strong>and</strong> a destin<strong>at</strong>ion sink agent. Both the tra<strong>ns</strong>port agents are <strong>at</strong>tached to their resoective nodes.Finally an end-to-end connection is setup between the src <strong>and</strong> sink.set ftp1 [new Applic<strong>at</strong>ion/FTP]$ftp1 <strong>at</strong>tach-agent $agentor set ftp1 [$agent <strong>at</strong>tach-app FTP] Both the above comm<strong>and</strong>s achieve the same. An applic<strong>at</strong>ion (ftp in thisexample) is cre<strong>at</strong>ed <strong>and</strong> <strong>at</strong>tached to the source agent. An applic<strong>at</strong>ion can be of two types, a traffic gener<strong>at</strong>or or a simul<strong>at</strong>edapplic<strong>at</strong>ion. Types of Traffic gener<strong>at</strong>ors currently present are: Applic<strong>at</strong>ion/Traffic/Exponential, Applic<strong>at</strong>ion/Traffic/Pareto,Applic<strong>at</strong>ion/Traffic/CBR, <strong>and</strong> Applic<strong>at</strong>ion/Traffic/Trace. See section 38.3 for details. Types of simul<strong>at</strong>ed applic<strong>at</strong>io<strong>ns</strong>currently implemented are: Applic<strong>at</strong>ion/FTP <strong>and</strong> Applic<strong>at</strong>ion/Telnet. See section 38.4 for details.340

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

Saved successfully!

Ooh no, something went wrong!