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

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

gives the page ID of the next request. PagePool/ProxyTrace loads the request stream during initialization phase, so it does notneed a random variable for request interval; see its description below.An example of using PagePool/Math is at Section 39.8. That script is also available at ns/tcl/ex/simple-webcache.tcl.39.4.2 PagePool/CompMathIt improves over PagePool/Math by introducing a compound page model. By a compound page we mean a page whichconsists of a main text page and a number of embedded objects, e.g., GIFs. We model a compound page as a main pageand several component objects. The main page is always assigned with ID 0. All component pages have the same size;both the main page size and component object size is fixed, but adjustable through OTcl-bound variables main_size_ andcomp_size_, respectively. The number of component objects can be set using the OTcl-bound variable num_pages_.PagePool/CompMath 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 random variable for main page lifetime. Another one, ranvar-obj-age, set that forcomponent objects.Always returns 0, which is the main page ID.Returns the next modification time of the given page 〈pageID〉. If the given ID is 0, it usesthe main page lifetime random variable; otherwise it uses the component object lifetimerandom variable.An example of using PagePool/CompMath is available at ns/tcl/ex/simple-webcache-comp.tcl.39.4.3 PagePool/ProxyTraceThe above two page pool synthesize request stream to a single web page by two random variables: one for request interval,another for requested page ID. Sometimes users may want more complicated request stream, which consists of multiplepages and exhibits spatial locality and temporal locality. There exists one proposal (SURGE [3]) which generates suchrequest streams, we choose to provide an alternative solution: use real web proxy cache trace (or server trace).The class PagePool/ProxyTrace uses real traces to drive simulation. Because there exist many web traces with differentformats, they should be converted into a intermediate format before fed into this page pool. The converter is availableat http://mash.cs.berkeley.edu/dist/vint/webcache-trace-conv.tar.gz. It accepts four trace formats: DEC proxy trace (1996),UCB Home-IP trace, NLANR proxy trace, and EPA web server trace. It converts a given trace into two files: pglog andreqlog. Each line in pglog has the following format:[ ]Each line, except the last line, in reqlog has the following format:[ ]The last line in reqlog records the duration of the entire trace and the total number of unique URLs:i 349

PagePool/ProxyTrace takes these two file as input, and use them to drive simulation. Because most existing web proxy tracesdo not contain complete page modification information, we choose to use a bimodal page modification model [7]. We allowuser to select x% of the pages to have one random page modification interval generator, and the rest of the pages to haveanother generator. In this way, it’s possible to let x% pages to be dynamic, i.e., modified frequently, and the rest static. Hotpages are evenly distributed among all pages. For example, assume 10% pages are dynamic, then if we sort pages into a listaccording to their popularity, then pages 0, 10, 20, . . . are dynamic, rest are static. Because of this selection mechanism, weonly allow bimodal ratio to change in the unit of 10%.In order to distribute requests to different requestors in the simulator, PagePool/ProxyTrace maps the client ID in the traces torequestors in the simulator using a modulo operation.PagePool/ProxyTrace has the following major OTcl methods:get-poolsizeget-durationbimodal-ratioset-client-num 〈num〉gen-request 〈ClientID〉gen-size 〈PageID〉bimodal-ratio 〈ratio〉ranvar-dp 〈ranvar〉set-reqfile 〈file〉set-pgfile 〈file〉gen-modtime 〈PageID〉 〈LastModTime〉Returns the total number of pages.Returns the duration of the trace.Returns the bimodal ratio.Set the number of requestors in the simulation.Generate the next request for the given requestor.Returns the size of the given page.Set the dynamic pages to be 〈ratio〉*10 percent. Note that this ratio changes inunit of 10%.Set page modification interval generator for dynamic pages. Similarly, ranvarsp〈ranvar〉 sets the generator for static pages.Set request stream file, as discussed above.Set page information file, as discussed above.Generate next modification time for the given page.An example of using PagePool/ProxyTrace is available at ns/tcl/ex/simple-webcache-trace.tcl.39.4.4 PagePool/ClientThe class PagePool/Client helps caches to keep track of pages resident in cache, and to store various cache-related informationabout pages. It is mostly implemented in C++, because it is mainly used internally and little functionality is needed by users.It has the following major C++ methods:• get_page(const char* name) - Returns a pointer to the page with the given name.• add_page(const char *name, int size, double mt, double et, double age) - Add a pagewith given size, last modification time (mt), cache entry time (et), and page lifetime (age).• remove_page(const char* name) - Remove a page from cache.This page pool should support various cache replacement algorithms, however, it has not been implemented yet.39.4.5 PagePool/WebTrafThe class PagePool/WebTraf is a standalone Web traffic modle that utilizes PagePool framework. However, this class hasnothing to do with the HttpApp classes. Because we are only interested in using it to study Web traffic pattern here, and do350

PagePool/ProxyTrace takes these two file as input, <strong>and</strong> use them to drive simul<strong>at</strong>ion. Because most existing web proxy tracesdo not contain complete page modific<strong>at</strong>ion inform<strong>at</strong>ion, we choose to use a bimodal page modific<strong>at</strong>ion model [7]. We allowuser to select x% of the pages to have one r<strong>and</strong>om page modific<strong>at</strong>ion interval gener<strong>at</strong>or, <strong>and</strong> the rest of the pages to haveanother gener<strong>at</strong>or. In this way, it’s possible to let x% pages to be dynamic, i.e., modified frequently, <strong>and</strong> the rest st<strong>at</strong>ic. Hotpages are evenly distributed among all pages. For example, assume 10% pages are dynamic, then if we sort pages into a listaccording to their popularity, then pages 0, 10, 20, . . . are dynamic, rest are st<strong>at</strong>ic. Because of this selection mechanism, weonly allow bimodal r<strong>at</strong>io to change in the unit of 10%.In order to distribute requests to different requestors in the simul<strong>at</strong>or, PagePool/ProxyTrace maps the client ID in the traces torequestors in the simul<strong>at</strong>or using a modulo oper<strong>at</strong>ion.PagePool/ProxyTrace has the following major OTcl methods:get-poolsizeget-dur<strong>at</strong>ionbimodal-r<strong>at</strong>ioset-client-num 〈num〉gen-request 〈ClientID〉gen-size 〈PageID〉bimodal-r<strong>at</strong>io 〈r<strong>at</strong>io〉ranvar-dp 〈ranvar〉set-reqfile 〈file〉set-pgfile 〈file〉gen-modtime 〈PageID〉 〈LastModTime〉Retur<strong>ns</strong> the total number of pages.Retur<strong>ns</strong> the dur<strong>at</strong>ion of the trace.Retur<strong>ns</strong> the bimodal r<strong>at</strong>io.Set the number of requestors in the simul<strong>at</strong>ion.Gener<strong>at</strong>e the next request for the given requestor.Retur<strong>ns</strong> the size of the given page.Set the dynamic pages to be 〈r<strong>at</strong>io〉*10 percent. Note th<strong>at</strong> this r<strong>at</strong>io changes inunit of 10%.Set page modific<strong>at</strong>ion interval gener<strong>at</strong>or for dynamic pages. Similarly, ranvarsp〈ranvar〉 sets the gener<strong>at</strong>or for st<strong>at</strong>ic pages.Set request stream file, as discussed above.Set page inform<strong>at</strong>ion file, as discussed above.Gener<strong>at</strong>e next modific<strong>at</strong>ion time for the given page.An example of using PagePool/ProxyTrace is available <strong>at</strong> <strong>ns</strong>/tcl/ex/simple-webcache-trace.tcl.39.4.4 PagePool/Client<strong>The</strong> class PagePool/Client helps caches to keep track of pages resident in cache, <strong>and</strong> to store various cache-rel<strong>at</strong>ed inform<strong>at</strong>ionabout pages. It is mostly implemented in C++, because it is mainly used internally <strong>and</strong> little functionality is needed by users.It has the following major C++ methods:• get_page(co<strong>ns</strong>t char* name) - Retur<strong>ns</strong> a pointer to the page with the given name.• add_page(co<strong>ns</strong>t char *name, int size, double mt, double et, double age) - Add a pagewith given size, last modific<strong>at</strong>ion time (mt), cache entry time (et), <strong>and</strong> page lifetime (age).• remove_page(co<strong>ns</strong>t char* name) - Remove a page from cache.This page pool should support various cache replacement algorithms, however, it has not been implemented yet.39.4.5 PagePool/WebTraf<strong>The</strong> class PagePool/WebTraf is a st<strong>and</strong>alone Web traffic modle th<strong>at</strong> utilizes PagePool framework. However, this class hasnothing to do with the HttpApp classes. Because we are only interested in using it to study Web traffic p<strong>at</strong>tern here, <strong>and</strong> do350

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

Saved successfully!

Ooh no, something went wrong!