12.07.2015 Views

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 ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

37.3 Architecture of the PLM Protocol<strong>The</strong> code of the PLM protocol is divided in three files: ~<strong>ns</strong>/tcl/plm/plm.tcl, which contai<strong>ns</strong> the PLM protocol machinerywithout any specific interface with <strong>ns</strong>; ~<strong>ns</strong>/tcl/plm/plm-<strong>ns</strong>.tcl, which contai<strong>ns</strong> the specific <strong>ns</strong> interface. However, we do notguarantee the strict validity of this <strong>ns</strong> interfacing; ~<strong>ns</strong>/tcl/plm/plm-topo.tcl, which contai<strong>ns</strong> a user interface to build simul<strong>at</strong>io<strong>ns</strong>cenarios with PLM flows.In the following we do not discuss the various procedures per object (for i<strong>ns</strong>tance all the i<strong>ns</strong>tproc of the PLM class) but r<strong>at</strong>herper functionality (for i<strong>ns</strong>tance which i<strong>ns</strong>tproc among the various classes are involved in the i<strong>ns</strong>tanti<strong>at</strong>ion 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 I<strong>ns</strong>tanti<strong>at</strong>ion of a PLM SourceTo cre<strong>at</strong>e a PLM source, place it <strong>at</strong> node n, <strong>and</strong> start it <strong>at</strong> t 0 , we call the PLMTopology i<strong>ns</strong>tproc place_source n t 0 .This i<strong>ns</strong>tproc return addr, the address required to <strong>at</strong>tach a receiver to this source. place_source calls the Simul<strong>at</strong>ori<strong>ns</strong>tproc PLMbuild_source_set th<strong>at</strong> cre<strong>at</strong>es as many Applic<strong>at</strong>ion/Traffic/CBR_PP i<strong>ns</strong>tances as there are layers (in thefollowing we call an i<strong>ns</strong>tance of the class Applic<strong>at</strong>ion/Traffic/CBR_PP a layer). Each layer corresponds to a different multicastgroup.To speed up the simul<strong>at</strong>io<strong>ns</strong> 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). Th<strong>at</strong> 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.<strong>The</strong> multicast trees take <strong>at</strong> most the maximum RTT of the network to be established <strong>and</strong> must be established before t 0 ,the PLM source starting time. <strong>The</strong>refore, 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 largelyoverestim<strong>at</strong>ed. At time t 0 , we set maxpkts_ to 268435456 for all the layers.It is fundamental, in order to have persistent multicast trees, th<strong>at</strong> the prune timeout is set to a large value. For i<strong>ns</strong>tance, withDM routing:DM set PruneTimeout 1000Each layer of a same PLM source has the same flow id fid_. Co<strong>ns</strong>equently, each PLM source is co<strong>ns</strong>idered as a single flowfor a Fair Queueing scheduler. <strong>The</strong> PLM code manages autom<strong>at</strong>ically the fid_ to prevent different sources to have the samefid_. <strong>The</strong> fid_ starts <strong>at</strong> 1 for the first source <strong>and</strong> is increased by one for each new source. Be careful to avoid other flows(for i<strong>ns</strong>tance concurrent TCP flows) to have the same fid_ than the PLM sources. Additionally, If you co<strong>ns</strong>ider fid_ largerthan 32, do not forget to increase the MAXFLOW in ~<strong>ns</strong>/fq.cc (MAXFLOW must be set to the highest fid_ co<strong>ns</strong>idered in thesimul<strong>at</strong>ion).37.3.2 I<strong>ns</strong>tanti<strong>at</strong>ion of a PLM ReceiverAll the PLM machinery is implemented <strong>at</strong> the receiver. In this section we decribe the i<strong>ns</strong>tanti<strong>at</strong>ion process of a receiver. To cre<strong>at</strong>e,place <strong>at</strong> node n, <strong>at</strong>tach to source S, <strong>and</strong> start <strong>at</strong> t 1 a PLM receiver we call the PLMTopology i<strong>ns</strong>tproc build_receivern addr t 1 C where addr is the address returned by place_source when S was cre<strong>at</strong>ed, <strong>and</strong> C is the check value. <strong>The</strong>receiver cre<strong>at</strong>ed by build_receiver is an i<strong>ns</strong>tance of the class PLM/<strong>ns</strong>, the <strong>ns</strong> interface to the PLM machinery. Atthe initialis<strong>at</strong>ion of the receiver, the PLM i<strong>ns</strong>tproc init is called due to inheritance. init calls the PLM/<strong>ns</strong> i<strong>ns</strong>tproc326

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!