forest-net
an overlay networks for large-scale virtual worlds
|
The QuManager class, manages a set of queues for each of the links in a router. More...
#include <QuManager.h>
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 | |
LinkInfo * | lnkInfo |
lnkInfo[lnk] hold info on lnk | |
QuInfo * | quInfo |
quInfo[q] is information for q | |
DheapSet< uint64_t > * | hset |
set of heaps for pkt scheduler | |
PacketStore * | ps |
pointer to packet store object | |
StatsModule * | sm |
pointer to statistics module | |
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.
int forest::QuManager::allocQ | ( | int | lnk) |
Allocate a queue and assign it to a link.
lnk | is the link to be assigned a new queue. |
Definition at line 74 of file QuManager.cpp.
int forest::QuManager::deq | ( | int & | lnk, |
uint64_t | now | ||
) |
Dequeue the next packet that is ready to go out.
now | is the current time |
lnk | is a reference argument; on a successful return, it is set to the number of the link on which the packet should be sent |
Definition at line 160 of file QuManager.cpp.
bool forest::QuManager::enq | ( | int | px, |
int | qid, | ||
uint64_t | now | ||
) |
Enqueue a packet.
p | is the packet number of the packet to be queued |
q | is the the qid for the queue for the packet |
now | is the current time |
Definition at line 107 of file QuManager.cpp.
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.