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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 37PLMThis chapter describes the <strong>ns</strong> implement<strong>at</strong>ion of the PLM protocol [19]. <strong>The</strong> code of the PLM protocol is written in both C++<strong>and</strong> OTcl. <strong>The</strong> PLM Packet Pair gener<strong>at</strong>or is written in C++ <strong>and</strong> the PLM core machinery is written in OTcl. <strong>The</strong> chapterhas simply three parts: the first part shows how to cre<strong>at</strong>e <strong>and</strong> configure a PLM session; the second part describes the PacketPair source gener<strong>at</strong>or; the third part describes the architecture <strong>and</strong> internals of the PLM protocol. In this last part, r<strong>at</strong>her thangiving a list of procedures <strong>and</strong> functio<strong>ns</strong>, we introduce the main procedures per functionality (i<strong>ns</strong>tanti<strong>at</strong>ion of a PLM source,i<strong>ns</strong>tanti<strong>at</strong>ion of a PLM receiver, reception of a packet, detection of a loss, etc.).<strong>The</strong> procedures, functio<strong>ns</strong>, <strong>and</strong> variables described in this chapter can be found in: ~<strong>ns</strong>/plm/cbr-traffic-PP.cc, ~<strong>ns</strong>/plm/lossmonitor-plm.cc,~<strong>ns</strong>/tcl/plm/plm.tcl, ~<strong>ns</strong>/tcl/plm/plm-<strong>ns</strong>.tcl, ~<strong>ns</strong>/tcl/plm/plm-topo.tcl, ~<strong>ns</strong>/tcl/lib/<strong>ns</strong>-default.tcl.37.1 Configur<strong>at</strong>ionCre<strong>at</strong>ing 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 ~<strong>ns</strong>/tcl/ex/simple-plm.tcl).set packetSize 500set plm_debug_flag 2set r<strong>at</strong>es "50e3 50e3 50e3 50e3 50e3"set r<strong>at</strong>es_cum [calc_cum $r<strong>at</strong>es]set level [llength $r<strong>at</strong>es]set Queue_sched_ FQset PP_burst_length 2set PP_estim<strong>at</strong>ion_length 3;#Packet size (in bytes);#Debugging output;#R<strong>at</strong>e of each layer;#Cumul<strong>at</strong>ed r<strong>at</strong>e of the layers (m<strong>and</strong><strong>at</strong>ory);#Number of layers (m<strong>and</strong><strong>at</strong>ory);#Scheduling of the queues;#PP burst length (in packets);#Minimum number of PP required to make an estim<strong>at</strong>eClass Scenario0 -superclass PLMTopologyScenario0 i<strong>ns</strong>tproc init args {eval $self next $args$self i<strong>ns</strong>tvar <strong>ns</strong> 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

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

Saved successfully!

Ooh no, something went wrong!