📄 node97.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>9.3 Configuration</TITLE><META NAME="description" CONTENT="9.3 Configuration"><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="next" HREF="node98.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node98.html"><LINK REL="previous" HREF="node93.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node93.html"><LINK REL="up" HREF="node91.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node91.html"><LINK REL="next" HREF="node98.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node98.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html2791" HREF="node98.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node98.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2785" HREF="node91.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node91.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2779" HREF="node96.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node96.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2787" 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="tex2html2789" 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="tex2html2792" HREF="node98.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node98.html">9.4 Commands at a</A><B> Up:</B> <A NAME="tex2html2786" HREF="node91.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node91.html">9. Differentiated Services Module</A><B> Previous:</B> <A NAME="tex2html2780" HREF="node96.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node96.html">9.2.3 Policy</A>   <B> <A NAME="tex2html2788" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html2790" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H1><A NAME="SECTION03630000000000000000"></A>
<A NAME="sec:diffservconfig"></A><BR>9.3 Configuration</H1>
The number of physical and virtual queues can be configured as:
<TT>$dsredq set numQueues_ 1</TT>
<TT>$dsredq setNumPrec 2</TT>
Variable <TT>numQueues_</TT> in class <TT>dsREDQueue</TT>
specifies the number of physical queues.
It has a default value as 4 defined in tcl/lib/ns-default.tcl
and can be changed as shown in the example above.
Variable <TT>setNumPrec</TT> sets the number of virtual queues
within one physical queue.
RED parameters can be configured for each virtual queue as follows:
<TT>$dsredq configQ 0 1 10 20 0.10</TT>
The mean packet size (in bytes) is also needed for
the average RED queue length calculation.
<TT>$dsredq meanPktSize 1500</TT>
The variant of MRED used to calculate queue sizes can be configured.
<TT>$dsredq setMREDMode RIO-C 0</TT>
The above command sets the MRED mode of physical queue 0 to RIO-C.
If the second argument was not included,
all queues would be set to RIO-C
which is the default.
The various MRED modes supported in DiffServ module are:
<DL><DT><STRONG>RIO-C (RIO Coupled):</STRONG></DT><DD>The probability of dropping an out-of-profile packet is based on
the weighted average lengths of all virtual queues;
while the probability of dropping an in-profile packet is based solely on
the weighted average length of its virtual queue.
</DD><DT><STRONG>RIO-D (RIO De-coupled):</STRONG></DT><DD>Similar to RIO-C;
except the probability of dropping an out-of-profile packet is based on
the size of its virtual queue.
</DD><DT><STRONG>WRED (Weighted RED):</STRONG></DT><DD>All probabilities are based on a single queue length.
</DD><DT><STRONG>DROP:</STRONG></DT><DD>Same as a drop tail queue with queue limit set by RED minimum threshold:
when the queue size reaches the minimum threshold,
all packets are dropped regardless of marking.
</DD></DL>
The following command adds an entry to the PHB Table and
maps code point 11 to physical queue 0 and virtual queue 1.
<TT>$dsredq addPHBEntry 11 0 1</TT>
In , packets are defaulted to a code point of zero.
Therefore, user must add a PHB entry for the zero code point in order to
handle best effort traffic.
In addition, commands are available to allow the user to choose the
scheduling mode between physical queues.
For example:
<TT>$dsredq setSchedularMode WRR</TT>
<TT>$dsredq addQueueWeights 1 5</TT>
The above pair of commands sets the scheduling mode to Weighted Round Robin
and the weight for queue 1 to 5.
Other scheduling modes supported are
Weighted Interleaved Round Robin (WIRR), Round Robin (RR),
and Priority (PRI).
The default scheduling mode is Round Robin.
For Priority scheduling,
priority is arranged in sequential order with
queue 0 having the highest priority.
Also, one can set the a limit on the maximum bandwidth
a particular queue can get using as follows:
<TT>$dsredq setSchedularMode PRI</TT>
<TT>$dsredq addQueueRate 0 5000000</TT>
These commands specify the maximum bandwidth that
queue 0 can consume is 5Mb.
The <TT>addPolicyEntry</TT> command is used to
add an entry to the Policy Table.
It takes different parameters depending on what policer type is used.
The first two parameters after the command name are always
the source and destination node IDs,
and the next parameter is the policer type.
Following the policer type are the parameters needed by that policer as
summarized below:
<BLOCKQUOTE><TABLE CELLPADDING=3><TR><TD ALIGN="LEFT">TSW2CM</TD><TD ALIGN="LEFT">Initial code point</TD><TD ALIGN="LEFT">CIR</TD><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">TSW3CM</TD><TD ALIGN="LEFT">Initial code point</TD><TD ALIGN="LEFT">CIR</TD><TD ALIGN="LEFT">PIR</TD><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">TokenBucket</TD><TD ALIGN="LEFT">Initial code point</TD><TD ALIGN="LEFT">CIR</TD><TD ALIGN="LEFT">CBS</TD><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">srTCM</TD><TD ALIGN="LEFT">Initial code point</TD><TD ALIGN="LEFT">CIR</TD><TD ALIGN="LEFT">CBS</TD><TD ALIGN="LEFT">EBS</TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">trTCM</TD><TD ALIGN="LEFT">Initial code point</TD><TD ALIGN="LEFT">CIR</TD><TD ALIGN="LEFT">CBS</TD><TD ALIGN="LEFT">PIR</TD><TD ALIGN="LEFT">PBS</TD></TR></TABLE></BLOCKQUOTE>
Consider a Tcl script for which
<TT>$q</TT> is a variable for an edge queue,
and <TT>$s</TT> and <TT>$d</TT> are source and destination nodes.
The following command adds a TSW2CM policer for traffic going from
the source to the destination:
<TT>$q addPolicyEntry [$s id] [$d id] TSW2CM 10 2000000</TT>
Other parameters could be used for different policers
in place of "TSW2CM":
<BLOCKQUOTE><TABLE CELLPADDING=3><TR><TD ALIGN="LEFT">TSW3CM</TD><TD ALIGN="LEFT">10</TD><TD ALIGN="LEFT">2000000</TD><TD ALIGN="LEFT">3000000</TD><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">TokenBucket</TD><TD ALIGN="LEFT">10</TD><TD ALIGN="LEFT">2000000</TD><TD ALIGN="LEFT">10000</TD><TD ALIGN="LEFT"> </TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">srTCM</TD><TD ALIGN="LEFT">10</TD><TD ALIGN="LEFT">2000000</TD><TD ALIGN="LEFT">10000</TD><TD ALIGN="LEFT">20000</TD><TD ALIGN="LEFT"> </TD></TR><TR><TD ALIGN="LEFT">trTCM</TD><TD ALIGN="LEFT">10</TD><TD ALIGN="LEFT">2000000</TD><TD ALIGN="LEFT">10000</TD><TD ALIGN="LEFT">3000000</TD><TD ALIGN="LEFT">10000</TD></TR></TABLE></BLOCKQUOTE>
Note, however,
that only one policy can be applied to any source destination pair.
The following command adds an entry to the Policer Table,
specifying that the trTCM has
initial (green) code point 10, downgraded (yellow) code point 11
and further downgraded (red) code point 12:
<TT>$dsredq addPolicerEntry trTCM 10 11 12</TT>
There must be a Policer Table entry in place for every
policer type and initial code point pair.Queries supported:
<DL><DT></DT><DD>Output entires in Policy Table, one line at a time:
<TT>$dsredq printPolicyTable</TT>
</DD><DT></DT><DD>Output entires in Policer Table, one line at a time:
<TT>$dsredq printPolicerTable</TT>
</DD><DT></DT><DD>Output entries in PHB table, one line at a time:
<TT>$dsredq printPHBTable</TT>
</DD><DT></DT><DD>Packets statistic results:
<TT>$dsredq printStats</TT>
Sample output:
<BLOCKQUOTE><TABLE CELLPADDING=3 BORDER="1"><TR><TD ALIGN="LEFT" COLSPAN=5>Packets Statistics</TD></TR><TR><TD ALIGN="LEFT">CP</TD><TD ALIGN="LEFT">TotPkts</TD><TD ALIGN="LEFT">TxPkts</TD><TD ALIGN="LEFT">ldrops</TD><TD ALIGN="LEFT">edrops</TD></TR><TR><TD ALIGN="LEFT">All</TD><TD ALIGN="LEFT">249126</TD><TD ALIGN="LEFT">249090</TD><TD ALIGN="LEFT">21</TD><TD ALIGN="LEFT">15</TD></TR><TR><TD ALIGN="LEFT">10</TD><TD ALIGN="LEFT">150305</TD><TD ALIGN="LEFT">150300</TD><TD ALIGN="LEFT">0</TD><TD ALIGN="LEFT">5</TD></TR><TR><TD ALIGN="LEFT">20</TD><TD ALIGN="LEFT">98821</TD><TD ALIGN="LEFT">98790</TD><TD ALIGN="LEFT">21</TD><TD ALIGN="LEFT">10</TD></TR></TABLE></BLOCKQUOTE>
<BLOCKQUOTE>CP: code point
TotPkts: packets received
TxPkts: packets sent
ldrops: packets are dropped due to link overflow
edrops: RED early dropping).
</BLOCKQUOTE>
</DD><DT></DT><DD>Returns the RED weighted average size of the specified physical queue:
<TT>$dsredq getAverage 0</TT>
</DD><DT></DT><DD>Returns the current size of the C Bucket (in bytes):
<TT>$dsredq getCBucket</TT>
</DD></DL><HR><!--Navigation Panel--><A NAME="tex2html2791" HREF="node98.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node98.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html2785" HREF="node91.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node91.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html2779" HREF="node96.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node96.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html2787" 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="tex2html2789" 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="tex2html2792" HREF="node98.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node98.html">9.4 Commands at a</A><B> Up:</B> <A NAME="tex2html2786" HREF="node91.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node91.html">9. Differentiated Services Module</A><B> Previous:</B> <A NAME="tex2html2780" HREF="node96.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node96.html">9.2.3 Policy</A>   <B> <A NAME="tex2html2788" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html2790" 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 + -