PacketClassifierBase

Package: inet.queueing.base

simple module PacketClassifierBase

Base module for various packet classifier modules. Derived modules must implement a single packet classifier function which determines the index of the output gate for the next pushed packet.

See also: IPacketClassifier

inet.queueing.base.PacketClassifierBasePacketClassifierBasesimple

Inheritance diagram

Known subclasses

Name

Type

Description

EthernetFrameClassifier

simple module

Classifier that forwards Ethernet PAUSE frames to the pauseOut gate, and other frames to the defaultOut gate.

PcpClassifier

simple module

Classifies packets based on the attached PCP value [0, 7]. The PCP is determined by a PcpReq or a PcpInd or both. The output gate index is the ith value in the pcpToGateIndex parameter.

PcpTrafficClassClassifier

compound module

Classifies packets based on the attached PCP value [0, 7]. The PCP is determined by a PcpReq or a PcpInd or both. The output gate index is the value found in the mapping matrix using the PCP value as the row index and the number of connected consumers (traffic categories) as the column index.

BehaviorAggregateClassifier

simple module

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

MultiFieldClassifier

simple module

This classifier contains a list of filters that identifies the flows and determines their classes. Each filter can match the source and destination address, IP protocol number, source and destination ports, or ToS of the datagram. The first matching filter determines the index of the out gate. If no matching filter is found, then the packet will be sent through the defaultOut gate.

StreamClassifier

simple module

Classifies packets based on the stream they are part of. The stream is determined by a StreamReq or a StreamInd or both.

ContentBasedClassifier

simple module

Connects one packet producer to multiple packet consumers. It can be populated with packets from the connected packet producer. When this occurs, the classifier pushes the packet to one of its connected packet consumers based on the configured packet filters. The first matching expression determines the index of the output gate.

LabelClassifier

simple module

Classifies packets based on the attached labels in a LabelsTag.

MarkovClassifier

simple module

Implements a packet classifier using a Markov process that has as many states as output gates the classifier has. The output gate for a given packet is determined by the current state of the Markov process.

MultiTokenBucketClassifier

simple module

Classifies packets into the first bucket that contains the required number of tokens. The packet is forwarded to the output gate that corresponds to the selected bucket.

PacketClassifier

simple module

Connects one packet producer to multiple packet consumers. It can be pushed with packets from the connected packet producer. When this happens, the classifier pushes the packet to one of its connected packet consumers based on the configured packet classifier function. The packet classifier function takes a packet and returns an integer which in turn is used for determining the output gate.

PriorityClassifier

simple module

This classifier pushes packets into the first non-full among its connected packet consumers.

TokenBucketClassifier

simple module

Classifies packets to the first output gate if the bucket contains enough number of tokens for the packet passing through, otherwise the second output gate is used. The amount of required tokens is equal to the packet length in bits and is subtracted from the number of stored tokens. New tokens are generated with the provided constant rate and they may also be added by other modules.

WrrClassifier

simple module

Implements a weighted round-robin classifier.

Extends

Name

Type

Description

PacketProcessorBase

simple module

Base module for various packet processing modules which maintains a few statistics.

Parameters

Name

Type

Default value

Description

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

reverseOrder

bool

false

Properties

Name

Value

Description

class

PacketClassifierBase

display

i=block/classifier

Gates

Name

Direction

Size

Description

in

input

out [ ]

output

Signals

Name

Type

Unit

Description

packetPushed

inet::Packet

Statistics

Name

Title

Source

Record

Unit

Interpolation Mode

Description

dataRate

data rate

throughput(packetPushed)

vector

bps

linear

the statistical value is the data rate of the classified packets

packetLengths

packet lengths

packetLength(packetPushed)

sum,histogram,vector

b

none

the statistical value is the length of the classified packet

packets

packets

packetPushed

count

pk

the statistical value is the classified packet

Source code

//
// Base module for various packet classifier modules. Derived modules
// must implement a single packet classifier function which determines the index
// of the output gate for the next pushed packet.
//
// @see ~IPacketClassifier
//
simple PacketClassifierBase extends PacketProcessorBase
{
    parameters:
        bool reverseOrder = default(false);
        displayStringTextFormat = default("classified %p pk (%l)");
        @class(PacketClassifierBase);
        @display("i=block/classifier");
        @signal[packetPushed](type=inet::Packet);
        // the statistical value is the classified packet
        @statistic[packets](title="packets"; source=packetPushed; record=count; unit=pk);
        // the statistical value is the length of the classified packet
        @statistic[packetLengths](title="packet lengths"; source=packetLength(packetPushed); record=sum,histogram,vector; unit=b; interpolationmode=none);
        // the statistical value is the data rate of the classified packets
        @statistic[dataRate](title="data rate"; source=throughput(packetPushed); record=vector; unit=bps; interpolationmode=linear);
    gates:
        input in;
        output out[];
}

File: src/inet/queueing/base/PacketClassifierBase.ned