SSF.OS.WWW
Class httpClient

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.OS.WWW.httpClient
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class httpClient
extends ProtocolSession

Master class for creating HTTP client-server sessions. Obtains DML configuration specifying available servers and session parameters, and kicks-off the client.


Field Summary
static int ERR_CLOSE
           
static int ERR_CONNECT
           
static int ERR_RCVDATA
           
static int ERR_RCVHEADER
           
static int ERR_SENDREQUEST
           
 java.lang.String serverList
          Name of the server list
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
httpClient()
          Constructors
 
Method Summary
 void clientDebug(int errno, java.lang.String str)
          preamble to client-side diagnostics
 void clientDebug(java.lang.String str)
          preamble to client-side-only diagnostics
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the client.
 void configTraffic(com.renesys.raceway.DML.Configuration traffic, java.lang.String client_nhi, java.util.Vector server_list)
          Add a list of servers available to the client(s) to the server_list.
 void init()
          Kick-off the sessionArrivalProcess mode.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
 void sessionArrivalProcess()
          Session renewal process: sleep for a random time distributed according to interSessnTimeGen, then open a session to a randomly selected server, then after the session is completed either with success or failure, repeat the off-on cycle.
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serverList

public java.lang.String serverList
Name of the server list


ERR_CONNECT

public static final int ERR_CONNECT
See Also:
Constant Field Values

ERR_SENDREQUEST

public static final int ERR_SENDREQUEST
See Also:
Constant Field Values

ERR_RCVHEADER

public static final int ERR_RCVHEADER
See Also:
Constant Field Values

ERR_RCVDATA

public static final int ERR_RCVDATA
See Also:
Constant Field Values

ERR_CLOSE

public static final int ERR_CLOSE
See Also:
Constant Field Values
Constructor Detail

httpClient

public httpClient()
Constructors

Method Detail

clientDebug

public void clientDebug(java.lang.String str)
preamble to client-side-only diagnostics


clientDebug

public void clientDebug(int errno,
                        java.lang.String str)
preamble to client-side diagnostics


init

public void init()
          throws ProtocolException
Kick-off the sessionArrivalProcess mode.

Overrides:
init in class ProtocolSession
ProtocolException

sessionArrivalProcess

public void sessionArrivalProcess()
Session renewal process: sleep for a random time distributed according to interSessnTimeGen, then open a session to a randomly selected server, then after the session is completed either with success or failure, repeat the off-on cycle.


config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the client. Example of the supported DML attributes:
   ProtocolSession [ name client use SSF.OS.WWW.httpClient

     # earliest time to send the first request to server (seconds).

     start_time 1.0

     # HTTP session arrival process in this client. The first session
     # begins at start_time + inter_session_time (in seconds).
     # Each session is with a server chosen uniformly at random from
     # the servers specified in the .Net.traffic for this client.

     inter_session_time [
       distribution [
         name "Exponential"         # distribution class name
         lambda 0.01                # mean = 1/lambda
       ]
     ]

     # distribution of number of pages per session with selected server.
     # if random variable = 0, round up to 1

     pages_in_session [
       distribution [
         name "Exponential"         # distribution class name
         lambda 0.2                 # mean = 1/lambda
       ]
     ]

     # distribution of user-think-times (off-times) between consecutive
     # in-session page requests, counted from the time when the previous
     # page delivery is completed (in seconds).

     inter_page_time [
       distribution [
         name "Pareto"              # distribution class name
         k 25.0                     # scale (cutoff) parameter
         alpha 2.0                  # shape (exponent) parameter
       ]
     ]

     # distribution of delays between consecutive requests in a session.
     # Counted from the time when the previous request was completed. (In seconds.)

     inter_request_time [
       distribution [
         name "Pareto"              # distribution class name
         k 0.1667                   # scale (cutoff) parameter
         alpha 1.5                  # shape (exponent) parameter
       ]
     ]

     http_hdr_size 1000  # nominal HTTP header size (virtual bytes) read from a socket
                         # before reading data (if indicated by http header)
     persistent false    # if true, one persistent TCP connection per session (HTTP1.1),
                         # if false,one TCP connection for each request/response (HTTP1.0).
     show_report true    # print client-server session summary report
     debug false         # print verbose client/server diagnostics

 # new atributes in ssfnet_1.3 - backward compatible with ssfnet_1.2
  ------------------------------------------------------------------

    server_list  "mylist" # identifies server list(s) name in traffic pattern
                          # if omitted concatenate all server lists in
                          # matching pattern
   ]
 

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class ProtocolSession
com.renesys.raceway.DML.configException

configTraffic

public void configTraffic(com.renesys.raceway.DML.Configuration traffic,
                          java.lang.String client_nhi,
                          java.util.Vector server_list)
                   throws com.renesys.raceway.DML.configException
Add a list of servers available to the client(s) to the server_list. A client may match multiple NHI prefixes; the servers specified by multiple matches are simply added to the server_list without checking for duplication. All NHI addresses must be global. A given client_nhi matches the value of the attribute "client foo' iff the NHI string "client_nhi" extends the NHI value "foo", viz. client_nhi = foo:* or client_nhi = foo. The attribute traffic can have the forms
  traffic [
    pattern [
      client 1:1        # value N or N:H allowed, where N is NHI network prefix
      servers [list "caseA" nhi 1:2(0) port 10]  # single server
    ]
    pattern [
      client 2:1
      servers [list "caseB" nhi_range [from 2:2(0) to 2:5(0)] port 11] # vector of servers
    ]
  ]
In case of a range of nhi addreses, an allowed range is of the form from N:h1(i) to N:h2(i), where N is a valid Net prefix, and h1 <= h2 is a range of hosts.

The optional attribute servers.list introduced in ssfnet_1.3 can be matched by tcpClient or httpClient attribute server_list to narrow down a list of servers, and - more importantly - to allow a client application to distinguish multiple servers on a single host (Note that tcpClient and httpClient configuration does not specify the server port number; instead a client searches the list of all servers in the .Net.traffic attribute, and chooses the ones that match the client's host NHI address AND also match the server_list attribute value string.

com.renesys.raceway.DML.configException

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Description copied from class: ProtocolSession
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. The pusher sends a reference to itself in the second argument. This push happens immediately, without any simulation time elapsing, regardless of other activities taking place in the ProtocolGraph.

If you desire "safe" interaction with other CPU activities, even though your push() consumes no measurable/modelable CPU cycles, define the "cpudelay true" attribute for the ProtocolGraph and use pushAfterDelay(message,fromSession,0.0). This will guarantee proper ordering; that is, the framework will wait until the CPU is free before proceeding with the requested push().

Specified by:
push in class ProtocolSession
ProtocolException