set packetSize 500 #Packet size (in bytes);
set plm_debug_flag 2 #Debugging output;
set rates "50e3 50e3 50e3 50e3 50e3" #Rate of each layer;
set rates_cum [calc_cum $rates] #Cumulated rate of the layers (mandatory);
set level [llength $rates] #Number of layers (mandatory);
set Queue_sched_ FQ #Scheduling of the queues;
set PP_burst_length 2 #PP burst length (in packets);
set PP_estimation_length 3 #Minimum number of PP required to make an estimate;
Class Scenario0 -superclass PLMTopology
Scenario0 instproc init args {
eval $self next $args
$self instvar ns node
$self build_link 1 2 100ms 256Kb #Build a link;
set addr(1) [$self place_source 1 3] #Set a PLM source;
$self place_receiver 2 $addr(1) 5 1 #Set a PLM receiver;
#set up the multicast routing
DM set PruneTimeout 1000 #A large PruneTimeout value is required;
set mproto DM
set mrthandle [$ns mrtproto $mproto {} ]
}
set ns [new Simulator -multicast on] #PLM needs multicast routing;
$ns multicast
$ns namtrace-all [open out.nam w] #Nam output;
set scn [new Scenario0 $ns] #Call of the scenario;
$ns at 20 "exit 0"
$ns run
Several variables are introduced in this example. They all need to be set in the simulation script (there is no default value for these variables). In particular the two following lines are mandatory and must not be omitted:
set rates_cum [calc_cum $rates] set level [llength $rates]
We describe now in detail each variable:
All the simulations for PLM should be setup using the PLMTopology environment (as in the example script where we define a PLMTopology superclass called Scenario0). The user interface is (all the instproc can be found in ~ns/tcl/plm/plm-topo.tcl):
Tom Henderson 2011-11-05