Ieee8021qFilter

Package: inet.linklayer.ieee8021q

Ieee8021qFilter

compound module

Implements the IEEE 802.1Q per-stream filtering and policing. The relationship between streams, gates, and meters is not one-to-one. The number of streams, gates, and meters can be different, and the module will take care of the connections between the submodules based on the streamFilterTable parameter.

In order to define the behavior of a default path, you can add an entry to the streamFilterTable that matches all streams: {stream: "*", gate: n, meter: n}

classifier : like IPacketClassifier

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

IPacketClassifier: Interface for packet classifier modules.

Source:
classifier: <default("PriorityClassifier")> like IPacketClassifier {
    @display("p=100,100");
} streamFilter[numStreams] : like IPacketFilter

StreamFilter: Implements a packet filter using solely the stream name.

IPacketFilter: Interface for packet filter modules.

Source:
streamFilter[numStreams]: <default("StreamFilter")> like IPacketFilter {
    backpressure = default(true);
    streamNameFilter = default(parent.streamFilterTable.get(index).get("stream"));
    @display("p=300,100,column,150");
} sm[numGates] : PacketMultiplexer

Connects multiple packet producers to one packet consumer.

Source:
sm[numGates]: PacketMultiplexer {
    displayStringTextFormat = default("");
    @display("p=500,100,column,150");
} gateFilter[numGates] : like IPacketFilter

BackPressureBasedFilter: Implements a packet filter that drops packets when the following module (consumer) does not allow...

IPacketFilter: Interface for packet filter modules.

Source:
gateFilter[numGates]: <default("BackPressureBasedFilter")> like IPacketFilter {
    @display("p=700,100,column,150");
} gate[numGates] : like IPacketGate

InteractiveGate: This packet gate module allows or forbids packets to pass through depending on whether the gate is...

IPacketGate: Interface for a packet gate.

Source:
gate[numGates]: <default("InteractiveGate")> like IPacketGate {
    @display("p=900,100,column,150");
} gc[numGates] : like IPacketClassifier

StreamClassifier: Classifies packets based on the stream they are part of.

IPacketClassifier: Interface for packet classifier modules.

Source:
gc[numGates]: <default("StreamClassifier")> like IPacketClassifier {
    displayStringTextFormat = default("");
    @display("p=1100,100,column,150;i=-;b=10,10,oval,grey,,1");
} gm[numMeters] : PacketMultiplexer

Connects multiple packet producers to one packet consumer.

Source:
gm[numMeters]: PacketMultiplexer {
    displayStringTextFormat = default("");
    @display("p=1300,100,column,150");
} meter[numMeters] : like IPacketMeter

DualRateThreeColorMeter: This packet meter module measures the packet flow that is passing through using two token buckets.

IPacketMeter: Interface for packet meter modules.

Source:
meter[numMeters]: <default("DualRateThreeColorMeter")> like IPacketMeter {
    @display("p=1500,100,column,150");
} flowFilter[numMeters] : like IPacketFilter

LabelFilter: This packet filter module drops packets that don't match the given packet label filter criteria.

IPacketFilter: Interface for packet filter modules.

Source:
flowFilter[numMeters]: <default("LabelFilter")> like IPacketFilter {
    labelFilter = default("green");
    @display("p=1700,100,column,150");
} multiplexer : PacketMultiplexer

Connects multiple packet producers to one packet consumer.

Source:
multiplexer: PacketMultiplexer {
    @display("p=1900,100");
} barrier : BackPressureBarrier

Prevents backpressure propagation from its output to its input and vice versa.

Source:
barrier: BackPressureBarrier {
    @display("p=2100,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.

Parameters

Name Type Default value Description
numStreams int

The number of different streams to filter for

numGates int

The number of gates

numMeters int

The number of traffic meters

streamFilterTable object

An array of objects where each object contains a stream name, gate index, and meter index, for example: [{stream: "s0", gate: 0, meter: 0}, ...]

Properties

Name Value Description
display i=block/filter

Gates

Name Direction Size Description
in input
out output

Unassigned submodule parameters

Name Type Default value Description
sm.displayStringTextFormat string ""

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

sm.forwardServiceRegistration bool true
sm.forwardProtocolRegistration bool true
gm.displayStringTextFormat string ""

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

gm.forwardServiceRegistration bool true
gm.forwardProtocolRegistration bool true
multiplexer.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

multiplexer.forwardServiceRegistration bool true
multiplexer.forwardProtocolRegistration bool true
barrier.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

Source code

//
// Implements the IEEE 802.1Q per-stream filtering and policing.
// The relationship between streams, gates, and meters is not one-to-one. The
// number of streams, gates, and meters can be different, and the module will take
// care of the connections between the submodules based on the `streamFilterTable`
// parameter.
//
// In order to define the behavior of a default path, you can add an entry to the
// `streamFilterTable` that matches all streams:
// {stream: "*", gate: n, meter: n}
//
module Ieee8021qFilter like IPacketFilter
{
    parameters:
        int numStreams; // The number of different streams to filter for
        int numGates; // The number of gates
        int numMeters; // The number of traffic meters
        object streamFilterTable; // An array of objects where each object contains a stream name, gate index, and meter index, for example: [{stream: "s0", gate: 0, meter: 0}, ...]
        @display("i=block/filter");
    gates:
        input in;
        output out;
    submodules:
        classifier: <default("PriorityClassifier")> like IPacketClassifier {
            @display("p=100,100");
        }
        streamFilter[numStreams]: <default("StreamFilter")> like IPacketFilter {
            backpressure = default(true);
            streamNameFilter = default(parent.streamFilterTable.get(index).get("stream"));
            @display("p=300,100,column,150");
        }
        sm[numGates]: PacketMultiplexer {
            displayStringTextFormat = default("");
            @display("p=500,100,column,150");
        }
        gateFilter[numGates]: <default("BackPressureBasedFilter")> like IPacketFilter {
            @display("p=700,100,column,150");
        }
        gate[numGates]: <default("InteractiveGate")> like IPacketGate {
            @display("p=900,100,column,150");
        }
        gc[numGates]: <default("StreamClassifier")> like IPacketClassifier {
            displayStringTextFormat = default("");
            @display("p=1100,100,column,150;i=-;b=10,10,oval,grey,,1");
        }
        gm[numMeters]: PacketMultiplexer {
            displayStringTextFormat = default("");
            @display("p=1300,100,column,150");
        }
        meter[numMeters]: <default("DualRateThreeColorMeter")> like IPacketMeter {
            @display("p=1500,100,column,150");
        }
        flowFilter[numMeters]: <default("LabelFilter")> like IPacketFilter {
            labelFilter = default("green");
            @display("p=1700,100,column,150");
        }
        multiplexer: PacketMultiplexer {
            @display("p=1900,100");
        }
        barrier: BackPressureBarrier {
            @display("p=2100,100");
        }
    connections allowunconnected:
        in --> { @display("m=w"); } --> classifier.in;
        for i=0..numStreams-1 {
            classifier.out++ --> streamFilter[i].in;
        }
        for i=0..numStreams-1, for j=0..numGates-1 {
            streamFilter[i].out --> sm[j].in++ if streamFilterTable.get(i).get("gate") == j;
        }
        for i=0..numGates-1 {
            sm[i].out --> gateFilter[i].in;
            gateFilter[i].out --> gate[i].in;
            gate[i].out --> gc[i].in;
        }
        for i=0..numGates-1, for j=0..numMeters-1 {
            gc[i].out++ --> gm[j].in++ if findArrayObjectElement(streamFilterTable, "gate", i, "meter", j) != null;
        }
        for i=0..numMeters-1 {
            gm[i].out --> meter[i].in;
            meter[i].out --> flowFilter[i].in;
            flowFilter[i].out --> multiplexer.in++;
        }
        multiplexer.out --> barrier.in;
        barrier.out --> { @display("m=e"); } --> out;
}
File: src/inet/linklayer/ieee8021q/Ieee8021qFilter.ned