14.4 Commands at a glance
The following is a list of error-model related commands commonly used in
simulation scripts:
set em [new ErrorModel]
$em unit pkt
$em set rate_ 0.02
$em ranvar [new RandomVariable/Uniform]
$em drop-target [new Agent/Null]
This is a simple example of how to create and configure an error model.
The commands to place the error-model in a simple link will be shown next.
$simplelink errormodule args
This commands inserts the error-model before the queue object in simple link.
However in this case the error-model's drop-target points to the link's
drophead_ element.
$ns_ lossmodel em src dst
This command places the error-model before the queue in a simplelink defined
by the <src> and <dst> nodes. This is basically a wrapper for the above method.
$simplelink insert-linkloss args
This inserts a loss-module after the queue, but right before the delay link_
element in the simple link. This is because nam can visualize a packet drop
only if the packet is on the link or in the queue. The error-module's
drop-target points to the link's drophead_ element.
$ns_ link-lossmodel em src dst
This too is a wrapper method for insert-linkloss method described above.
That is this inserts the error-module right after the queue element in a
simple link (src-dst).
Tom Henderson
2014-12-17