Ieee8021qTimeAwareShaper

Package: inet.linklayer.ieee8021q

compound module Ieee8021qTimeAwareShaper

Implements the IEEE 802.1Q time aware shaper.

Ieee8021qTimeAwareShaperin --> classifier.inclassifier.out++ --> queue[i].in for i=0..numTrafficClasses - 1⦀queue[i].out --> transmissionSelectionAlgorithm[i].in for i=0..numTrafficClasses - 1⦀transmissionSelectionAlgorithm[i].out --> transmissionGate[i].in for i=0..numTrafficClasses - 1⦀transmissionGate[i].out --> transmissionSelection.in++ for i=0..numTrafficClasses - 1⦀transmissionSelection.out --> outbuffer: inet.queueing.contract.IPacketBuffer (like IPacketBuffer) IPacketBuffer: Interface for packet buffer modules. Source: buffer: <default("")> like IPacketBuffer if typename != "" { parameters: @display("p=100,225"); }buffergateControlList: inet.queueing.gate.GateControlList Configures multiple `PeriodicGate` modules according to a gate control list. Source: gateControlList: GateControlList if hasGcl { parameters: @display("p=100,350"); }gateControlListclassifier: inet.linklayer.ieee8021q.PcpTrafficClassClassifier (like IPacketClassifier) PcpTrafficClassClassifier: Classifies packets based on the attached PCP value [0, 7]. IPacketClassifier: Interface for packet classifier modules. Source: classifier: <default("PcpTrafficClassClassifier")> like IPacketClassifier { parameters: @display("p=100,100"); }classifierqueue[numTrafficClasses]: inet.queueing.queue.PacketQueue (like IPacketQueue) PacketQueue: Implements a configurable packet queue, which is suitable for use in MAC protocols, traffic condi... IPacketQueue: Interface for packet queue modules. Source: queue[numTrafficClasses]: <default("PacketQueue")> like IPacketQueue { parameters: bufferModule = default(exists(parent.buffer) ? "^.buffer" : ""); @display("p=300,100,column,125"); }queue[numTrafficClasses]transmissionSelectionAlgorithm[numTrafficClasses]: inet.queueing.contract.IPacketGate (like IPacketGate) IPacketGate: Interface for a packet gate. Source: transmissionSelectionAlgorithm[numTrafficClasses]: <default("")> like IPacketGate { parameters: @display("p=500,100,column,125"); }transmissionSelectionAlgorithm[numTrafficClasses]transmissionGate[numTrafficClasses]: inet.queueing.gate.PeriodicGate (like IPacketGate) PeriodicGate: Allows or forbids packets to pass through depending on whether the gate is open or closed. IPacketGate: Interface for a packet gate. Source: transmissionGate[numTrafficClasses]: <default("PeriodicGate")> like IPacketGate { parameters: @display("p=700,100,column,125"); }transmissionGate[numTrafficClasses]transmissionSelection: inet.queueing.scheduler.PriorityScheduler (like IPacketScheduler) PriorityScheduler: This scheduler pulls packets from the first non-empty among its connected packet providers. IPacketScheduler: Interface for packet scheduler modules. Source: transmissionSelection: <default("PriorityScheduler")> like IPacketScheduler { parameters: reverseOrder = default(true); @display("p=900,100"); }transmissionSelection

Usage diagram

Inheritance 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

numTrafficClasses

int

8

Number of traffic categories

bitrate

double

hasGcl

bool

false

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

inet::Packet

packetPulled

inet::Packet

packetPushEnded

inet::Packet?

packetPushStarted

inet::Packet

packetRemoved

inet::Packet

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

gateControlList.displayStringTextFormat

string

“”

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

gateControlList.durations

object

[]

List of entry durations, e.g. [4ms, 2ms, 2ms, 2ms]

gateControlList.gateStates

object

[]

List of gate states, e.g. [“10000000”, “01111111”, “10000000”, “01111111”]

gateControlList.numGates

int

8

Number of configured PeriodicGate modules

gateControlList.mapping

string

String specifying the gate index for the ith gate state, e.g. “76543210” means reverse gate index order

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

queue.packetCapacity

int

-1

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

queue.dataCapacity

int

-1b

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

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

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

queue.bufferModule

string

exists(parent.buffer) ? “^.buffer” : “”

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

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

transmissionGate.bitrate

double

nan bps

transmissionGate.extraLength

int

0b

transmissionGate.extraDuration

double

0s

transmissionGate.clockModule

string

“”

Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional

transmissionGate.initiallyOpen

bool

true

Specifies if the gate is initially open or closed

transmissionGate.offset

double

0s

Specifies where the period starts in the list of gate state change durations; where it is in the period at the start

transmissionGate.durations

object

[]

List of time durations within the period that determine if the gate is open or closed; period is the sum of the durations

transmissionGate.scheduleForAbsoluteTime

bool

true

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

transmissionGate.openSchedulingPriority

int

0

FES scheduling priority for the next gate open event

transmissionGate.closeSchedulingPriority

int

0

FES scheduling priority for the next gate close event

transmissionGate.enableImplicitGuardBand

bool

true

Implicit guard band means that a packet is not allowed to be forwarded if it cannot finish transmission before the end of window.

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

transmissionSelection.reverseOrder

bool

true

Source code

//
// Implements the IEEE 802.1Q time aware shaper.
//
module Ieee8021qTimeAwareShaper extends CompoundPacketQueueBase
{
    parameters:
        int numTrafficClasses = default(8); // Number of traffic categories
        double bitrate @unit(bps);
        bool hasGcl = default(false);
        *.bitrate = default(this.bitrate);
        *.extraLength = default(64b); // Overhead for Ethernet PHY header
    submodules:
        buffer: <default("")> like IPacketBuffer if typename != "" {
            parameters:
                @display("p=100,225");
        }
        gateControlList: GateControlList if hasGcl {
            parameters:
                @display("p=100,350");
        }
        classifier: <default("PcpTrafficClassClassifier")> like IPacketClassifier {
            parameters:
                @display("p=100,100");
        }
        queue[numTrafficClasses]: <default("PacketQueue")> like IPacketQueue {
            parameters:
                bufferModule = default(exists(parent.buffer) ? "^.buffer" : "");
                @display("p=300,100,column,125");
        }
        transmissionSelectionAlgorithm[numTrafficClasses]: <default("")> like IPacketGate {
            parameters:
                @display("p=500,100,column,125");
        }
        transmissionGate[numTrafficClasses]: <default("PeriodicGate")> like IPacketGate {
            parameters:
                @display("p=700,100,column,125");
        }
        transmissionSelection: <default("PriorityScheduler")> like IPacketScheduler {
            parameters:
                reverseOrder = default(true);
                @display("p=900,100");
        }
    connections:
        in --> { @display("m=w"); } --> classifier.in;
        for i = 0 .. numTrafficClasses - 1 {
            classifier.out++ --> queue[i].in;
            queue[i].out --> transmissionSelectionAlgorithm[i].in;
            transmissionSelectionAlgorithm[i].out --> transmissionGate[i].in;
            transmissionGate[i].out --> transmissionSelection.in++;
        }
        transmissionSelection.out --> { @display("m=e"); } --> out;
}

File: src/inet/linklayer/ieee8021q/Ieee8021qTimeAwareShaper.ned