📄 node466.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.3.3 Reception of a Packet</TITLE><META NAME="description" CONTENT="34.3.3 Reception of a Packet"><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="node467.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node467.html"><LINK REL="previous" HREF="node465.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node465.html"><LINK REL="up" HREF="node463.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node463.html"><LINK REL="next" HREF="node467.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node467.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html8539" HREF="node467.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node467.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8533" HREF="node463.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node463.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8527" HREF="node465.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node465.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8535" 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="tex2html8537" 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="tex2html8540" HREF="node467.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node467.html">34.3.4 Detection of a</A><B> Up:</B> <A NAME="tex2html8534" HREF="node463.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node463.html">34.3 Architecture of the</A><B> Previous:</B> <A NAME="tex2html8528" HREF="node465.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node465.html">34.3.2 Instantiation of a</A>   <B> <A NAME="tex2html8536" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8538" HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION06533000000000000000"></A><A NAME="sec:PLMReception-Packet"></A><BR>34.3.3 Reception of a Packet</H2>We create a new c++ class PLMLossMonitor (plm/loss-monitor-plm.cc) thatinherits from LossMonitor. The OTcl class name of the c++ PLMLossMonitor class isAgent/LossMonitor/PLM.<PRE>class PLMLossMonitor : public LossMonitor {public: PLMLossMonitor(); virtual void recv(Packet* pkt, Handler*);protected: // PLM only int flag_PP_; double packet_time_PP_; int fid_PP_;};static class PLMLossMonitorClass : public TclClass {public: PLMLossMonitorClass() : TclClass("Agent/LossMonitor/PLM") {} TclObject* create(int, const char*const*) { return (new PLMLossMonitor()); }} class_loss_mon_plm;</PRE><P>We add in <TT>void PLMLossMonitor::recv(Packet* pkt, Handler*)</TT> a Tcl call to the Agent/LossMonitor/PLM instproc <TT>log-PP</TT> each time a packet is received :<PRE> void LossMonitor::recv(Packet* pkt, Handler*) { ... if (expected_ \>= 0) { ... } Tcl::instance().evalf("%s log-PP", name()); }</PRE><P>The Agent/LossMonitor/PLM instproc <TT>log-PP</TT> is empty. In fact, we define the <TT> log-PP</TT> instproc for the class PLMLossTrace. <TT>log-PP</TT>computes an estimate of the available bandwidth based on a single PP burst (oflength <TT>PP_burst_length</TT> in packets). Once <TT>log-PP</TT> has received the <TT>PP_burst_length</TT> packets of the burst, it computes the estimate and calls the PLM instproc <TT>make_estimate</TT> with the computed estimate as argument. <P><TT>make_estimate</TT> puts the estimate based on a single PP(<TT>PP_value</TT>) in an array of estimate samples (<TT>PP_estimate</TT>). If <TT> PP_value</TT> is lower than the current subscription level (i.e. lower than thethroughput achieved according to the current number of layers subscribed), <TT> make_estimate</TT> calls the PLM instproc <TT>stability-drop</TT> which simply dropslayers until the current subscription level becomes lower than <TT>PP_value</TT>.<TT>make_estimate</TT> makes an estimate <TT>PP_estimate_value</TT> by taking theminimum <TT>PP_value</TT> received during the last <TT>check_estimate</TT> period(if there are atleast <TT>PP_estimation_length</TT> single PP estimate received). Once <TT> make_estimate</TT> has a <TT>PP_estimate_value</TT> it calls the PLM instproc <TT> choose_layer</TT> which joins or drops layer(s) according to the current subscriptionlevel and to the <TT>PP_estimate_value</TT>. For details about the PLM instproc<TT>make_estimate</TT>, refer to its code in tcl/plm/plm.tcl.<P><HR><!--Navigation Panel--><A NAME="tex2html8539" HREF="node467.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node467.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html8533" HREF="node463.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node463.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html8527" HREF="node465.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node465.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html8535" 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="tex2html8537" 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="tex2html8540" HREF="node467.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node467.html">34.3.4 Detection of a</A><B> Up:</B> <A NAME="tex2html8534" HREF="node463.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node463.html">34.3 Architecture of the</A><B> Previous:</B> <A NAME="tex2html8528" HREF="node465.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node465.html">34.3.2 Instantiation of a</A>   <B> <A NAME="tex2html8536" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html8538" 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 + -