Package: inet.linklayer.ieee8021q
Ieee8021qFilter
compound moduleThis 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.
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