PacketPolicing¶
Package: inet.queueing.policing
compound module PacketPolicing
Combines a packet meter and a packet filter into a packet policing module. The meter measures the packet flow that is passing through and attaches some meta information to the packets. The filter drops the packets that do not match the implemented filter criteria.
Usage diagram¶
Inheritance diagram¶
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
in |
input |
||
out |
output |
Unassigned submodule parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
meter.displayStringTextFormat |
string |
“contains %n tk\nmetered %p pk (%l)” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
meter.tokenConsumptionPerPacket |
double |
0 |
How many tokens are consumed per packet |
meter.defaultLabel |
string |
“red” |
The label that is attached to packets if there are not enough tokens in the bucket, no label by default |
meter.labelPriority |
object |
colorAware ? [“green”, “yellow”, “red”] : [] |
The list of labels in the order of priority, if specified packets can only be promoted in this order |
meter.committedInformationRate |
double |
Committed information rate |
|
meter.excessInformationRate |
double |
Excess information rate |
|
meter.committedBurstSize |
int |
Committed burst size |
|
meter.excessBurstSize |
int |
Excess burst size |
|
meter.bitsPerToken |
int |
8 |
How many bits are represented by 1 token |
meter.colorAware |
bool |
false |
Enables color-aware mode where packets can only be demoted |
filter.displayStringTextFormat |
string |
“dropped {numDroppedPackets}/{numProcessedPackets} pk ({droppedTotalLength}/{processedTotalLength})” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
filter.backpressure |
bool |
false |
|
filter.labelFilter |
string |
The label filter as a match expression (e.g. green or red) |
Source code¶
//
// Combines a packet meter and a packet filter into a packet policing
// module. The meter measures the packet flow that is passing through and attaches
// some meta information to the packets. The filter drops the packets that do not
// match the implemented filter criteria.
//
module PacketPolicing like IPacketPolicing
{
gates:
input in @labels(push);
output out @labels(push);
submodules:
meter: <default("DualRateThreeColorMeter")> like IPacketMeter {
parameters:
@display("p=125,120");
}
filter: <default("LabelFilter")> like IPacketFilter {
parameters:
@display("p=325,120");
}
connections:
in --> { @display("m=w"); } --> meter.in;
meter.out --> filter.in;
filter.out --> { @display("m=e"); } --> out;
}