SSF.OS.UDP.test
Class udpStreamClient

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.OS.UDP.test.udpStreamClient
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class udpStreamClient
extends ProtocolSession

Master class for creating streaming UDP client-server sessions. Obtains DML configuration specifying available servers and session parameters.


Field Summary
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
udpStreamClient()
          Constructors
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Client configuration.
 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.
 java.lang.Object getRandomVectorElement(java.util.Vector v, java.util.Random rng)
           
 void init()
          Kick-off timer to start client operation.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
 void startOnce(int nsess)
          Prototype method to open one or more sessions to randomly selected servers.
 void startOnOff()
          Prototype session renewal process: open a session to a randomly selected server, wait until session is completed either with success or failure; then again wait for specified time; and repeat.
 
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
 

Constructor Detail

udpStreamClient

public udpStreamClient()
Constructors

Method Detail

init

public void init()
          throws ProtocolException
Kick-off timer to start client operation. Choose startOnce or startOnOff mode.

Overrides:
init in class ProtocolSession
ProtocolException

startOnce

public void startOnce(int nsess)
Prototype method to open one or more sessions to randomly selected servers. Remember to check that the server's client_limit allows multiple sessions.


startOnOff

public void startOnOff()
Prototype session renewal process: open a session to a randomly selected server, wait until session is completed either with success or failure; then again wait for specified time; and repeat. Should be elaborated by specifying the distributions of inter-session waiting times and requested file sizes.


getRandomVectorElement

public java.lang.Object getRandomVectorElement(java.util.Vector v,
                                               java.util.Random rng)

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Client configuration. Supported DML attributes:
   ProtocolSession [ name client use SSF.OS.UDP.test.udpStreamClient
     start_time   %F     # earliest time to send request to server, sec
     start_window %F     # send request to server at randomly chosen time
                         # in interval [start_time, start_time+start_window]

     file_size     %I    # requested file size (virtual payload bytes, int)
     request_size  %I    # client request nominal datagram size (bytes, int)
     datagram_size %I    # max datagram payload size (bytes, int)
     show_report   %S    # print client-server session summary report, true/false
     debug         %S    # print verbose diagnostics, true/false
   ]
 

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 [nhi 1:2(0) port 10]  # single server
    ]
    pattern [
      client 2:1
      servers [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.

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