|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity FnbSCFQScheduler
public abstract class FnbSCFQScheduler
FnbSCFQScheduler implements a Self Clocked Fair Queueing Scheduler. A SCFQ is a
variation of Weighted Fair Queueing (WFQ), which is easier to implement than
WFQ because it does not need to compute round numbers at every iteration.
For more details refer to S. R. Golestani's INFOCOM '94 paper
A self-clocked fair queueing scheme for broadband applications.
Note that this class is based on SCFQScheduler
class.
A SCFQ scheduler can provide differentiated service to traffic by changing the weights associated with a certain class of traffic. The higher the weight of a class of traffic, the better treatment it receives. In this class, you can set the weights by calling setWeights() with a linear array of weights. Traffic that is class 0 (default), are assigned the first element of the array as its weight.
For example:
String userName = { "User_0", "User_1", User_2" }; // list of user names
int[] trafficClass = { 0, 1, 2 }; // a list of class for each user
int[] weights = { 1, 2, 3 }; // a list of weights for each class
From the above example, User_0 has a traffic class of 0 (low
priority), whereas User_2 has a traffic class of 2 (high priority)
judging from their respective weights.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
FnbSCFQScheduler(boolean stats)
Creates a new packet scheduler with the name "FnbSCFQScheduler". |
|
FnbSCFQScheduler(double baudRate,
int max_buf_size)
Creates a new SCFQ packet scheduler with the specified baud rate (bits/s). |
|
FnbSCFQScheduler(double baudRate,
int max_buf_size,
boolean stats)
Creates a new SCFQ packet scheduler with the specified baud rate (bits/s). |
|
FnbSCFQScheduler(String name,
double baudRate,
int max_buf_size,
boolean stats)
Creates a new SCFQ packet scheduler with the specified name and baud rate (in bits/s). |
|
FnbSCFQScheduler(String name,
int max_buf_size)
Creates a new SCFQ packet scheduler with the specified name. |
|
FnbSCFQScheduler(String name,
int max_buf_size,
boolean stats)
Creates a new SCFQ packet scheduler with the specified name. |
Method Summary | |
---|---|
void |
body()
A method that gets one process event at one time until the end of a simulation, then delivers an event to the entity (its parent) |
protected boolean |
checkDroppedGlList(int gl,
int user)
Checks if there is an existing gridletID_userID in the droppedGl_user array. |
Packet |
deque()
The method deque() has to decide which queue is to be served next. |
abstract boolean |
enque(Packet pnp)
Checks queue size and puts a packet into the queue |
abstract double |
getAvg()
Returns the avg buffer size |
double |
getBaudRate()
Returns the baud rate of the egress port that is using this scheduler. |
protected double |
getCounterDroppedPkts()
Returns the DROPPED_PKTS_COUNTER |
protected double |
getMaxBufferSize()
This function returns maximum buffer size, up to this moment along the experiment. |
protected double |
getMaxBufferSizeInPkts()
This function returns the max buffer size in pkts. |
int |
getRouterID()
Gets the router ID that hosts this scheduler. |
int |
getSchedID()
Gets the ID of this scheduler. |
String |
getSchedName()
Gets the name of this scheduler. |
protected void |
increaseDroppedPktCounter()
Increases the counter for the dropped packets by 1 |
protected abstract void |
initialize()
This function initializes the parameters of the buffers policies (RED, ARED) |
protected void |
insertGlID_userID(FnbDroppedPacketInfo info)
Adds the packet info to the dropped list |
protected boolean |
insertPacketIntoQueue(Packet pnp)
Puts a packet into the queue |
boolean |
isEmpty()
Determines whether the scheduler is currently keeping any packets in its queue(s). |
protected boolean |
makeRoomForPacket()
This function tries to drop a data packet out of a full queue, so that a control packet can be stored in that queue. |
protected double |
pktListSize()
Returns the size of the packet list. |
protected void |
resetCounterDroppedPkts()
Resets the DROPPED_PKTS_COUNTER |
boolean |
setBaudRateSCFQ(double rate)
Sets the baud rate that this scheduler will be sending packets at. |
protected void |
setMaxBufferSize(int maxSize)
This function sets the maximum buffer size |
boolean |
setRouterID(int routerID)
Sets the router ID that hosts this scheduler. |
boolean |
setWeights(double[] weights)
This method allows you to set different weights for different types of traffic. |
int |
size()
Determines the number of packets that are currently enqueued in this scheduler. |
abstract void |
updateStats()
Update the statistics of this scheduler to a file. |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface PacketScheduler |
---|
setBaudRate |
Constructor Detail |
---|
public FnbSCFQScheduler(String name, double baudRate, int max_buf_size, boolean stats) throws Exception
name
- Name of this schedulerbaudRate
- baud rate in bits/s of the port that is using
this scheduler.max_buf_size
- maximum buffer size for routersstats
- whether we want to store stats or not
Exception
- This happens when the name is null or
the baud rate <= 0public FnbSCFQScheduler(double baudRate, int max_buf_size, boolean stats) throws Exception
baudRate
- baud rate in bits/s of the port that is using
this scheduler.max_buf_size
- maximum buffer size for routersstats
- whether we want to store stats or not
Exception
- This happens when the baud rate <= 0public FnbSCFQScheduler(String name, int max_buf_size, boolean stats) throws Exception
PacketScheduler.setBaudRate(double)
before the simulation starts.
name
- Name of this schedulermax_buf_size
- maximum buffer size for routersstats
- whether we want to store stats or not
Exception
- This happens when the name is nullPacketScheduler.setBaudRate(double)
public FnbSCFQScheduler(boolean stats) throws Exception
PacketScheduler.setBaudRate(double)
before the simulation starts.
stats
- whether we want to store stats or not
Exception
- This happens when the name is nullPacketScheduler.setBaudRate(double)
public FnbSCFQScheduler(double baudRate, int max_buf_size) throws Exception
baudRate
- baud rate in bits/s of the port that is using
this scheduler.max_buf_size
- maximum buffer size for routers
Exception
- This happens when the baud rate <= 0public FnbSCFQScheduler(String name, int max_buf_size) throws Exception
PacketScheduler.setBaudRate(double)
before the simulation starts.
name
- Name of this schedulermax_buf_size
- maximum buffer size for routers
Exception
- This happens when the name is nullPacketScheduler.setBaudRate(double)
Method Detail |
---|
protected abstract void initialize()
public boolean setWeights(double[] weights)
weights
- a linear array of the weights to be assigned to different
classes of traffic.
public abstract boolean enque(Packet pnp)
enque
in interface PacketScheduler
pnp
- A Packet to be enqued by this scheduler.
protected boolean insertPacketIntoQueue(Packet pnp)
pnp
- A Packet to be enqued by this scheduler.
public Packet deque()
deque
in interface PacketScheduler
protected double pktListSize()
public boolean isEmpty()
isEmpty
in interface PacketScheduler
public int size()
size
in interface PacketScheduler
public int getSchedID()
getSchedID
in interface PacketScheduler
public String getSchedName()
getSchedName
in interface PacketScheduler
public boolean setBaudRateSCFQ(double rate)
rate
- the baud rate of this scheduler (in bits/s)
public double getBaudRate()
getBaudRate
in interface PacketScheduler
PacketScheduler.setBaudRate(double)
public boolean setRouterID(int routerID)
setRouterID
in interface PacketScheduler
routerID
- the router ID that hosts this scheduler
public int getRouterID()
getRouterID
in interface PacketScheduler
protected boolean makeRoomForPacket()
protected double getCounterDroppedPkts()
protected void resetCounterDroppedPkts()
protected double getMaxBufferSize()
protected double getMaxBufferSizeInPkts()
protected void setMaxBufferSize(int maxSize)
maxSize
- the new maximum buffer sizepublic void body()
body
in class Sim_entity
public abstract double getAvg()
protected void increaseDroppedPktCounter()
protected void insertGlID_userID(FnbDroppedPacketInfo info)
info
- a dropped packet infoprotected boolean checkDroppedGlList(int gl, int user)
gl
- the gridletuser
- user to which the gridlet belongs
public abstract void updateStats()
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |