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 ...
place_receiver n addr C nb creates and places a PLM receiver at node n and attached it to the source which returnthe address addr. The check value for this PLM receiver is C. An optional parameter nb allows to get an instanceof the PLM receiver called PLMrcvr($nb). This instance is only useful to get some specific statistics about thisreceiver (mainly the number of packets received or lost).37.2 The Packet Pair Source GeneratorThis section describes the Packet Pair source generator; the relevant files are: ~ns/plm/cbr-traffic-PP.cc, ~ns/tcl/lib/nsdefault.tcl.The OTcl class name of the PP source is: Application/Traffic/CBR_PP. The Packet Pair (PP) source generatoris in the file ~ns/plm/cbr-traffic-PP.cc. This source generator is a variation of the CBR source generator in ~ns/cbr_traffic.cc.We just describe the salient differences between the code of the CBR source and the code of the PP source. The default valuesin ~ns/tcl/lib/ns-default.tcl for the PP source generator are the same than for the CBR source. We need for the PP sourcegenerator a new parameter PBM_:Application/Traffic/CBR_PP set PBM_ 2;#Default valueThe OTcl instvar bounded variable PBM_ (same name in C++ and in OTcl) specifies the number of back-to-back packets tobe sent. For PBM_=1 we have a CBR source, for PBM_=2 we have a Packet Pair source (a source which sends two packetsback-to-back), etc. The mean rate of the PP source is rate_, but the packets are sent in burst of PBM_ packets. Note that wealso use the terminology Packet Pair source and Packet Pair burst for PBM_>2. We compute the next_interval as:double CBR_PP_Traffic::next_interval(int& size)/*(PP_ - 1) is the number of packets in the current burst.*/if (PP_ >= (PBM_ - 1))interval_ = PBM_*(double)(size_ sendmsg(size_, "NEW_BURST");elseagent_->sendmsg(size_);...325
37.3 Architecture of the PLM ProtocolThe code of the PLM protocol is divided in three files: ~ns/tcl/plm/plm.tcl, which contains the PLM protocol machinerywithout any specific interface with ns; ~ns/tcl/plm/plm-ns.tcl, which contains the specific ns interface. However, we do notguarantee the strict validity of this ns interfacing; ~ns/tcl/plm/plm-topo.tcl, which contains a user interface to build simulationscenarios with PLM flows.In the following we do not discuss the various procedures per object (for instance all the instproc of the PLM class) but ratherper functionality (for instance which instproc among the various classes are involved in the instantiation of a PLM receiver).For a given functionality, we do not describe in details all the code involved, but we give the principal steps.37.3.1 Instantiation of a PLM SourceTo create a PLM source, place it at node n, and start it at t 0 , we call the PLMTopology instproc place_source n t 0 .This instproc return addr, the address required to attach a receiver to this source. place_source calls the Simulatorinstproc PLMbuild_source_set that creates as many Application/Traffic/CBR_PP instances as there are layers (in thefollowing we call an instance of the class Application/Traffic/CBR_PP a layer). Each layer corresponds to a different multicastgroup.To speed up the simulations when the PLM sources start we use the following trick: At t = 0, PLMbuild_source_setrestricts each layer to send only one packet (maxpkts_ set to 1). That allows to build the multicast trees – one multicast treeper layer – without flooding the whole network. Indeed, each layer only sends one packet to build the corresponding multicasttree.The multicast trees take at most the maximum RTT of the network to be established and must be established before t 0 ,the PLM source starting time. Therefore, t 0 must be carrefully chosen, otherwise the source sends a large number of uselesspackets. However, as we just need to start the PLM source after the multicast trees are estabished, t 0 can be largelyoverestimated. At time t 0 , we set maxpkts_ to 268435456 for all the layers.It is fundamental, in order to have persistent multicast trees, that the prune timeout is set to a large value. For instance, withDM routing:DM set PruneTimeout 1000Each layer of a same PLM source has the same flow id fid_. Consequently, each PLM source is considered as a single flowfor a Fair Queueing scheduler. The PLM code manages automatically the fid_ to prevent different sources to have the samefid_. The fid_ starts at 1 for the first source and is increased by one for each new source. Be careful to avoid other flows(for instance concurrent TCP flows) to have the same fid_ than the PLM sources. Additionally, If you consider fid_ largerthan 32, do not forget to increase the MAXFLOW in ~ns/fq.cc (MAXFLOW must be set to the highest fid_ considered in thesimulation).37.3.2 Instantiation of a PLM ReceiverAll the PLM machinery is implemented at the receiver. In this section we decribe the instantiation process of a receiver. To create,place at node n, attach to source S, and start at t 1 a PLM receiver we call the PLMTopology instproc build_receivern addr t 1 C where addr is the address returned by place_source when S was created, and C is the check value. Thereceiver created by build_receiver is an instance of the class PLM/ns, the ns interface to the PLM machinery. Atthe initialisation of the receiver, the PLM instproc init is called due to inheritance. init calls the PLM/ns instproc326
- 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 and 324: set grp [Node allocaddr]$srm set ds
- Page 325: #set up the multicast routingDM set
- 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
- Page 375 and 376: 42.1.2 Inserting a Loss ModuleWhen
place_receiver n addr C nb cre<strong>at</strong>es <strong>and</strong> places a PLM receiver <strong>at</strong> node n <strong>and</strong> <strong>at</strong>tached it to the source which returnthe address addr. <strong>The</strong> check value for this PLM receiver is C. An optional parameter nb allows to get an i<strong>ns</strong>tanceof the PLM receiver called PLMrcvr($nb). This i<strong>ns</strong>tance is only useful to get some specific st<strong>at</strong>istics about thisreceiver (mainly the number of packets received or lost).37.2 <strong>The</strong> Packet Pair Source Gener<strong>at</strong>orThis section describes the Packet Pair source gener<strong>at</strong>or; the relevant files are: ~<strong>ns</strong>/plm/cbr-traffic-PP.cc, ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>default.tcl.<strong>The</strong> OTcl class name of the PP source is: Applic<strong>at</strong>ion/Traffic/CBR_PP. <strong>The</strong> Packet Pair (PP) source gener<strong>at</strong>oris in the file ~<strong>ns</strong>/plm/cbr-traffic-PP.cc. This source gener<strong>at</strong>or is a vari<strong>at</strong>ion of the CBR source gener<strong>at</strong>or in ~<strong>ns</strong>/cbr_traffic.cc.We just describe the salient differences between the code of the CBR source <strong>and</strong> the code of the PP source. <strong>The</strong> default valuesin ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>-default.tcl for the PP source gener<strong>at</strong>or are the same than for the CBR source. We need for the PP sourcegener<strong>at</strong>or a new parameter PBM_:Applic<strong>at</strong>ion/Traffic/CBR_PP set PBM_ 2;#Default value<strong>The</strong> OTcl i<strong>ns</strong>tvar bounded variable PBM_ (same name in C++ <strong>and</strong> in OTcl) specifies the number of back-to-back packets tobe sent. For PBM_=1 we have a CBR source, for PBM_=2 we have a Packet Pair source (a source which sends two packetsback-to-back), etc. <strong>The</strong> mean r<strong>at</strong>e of the PP source is r<strong>at</strong>e_, but the packets are sent in burst of PBM_ packets. Note th<strong>at</strong> wealso use the terminology Packet Pair source <strong>and</strong> Packet Pair burst for PBM_>2. We compute the next_interval as:double CBR_PP_Traffic::next_interval(int& size)/*(PP_ - 1) is the number of packets in the current burst.*/if (PP_ >= (PBM_ - 1))interval_ = PBM_*(double)(size_ sendmsg(size_, "NEW_BURST");elseagent_->sendmsg(size_);...325