DiffservQueue¶
Package: inet.networklayer.diffserv
compound module DiffservQueue
This is an example queue that can be used in interfaces of DS core and edge nodes to support the AFxy (RFC 2597) and EF (RFC 3246) PHBs.
The incoming packets are first classified according to their DSCP field. DSCPs other than AFxy and EF are handled as BE (best effort).
EF packets are stored in a dedicated queue and served first when a packet is requested. Because they can preempt the other queues, the rate of the EF packets should be limited to a fraction of the bandwidth of the link. This is achieved by metering the EF traffic with a token bucket meter and dropping packets that do not conform to the traffic profile.
There are other queues for AFx classes and BE. The AFx queues use RED to implement 3 different drop priorities within the class. BE packets are stored in a drop-tail queue. Packets from AFxy and BE queues are scheduled by a WRR scheduler, which ensures that the remaining bandwidth is allocated among the classes according to the specified weights.
See also: AFxyQueue
Usage diagram¶
Inheritance diagram¶
Extends¶
Name |
Type |
Description |
|---|---|---|
compound module |
This compound module serves as a base module for complex packet queues formed by combining several queueing components. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“contains %p pk (%l) pushed %u created %c\n pulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
packetCapacity |
int |
-1 |
Maximum number of packets in the queue, no limit by default |
dataCapacity |
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
dropperClass |
string |
“” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
interfaceTableModule |
string |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
CompoundPacketQueueBase |
|
defaultStatistic |
queueLength:vector |
|
display |
i=block/queue |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
in |
input |
||
out |
output |
Signals¶
Name |
Type |
Unit |
Description |
|---|---|---|---|
packetDropped |
|||
packetPulled |
|||
packetPushEnded |
inet::Packet? |
||
packetPushStarted |
|||
packetRemoved |
Statistics¶
Name |
Title |
Source |
Record |
Unit |
Interpolation Mode |
Description |
|---|---|---|---|---|---|---|
droppedPacketLengthsQueueOverflow |
dropped packet lengths: queue overflow |
packetLength(packetDropReasonIsQueueOverflow(warmup(localSignal(packetDropped)))) |
sum,vector |
b |
none |
the statistical value is the length of the packet that is dropped due to queue overflow |
droppedPacketsQueueOverflow |
dropped packets: queue overflow |
packetDropReasonIsQueueOverflow(warmup(localSignal(packetDropped))) |
count |
pk |
none |
the statistical value is the packet that is dropped due to queue overflow |
flowIncomingDataRate |
flow specific incoming data rate |
throughput(flowPacketLength(demuxFlow(warmup(localSignal(packetPushStarted))))) |
vector |
bps |
linear |
the statistical value is the flow specific data rate of the incoming packets |
flowOutgoingDataRate |
flow specific outgoing data rate |
throughput(flowPacketLength(demuxFlow(warmup(localSignal(packetPulled))))) |
vector |
bps |
linear |
the statistical value is the flow specific data rate of the outgoing packets |
flowQueueingTime |
flow queueing times |
queueingTime(demuxFlow(warmup(localSignal(packetPulled)))) |
histogram,vector |
s |
none |
the statistical value is the flow specific queueing time of packets |
incomingDataRate |
incoming datarate |
throughput(warmup(localSignal(packetPushStarted))) |
vector |
bps |
linear |
the statistical value is the data rate of the incoming packets |
incomingPacketLengths |
incoming packet lengths |
packetLength(warmup(localSignal(packetPushStarted))) |
sum,histogram,vector |
b |
none |
the statistical value is the length of the incoming packet |
incomingPackets |
incoming packets |
warmup(localSignal(packetPushStarted)) |
count |
pk |
the statistical value is the incoming packet |
|
outgoingDataRate |
outgoing datarate |
throughput(warmup(localSignal(packetPulled))) |
vector |
bps |
linear |
the statistical value is the data rate of the outgoing packets |
outgoingPacketLengths |
outgoing packet lengths |
packetLength(warmup(localSignal(packetPulled))) |
sum,histogram,vector |
b |
none |
the statistical value is the length of the outgoing packet |
outgoingPackets |
outgoing packets |
warmup(localSignal(packetPulled)) |
count |
pk |
the statistical value is the outgoing packet |
|
queueBitLength |
queue bit length |
warmup(atomic(constant0(localSignal(packetPushEnded)) + sum(packetLength(localSignal(packetPushStarted))) - sum(packetLength(localSignal(packetPulled))) - sum(packetLength(localSignal(packetRemoved))) - sum(packetLength(localSignal(packetDropped))))) |
last,max,timeavg,vector |
b |
sample-hold |
the statistical value is the total bit length of all packets in the queue |
queueingTime |
queueing times |
queueingTime(warmup(localSignal(packetPulled))) |
histogram,vector |
s |
none |
the statistical value is the queueing time of packets |
queueLength |
queue length |
warmup(atomic(constant0(localSignal(packetPushEnded)) + count(localSignal(packetPushStarted)) - count(localSignal(packetPulled)) - count(localSignal(packetRemoved)) - count(localSignal(packetDropped)))) |
last,max,timeavg,vector |
pk |
sample-hold |
the statistical value is the number of packets in the queue |
Unassigned submodule parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
classifier.displayStringTextFormat |
string |
“{classifierStatus}” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
classifier.reverseOrder |
bool |
false |
|
efMeter.displayStringTextFormat |
string |
“{meterStatus}” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
efMeter.interfaceTableModule |
string |
The path to the InterfaceTable module |
|
efMeter.cir |
string |
“10%” |
Committed information rate, either absolute bitrate (e.g. “100kbps”) or relative to the link’s datarate (e.g. “20%”) |
efMeter.cbs |
int |
5000B |
Committed burst size |
efMeter.colorAwareMode |
bool |
false |
Enables color-aware mode |
sink.displayStringTextFormat |
string |
“received %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
sink.clockModule |
string |
“” |
Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional |
sink.initialConsumptionOffset |
double |
0s |
Initial duration before which packets are not consumed |
sink.consumptionInterval |
double |
0s |
Elapsed time between subsequent packets allowed to be pushed by the connected packet producer, 0 means any number of packets can be pushed at the same simulation time |
sink.scheduleForAbsoluteTime |
bool |
true |
When a clock is used, “relative” means that setting the clock will not affect the simulation time of the event |
efQueue.displayStringTextFormat |
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
efQueue.packetCapacity |
int |
5 |
Maximum number of packets in the queue, no limit by default |
efQueue.dataCapacity |
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
efQueue.dropperClass |
string |
“inet::queueing::PacketAtCollectionEndDropper” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
efQueue.comparatorClass |
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
efQueue.bufferModule |
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“passed %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
true |
||
bool |
true |
||
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
int |
-1 |
Maximum number of packets in the queue, no limit by default |
|
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
|
string |
“” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“passed %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
true |
||
bool |
true |
||
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
int |
-1 |
Maximum number of packets in the queue, no limit by default |
|
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
|
string |
“” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“passed %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
true |
||
bool |
true |
||
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
int |
-1 |
Maximum number of packets in the queue, no limit by default |
|
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
|
string |
“” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
false |
||
double |
150 |
Average packet rate for calculations when queue is empty |
|
bool |
false |
If enabled, packets are marked with ECN if applicable |
|
int |
int(maxth) |
Packets are dropped if queue length is greater |
|
string |
“passed %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
bool |
true |
||
bool |
true |
||
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
|
int |
-1 |
Maximum number of packets in the queue, no limit by default |
|
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
|
string |
“” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
|
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
|
beQueue.displayStringTextFormat |
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
beQueue.packetCapacity |
int |
100 |
Maximum number of packets in the queue, no limit by default |
beQueue.dataCapacity |
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
beQueue.dropperClass |
string |
“inet::queueing::PacketAtCollectionEndDropper” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
beQueue.comparatorClass |
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
beQueue.bufferModule |
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
wrr.displayStringTextFormat |
string |
“scheduled %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
wrr.reverseOrder |
bool |
false |
|
wrr.weights |
string |
“1 1 1 1 1” |
|
priority.displayStringTextFormat |
string |
“scheduled %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
priority.reverseOrder |
bool |
false |
Source code¶
//
// This is an example queue that can be used in
// interfaces of DS core and edge nodes to support
// the AFxy (RFC 2597) and EF (RFC 3246) PHBs.
//
// The incoming packets are first classified according to
// their DSCP field. DSCPs other than AFxy and EF are handled
// as BE (best effort).
//
// EF packets are stored in a dedicated queue and served first
// when a packet is requested. Because they can preempt the other
// queues, the rate of the EF packets should be limited to a fraction
// of the bandwidth of the link. This is achieved by metering the EF
// traffic with a token bucket meter and dropping packets that
// do not conform to the traffic profile.
//
// There are other queues for AFx classes and BE. The AFx queues
// use RED to implement 3 different drop priorities within the class.
// BE packets are stored in a drop-tail queue.
// Packets from AFxy and BE queues are scheduled by a WRR scheduler,
// which ensures that the remaining bandwidth is allocated among the classes
// according to the specified weights.
//
// @see ~AFxyQueue
//
module DiffservQueue extends CompoundPacketQueueBase
{
parameters:
string interfaceTableModule;
*.interfaceTableModule = default(absPath(this.interfaceTableModule));
submodules:
classifier: BehaviorAggregateClassifier {
dscps = "EF AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43";
@display("p=100,330");
}
efMeter: TokenBucketMeter {
cir = default("10%"); // Reserved EF bandwidth as a percentage of the datarate of the interface
cbs = default(5000B); // 5 1000B packets
@display("p=250,130");
}
sink: PassivePacketSink {
@display("p=400,80");
}
efQueue: DropTailQueue {
packetCapacity = default(5); // Keep low for low delay and jitter
@display("p=400,180");
}
af1xQueue: AFxyQueue {
@display("p=250,230");
}
af2xQueue: AFxyQueue {
@display("p=250,330");
}
af3xQueue: AFxyQueue {
@display("p=250,430");
}
af4xQueue: AFxyQueue {
@display("p=250,530");
}
beQueue: DropTailQueue {
@display("p=250,630");
}
wrr: WrrScheduler {
weights = default("1 1 1 1 1");
@display("p=400,330");
}
priority: PriorityScheduler {
@display("p=550,330");
}
connections:
in --> classifier.in;
classifier.out++ --> efMeter.in;
classifier.out++ --> af1xQueue.afx1In;
classifier.out++ --> af1xQueue.afx2In;
classifier.out++ --> af1xQueue.afx3In;
classifier.out++ --> af2xQueue.afx1In;
classifier.out++ --> af2xQueue.afx2In;
classifier.out++ --> af2xQueue.afx3In;
classifier.out++ --> af3xQueue.afx1In;
classifier.out++ --> af3xQueue.afx2In;
classifier.out++ --> af3xQueue.afx3In;
classifier.out++ --> af4xQueue.afx1In;
classifier.out++ --> af4xQueue.afx2In;
classifier.out++ --> af4xQueue.afx3In;
classifier.defaultOut --> beQueue.in;
efMeter.greenOut --> { @display("ls=green"); } --> efQueue.in;
efMeter.redOut --> { @display("ls=red"); } --> sink.in;
af1xQueue.out --> wrr.in++;
af2xQueue.out --> wrr.in++;
af3xQueue.out --> wrr.in++;
af4xQueue.out --> wrr.in++;
beQueue.out --> wrr.in++;
efQueue.out --> priority.in++;
wrr.out --> priority.in++;
priority.out --> out;
}