|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object SCFQScheduler
public class SCFQScheduler
SCFQScheduler 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.
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.
Constructor Summary | |
---|---|
SCFQScheduler()
Creates a new packet scheduler with the name "SCFQScheduler". |
|
SCFQScheduler(double baudRate)
Creates a new SCFQ packet scheduler with the specified baud rate (bits/s). |
|
SCFQScheduler(String name)
Creates a new SCFQ packet scheduler with the specified name. |
|
SCFQScheduler(String name,
double baudRate)
Creates a new SCFQ packet scheduler with the specified name and baud rate (in bits/s). |
Method Summary | |
---|---|
Packet |
deque()
The method deque() has to decide which queue is to be served next. |
boolean |
enque(Packet pnp)
Puts a packet into the queue |
double |
getBaudRate()
Returns the baud rate of the egress port that is using this scheduler. |
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. |
boolean |
isEmpty()
Determines whether the scheduler is currently keeping any packets in its queue(s). |
boolean |
setBaudRate(double rate)
Sets the baud rate that this scheduler will be sending packets at. |
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. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SCFQScheduler(String name, double baudRate) throws ParameterException
name
- Name of this schedulerbaudRate
- baud rate in bits/s of the port that is using
this scheduler.
ParameterException
- This happens when the name is null or
the baud rate <= 0public SCFQScheduler(double baudRate) throws ParameterException
baudRate
- baud rate in bits/s of the port that is using
this scheduler.
ParameterException
- This happens when the baud rate <= 0public SCFQScheduler(String name) throws ParameterException
PacketScheduler.setBaudRate(double)
before the simulation starts.
name
- Name of this scheduler
ParameterException
- This happens when the name is nullPacketScheduler.setBaudRate(double)
public SCFQScheduler() throws ParameterException
PacketScheduler.setBaudRate(double)
before the simulation starts.
ParameterException
- This happens when the name is nullPacketScheduler.setBaudRate(double)
Method Detail |
---|
public boolean setWeights(double[] weights)
weights
- a linear array of the weights to be assigned to different
classes of traffic.
public boolean enque(Packet pnp)
enque
in interface PacketScheduler
pnp
- A Packet to be enqued by this scheduler.
public Packet deque()
deque
in interface PacketScheduler
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 setBaudRate(double rate)
setBaudRate
in interface PacketScheduler
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
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |