May 10, 2007

Web Traffic Generation in NS-2 with PackMime-HTTP


The ns network simulator has objects called "Applications" that control data transfer in a simulation. These Applications communicate via "Agents" which represent the transport layer of the network. PackMimeHTTP is the ns object that drives the generation of HTTP traffic. Each PackMimeHTTP object controls the operation of two types of Applications, a PackMimeHTTP server Application and a PackMimeHTTP client Application. Each of these Applications is conncted to a TCP Agent (Full-TCP).

Each web server or web client cloud is represented by a single ns node that can produce and consume multiple HTTP connections at a time (Figure 1). For each HTTP connection, PackMimeHTTP creates (or allocates from the inactive pool, as described below) server and client Applications and their associated TCP Agents. After setting up and starting each connection, PackMimeHTTP sets a timer to expire when the next new connection should begin. The time between new connections is governed by the connection rate parameter supplied by the user. New connections are started according to the connection arrival times without regard to the completion of previous requests, but a new request between the same client and server pair (as with HTTP 1.1) begins only after the previous request-response pair has been completed.

PackMimeHTTP handles the re-use of Applications and Agents that have completed their data transfer. There are 5 pools used to maintain Applications and Agents -- one pool for inactive TCP Agents and one pool each for active and inactive client and server Applications. The pools for active Applications ensure that all active Applications are destroyed when the simulation is finished. Active TCP Agents do not need to be placed in a pool beacuse each active Application contains a pointer to its associated TCP Agent. New objects are only created when there are no Agents or Applications available in the inactive pools.

PackMimeHTTP Client Application
Each PackMimeHTTP client controls the HTTP request sizes that are transferred. The client is started when a new TCP connection is started. Each PackMimeHTTP client takes the following steps:

  • sample the number of requests for this connection from the number-of-requests distribution (if the number of requests is 1, this is an HTTP 1.0 connection)
  • sample the inter-request times from the inter-request-time distribution, if there will be more than 1 request
  • sample the HTTP request sizes from the request-size distribution
  • send the first HTTP request to the server
  • listen for the HTTP response
  • when the entire HTTP response has been received, the client sets a timer to expire when the next request should be made
  • when the timer expires, the next HTTP request is sent, and the above process is repeated until all requests have been completed

PackMimeHTTP Server Application
Each web server controls the response sizes that are transferred. The server is started by when a new TCP connection is started. 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 samples the HTTP response sizes from the HTTP response size distribution
  • this process is repeated until the requests are exhausted -- the server is told how many requests will be sent in the connection
  • send a FIN to close the connection

PackMimeHTTP Random Variables
This implementation of PackMimeHTTP provides several ns RandomVariable objects for specifying distributions of PackMimeHTTP connection variables. The implementations were taked from source code provided by Bell Labs and modified to fit into the ns RandomVariable framework. This allows PackMimeHTTP connection variables to be specified by any type of ns RandomVariable, which now include PackMimeHTTP-specific random variables. The PackMimeHTTP-specific random variable syntax for TCL scripts is as follows:
  • RandomVariable/PackMimeHTTPFlowArrive rate, where rate is the specified PackMimeHTTP connection rate
  • RandomVariable/PackMimeHTTPFileSize rate type, where type is 0 for HTTP requests and 1 for HTTP responses
  • RandomVariable/PackMimeHTTPXmit rate type, where type is 0 for client-side transmission delays and 1 for server-side transmission delays
For installation, more info here

tags :

No comments: