gov.nist.antd.mpls.mgmt.mpls_interface
Class MPLSQueue

java.lang.Object
  |
  +--gov.nist.antd.diffserv.SimplePacketQueue
        |
        +--gov.nist.antd.mpls.mgmt.mpls_interface.MPLSQueue
Direct Known Subclasses:
MPLSDropTailQueue, MPLSREDQueue

public abstract class MPLSQueue
extends SimplePacketQueue

This abstract class inherits the SimplePacketQueue, and is used to implement various MPLS queues (e.g. TropTail, RED, RIO). It contains various information for the packet processing in the MPLS-queue. It also contains variables of queue statics for the performance of the queuing function.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
EunHyuk Lim (ehlim@antd.nist.gov, othree28@hotmail.com)
, borchert , Chul Kim , rouil

Field Summary
 double BitRate
          Field BitRate - Bit rate
 int BufferSize
          Field BufferSize - Buffer size
 boolean debug
          Field debug - Debug flag
 int dequeueCount
          Field dequeueCount - Dequeued packet count
 double dropBytes
          Field dropBytes - Dropped packet bytes count
 int dropCount
          Field dropCount - Packet drop count
 java.lang.String HostID
          Field HostID - Host ID
 double incomingBytes
          Field incomingBytes - Incoming packet bytes count
 int incomingCount
          Field incomingCount - Incoming packet Count
 boolean isActive
          Field isActive - Flag for activation
 boolean isWFQ
          Field isWFQ - WFQ flag
 Host localHost
          Field localHost - Local Host object
 MPLSInterfaceInfo mplsInterfaceInfo
          Field mplsInterfaceInfo - MPLS Interface Information
 double nextEFt
          Field nextEFt - Next EFt
 double outgoingBytes
          Field outgoingBytes - Outgoing Packet bytes
 int outgoingCount
          Field outgoingCount - Outgoing packet count
 double prevdropBytes
          Field prevdropBytes - Previous dropped packet bytes
 int prevdropCount
          Field prevdropCount - Previous dropped packet count
 double prevEFt
          Field prevEFt - Prevous EFt
 double previncomingBytes
          Field previncomingBytes - Previous incoming packet bytes count
 int previncomingCount
          Field previncomingCount - Previous incoming packet count
 double prevoutgoingBytes
          Field prevoutgoingBytes - Previous outgoing packet bytes
 int prevoutgoingCount
          Field prevoutgoingCount - Previous outgoing packet count
 int Priority
          Field Priority - Queue Priority
 double Rx
          Field Rx - Receive Rate
 MPLSPacketScheduler Scheduler
          Field Scheduler - Packet Scheduler object
(package private)  double SumOfWeight
          Field SumOfWeight - XXX
 double totalQueueingDelay
          Field totalQueueingDelay - Total queueing delay
 double Weight
          Field Weight - WFQ's weight value
 
Fields inherited from class gov.nist.antd.diffserv.SimplePacketQueue
 
Constructor Summary
MPLSQueue()
          Constructor MPLSQueue
 
Method Summary
 void calculatEFtForWFQ(ProtocolMessage message)
          Weighted Fair Queue Scheduling.
 boolean configWFQParms(double pdr, double Rate)
          Method configWFQParms Set the WFQ parameters with PDR and rate
 boolean configWFQParms(double pdr, double cdr, double C, double sW)
          Method configWFQParms Set the WFQ parameters
 MessageWrapper dequeue()
          Dequeues the queue.
 void displayQueueInfo()
          Method displayQueueInfo
 boolean enqueue(ProtocolMessage message, ProtocolSession fromSession)
          Enqueue the given message.
 double getAvgQueueingDelay()
          Method getAvgQueueingDelay Get the Average Queueing delay
 double getDropPacketBytes()
          Method getDropPacketBytes Get the dropped packet bytes
 int getDropPacketCount()
          Method getDropPacketCount Get the Dropped packet count
 double getIncomingPacketBytes()
          Method getIncomingPacketBytes Get the incoming packet bytes count
 int getIncomingPacketCount()
          Method getIncomingPacketCount Get the incoming packet count
 double getOutgoingPacketBytes()
          Method getOutgoingPacketBytes Get the outgoing packet bytes count
 int getOutgoingPacketCount()
          Method getOutgoingPacketCount Get the outgoing packet count
 void init(MPLSInterfaceInfo minfo)
          Initializes the queue.
 void setBitRate(double bitrate)
          Method setBitRate Set Bitrate
 void setBufferSize(int size)
          Method setBufferSize Set the buffersize
 void setPriorityWeight(int priority, double weight)
          Method setPriorityWeight Set the priority and weight value
 void setScheduler(MPLSPacketScheduler scheduler)
          Method setScheduler Set Scheduler to this queue
 void setupWFQParms(double C, double W, double sW)
          Method setupWFQParms
 java.lang.String toString()
          Method toString
 
Methods inherited from class gov.nist.antd.diffserv.SimplePacketQueue
getAvailableQLength, getFirstPacket, getMaxSize, getQLength, init, isEmpty, isFull, reset, setMaxSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mplsInterfaceInfo

public MPLSInterfaceInfo mplsInterfaceInfo
Field mplsInterfaceInfo - MPLS Interface Information


localHost

public Host localHost
Field localHost - Local Host object


HostID

public java.lang.String HostID
Field HostID - Host ID


isActive

public boolean isActive
Field isActive - Flag for activation


debug

public boolean debug
Field debug - Debug flag


BufferSize

public int BufferSize
Field BufferSize - Buffer size


BitRate

public double BitRate
Field BitRate - Bit rate


Priority

public int Priority
Field Priority - Queue Priority


isWFQ

public boolean isWFQ
Field isWFQ - WFQ flag


Weight

public double Weight
Field Weight - WFQ's weight value


prevEFt

public double prevEFt
Field prevEFt - Prevous EFt


nextEFt

public double nextEFt
Field nextEFt - Next EFt


Rx

public double Rx
Field Rx - Receive Rate


Scheduler

public MPLSPacketScheduler Scheduler
Field Scheduler - Packet Scheduler object


incomingCount

public int incomingCount
Field incomingCount - Incoming packet Count


incomingBytes

public double incomingBytes
Field incomingBytes - Incoming packet bytes count


previncomingCount

public int previncomingCount
Field previncomingCount - Previous incoming packet count


previncomingBytes

public double previncomingBytes
Field previncomingBytes - Previous incoming packet bytes count


dropCount

public int dropCount
Field dropCount - Packet drop count


dropBytes

public double dropBytes
Field dropBytes - Dropped packet bytes count


prevdropCount

public int prevdropCount
Field prevdropCount - Previous dropped packet count


prevdropBytes

public double prevdropBytes
Field prevdropBytes - Previous dropped packet bytes


outgoingCount

public int outgoingCount
Field outgoingCount - Outgoing packet count


outgoingBytes

public double outgoingBytes
Field outgoingBytes - Outgoing Packet bytes


prevoutgoingCount

public int prevoutgoingCount
Field prevoutgoingCount - Previous outgoing packet count


prevoutgoingBytes

public double prevoutgoingBytes
Field prevoutgoingBytes - Previous outgoing packet bytes


dequeueCount

public int dequeueCount
Field dequeueCount - Dequeued packet count


totalQueueingDelay

public double totalQueueingDelay
Field totalQueueingDelay - Total queueing delay


SumOfWeight

double SumOfWeight
Field SumOfWeight - XXX

Constructor Detail

MPLSQueue

public MPLSQueue()
Constructor MPLSQueue

Method Detail

init

public void init(MPLSInterfaceInfo minfo)
Initializes the queue.

Parameters:
minfo - the MPLSInterfaceInfo

setScheduler

public void setScheduler(MPLSPacketScheduler scheduler)
Method setScheduler Set Scheduler to this queue

Parameters:
scheduler -

setBufferSize

public void setBufferSize(int size)
Method setBufferSize Set the buffersize

Parameters:
size -

setBitRate

public void setBitRate(double bitrate)
Method setBitRate Set Bitrate

Parameters:
bitrate -

setPriorityWeight

public void setPriorityWeight(int priority,
                              double weight)
Method setPriorityWeight Set the priority and weight value

Parameters:
priority -
weight -

enqueue

public boolean enqueue(ProtocolMessage message,
                       ProtocolSession fromSession)
Enqueue the given message.

Overrides:
enqueue in class SimplePacketQueue
Parameters:
message - The message to enqueue
fromSession - The originating session
Returns:
boolean - True if success

dequeue

public MessageWrapper dequeue()
Dequeues the queue.

Overrides:
dequeue in class SimplePacketQueue
Returns:
The wrapper that contains the message.

setupWFQParms

public void setupWFQParms(double C,
                          double W,
                          double sW)
Method setupWFQParms

Parameters:
C - - aggregated bandwidth
W - - Weight for the Queue
sW - - Sum of weights

configWFQParms

public boolean configWFQParms(double pdr,
                              double cdr,
                              double C,
                              double sW)
Method configWFQParms Set the WFQ parameters

Parameters:
pdr - - Peak Data Rate
cdr - - Committed Data Rate
C - - Aggregated bandwidth
sW - - Sum of weights
Returns:
boolean - True if the Relative bandwidth is not the same with calculated rate

configWFQParms

public boolean configWFQParms(double pdr,
                              double Rate)
Method configWFQParms Set the WFQ parameters with PDR and rate

Parameters:
pdr - - Peak Data Rate
Rate -
Returns:
boolean

calculatEFtForWFQ

public void calculatEFtForWFQ(ProtocolMessage message)
Weighted Fair Queue Scheduling. Find a packet with smallest EFt(estimated finish time). For this processing, each queue with "DSPktSched_WFQ" flag set maintains the variable "nextPckEFt". EFt is calculated for each packet at its arrival by the enque() method. For a queue weight wx and aggregated bandwidth C, relative bandwidth for queue x : Rx = C * wx /(sumi wi). For a packet Pi of size Bi, arrived at ti, the estimated EFt(Pi) = St(Pi) + Tt(Pi) where transmission start time St(Pi) = Max[EFt(Pi-1), ti] packet transmission time Tt(Pi) = Bi / Rx;
The nextPckEFt variable is set by deque() method if there is next packet to send. If there is no packet to send, nextPckEFt = INF (infinity value).

Parameters:
message -

getIncomingPacketCount

public int getIncomingPacketCount()
Method getIncomingPacketCount Get the incoming packet count

Returns:
int - Imconign packet count

getIncomingPacketBytes

public double getIncomingPacketBytes()
Method getIncomingPacketBytes Get the incoming packet bytes count

Returns:
double

getDropPacketCount

public int getDropPacketCount()
Method getDropPacketCount Get the Dropped packet count

Returns:
int

getDropPacketBytes

public double getDropPacketBytes()
Method getDropPacketBytes Get the dropped packet bytes

Returns:
double

getOutgoingPacketCount

public int getOutgoingPacketCount()
Method getOutgoingPacketCount Get the outgoing packet count

Returns:
int

getOutgoingPacketBytes

public double getOutgoingPacketBytes()
Method getOutgoingPacketBytes Get the outgoing packet bytes count

Returns:
double

getAvgQueueingDelay

public double getAvgQueueingDelay()
Method getAvgQueueingDelay Get the Average Queueing delay

Returns:
double

displayQueueInfo

public void displayQueueInfo()
Method displayQueueInfo


toString

public java.lang.String toString()
Method toString

Overrides:
toString in class java.lang.Object