MultiTokenBucketMeter

Package: inet.queueing.meter

simple module MultiTokenBucketMeter

Labels packets according to the first token bucket that contains the required number of tokens. If no such token bucket is found then the default label is attached to the packet.

inet.queueing.meter.MultiTokenBucketMeterMultiTokenBucketMetersimple

Inheritance diagram

Known subclasses

Name

Type

Description

DualRateThreeColorMeter

simple module

This packet meter module measures the packet flow that is passing through using two token buckets. The meter attaches a LabelsTag to each packet with either green, yellow, or red color depending on which token bucket contains the required number of tokens for the packet.

SingleRateThreeColorMeter

simple module

This packet meter module measures the packet flow that is passing through using two token buckets. The meter attaches a LabelsTag to each packet with either green, yellow, or red color depending on which token bucket contains the required number of tokens for the packet.

Extends

Name

Type

Description

PacketMeterBase

simple module

Base module for various packet meter modules. Derived modules must implement a single meterPacket() function which meters the flow of and attaches the required tags.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“contains %n tk\nmetered %p pk (%l)”

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

buckets

object

Array of objects specifying the token buckets, see TokenBucketMeter(1,:ref:2 <neddoc-inet-queueing-meter-tokenbucketmeter>) for parameters

tokenConsumptionPerPacket

double

0

How many tokens are consumed per packet

tokenConsumptionPerBit

double

1

How many tokens are consumed per bit

defaultLabel

string

“”

The label that is attached to packets if there are not enough tokens in the bucket, no label by default

labelPriority

object

[]

The list of labels in the order of priority, if specified packets can only be promoted in this order

Properties

Name

Value

Description

class

MultiTokenBucketMeter

display

i=block/star

Gates

Name

Direction

Size

Description

in

input

out

output

Signals

Name

Type

Unit

Description

packetPulledIn

inet::Packet

packetPulledOut

inet::Packet

packetPushedIn

inet::Packet

packetPushedOut

inet::Packet

tokensChanged

double

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

flowIncomingDataRate

flow specific incoming data rate

throughput(demuxFlow(merge(packetPushedIn, packetPulledIn)))

vector

bps

linear

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

flowIncomingPacketLengths

flow specific incoming packet lengths

packetLength(demuxFlow(merge(packetPushedIn, packetPulledIn)))

sum,histogram,vector

b

none

the statistical value is the flow specific length of the incoming packet

flowOutgoingDataRate

flow specific outgoing data rate

throughput(demuxFlow(merge(packetPushedOut, packetPulledOut)))

vector

bps

linear

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

flowOutgoingPacketLengths

flow specific outgoing packet lengths

packetLength(demuxFlow(merge(packetPushedOut, packetPulledOut)))

sum,histogram,vector

b

none

the statistical value is the flow specific length of the outgoing packet

incomingDataRate

incoming data rate

throughput(merge(packetPushedIn, packetPulledIn))

vector

bps

linear

the statistical value is the data rate of the incoming packets

incomingPacketLengths

incoming packet lengths

packetLength(merge(packetPushedIn, packetPulledIn))

sum,histogram,vector

b

none

the statistical value is the length of the incoming packet

incomingPackets

incoming packets

merge(packetPushedIn, packetPulledIn)

count

pk

the statistical value is the incoming packet

numTokens

number of tokens

demux(tokensChanged)

vector

tk

linear

outgoingDataRate

outgoing data rate

throughput(merge(packetPushedOut, packetPulledOut))

vector

bps

linear

the statistical value is the data rate of the outgoing packets

outgoingPacketLengths

outgoing packet lengths

packetLength(merge(packetPushedOut, packetPulledOut))

sum,histogram,vector

b

none

the statistical value is the length of the outgoing packet

outgoingPackets

outgoing packets

merge(packetPushedOut, packetPulledOut)

count

pk

the statistical value is the outgoing packet

Source code

//
// Labels packets according to the first token bucket that contains
// the required number of tokens. If no such token bucket is found then the
// default label is attached to the packet.
//
simple MultiTokenBucketMeter extends PacketMeterBase like IPacketMeter
{
    parameters:
        object buckets; // Array of objects specifying the token buckets, see ~TokenBucketMeter for parameters
                        // example: [{initialNumTokens: 100, maxNumTokens: 1000, tokenProductionRate: 10, label: "green", excessTokenModule: ".other"}]
        double tokenConsumptionPerPacket = default(0); // How many tokens are consumed per packet
        double tokenConsumptionPerBit = default(1); // How many tokens are consumed per bit
        string defaultLabel = default(""); // The label that is attached to packets if there are not enough tokens in the bucket, no label by default
        object labelPriority = default([]); // The list of labels in the order of priority, if specified packets can only be promoted in this order
        displayStringTextFormat = default("contains %n tk\nmetered %p pk (%l)");
        @signal[tokensChanged](type=double);
        @statistic[numTokens](title="number of tokens"; source=demux(tokensChanged); record=vector; unit=tk; interpolationmode=linear);
        @class(MultiTokenBucketMeter);
}

File: src/inet/queueing/meter/MultiTokenBucketMeter.ned