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 ...
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
- Page 299 and 300: Chapter 35SCTP AgentsThis chapter d
- Page 301 and 302: Figure 35.1: Example of a Multihome
- Page 303 and 304: Note: the actual value of these tra
- Page 305 and 306: 1.526624 1 4 sctp 1500 -------D 0 1
- Page 307 and 308: $ns at 5.0 "finish"$ns run35.5.2 Mu
- Page 309 and 310: Chapter 36Agent/SRMThis chapter des
- Page 311 and 312: 36.1.2 Other Configuration Paramete
- Page 313 and 314: 3.6274 n 0 m r 1 type repair servi
- Page 315 and 316: 3.6029 n 3 m r 2 Q NTIMER at 3.730
- Page 317 and 318: 36.4 Loss Detection—The Class SRM
- Page 319 and 320: same packet. The repair objet does
- Page 321 and 322: }hdr_asrm* seh = (hdr_asrm*) p->acc
- Page 323 and 324: set grp [Node allocaddr]$srm set ds
- Page 325 and 326: #set up the multicast routingDM set
- Page 327 and 328: 37.3 Architecture of the PLM Protoc
- Page 329 and 330: We add in void PLMLossMonitor::recv
- Page 331 and 332: Part VIApplication330
- Page 333 and 334: Traffic generatorsApplication/Traff
- Page 335 and 336: • recv(int nbytes)—Announces th
- Page 337 and 338: 1. EXPOO_Traffic—generates traffi
- Page 339 and 340: set src [new Agent/UDP]set sink [ne
- Page 341 and 342: Application FTP FTP objects produce
- Page 343 and 344: send_data(ADU)Application(HttpApp,
- Page 345 and 346: 39.1.4 Transmitting user data over
- Page 347 and 348: and teardown of connections. Only O
- Page 349: TclObjectPagePoolPagePool/CompMathP
- Page 353 and 354: }int id_; // object IDWebTrafSessio
- Page 355 and 356: An Http/Server object waits for inc
- Page 357 and 358: set tmp [new RandomVariable/Exponen
- Page 359 and 360: Object Type Event Type Explaination
- Page 361 and 362: Chapter 40Worm ModelIn this chapter
- Page 363 and 364: $w local-p 0.5Following are some co
- Page 365 and 366: (nsnode) clientcloudPackM ime(nsnod
- Page 367 and 368: HTTP responsesclients servers Delay
- Page 369 and 370: 41.5 Commands at a GlanceThe follow
- Page 371 and 372: • HTTP response size (bytes)• s
- Page 373 and 374: Chapter 42Session-level Packet Dist
- Page 375 and 376: 42.1.2 Inserting a Loss ModuleWhen
- Page 377 and 378: Delay and Loss Modules Each receive
- Page 379 and 380: Chapter 43Asim: approximate analyti
- Page 381 and 382: set n(1) [$ns node]set link(0:1) [$
- Page 383 and 384: Part VIIIEmulation382
- Page 385 and 386: When using the emulation mode, a sp
- Page 387 and 388: set intf [$pf1 open readonly]puts "
- Page 389 and 390: puts "install nets into taps..."$a0
- Page 391 and 392: Chapter 45Nam45.1 IntroductionNam i
- Page 393 and 394: • Button 6 (Chevron logo) - Close
- Page 395 and 396: Second, when dealing with randomly
- Page 397 and 398: dst_portaddr,seqno,flags,sname);A n
- Page 399 and 400: • up• down• right• left•
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