driver
Class CBR

java.lang.Object
  extended by driver.CBR

public class CBR
extends java.lang.Object

Constant Bit Rate simulation program. This program creates a field and places nodes randomly throughout it. Some of the nodes are designated as client-server pairs, and these pairs transmit packets to each other for the duration of the simulation. It is possible to specify, among other things, the routing protocol used, the packet loss probability, and the rate of node movement.

Author:
Ben Viglietta, Rimon Barr

Nested Class Summary
static class CBR.Client
          A client node in the simulation.
static interface CBR.ClientInterface
          The interface for client nodes in the simulation.
private static class CBR.CommandLineOptions
          Simulation parameters with default values.
static class CBR.Server
          A server node in the simulation.
static interface CBR.ServerInterface
          The interface for server nodes in the simulation.
 
Field Summary
private static int numClientsTransmitting
          The number of clients currently transmitting.
private static int PORT
          Default port number to send and receive packets.
 
Constructor Summary
CBR()
           
 
Method Summary
private static void buildField(CBR.CommandLineOptions opts)
          Constructs field and nodes with given command-line options, establishes client/server pairs and starts them.
static void main(java.lang.String[] args)
          Starts the CBR simulation.
private static CBR.CommandLineOptions parseCommandLineOptions(java.lang.String[] args)
          Parses command-line arguments.
private static void showUsage()
          Prints a usage statement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT

private static final int PORT
Default port number to send and receive packets.

See Also:
Constant Field Values

numClientsTransmitting

private static int numClientsTransmitting
The number of clients currently transmitting.

Constructor Detail

CBR

public CBR()
Method Detail

showUsage

private static void showUsage()
Prints a usage statement.


parseCommandLineOptions

private static CBR.CommandLineOptions parseCommandLineOptions(java.lang.String[] args)
                                                       throws jargs.gnu.CmdLineParser.OptionException
Parses command-line arguments.

Parameters:
args - command-line arguments
Returns:
parsed command-line options
Throws:
CmdLineParser.OptionException - if the command-line arguments are not well-formed.

buildField

private static void buildField(CBR.CommandLineOptions opts)
Constructs field and nodes with given command-line options, establishes client/server pairs and starts them.

Parameters:
opts - command-line parameters

main

public static void main(java.lang.String[] args)
Starts the CBR simulation.

Parameters:
args - command-line arguments that may determine the parameters of the simulation