PacketClassifierBase

Package: inet.queueing.base

PacketClassifierBase

simple module

This is a 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

Inheritance diagram

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

Known subclasses

Name Type Description
BehaviorAggregateClassifier simple module

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

ContentBasedClassifier simple module

This 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 filters. The first matching expression determines the index of the output gate.

EthernetFrameClassifier simple module

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

LabelClassifier simple module

This module classifies packets based on the attached labels in a LabelsTag.

MarkovClassifier simple module

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

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.

MultiTokenBucketClassifier simple module

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

PacketClassifier simple module

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

PcpClassifier simple module

This 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

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

PriorityClassifier simple module

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

StreamClassifier simple module

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

TokenBucketClassifier simple module

This 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

This module implements weighted round-robin classifier.

Extends

Name Type Description
PacketProcessorBase simple module

This is a 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

reverseOrder bool false

Properties

Name Value Description
display i=block/classifier
class PacketClassifierBase

Gates

Name Direction Size Description
in input
out [ ] output

Signals

Name Type Unit
packetPushed inet::Packet

Statistics

Name Title Source Record Unit Interpolation Mode
packetLengths packet lengths packetLength(packetPushed) sum, histogram, vector b none
dataRate data rate throughput(packetPushed) vector bps linear
packets packets packetPushed count pk

Source code

//
// This is a 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