20.8 Commands at a glance
Following is a list of commands used for diffusion related simulation in ns.
$ns_ node-config -adhocRouting $opt(adhocRouting)
-llType $opt(ll)
...
-diffusionFilter $opt(filters)
-stopTime $(pre-stop)
...
where,
value of opt(adhocRouting) is set to Directed_Diffusion
This command is used to enable directed diffusion in wireless nodes.
value of opt(filters) can be a list of filters that is required to be attached to diffusion nodes each separated by a forward-slash like GradientFilter/GeoRoutingFilter/TagFilter or maybe GradientFilter/TagFilter etc.
This command allows adding filter objects to diffusion-enabled nodes.
value of opt(pre-stop) is usually the time simulation stops when all statistical data is dumped into a file.
This command allows dumping of statistical data into an output file after running a diffusion simulation.
set src [new Application/DiffApp/PingSender]
This command is used to create ping-sender application.
set snk [new Application/DiffApp/PingReceiver]
This command is used to create ping-receiver application.
set src [new Application/DiffApp/PushSender]
This command is used to create push-sender application.
set snk [new Application/DiffApp/PushReceiver]
This command is used to create push-receiver application.
set src [new Application/DiffApp/GearSenderApp]
This command is used to create gear-sender application.
set snk [new Application/DiffApp/GearReceiverApp]
This command is used to create gear-receiver application.
$gearApp push-pull-options push/pull point/region co-ordinatesX1 X2 Y1 Y2
This command defines the type of routing algorithm gear is using. Incase the second option is defined as region, all four co-ordinates should be defined. While if point is chosen, only X1 and Y1 maybe defined.
$ns_ attach-diffapp $node_ $src_
where the diffusion application $src_ gets attached to the given $node_.
$src_(0) publish
Command to start a ping source (sender).
$snk_(0) subscribe
Command to start a ping sink (receiver).
Tom Henderson
2011-11-05