📄 node461.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by: Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by: Nikos Drakos, CBLU, University of Leeds* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>34.1.0.0.1 Creating a simple scenario with one PLM flow (only one receiver)</TITLE><META NAME="description" CONTENT="34.1.0.0.1 Creating a simple scenario with one PLM flow (only one receiver)"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="previous" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html"><LINK REL="up" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html"><LINK REL="next" HREF="node462.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node462.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html8464" HREF="node462.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node462.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8458" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8454" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8460" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html8462" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html8465" HREF="node462.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node462.html">34.2 The Packet Pair</A><B> Up:</B> <A NAME="tex2html8459" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html">34.1 Configuration</A><B> Previous:</B> <A NAME="tex2html8455" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html">34.1 Configuration</A>   <B> <A NAME="tex2html8461" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8463" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H4><A NAME="SECTION06510010000000000000">34.1.0.0.1 Creating a simple scenario with one PLM flow (only one receiver)<BR></A></H4>This simple example can be run as is (several complex scenarios can be found inthe file tcl/ex/simple-plm.tcl).<P><PRE> 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</PRE><P>Several variables are introduced in this example. They all need to be set in thesimulation script (there is no default value for these variables). In particularthe two following lines are mandatory and must not be omitted:<PRE> set rates_cum [calc_cum $rates] set level [llength $rates]</PRE><P>We describe now in detail each variable:<DL><DT><STRONG><TT>packetSize</TT></STRONG></DT><DD>represents the size of the packets in bytes sent by the PLM source. </DD><DT><STRONG><TT>plm_debug_flag</STRONG></DT><DD>represents the verbose level of debugging output: from 0 no output to 3 full output. For <TT>plm_debug_flag</TT> set to 3 (full output), long lines output are generated which is not compatible with nam visualization. </DD><DT><STRONG><TT>rates</STRONG></DT><DD>is a list specifying the bandwidth of each layer (this is not the cumulated bandwidth!). </DD><DT><STRONG><TT>rates_cum</STRONG></DT><DD>is a list specifying the cumulated bandwidth of the layers: the first element of <TT>rates_cum</TT> is the bandwidth a layer 1, the second element of <TT>rates_cum</TT> is the sum of the bandwidth of layer 1 and layer 2, etc. The proc calc_cum computes the cumulated rates. </DD><DT><STRONG><TT>level</STRONG></DT><DD>is the number of layers. </DD><DT><STRONG><TT>Queue_sched_</STRONG></DT><DD>represents the scheduling of the queues. This is used by the PLMTopology instproc <TT>build_link</TT>. PLM requires FQ scheduling or a variation. </DD><DT><STRONG><TT>PP_burst_length</STRONG></DT><DD>represents the size of the Packet Pair bursts in packets. </DD><DT><STRONG><TT>PP_estimation_length</STRONG></DT><DD>represents the minimum number of Packet Pair required to compute an estimate (see section <A HREF="node466.html#sec:PLMReception-Packet" tppabs="http://www.isi.edu/nsnam/ns/doc/node466.html#sec:PLMReception-Packet">34.3.3</A>). </DD></DL></TT></TT></TT></TT></TT></TT></TT><P>All the simulations for PLM should be setup using the PLMTopology environment (asin the example script where we define a PLMTopology superclass called Scenario0). Theuser interface is (all the instproc can be found in tcl/plm/plm-topo.tcl):<DL><DT><STRONG><TT>build_link a b d bw</TT></STRONG></DT><DD>creates a duplex link between node <TT>a</TT> and <TT>b</TT> with a delay <TT>d</TT> and a bandwidth <TT>bw</TT>. If either node does not exist, <TT>build_link</TT> creates it.</DD><DT><STRONG><TT>place_source n t</TT></STRONG></DT><DD>creates and places a PLM source at node <TT>n</TT> and starts it at time <TT>t</TT>. <TT>place_source</TT> returns <TT>addr</TT> which allows to attach receivers to this source.</DD><DT><STRONG><TT>place_receiver n addr C nb</TT></STRONG></DT><DD>creates and places a PLM receiver at node <TT>n</TT> and attached it to the source which return the address <TT>addr</TT>. The check value for this PLM receiver is <TT>C</TT>. An optional parameter <TT>nb</TT> allows to get an instance of the PLM receiver called <TT>PLMrcvr($nb)</TT>. This instance is only useful to get some specific statistics about this receiver (mainly the number of packets received or lost). </DD></DL><P><HR><!--Navigation Panel--><A NAME="tex2html8464" HREF="node462.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node462.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8458" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8454" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8460" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html8462" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html8465" HREF="node462.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node462.html">34.2 The Packet Pair</A><B> Up:</B> <A NAME="tex2html8459" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html">34.1 Configuration</A><B> Previous:</B> <A NAME="tex2html8455" HREF="node460.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node460.html">34.1 Configuration</A>   <B> <A NAME="tex2html8461" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8463" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <!--End of Navigation Panel--><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -