net.clackrouter.component.extension
Class UDPSource

java.lang.Object
  extended by net.clackrouter.component.base.ClackComponent
      extended by net.clackrouter.component.extension.UDPSource
All Implemented Interfaces:
Alarm

public class UDPSource
extends ClackComponent

Generates uniform user-specified UDP traffic at a given rate.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent
ClackComponent.Waiter
 
Field Summary
static java.lang.String DEFAULT_PAYLOAD
           
static int DEFAULT_PORT
           
static int DEFAULT_SENDING_RATE
           
static int NUM_PORTS
           
static int PORT_OUT
           
 
Fields inherited from class net.clackrouter.component.base.ClackComponent
componentCell, m_has_error, m_log, m_name, m_num_ports, m_packetcount_in, m_packetcount_out, m_ports, mListeners, mRouter, pendingError, SIGNAL_ERROR_LEN_MSEC, UNIQUE_COUNT, view
 
Constructor Summary
UDPSource(Router r, java.lang.String name)
           
 
Method Summary
 void poll()
          override poll() to send UDP packets at a regular rate
 void setDestinationAddress(java.net.InetAddress dst)
           
 void setDestinationPort(int dPort)
          Set destination port for this UDP traffic
 void setSendingRate(int r)
          Sets the rate (as a percentage of full router speed) at which the UDP source sends packets
 void setSourceAddress(java.net.InetAddress src)
           
 void setSourcePort(int sPort)
          Set source port for this UDP traffic
 void setUDPPayload(java.lang.String load)
          Set the contents of the UDP packets to be sent.
protected  void setupPorts(int numports)
          Allocates an array of ClackPort objects to be used by this component
 
Methods inherited from class net.clackrouter.component.base.ClackComponent
acceptPacket, createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getColor, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getPropertiesView, getRouter, getSerializableProperties, getTime, getTypeName, getUniqueCount, getView, handlePullRequest, hasError, initializeProperties, isHierarchical, isModifying, log, notifyAlarm, registerListener, sendOutPort, setAlarm, setComponentCell, setName, setPendingError, setView, showErrorDialog, signalError, try_repaint, unregisterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PORT_OUT

public static int PORT_OUT

NUM_PORTS

public static int NUM_PORTS

DEFAULT_PAYLOAD

public static java.lang.String DEFAULT_PAYLOAD

DEFAULT_PORT

public static int DEFAULT_PORT

DEFAULT_SENDING_RATE

public static int DEFAULT_SENDING_RATE
Constructor Detail

UDPSource

public UDPSource(Router r,
                 java.lang.String name)
Method Detail

setupPorts

protected void setupPorts(int numports)
Description copied from class: ClackComponent
Allocates an array of ClackPort objects to be used by this component

Overrides:
setupPorts in class ClackComponent
Parameters:
numports - the number of ports to create

poll

public void poll()
override poll() to send UDP packets at a regular rate

Overrides:
poll in class ClackComponent

setSourceAddress

public void setSourceAddress(java.net.InetAddress src)

setDestinationAddress

public void setDestinationAddress(java.net.InetAddress dst)

setUDPPayload

public void setUDPPayload(java.lang.String load)
Set the contents of the UDP packets to be sent.


setSourcePort

public void setSourcePort(int sPort)
Set source port for this UDP traffic


setDestinationPort

public void setDestinationPort(int dPort)
Set destination port for this UDP traffic


setSendingRate

public void setSendingRate(int r)
Sets the rate (as a percentage of full router speed) at which the UDP source sends packets