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.

TclObjectPagePoolPagePool/CompM<strong>at</strong>hPagePool/M<strong>at</strong>hPagePool/ClientPagePool/ProxyTraceFigure 39.3: Class hierarchy of page pools• name(char *buf) - Print the page’s name into the given buffer. A page’s name is in the form<strong>at</strong> of: 〈ServerName〉:〈PageID〉.• split_name(co<strong>ns</strong>t char *name, PageID& id) - Split a given page name into its two components. This isa st<strong>at</strong>ic method.• mtime() - Retur<strong>ns</strong> the last modific<strong>at</strong>ion time of the page.• age() - Retur<strong>ns</strong> the lifetime of the page.39.4 Page poolsPagePool <strong>and</strong> its derived classes are used by servers to gener<strong>at</strong>e page inform<strong>at</strong>ion (name, size, modific<strong>at</strong>ion time, lifetime,etc.), by caches to describe which pages are in storage, <strong>and</strong> by clients to gener<strong>at</strong>e a request stream. Figure 39.3 provides anoverview of the class hierarchy here.Among these, class PagePool/Client is mostly used by caches to store pages <strong>and</strong> other cache-rel<strong>at</strong>ed inform<strong>at</strong>ion; other threeclasses are used by servers <strong>and</strong> clients. In the following we describe these classes one by one.39.4.1 PagePool/M<strong>at</strong>hThis is the simplest type of page pool. It has only one page, whose size can be gener<strong>at</strong>ed by a given r<strong>and</strong>om variable. Pagemodific<strong>at</strong>ion sequence <strong>and</strong> request sequence are gener<strong>at</strong>ed using two given r<strong>and</strong>om variables. It has the following OTclmethods:gen-pageidgen-sizegen-modtime 〈pageID〉 〈mt〉ranvar-age 〈rv〉ranvar-size 〈rv〉Retur<strong>ns</strong> the page ID which will be requested next. Because it has only one page, it alwaysretur<strong>ns</strong> 0.Retur<strong>ns</strong> the size of the page. It can be gener<strong>at</strong>ed by a given r<strong>and</strong>om variable.Retur<strong>ns</strong> the next modific<strong>at</strong>ion time of the page. 〈mt〉 gives the last modific<strong>at</strong>ion time. Ituses the lifetime r<strong>and</strong>om variable.Set the file lifetime r<strong>and</strong>om variable as 〈rv〉.Set the file size r<strong>and</strong>om variable to be 〈rv〉.NOTE: <strong>The</strong>re are two ways to gener<strong>at</strong>e a request sequence. With all page pools except PagePool/ProxyTrace, request sequenceis gener<strong>at</strong>ed with a r<strong>and</strong>om variable which describes the request interval, <strong>and</strong> the gen-pageid method of other page pools348

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

Saved successfully!

Ooh no, something went wrong!