DSQueue2

Package: inet.examples.diffserv.onedomain

DSQueue2

compound module

Diffserv Queue used in Experiment 2.1 - 2.4.

classifier : BehaviorAggregateClassifier

Reads the DSCP (lower six bits of ToS/TrafficClass) from the received datagram, and forwards the...

Source:
classifier: BehaviorAggregateClassifier {
    dscps = "AF11 AF12 AF13";
    @display("p=100,200");
} red1 : RedDropper

Implements Random Early Detection (RED).

Source:
red1: RedDropper {
    collectionModule = "^.afQueue";
    @display("p=200,100");
} red2 : RedDropper

Implements Random Early Detection (RED).

Source:
red2: RedDropper {
    collectionModule = "^.afQueue";
    @display("p=200,200");
} red3 : RedDropper

Implements Random Early Detection (RED).

Source:
red3: RedDropper {
    collectionModule = "^.afQueue";
    @display("p=200,300");
} mux : PacketMultiplexer

Connects multiple packet producers to one packet consumer.

Source:
mux: PacketMultiplexer {
    @display("p=300,200");
} afQueue : PacketQueue

Implements a configurable packet queue, which is suitable for use in MAC protocols, traffic...

Source:
afQueue: PacketQueue {
    @display("p=400,200");
} beQueue : DropTailQueue

A limited packet queue that drops packets at the tail of the queue.

Source:
beQueue: DropTailQueue {
    @display("p=200,400");
} wrr : WrrScheduler

Implements weighted round-robin scheduling.

Source:
wrr: WrrScheduler {
    @display("p=500,300");
}

Usage diagram

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Extends

Name Type Description
CompoundPacketQueueBase 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

Properties

Name Value Description
class CompoundPacketQueueBase
display i=block/queue
defaultStatistic queueLength:vector

Gates

Name Direction Size Description
in input
out output

Signals

Name Type Unit Description
packetRemoved inet::Packet
packetPushStarted inet::Packet
packetDropped inet::Packet
packetPushEnded inet::Packet?
packetPulled inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode Description
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

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

droppedPacketsQueueOverflow dropped packets: queue overflow packetDropReasonIsQueueOverflow(localSignal(packetDropped)) count pk none

the statistical value is the packet that is dropped due to queue overflow

queueingTime queueing times queueingTime(localSignal(packetPulled)) histogram, vector s none

the statistical value is the queueing time of packets

incomingDataRate incoming datarate throughput(localSignal(packetPushStarted)) vector bps linear

the statistical value is the data rate of the incoming packets

flowQueueingTime flow queueing times queueingTime(demuxFlow(localSignal(packetPulled))) histogram, vector s none

the statistical value is the flow specific queueing time of packets

incomingPacketLengths incoming packet lengths packetLength(localSignal(packetPushStarted)) sum, histogram, vector b none

the statistical value is the length of the incoming packet

flowIncomingDataRate flow specific incoming data rate throughput(flowPacketLength(demuxFlow(localSignal(packetPushStarted)))) vector bps linear

the statistical value is the flow specific data rate of the incoming packets

outgoingDataRate outgoing datarate throughput(localSignal(packetPulled)) vector bps linear

the statistical value is the data rate of the outgoing packets

outgoingPacketLengths outgoing packet lengths packetLength(localSignal(packetPulled)) sum, histogram, vector b none

the statistical value is the length of the outgoing packet

droppedPacketLengthsQueueOverflow dropped packet lengths: queue overflow packetLength(packetDropReasonIsQueueOverflow(localSignal(packetDropped))) sum, vector b none

the statistical value is the length of the packet that is dropped due to queue overflow

flowOutgoingDataRate flow specific outgoing data rate throughput(flowPacketLength(demuxFlow(localSignal(packetPulled)))) vector bps linear

the statistical value is the flow specific data rate of the outgoing packets

incomingPackets incoming packets localSignal(packetPushStarted) count pk

the statistical value is the incoming packet

outgoingPackets outgoing packets localSignal(packetPulled) count pk

the statistical value is the outgoing packet

Unassigned submodule parameters

Name Type Default value Description
classifier.displayStringTextFormat string "classified %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

classifier.reverseOrder bool false
red1.displayStringTextFormat string "dropped %d/%p pk (%k/%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

red1.backpressure bool false
red1.wq double 0.002

Weight of the current queue length in the averaged queue length, in range [0.0, 1.0]

red1.minth double 5

Minimum threshold for average queue length

red1.maxth double 50

Maximum threshold for average queue length (=buffer capacity), in range (minth,packetCapacity]

red1.maxp double 0.02

Maximum value for pbs, in range [0.0, 1.0]

red1.pkrate double 150

Average packet rate for calculations when queue is empty

red1.useEcn bool false

If enabled, packets are marked with ECN if applicable

red1.packetCapacity int int(maxth)

Packets are dropped if queue length is greater

red2.displayStringTextFormat string "dropped %d/%p pk (%k/%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

red2.backpressure bool false
red2.wq double 0.002

Weight of the current queue length in the averaged queue length, in range [0.0, 1.0]

red2.minth double 5

Minimum threshold for average queue length

red2.maxth double 50

Maximum threshold for average queue length (=buffer capacity), in range (minth,packetCapacity]

red2.maxp double 0.02

Maximum value for pbs, in range [0.0, 1.0]

red2.pkrate double 150

Average packet rate for calculations when queue is empty

red2.useEcn bool false

If enabled, packets are marked with ECN if applicable

red2.packetCapacity int int(maxth)

Packets are dropped if queue length is greater

red3.displayStringTextFormat string "dropped %d/%p pk (%k/%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

red3.backpressure bool false
red3.wq double 0.002

Weight of the current queue length in the averaged queue length, in range [0.0, 1.0]

red3.minth double 5

Minimum threshold for average queue length

red3.maxth double 50

Maximum threshold for average queue length (=buffer capacity), in range (minth,packetCapacity]

red3.maxp double 0.02

Maximum value for pbs, in range [0.0, 1.0]

red3.pkrate double 150

Average packet rate for calculations when queue is empty

red3.useEcn bool false

If enabled, packets are marked with ECN if applicable

red3.packetCapacity int int(maxth)

Packets are dropped if queue length is greater

mux.displayStringTextFormat string "passed %p pk (%l)"

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

mux.forwardServiceRegistration bool true
mux.forwardProtocolRegistration bool true
afQueue.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

afQueue.packetCapacity int -1

Maximum number of packets in the queue, no limit by default

afQueue.dataCapacity int -1b

Maximum total length of packets in the queue, no limit by default

afQueue.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

afQueue.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

afQueue.bufferModule 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

Source code

//
// Diffserv Queue used in Experiment 2.1 - 2.4.
//
module DSQueue2 extends CompoundPacketQueueBase
{
    submodules:
        classifier: BehaviorAggregateClassifier {
            dscps = "AF11 AF12 AF13";
            @display("p=100,200");
        }
        red1: RedDropper {
            collectionModule = "^.afQueue";
            @display("p=200,100");
        }
        red2: RedDropper {
            collectionModule = "^.afQueue";
            @display("p=200,200");
        }
        red3: RedDropper {
            collectionModule = "^.afQueue";
            @display("p=200,300");
        }
        mux: PacketMultiplexer {
            @display("p=300,200");
        }
        afQueue: PacketQueue {
            @display("p=400,200");
        }
        beQueue: DropTailQueue {
            @display("p=200,400");
        }
        wrr: WrrScheduler {
            @display("p=500,300");
        }
    connections:
        in --> classifier.in;
        classifier.out++ --> red1.in;
        classifier.out++ --> red2.in;
        classifier.out++ --> red3.in;
        classifier.defaultOut --> beQueue.in;

        red1.out --> mux.in++;
        red2.out --> mux.in++;
        red3.out --> mux.in++;
        mux.out --> afQueue.in;
        beQueue.out --> wrr.in++;
        afQueue.out --> wrr.in++;
        wrr.out --> out;
}

File: examples/diffserv/onedomain/DSQueue2.ned