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

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

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

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

Saved successfully!

Ooh no, something went wrong!