forest-net
an overlay networks for large-scale virtual worlds
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
forest::QuManager Class Reference

The QuManager class, manages a set of queues for each of the links in a router. More...

#include <QuManager.h>

Collaboration diagram for forest::QuManager:

Classes

struct  LinkInfo
 
struct  QuInfo
 

Public Member Functions

 QuManager (int, int, int, int, PacketStore *, StatsModule *)
 
bool validQ (int) const
 
int allocQ (int)
 Allocate a queue and assign it to a link. More...
 
void freeQ (int)
 Free a queue. More...
 
bool setLinkRates (int, RateSpec &)
 
bool setQRates (int, RateSpec &)
 
bool setQLimits (int, int, int)
 
bool enq (int, int, uint64_t)
 Enqueue a packet. More...
 
int deq (int &, uint64_t)
 Dequeue the next packet that is ready to go out. More...
 

Private Attributes

int nL
 number of links
 
int nP
 total # of packets in the system
 
int nQ
 number of queues per link
 
int maxppl
 max # of packets per link
 
int qCnt
 number of allocated queues
 
ListSet * queues
 collection of lists of packets
 
int free
 first queue in the free list
 
Dheap< uint64_t > * active
 active queues, ordered by due time
 
Dheap< uint64_t > * vactive
 virtually active queues
 
mutex mtx
 to make all operations atomic
 
LinkInfolnkInfo
 lnkInfo[lnk] hold info on lnk
 
QuInfoquInfo
 quInfo[q] is information for q
 
DheapSet< uint64_t > * hset
 set of heaps for pkt scheduler
 
PacketStoreps
 pointer to packet store object
 
StatsModulesm
 pointer to statistics module
 

Detailed Description

The QuManager class, manages a set of queues for each of the links in a router.

This version provides a separate WDRR scheduler for each link. Queues for each link are numbered 1,2,... and each queue has quantum, which represents the number of "new" bytes an active queue may send each time it is visited by the packet scheduler.

Definition at line 47 of file QuManager.h.

Member Function Documentation

int forest::QuManager::allocQ ( int  lnk)

Allocate a queue and assign it to a link.

Parameters
lnkis the link to be assigned a new queue.
Returns
the qid of the assigned queue, or 0 no queues are available

Definition at line 74 of file QuManager.cpp.

Here is the caller graph for this function:

int forest::QuManager::deq ( int &  lnk,
uint64_t  now 
)

Dequeue the next packet that is ready to go out.

Parameters
nowis the current time
lnkis a reference argument; on a successful return, it is set to the number of the link on which the packet should be sent
Returns
the packet number of the packet to be sent, or 0 if there are no links that are ready to send a packet

Definition at line 160 of file QuManager.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool forest::QuManager::enq ( int  px,
int  qid,
uint64_t  now 
)

Enqueue a packet.

Parameters
pis the packet number of the packet to be queued
qis the the qid for the queue for the packet
nowis the current time
Returns
true on success, false on failure; the operation can fail if the qid is invalid, if the queue is already full, or the link is at its limit for packets queued

Definition at line 107 of file QuManager.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void forest::QuManager::freeQ ( int  qid)

Free a queue.

If the specified queue is empty, it is immediately returned to the free list. Otherwise, it is marked so that no new packets can be queued. When all existing packets have been sent, the queue will be returned to the free list.

Definition at line 90 of file QuManager.cpp.


The documentation for this class was generated from the following files: