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...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

gives the page ID of the next request. PagePool/ProxyTrace loads the request stream during initializ<strong>at</strong>ion phase, so it does notneed a r<strong>and</strong>om variable for request interval; see its description below.An example of using PagePool/M<strong>at</strong>h is <strong>at</strong> Section 39.8. Th<strong>at</strong> script is also available <strong>at</strong> <strong>ns</strong>/tcl/ex/simple-webcache.tcl.39.4.2 PagePool/CompM<strong>at</strong>hIt improves over PagePool/M<strong>at</strong>h by introducing a compound page model. By a compound page we mean a page whichco<strong>ns</strong>ists of a main text page <strong>and</strong> a number of embedded objects, e.g., GIFs. We model a compound page as a main page<strong>and</strong> several component objects. <strong>The</strong> main page is always assigned with ID 0. All component pages have the same size;both the main page size <strong>and</strong> component object size is fixed, but adjustable through OTcl-bound variables main_size_ <strong>and</strong>comp_size_, respectively. <strong>The</strong> number of component objects can be set using the OTcl-bound variable num_pages_.PagePool/CompM<strong>at</strong>h has the following major OTcl methods:gen-size 〈pageID〉ranvar-main-age 〈rv〉gen-pageidgen-modtime 〈pageID〉 〈mt〉If 〈pageID〉 is 0, return main_size_, otherwise return comp_size_.Set r<strong>and</strong>om variable for main page lifetime. Another one, ranvar-obj-age, set th<strong>at</strong> forcomponent objects.Always retur<strong>ns</strong> 0, which is the main page ID.Retur<strong>ns</strong> the next modific<strong>at</strong>ion time of the given page 〈pageID〉. If the given ID is 0, it usesthe main page lifetime r<strong>and</strong>om variable; otherwise it uses the component object lifetimer<strong>and</strong>om variable.An example of using PagePool/CompM<strong>at</strong>h is available <strong>at</strong> <strong>ns</strong>/tcl/ex/simple-webcache-comp.tcl.39.4.3 PagePool/ProxyTrace<strong>The</strong> above two page pool synthesize request stream to a single web page by two r<strong>and</strong>om variables: one for request interval,another for requested page ID. Sometimes users may want more complic<strong>at</strong>ed request stream, which co<strong>ns</strong>ists of multiplepages <strong>and</strong> exhibits sp<strong>at</strong>ial locality <strong>and</strong> temporal locality. <strong>The</strong>re exists one proposal (SURGE [3]) which gener<strong>at</strong>es suchrequest streams, we choose to provide an altern<strong>at</strong>ive solution: use real web proxy cache trace (or server trace).<strong>The</strong> class PagePool/ProxyTrace uses real traces to drive simul<strong>at</strong>ion. Because there exist many web traces with differentform<strong>at</strong>s, they should be converted into a intermedi<strong>at</strong>e form<strong>at</strong> before fed into this page pool. <strong>The</strong> converter is available<strong>at</strong> http://mash.cs.berkeley.edu/dist/vint/webcache-trace-conv.tar.gz. It accepts four trace form<strong>at</strong>s: DEC proxy trace (1996),UCB Home-IP trace, NLANR proxy trace, <strong>and</strong> EPA web server trace. It converts a given trace into two files: pglog <strong>and</strong>reqlog. Each line in pglog has the following form<strong>at</strong>:[ ]Each line, except the last line, in reqlog has the following form<strong>at</strong>:[ ]<strong>The</strong> last line in reqlog records the dur<strong>at</strong>ion of the entire trace <strong>and</strong> the total number of unique URLs:i 349

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

Saved successfully!

Ooh no, something went wrong!