40.6 Commands at a glance

Following are some transport agent and application related commands commonly used in simulation scripts:

set tcp1 [new Agent/TCP]
\$ns\_ attach-agent \$node\_(src) \$tcp1
set sink1 [new Agent/TCPSink]
\$ns\_ attach-agent \$node\_(snk) \$sink1
\$ns\_ connect \$tcp1 \$sink1
This creates a source tcp agent and a destination sink agent. Both the transport agents are attached to their resoective nodes. Finally an end-to-end connection is setup between the src and sink.

set ftp1 [new Application/FTP]
\$ftp1 attach-agent \$agent
or set ftp1 [$agent attach-app FTP] Both the above commands achieve the same. An application (ftp in this example) is created and attached to the source agent. An application can be of two types, a traffic generator or a simulated application. Types of Traffic generators currently present are: Application/Traffic/Exponential, Application/Traffic/Pareto, Application/Traffic/CBR, and Application/Traffic/Trace. See section 40.3 for details. Types of simulated applications currently implemented are: Application/FTP and Application/Telnet. See section 40.4 for details.

Tom Henderson 2011-11-05