The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...
Chapter 37PLMThis chapter describes the ns implementation of the PLM protocol [19]. The code of the PLM protocol is written in both C++and OTcl. The PLM Packet Pair generator is written in C++ and the PLM core machinery is written in OTcl. The chapterhas simply three parts: the first part shows how to create and configure a PLM session; the second part describes the PacketPair source generator; the third part describes the architecture and internals of the PLM protocol. In this last part, rather thangiving a list of procedures and functions, we introduce the main procedures per functionality (instantiation of a PLM source,instantiation of a PLM receiver, reception of a packet, detection of a loss, etc.).The procedures, functions, and variables described in this chapter can be found in: ~ns/plm/cbr-traffic-PP.cc, ~ns/plm/lossmonitor-plm.cc,~ns/tcl/plm/plm.tcl, ~ns/tcl/plm/plm-ns.tcl, ~ns/tcl/plm/plm-topo.tcl, ~ns/tcl/lib/ns-default.tcl.37.1 ConfigurationCreating a simple scenario with one PLM flow (only one receiver)This simple example can be run as is (several complex scenarios can be found in the file ~ns/tcl/ex/simple-plm.tcl).set packetSize 500set plm_debug_flag 2set rates "50e3 50e3 50e3 50e3 50e3"set rates_cum [calc_cum $rates]set level [llength $rates]set Queue_sched_ FQset PP_burst_length 2set PP_estimation_length 3;#Packet size (in bytes);#Debugging output;#Rate of each layer;#Cumulated rate of the layers (mandatory);#Number of layers (mandatory);#Scheduling of the queues;#PP burst length (in packets);#Minimum number of PP required to make an estimateClass Scenario0 -superclass PLMTopologyScenario0 instproc init args {eval $self next $args$self instvar ns node$self build_link 1 2 100ms 256Kbset addr(1) [$self place_source 1 3]$self place_receiver 2 $addr(1) 5 1;#Build a link;#Set a PLM source;#Set a PLM receiver323
#set up the multicast routingDM set PruneTimeout 1000set mproto DMset mrthandle [$ns mrtproto $mproto {} ]};#A large PruneTimeout value is requiredset ns [new Simulator -multicast on]$ns multicast$ns namtrace-all [open out.nam w]set scn [new Scenario0 $ns]$ns at 20 "exit 0"$ns run;#PLM needs multicast routing;#Nam output;#Call of the scenarioSeveral variables are introduced in this example. They all need to be set in the simulation script (there is no default value forthese 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:packetSize represents the size of the packets in bytes sent by the PLM source.plm_debug_flag represents the verbose level of debugging output: from 0 no output to 3 full output. Forplm_debug_flag set to 3 (full output), long lines output are generated which is not compatible with nam visualization.rates is a list specifying the bandwidth of each layer (this is not the cumulated bandwidth!).rates_cum is a list specifying the cumulated bandwidth of the layers: the first element of rates_cum is the bandwidtha layer 1, the second element of rates_cum is the sum of the bandwidth of layer 1 and layer 2, etc. The proccalc_cum{} computes the cumulated rates.level is the number of layers.Queue_sched_ represents the scheduling of the queues. This is used by the PLMTopology instproc build_link. PLMrequires FQ scheduling or a variation.PP_burst_length represents the size of the Packet Pair bursts in packets.PP_estimation_length represents the minimum number of Packet Pair required to compute an estimate (see section37.3.3).All the simulations for PLM should be setup using the PLMTopology environment (as in the example script where we definea PLMTopology superclass called Scenario0). The user interface is (all the instproc can be found in ~ns/tcl/plm/plm-topo.tcl):build_link a b d bw creates a duplex link between node a and b with a delay d and a bandwidth bw. If either nodedoes not exist, build_link creates it.place_source n t creates and places a PLM source at node n and starts it at time t. place_source returns addrwhich allows to attach receivers to this source.324
- Page 273 and 274: $ns_ mrtproto This command specifi
- Page 275 and 276: Chapter 31Network DynamicsThis chap
- Page 277 and 278: v 0.8123 link-up 3 5v 0.8123 link-u
- Page 279 and 280: The first argument is the time at w
- Page 281 and 282: $ns_ rtmodel This command defines
- Page 283 and 284: $ns set-address-format hierarchical
- Page 285 and 286: 32.4 Hierarchical Routing with Sess
- Page 287 and 288: Chapter 33UDP Agents33.1 UDP Agents
- Page 289 and 290: Chapter 34TCP AgentsThis section de
- Page 291 and 292: set ns [new Simulator]set node1 [$n
- Page 293 and 294: 34.2.1 The Base TCP SinkThe base TC
- Page 295 and 296: Agent/TCP/FullTcp set dupseg_fix_ t
- Page 297 and 298: 34.5 Tracing TCP DynamicsThe behavi
- Page 299 and 300: Chapter 35SCTP AgentsThis chapter d
- Page 301 and 302: Figure 35.1: Example of a Multihome
- Page 303 and 304: Note: the actual value of these tra
- Page 305 and 306: 1.526624 1 4 sctp 1500 -------D 0 1
- Page 307 and 308: $ns at 5.0 "finish"$ns run35.5.2 Mu
- Page 309 and 310: Chapter 36Agent/SRMThis chapter des
- Page 311 and 312: 36.1.2 Other Configuration Paramete
- Page 313 and 314: 3.6274 n 0 m r 1 type repair servi
- Page 315 and 316: 3.6029 n 3 m r 2 Q NTIMER at 3.730
- Page 317 and 318: 36.4 Loss Detection—The Class SRM
- Page 319 and 320: same packet. The repair objet does
- Page 321 and 322: }hdr_asrm* seh = (hdr_asrm*) p->acc
- Page 323: set grp [Node allocaddr]$srm set ds
- Page 327 and 328: 37.3 Architecture of the PLM Protoc
- Page 329 and 330: We add in void PLMLossMonitor::recv
- Page 331 and 332: Part VIApplication330
- Page 333 and 334: Traffic generatorsApplication/Traff
- Page 335 and 336: • recv(int nbytes)—Announces th
- Page 337 and 338: 1. EXPOO_Traffic—generates traffi
- Page 339 and 340: set src [new Agent/UDP]set sink [ne
- Page 341 and 342: Application FTP FTP objects produce
- Page 343 and 344: send_data(ADU)Application(HttpApp,
- Page 345 and 346: 39.1.4 Transmitting user data over
- Page 347 and 348: and teardown of connections. Only O
- Page 349 and 350: TclObjectPagePoolPagePool/CompMathP
- Page 351 and 352: PagePool/ProxyTrace takes these two
- Page 353 and 354: }int id_; // object IDWebTrafSessio
- Page 355 and 356: An Http/Server object waits for inc
- Page 357 and 358: set tmp [new RandomVariable/Exponen
- Page 359 and 360: Object Type Event Type Explaination
- Page 361 and 362: Chapter 40Worm ModelIn this chapter
- Page 363 and 364: $w local-p 0.5Following are some co
- Page 365 and 366: (nsnode) clientcloudPackM ime(nsnod
- Page 367 and 368: HTTP responsesclients servers Delay
- Page 369 and 370: 41.5 Commands at a GlanceThe follow
- Page 371 and 372: • HTTP response size (bytes)• s
- Page 373 and 374: Chapter 42Session-level Packet Dist
#set up the multicast routingDM set PruneTimeout 1000set mproto DMset mrth<strong>and</strong>le [$<strong>ns</strong> mrtproto $mproto {} ]};#A large PruneTimeout value is requiredset <strong>ns</strong> [new Simul<strong>at</strong>or -multicast on]$<strong>ns</strong> multicast$<strong>ns</strong> namtrace-all [open out.nam w]set scn [new Scenario0 $<strong>ns</strong>]$<strong>ns</strong> <strong>at</strong> 20 "exit 0"$<strong>ns</strong> run;#PLM needs multicast routing;#Nam output;#Call of the scenarioSeveral variables are introduced in this example. <strong>The</strong>y all need to be set in the simul<strong>at</strong>ion script (there is no default value forthese variables). In particular the two following lines are m<strong>and</strong><strong>at</strong>ory <strong>and</strong> must not be omitted:set r<strong>at</strong>es_cum [calc_cum $r<strong>at</strong>es]set level [llength $r<strong>at</strong>es]We describe now in detail each variable:packetSize represents the size of the packets in bytes sent by the PLM source.plm_debug_flag represents the verbose level of debugging output: from 0 no output to 3 full output. Forplm_debug_flag set to 3 (full output), long lines output are gener<strong>at</strong>ed which is not comp<strong>at</strong>ible with nam visualiz<strong>at</strong>ion.r<strong>at</strong>es is a list specifying the b<strong>and</strong>width of each layer (this is not the cumul<strong>at</strong>ed b<strong>and</strong>width!).r<strong>at</strong>es_cum is a list specifying the cumul<strong>at</strong>ed b<strong>and</strong>width of the layers: the first element of r<strong>at</strong>es_cum is the b<strong>and</strong>widtha layer 1, the second element of r<strong>at</strong>es_cum is the sum of the b<strong>and</strong>width of layer 1 <strong>and</strong> layer 2, etc. <strong>The</strong> proccalc_cum{} computes the cumul<strong>at</strong>ed r<strong>at</strong>es.level is the number of layers.Queue_sched_ represents the scheduling of the queues. This is used by the PLMTopology i<strong>ns</strong>tproc build_link. PLMrequires FQ scheduling or a vari<strong>at</strong>ion.PP_burst_length represents the size of the Packet Pair bursts in packets.PP_estim<strong>at</strong>ion_length represents the minimum number of Packet Pair required to compute an estim<strong>at</strong>e (see section37.3.3).All the simul<strong>at</strong>io<strong>ns</strong> for PLM should be setup using the PLMTopology environment (as in the example script where we definea PLMTopology superclass called Scenario0). <strong>The</strong> user interface is (all the i<strong>ns</strong>tproc can be found in ~<strong>ns</strong>/tcl/plm/plm-topo.tcl):build_link a b d bw cre<strong>at</strong>es a duplex link between node a <strong>and</strong> b with a delay d <strong>and</strong> a b<strong>and</strong>width bw. If either nodedoes not exist, build_link cre<strong>at</strong>es it.place_source n t cre<strong>at</strong>es <strong>and</strong> places a PLM source <strong>at</strong> node n <strong>and</strong> starts it <strong>at</strong> time t. place_source retur<strong>ns</strong> addrwhich allows to <strong>at</strong>tach receivers to this source.324