📄 node509.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>36.4.5 PagePool/WebTraf</TITLE><META NAME="description" CONTENT="36.4.5 PagePool/WebTraf"><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="node508.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node508.html"><LINK REL="up" HREF="node504.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node504.html"><LINK REL="next" HREF="node510.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node510.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html9234" HREF="node510.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node510.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html9228" HREF="node504.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node504.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html9224" HREF="node508.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node508.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html9230" 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="tex2html9232" 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="tex2html9235" HREF="node510.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node510.html">36.5 Web client</A><B> Up:</B> <A NAME="tex2html9229" HREF="node504.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node504.html">36.4 Page pools</A><B> Previous:</B> <A NAME="tex2html9225" HREF="node508.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node508.html">36.4.4 PagePool/Client</A>   <B> <A NAME="tex2html9231" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html9233" 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="SECTION07245000000000000000">36.4.5 PagePool/WebTraf</A></H2><P>The class PagePool/WebTraf is a standalone Web traffic modle that utilizesPagePool framework. However, this class has nothing to do with the HttpApp classes. Because we are only interested in using it to study Web traffic pattern here, and do not want to be bothered with the burden of transmitting HTTP headers, etc. It has the following two major data structures.Details can be found in ns/webcache/webtraf.cc and ns/webcache/webtraf.h, thearchitecture WebTraf model is also loosely described in [<A HREF="node589.html#Feldmann99a" tppabs="http://www.isi.edu/nsnam/ns/doc/node589.html#Feldmann99a">12</A>], Section 2.4, paragraph 3-4 and the appendix A.1.<P><UL><LI><TT>WebTrafSession</TT> - a class that models Web user session. It is defined as follows:<PRE>class WebTrafSession : public TimerHandler { public: WebTrafSession(WebTrafPool *mgr, Node *src, int np, int id) : rvInterPage_(NULL), rvPageSize_(NULL), rvInterObj_(NULL), rvObjSize_(NULL), mgr_(mgr), src_(src), nPage_(np), curPage_(0), donePage_(0), id_(id), interPageOption_(1) {} virtual ~WebTrafSession(); // Queried by individual pages/objects inline RandomVariable*& interPage() { return rvInterPage_; } inline RandomVariable*& pageSize() { return rvPageSize_; } inline RandomVariable*& interObj() { return rvInterObj_; } inline RandomVariable*& objSize() { return rvObjSize_; } void donePage(void* ClntData); // all the pages within this // session have been sent void launchReq(void* ClntData, int obj, int size); inline int id() const { return id_; } inline WebTrafPool* mgr() { return mgr_; } private: virtual void expire(Event *e = 0); // Lanuch request for a page virtual void handle(Event *e); // schedule the timer for next page RandomVariable *rvInterPage_, *rvPageSize_, *rvInterObj_, *rvObjSize_; WebTrafPool* mgr_; Node* src_; // One Web client (source of request) per session nt nPage_; // number of pages per session int curPage_; // number of pages that have been sent int id_; // page ID int interPageOption_;}</PRE></LI><LI><TT>WebPage</TT> - a class that models Web Page. It is defined as follows:<PRE>class WebPage : public TimerHandler { public: WebPage(int id, WebTrafSession* sess, int nObj, Node* dst) : id_(id), sess_(sess), nObj_(nObj), curObj_(0), doneObj_(0), dst_(dst) {} virtual ~WebPage() {} inline void start() { // Call expire() and schedule the next one if needed void doneObject() { // All the objects within this page have been sent inline int id() const { return id_; } Node* dst() { return dst_; } inline int curObj() const { return curObj_; } inline int doneObj() const { return doneObj_; } private: virtual void expire(Event* = 0) { // Launch request for an object virtual void handle(Event *e) { // schedule the timer for the next object int id_; // object ID WebTrafSession* sess_; // the session that requested this page int nObj_; // number of object in this page int curObj_ ; // number of object that have been sent Node* dst_; // server that this page has been requested from}</PRE></LI></UL><P>Following is a list of related OTcl methods to the WebTraf class.<BR><BR><P>The example script is available at ns/tcl/ex/web-traffic.tcl (alsosee ns/tcl/ex/large-scale-web-traffic.tcl for use of a large-scale web traffic simulation)<P><HR><!--Navigation Panel--><A NAME="tex2html9234" HREF="node510.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node510.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html9228" HREF="node504.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node504.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html9224" HREF="node508.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node508.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html9230" 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="tex2html9232" 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="tex2html9235" HREF="node510.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node510.html">36.5 Web client</A><B> Up:</B> <A NAME="tex2html9229" HREF="node504.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node504.html">36.4 Page pools</A><B> Previous:</B> <A NAME="tex2html9225" HREF="node508.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node508.html">36.4.4 PagePool/Client</A>   <B> <A NAME="tex2html9231" HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>   <B> <A NAME="tex2html9233" 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 + -