DRCL J-Sim API

drcl.inet.core.queue
Class RED

java.lang.Object
  extended bydrcl.DrclObj
      extended bydrcl.comp.queue.QLogic
          extended bydrcl.inet.core.queue.RED
All Implemented Interfaces:
java.lang.Cloneable, ObjectCloneable, ObjectDuplicable, java.io.Serializable
Direct Known Subclasses:
FRED

public class RED
extends QLogic

The Random Early Detection (RED) queue logic.

See Also:
Serialized Form

Field Summary
static java.lang.String EVENT_AVG_QSIZE
          Name of the average queue size change event.
static boolean RED_EWMA
           
static boolean RED_HOLT_WINTERS
           
 
Fields inherited from class drcl.comp.queue.QLogic
capacity, EVENT_QSIZE, qlen, qsize
 
Constructor Summary
RED()
           
RED(Component host_, java.lang.String avgpid_)
           
RED(Component host_, java.lang.String avgpid_, java.lang.String qpid_)
           
 
Method Summary
 java.lang.String adviceOn(java.lang.Object obj_, int psize_)
          Returns advice (in String) on whether or not to drop the packet.
 void dequeueHandler(java.lang.Object obj_, int psize_)
          Handles the event of dequeuing the object of the given size.
 void duplicate(java.lang.Object source_)
          Duplicates the content of the source object to this object.
 void enqueueHandler(java.lang.Object obj_, int psize_)
          Handles the event of enqueuing the object of the given size.
 double getBandwidth()
           
 double getInvProb()
           
 double getMaxThresh()
           
 int getMeanPacketSize()
           
 double getMinThresh()
           
 long getSeed()
           
 double getWeight()
           
 java.lang.String info(java.lang.String prefix_)
          Prints the content (states) of this queue management instance.
 boolean isMarkEnabled()
           
 boolean isWait()
           
 void reset()
          Resets this object to the initial state.
 void setAvgQSizePort(java.lang.String avgqspid_)
           
 void setBandwidth(double bw_)
           
 void setInvProb(double value)
           
 void setMarkEnabled(boolean enabled_)
          If enabled, RED marks the congestion bit of, instead of advising to drop, packets.
 void setMaxThresh(double max)
           
 void setMeanPacketSize(int size_)
           
 void setMinThresh(double min)
           
 void setRandomNumberGenerator(RandomNumberGenerator ug_)
           
 void setRandomNumberGenerator(RandomNumberGenerator ug_, long seed_)
           
 void setREDParam(int psize_, double bw_, double th_max_, double th_min_, double inv_max_p_, double qw_)
          Sets up all RED parameters.
 void setSeed(long seed_)
           
 void setWait(boolean enabled_)
           
 void setWeight(double weight)
           
 
Methods inherited from class drcl.comp.queue.QLogic
dropHandler, getCapacity, getCurrentQLength, getCurrentQSize, getHost, info, isEmpty, isFull, set, setCapacity, setHost, setQSizePort
 
Methods inherited from class drcl.DrclObj
clone, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RED_EWMA

public static boolean RED_EWMA

RED_HOLT_WINTERS

public static boolean RED_HOLT_WINTERS

EVENT_AVG_QSIZE

public static final java.lang.String EVENT_AVG_QSIZE
Name of the average queue size change event.

See Also:
Constant Field Values
Constructor Detail

RED

public RED()

RED

public RED(Component host_,
           java.lang.String avgpid_)
Parameters:
avgpid_ - ID of the average queue size change event port that will be created at the host component.

RED

public RED(Component host_,
           java.lang.String avgpid_,
           java.lang.String qpid_)
Parameters:
avgpid_ - ID of the average queue size change event port that will be created at the host component.
qpid_ - ID of the instant queue size change event port that will be created at the host component.
Method Detail

reset

public void reset()
Description copied from class: QLogic
Resets this object to the initial state. Subclasses must call super.reset() when overriding this method.

Overrides:
reset in class QLogic

duplicate

public void duplicate(java.lang.Object source_)
Description copied from class: QLogic
Duplicates the content of the source object to this object. If the host component is already set, this method also creates the queue size change event port of the same ID as that in source_. Subclasses must call super.duplicate() when overriding this method.

Specified by:
duplicate in interface ObjectDuplicable
Overrides:
duplicate in class QLogic

info

public java.lang.String info(java.lang.String prefix_)
Description copied from class: QLogic
Prints the content (states) of this queue management instance.

Overrides:
info in class QLogic
Parameters:
prefix_ - prefix of each line in the printout.

adviceOn

public java.lang.String adviceOn(java.lang.Object obj_,
                                 int psize_)
Returns advice (in String) on whether or not to drop the packet. Returns false if not to drop the packet.

Overrides:
adviceOn in class QLogic
Returns:
the advice; null if advicing not to drop the object.

enqueueHandler

public void enqueueHandler(java.lang.Object obj_,
                           int psize_)
Description copied from class: QLogic
Handles the event of enqueuing the object of the given size.

Overrides:
enqueueHandler in class QLogic

dequeueHandler

public void dequeueHandler(java.lang.Object obj_,
                           int psize_)
Description copied from class: QLogic
Handles the event of dequeuing the object of the given size.

Overrides:
dequeueHandler in class QLogic

setWait

public void setWait(boolean enabled_)

isWait

public boolean isWait()

setMarkEnabled

public void setMarkEnabled(boolean enabled_)
If enabled, RED marks the congestion bit of, instead of advising to drop, packets.


isMarkEnabled

public boolean isMarkEnabled()

setMeanPacketSize

public void setMeanPacketSize(int size_)

getMeanPacketSize

public int getMeanPacketSize()

setMaxThresh

public void setMaxThresh(double max)

getMaxThresh

public double getMaxThresh()

setMinThresh

public void setMinThresh(double min)

getMinThresh

public double getMinThresh()

setInvProb

public void setInvProb(double value)

getInvProb

public double getInvProb()

setWeight

public void setWeight(double weight)

getWeight

public double getWeight()

getBandwidth

public double getBandwidth()

setBandwidth

public void setBandwidth(double bw_)

setREDParam

public void setREDParam(int psize_,
                        double bw_,
                        double th_max_,
                        double th_min_,
                        double inv_max_p_,
                        double qw_)
Sets up all RED parameters. For each parameter, the default value is used if zero is given.


setSeed

public void setSeed(long seed_)

getSeed

public long getSeed()

setRandomNumberGenerator

public void setRandomNumberGenerator(RandomNumberGenerator ug_)

setRandomNumberGenerator

public void setRandomNumberGenerator(RandomNumberGenerator ug_,
                                     long seed_)

setAvgQSizePort

public void setAvgQSizePort(java.lang.String avgqspid_)

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~