Ieee8021qFilter

Package: inet.linklayer.ieee8021q

Ieee8021qFilter

compound module

This 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 about the connections between the submodules based on the streamFilterTable parameter.

classifier : like IPacketClassifier

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

IPacketClassifier: This module interface is implemented by packet classifier modules.

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

StreamFilter: This module implements a packet filter using solely the stream name.

IPacketFilter: This module interface is implemented by packet filter modules.

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

This module connects multiple packet producers to one packet consumer.

Source:
sm[numGates]: PacketMultiplexer {
    displayStringTextFormat = default("");
    @display("p=500,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: This module interface is implemented by packet gate.

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

StreamClassifier: This module classifies packets based on the stream they are part of.

IPacketClassifier: This module interface is implemented by packet classifier modules.

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

This module connects multiple packet producers to one packet consumer.

Source:
gm[numMeters]: PacketMultiplexer {
    displayStringTextFormat = default("");
    @display("p=1100,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: This module interface is implemented by packet meter modules.

Source:
meter[numMeters]: <default("DualRateThreeColorMeter")> like IPacketMeter {
    @display("p=1300,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: This module interface is implemented by packet filter modules.

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

This module connects multiple packet producers to one packet consumer.

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

This module prevents backpressure propagation from its output to its input and vice verse.

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

number of different streams to filter for

numGates int

number of gates

numMeters int

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

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

determines the text that is written on top of the submodule

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

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

Source code

//
// This 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 about the connections between the submodules based on the streamFilterTable
// parameter.
//
module Ieee8021qFilter like IPacketFilter
{
    parameters:
        int numStreams; // number of different streams to filter for
        int numGates; // number of gates
        int numMeters; // 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 {
            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");
        }
        gate[numGates]: <default("InteractiveGate")> like IPacketGate {
            @display("p=700,100,column,150");
        }
        gc[numGates]: <default("StreamClassifier")> like IPacketClassifier {
            displayStringTextFormat = default("");
            @display("p=900,100,column,150;i=-;b=10,10,oval,grey,,1");
        }
        gm[numMeters]: PacketMultiplexer {
            displayStringTextFormat = default("");
            @display("p=1100,100,column,150");
        }
        meter[numMeters]: <default("DualRateThreeColorMeter")> like IPacketMeter {
            @display("p=1300,100,column,150");
        }
        flowFilter[numMeters]: <default("LabelFilter")> like IPacketFilter {
            labelFilter = default("green");
            @display("p=1500,100,column,150");
        }
        multiplexer: PacketMultiplexer {
            @display("p=1700,100");
        }
        barrier: BackPressureBarrier {
            @display("p=1900,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 --> 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