ExampleCompoundPriorityQueue

Package: inet.tutorials.queueing

ExampleCompoundPriorityQueue

compound module

(no description)

classifier : WrrClassifier

Implements a weighted round-robin classifier.

Source:
classifier: WrrClassifier {
    @display("p=100,100");
} queue1 : PacketQueue

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

Source:
queue1: PacketQueue {
    @display("p=325,100");
} queue2 : PacketQueue

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

Source:
queue2: PacketQueue {
    @display("p=325,225");
} queue3 : PacketQueue

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

Source:
queue3: PacketQueue {
    @display("p=475,350");
} consumer : PassivePacketSink

A passive packet sink which is pushed with packets by the connected packet producer.

Source:
consumer: PassivePacketSink {
    @display("p=175,350");
} producer : ActivePacketSource

An active packet source which pushes packets into the connected module.

Source:
producer: ActivePacketSource {
    @display("p=325,350");
} scheduler : PriorityScheduler

This scheduler pulls packets from the first non-empty among its connected packet providers.

Source:
scheduler: PriorityScheduler {
    @display("p=550,100");
}

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.

Used in

Name Type Description
CompoundPacketQueueTutorialStep network (no description)

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 ::inet::queueing::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
classifier.weights string
queue1.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

queue1.packetCapacity int -1

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

queue1.dataCapacity int -1b

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

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

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

queue1.bufferModule string ""

Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default

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

queue2.packetCapacity int -1

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

queue2.dataCapacity int -1b

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

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

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

queue2.bufferModule string ""

Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default

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

queue3.packetCapacity int -1

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

queue3.dataCapacity int -1b

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

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

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

queue3.bufferModule string ""

Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default

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

consumer.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

consumer.initialConsumptionOffset double 0s

Initial duration before which packets are not consumed

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

consumer.scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

producer.displayStringTextFormat string "created %p pk (%l)"

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

producer.packetNameFormat string "%a-%c"

See directives in module documentation

producer.packetRepresentation string "byteCount"

Determines the chunk of the packet data

producer.packetProtocol string "unknown"
producer.packetLength int
producer.packetData int -1
producer.attachCreationTimeTag bool true
producer.attachIdentityTag bool true
producer.attachDirectionTag bool true
producer.clockModule string ""

Relative path of a module that implements IClock(1,2); optional

producer.initialProductionOffset double -1s

Initial duration before which packets are not produced. When negative, then produce packet in initialize()

producer.productionInterval double

Elapsed time between subsequent packets pushed to the connected packet consumer

producer.scheduleForAbsoluteTime bool true

When a clock is used, "relative" means that setting the clock will not affect the simulation time of the event

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

scheduler.reverseOrder bool false

Source code

module ExampleCompoundPriorityQueue extends CompoundPacketQueueBase
{
    parameters:
        @class(::inet::queueing::CompoundPacketQueueBase);
    submodules:
        classifier: WrrClassifier {
            @display("p=100,100");
        }
        queue1: PacketQueue {
            @display("p=325,100");
        }
        queue2: PacketQueue {
            @display("p=325,225");
        }
        queue3: PacketQueue {
            @display("p=475,350");
        }
        consumer: PassivePacketSink {
            @display("p=175,350");
        }
        producer: ActivePacketSource {
            @display("p=325,350");
        }
        scheduler: PriorityScheduler {
            @display("p=550,100");
        }
    connections:
        in --> { @display("m=w"); } --> classifier.in;
        classifier.out++ --> queue1.in;
        classifier.out++ --> queue2.in;
        classifier.out++ --> consumer.in;
        queue1.out --> scheduler.in++;
        queue2.out --> scheduler.in++;
        producer.out --> queue3.in;
        queue3.out --> scheduler.in++;
        scheduler.out --> { @display("m=e"); } --> out;
}

//-------------------------------------------------

File: tutorials/queueing/QueueingTutorial.ned