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 tcl/plm/plm-topo.tcl):