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 ...
41.1.2 PackMimeHTTP Server ApplicationEach web server controls the response sizes that are transferred. The server is started by when a new TCP connection isstarted. Each PackMimeHTTP client takes the following steps:• listen for an HTTP request from the associated client• when the entire request arrives, the server samples the server delay time from the server delay distribution• set a timer to expire when the server delay has passed• when the timer expires, the server sends response (the size of which was sampled by the client and passed to the server)• this process is repeated until the requests are exhausted – the server is told how many requests will be sent in theconnection• send a FIN to close the connection41.2 PackMimeHTTP Random VariablesThis implementation of PackMimeHTTP provides several ns RandomVariable objects for specifying distributions of Pack-MimeHTTP connection variables. The implementations were taken from source code provided by Bell Labs and modified tofit into the ns RandomVariable framework. This allows PackMimeHTTP connection variables to be specified by any type ofns RandomVariable, which now include PackMimeHTTP-specific random variables. If no RandomVariables are specified inthe TCL script, PackMimeHTTP will set these automatically.The PackMimeHTTP-specific random variable syntax for TCL scripts is as follows:• $ns [new RandomVariable/PackMimeHTTPFlowArrive ], where rate is the specified Pack-MimeHTTP connection rate (number of new connections per second)• $ns [new RandomVariable/PackMimeHTTPReqSize ], where rate is the specified PackMime-HTTP connection rate• $ns [new RandomVariable/PackMimeHTTPRspSize ], where rate is the specified PackMime-HTTP connection rate• $ns [new RandomVariable/PackMimeHTTPPersistRspSize]• $ns [new RandomVariable/PackMimeHTTPPersistent ], where probability isthe probability that the connection is persistent• $ns [new RandomVariable/PackMimeHTTPNumPages ], whereprobability is the probability that there is a single page in the connection and shape and scale are parametersto the Weibull distribution to determine the number of pages in the connection.• $ns [new RandomVariable/PackMimeHTTPSingleObjPages ], where probabilityis the probability that there is a single object on the current page.• $ns [new RandomVariable/PackMimeHTTPObjsPerPage ], where shape and scaleare parameters to the Gamma distribution to determine the number of objects on a single page.• $ns [new RandomVariable/PackMimeHTTPTimeBtwnObjs]• $ns [new RandomVariable/PackMimeHTTPTimeBtwnPages]365
HTTP responsesclients servers DelayBox DelayBox webFigureweb41.2: Example Topology Using PackMimeHTTP and DelayBox. The cloud of web clients is a single ns node, and thecloud of web servers is a single ns node. Each of the DelayBox nodes is a single ns node.requests HTTP• $ns [new RandomVariable/PackMimeHTTPServerDelay ], where shape and scaleare paramters to the Weibull distribution to determine server delay.• $ns [RandomVariable/PackMimeHTTPXmit ], where type is 0 for client-side delaysand 1 for server-side delays. Note: This random variable is only used in conjunction with DelayBox. It returns 1/2 ofthe actual delay because it is meant to be used with 2 DelayBox nodes, each of which should delay the packets for 1/2of the actual delay.41.3 Use of DelayBox with PackMime-HTTPPackMimeHTTP uses ns to model the TCP-level interaction between web clients and servers on the simulated link. Tosimulate network-level effects of HTTP transfer through the clouds, use DelayBox (see 22). DelayBox is an ns analog todummynet, often used in network testbeds to delay and drop packets. The delay times model the propagation and queuingdelay incurred from the source to the edge of the cloud (or edge of the cloud to destination). Since all HTTP connections inPackMimeHTTP take place between only two ns nodes, there must be an ns object to delay packets in each flow, rather thanjust having a static delay on the link between the two nodes. DelayBox also models bottleneck links and packet loss on anindividual connection basis. Two DelayBox nodes are used as shown in Figure 41.3. One node is placed in front of the webclient cloud ns node to handle client-side delays, loss, and bottleneck links. The other DelayBox node is placed in front ofthe web server cloud ns node to handle the server-side delays, loss, and bottleneck links.41.4 ExampleMore examples (including those that demonstrate the use of DelayBox with PackMime) are available in the tcl/ex/packmime/directory of the ns source code. The validation script test-suite-packmime.tcl is in tcl/test/ and can be runwith the command test-all-packmime from that directory.Note: The only PackMime-HTTP parameters that must be set are rate, client, server, flow_arrive, req_size,and rsp_size. The example below shows the minimal parameters that need to be set, but other parameters can be set tochange the default behavior (see “Commands at a Glance”).# test-packmime.tcl# useful constantsset CLIENT 0set SERVER 1366
- 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 and 350: TclObjectPagePoolPagePool/CompMathP
- Page 351 and 352: PagePool/ProxyTrace takes these two
- 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: (nsnode) clientcloudPackM ime(nsnod
- 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•
- Page 401 and 402: 46.1.7 Agent TracingAgent trace eve
- Page 403 and 404: v -t 1.0 -e node_tclscript 2 "Echo
- Page 405 and 406: If nam ever gets to the end of an e
- Page 407 and 408: l :link-t time-s source id-d des
- Page 409 and 410: E :D :P :a :session enqueue-t time
- Page 411 and 412: v :V :N :W :g :A :c :q :execute tcl
- Page 413 and 414: $ns duplex-link-op orient right$ns
- Page 415 and 416: Chapter 47Educational use of NS and
HTTP respo<strong>ns</strong>esclients servers DelayBox DelayBox webFigureweb41.2: Example Topology Using PackMimeHTTP <strong>and</strong> DelayBox. <strong>The</strong> cloud of web clients is a single <strong>ns</strong> node, <strong>and</strong> thecloud of web servers is a single <strong>ns</strong> node. Each of the DelayBox nodes is a single <strong>ns</strong> node.requests HTTP• $<strong>ns</strong> [new R<strong>and</strong>omVariable/PackMimeHTTPServerDelay ], where shape <strong>and</strong> scaleare paramters to the Weibull distribution to determine server delay.• $<strong>ns</strong> [R<strong>and</strong>omVariable/PackMimeHTTPXmit ], where type is 0 for client-side delays<strong>and</strong> 1 for server-side delays. Note: This r<strong>and</strong>om variable is only used in conjunction with DelayBox. It retur<strong>ns</strong> 1/2 ofthe actual delay because it is meant to be used with 2 DelayBox nodes, each of which should delay the packets for 1/2of the actual delay.41.3 Use of DelayBox with PackMime-HTTPPackMimeHTTP uses <strong>ns</strong> to model the TCP-level interaction between web clients <strong>and</strong> servers on the simul<strong>at</strong>ed link. Tosimul<strong>at</strong>e network-level effects of HTTP tra<strong>ns</strong>fer through the clouds, use DelayBox (see 22). DelayBox is an <strong>ns</strong> analog todummynet, often used in network testbeds to delay <strong>and</strong> drop packets. <strong>The</strong> delay times model the propag<strong>at</strong>ion <strong>and</strong> queuingdelay incurred from the source to the edge of the cloud (or edge of the cloud to destin<strong>at</strong>ion). Since all HTTP connectio<strong>ns</strong> inPackMimeHTTP take place between only two <strong>ns</strong> nodes, there must be an <strong>ns</strong> object to delay packets in each flow, r<strong>at</strong>her thanjust having a st<strong>at</strong>ic delay on the link between the two nodes. DelayBox also models bottleneck links <strong>and</strong> packet loss on anindividual connection basis. Two DelayBox nodes are used as shown in Figure 41.3. One node is placed in front of the webclient cloud <strong>ns</strong> node to h<strong>and</strong>le client-side delays, loss, <strong>and</strong> bottleneck links. <strong>The</strong> other DelayBox node is placed in front ofthe web server cloud <strong>ns</strong> node to h<strong>and</strong>le the server-side delays, loss, <strong>and</strong> bottleneck links.41.4 ExampleMore examples (including those th<strong>at</strong> demo<strong>ns</strong>tr<strong>at</strong>e the use of DelayBox with PackMime) are available in the tcl/ex/packmime/directory of the <strong>ns</strong> source code. <strong>The</strong> valid<strong>at</strong>ion script test-suite-packmime.tcl is in tcl/test/ <strong>and</strong> can be runwith the comm<strong>and</strong> test-all-packmime from th<strong>at</strong> directory.Note: <strong>The</strong> only PackMime-HTTP parameters th<strong>at</strong> must be set are r<strong>at</strong>e, client, server, flow_arrive, req_size,<strong>and</strong> rsp_size. <strong>The</strong> example below shows the minimal parameters th<strong>at</strong> need to be set, but other parameters can be set tochange the default behavior (see “Comm<strong>and</strong>s <strong>at</strong> a Glance”).# test-packmime.tcl# useful co<strong>ns</strong>tantsset CLIENT 0set SERVER 1366