simnet
Class BandwidthTest

java.lang.Object
  extended byjava.lang.Thread
      extended bysimnet.Application
          extended bysimnet.BandwidthTest
All Implemented Interfaces:
Pluggable, PlugoutListener, java.lang.Runnable, SimnetWindowListener

public class BandwidthTest
extends Application
implements Pluggable

An application that estimates available bandwidth across a link.


Nested Class Summary
(package private)  class BandwidthTest.BWTThread
          A worker thread to send test or probe packets.
 
Field Summary
static int BW_RX_PORT
          Port to receive bandwidth test packets on.
static int PACKET_SIZE
           
protected  java.util.Hashtable results
          Hash table of histogram results; keys are source port.
(package private)  DatagramSocket rx_sock
           
 
Fields inherited from class simnet.Application
appid, appstart, frame, initialized, node, NODE_ID, pid, random, sim, win
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
BandwidthTest()
           
 
Method Summary
 void BWRawTestResults(java.lang.Integer port)
          Print the raw results for a particular port.
 void BWTest(java.lang.String dest, java.lang.Integer period, java.lang.Integer duration, java.lang.String param)
          Run a bandwidth test.
 void BWTestSummary(java.lang.Integer capacity, java.lang.Integer answer)
          Estimates the amount of available bandwidth, and determines how close this is to the actual amount.
 void customInit()
          Create a datagram socket and bind it to the bandwidth test port.
 boolean prePlugout(java.lang.Object replacement)
          Just close the socket to clean up (not really necessary...).
 void run()
          Receive packets and record statistics.
 
Methods inherited from class simnet.Application
closeWindow, finalize, getTitleString, initialize, plugoutNotification, printout, printout, processWindowCommand, rawOut, window
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BW_RX_PORT

public static final int BW_RX_PORT
Port to receive bandwidth test packets on.

See Also:
Constant Field Values

PACKET_SIZE

public static final int PACKET_SIZE
See Also:
Constant Field Values

rx_sock

DatagramSocket rx_sock

results

protected java.util.Hashtable results
Hash table of histogram results; keys are source port.

Constructor Detail

BandwidthTest

public BandwidthTest()
Method Detail

customInit

public void customInit()
Create a datagram socket and bind it to the bandwidth test port.

Overrides:
customInit in class Application

BWTestSummary

public void BWTestSummary(java.lang.Integer capacity,
                          java.lang.Integer answer)
Estimates the amount of available bandwidth, and determines how close this is to the actual amount. For convienence, the answer is given as the delay between base packets.


BWRawTestResults

public void BWRawTestResults(java.lang.Integer port)
Print the raw results for a particular port.


BWTest

public void BWTest(java.lang.String dest,
                   java.lang.Integer period,
                   java.lang.Integer duration,
                   java.lang.String param)
Run a bandwidth test.


run

public void run()
Receive packets and record statistics.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class Application

prePlugout

public boolean prePlugout(java.lang.Object replacement)
Just close the socket to clean up (not really necessary...).

Specified by:
prePlugout in interface Pluggable
Returns:
if this object can now be removed (was the operation sucessful)