|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.component.base.ClackComponent net.clackrouter.component.base.Queue net.clackrouter.component.extension.REDQueue
public class REDQueue
Implementation of a Random Early Detection (RED) queue.
TODO: Currently, this implementation is lacking a GUI to set and modify the parameters in real-time, which is really needed for it to be useful. Its on the to-do list.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.clackrouter.component.base.ClackComponent |
---|
ClackComponent.Waiter |
Field Summary | |
---|---|
double |
alpha
|
double |
avgLen
|
double |
curLen
|
static double |
DEFAULT_ALPHA
|
static double |
DEFAULT_LEN
|
static double |
DEFAULT_MAX_PROBABILITY
|
static double |
DEFAULT_MAX_THRESHOLD
|
static double |
DEFAULT_MIN_THRESHOLD
|
double |
maxLen
|
double |
maxProb
|
double |
maxThresh
|
static long |
MIN_AVG_UPDATE_INTERVAL
|
double |
minThresh
|
static int |
NUM_PORTS
|
static int |
PORT_HEAD
|
static int |
PORT_TAIL
|
Fields inherited from class net.clackrouter.component.base.Queue |
---|
DEFAULT_SIZE, m_max_size, m_queue, m_recent_drop, m_total_drops, mQueueOccData, startTime |
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 | |
---|---|
REDQueue(Router router,
java.lang.String name)
|
|
REDQueue(Router router,
java.lang.String name,
double mLen,
double minTh,
double maxTh,
double mProb,
double a)
|
Method Summary | |
---|---|
void |
acceptPacket(VNSPacket packet,
int port_number)
Receives a packet and sees if RED will drop or enqueue |
boolean |
acceptWrite(java.lang.String key,
java.lang.String value)
|
java.lang.String[] |
getLauncherStrings()
|
int |
getMaxOccupancy()
The max occupancy of the queue |
int |
getOccupancy()
The current occupancy of the queue |
javax.swing.JPanel |
getPropertiesView()
Method for getting the properties view associated with this component Property views are used to display more detailed information about internal component state. |
java.util.Properties |
getReadHandlerValues()
|
java.util.Properties |
getWriteHandlerValues()
|
VNSPacket |
handlePullRequest(int port_number)
Removes a packet from the RED queue and recalculates the avg len |
boolean |
isModifying()
Reports whether this component modifies packets passed through it This value is used by the static checking algorithm used to make sure port connections are valid. |
void |
launch(java.lang.String s)
|
void |
poll()
Callback method to implement component functionality that is not initiated by a packet push. |
void |
setupPorts(int numPorts)
Allocates an array of ClackPort objects to be used by this component |
Methods inherited from class net.clackrouter.component.base.Queue |
---|
getQueueOccData, getSerializableProperties, getTotalDropped, getView, initializeProperties, queueOccupancyChanged, recentDropTest, setMaxOccupancy |
Methods inherited from class net.clackrouter.component.base.ClackComponent |
---|
createCopy, createInputPullPort, createInputPushPort, createOutputPullPort, createOutputPushPort, error, fireListeners, getColor, getComponentCell, getHierarchicalView, getLog, getName, getNumPorts, getPacketCountIn, getPacketCountOut, getPendingError, getPort, getRouter, getTime, getTypeName, getUniqueCount, hasError, isHierarchical, 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 |
---|
public static final int PORT_HEAD
public static final int PORT_TAIL
public static final int NUM_PORTS
public static double DEFAULT_LEN
public static double DEFAULT_MIN_THRESHOLD
public static double DEFAULT_MAX_THRESHOLD
public static double DEFAULT_MAX_PROBABILITY
public static double DEFAULT_ALPHA
public double minThresh
public double maxThresh
public double maxProb
public double avgLen
public double curLen
public double maxLen
public double alpha
public static long MIN_AVG_UPDATE_INTERVAL
Constructor Detail |
---|
public REDQueue(Router router, java.lang.String name)
public REDQueue(Router router, java.lang.String name, double mLen, double minTh, double maxTh, double mProb, double a)
Method Detail |
---|
public void setupPorts(int numPorts)
ClackComponent
setupPorts
in class Queue
numPorts
- the number of ports to createpublic void acceptPacket(VNSPacket packet, int port_number)
acceptPacket
in class Queue
packet
- The pushed packetport_number
- The number of the port that this packet is arriving onpublic VNSPacket handlePullRequest(int port_number)
handlePullRequest
in class Queue
port_number
- The port that a packet is being requested on
public void poll()
ClackComponent
Callback method to implement component functionality that is not initiated by a packet push.
The pull method is often used to implement a "pull" component, or to serve as a packet source.
The Router calls poll() once per processing loop if the component has been registered using the
Router.registerForPoll(ClackComponent)
method.
poll
in class ClackComponent
public int getOccupancy()
Queue
getOccupancy
in class Queue
public int getMaxOccupancy()
Queue
getMaxOccupancy
in class Queue
public boolean isModifying()
ClackComponent
isModifying
in class Queue
public java.util.Properties getReadHandlerValues()
getReadHandlerValues
in interface ComponentDataHandler
public java.util.Properties getWriteHandlerValues()
getWriteHandlerValues
in interface ComponentDataHandler
public boolean acceptWrite(java.lang.String key, java.lang.String value)
acceptWrite
in interface ComponentDataHandler
public javax.swing.JPanel getPropertiesView()
ClackComponent
getPropertiesView
in class Queue
public java.lang.String[] getLauncherStrings()
getLauncherStrings
in interface ComponentVizLauncher
public void launch(java.lang.String s)
launch
in interface ComponentVizLauncher
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |