Package: inet.networklayer.diffserv
SingleRateThreeColorMeter
simple moduleThis module implements a Single Rate Three Color Meter (RFC 2697).
IP packets are classified according to three parameters, Committed Information Rate (cir), Committed Burst Size (cbs), and Excess Burst Size (ebs), to be either green, yellow or red.
The green traffic is guaranteed to be under (in bits)
cir * (t1 - t0) + 8 * cbsand green+yellow traffic to be under
cir * (t1 - t0) + 8 * (cbs + ebs)in every [t0,t1] interval.
When operating in color-aware mode, the meter does not recolor a packet that was colored by a previous marker to a lesser conforming color.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
interfaceTableModule | string |
The path to the InterfaceTable module |
|
cir | string |
committed information rate, either absolute bitrate (e.g. "100kbps"), or relative to the link's datarate (e.g. "20%") |
|
cbs | int |
committed burst size |
|
ebs | int |
excess burst size |
|
colorAwareMode | bool | false |
enables color-aware mode |
Properties
Name | Value | Description |
---|---|---|
display | i=block/timer |
Gates
Name | Direction | Size | Description |
---|---|---|---|
in | input | ||
greenOut | output | ||
yellowOut | output | ||
redOut | output |
Direct method calls (observed)
call to | function | info |
---|---|---|
InterfaceTable | inet::InterfaceTable::findInterfaceByNodeInputGateId | findInterfaceByNodeInputGateId |
Pushed in messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
in | Packet | 0 | PacketMultiplexer | DispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag |
Push out messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
greenOut | Packet | 0 | PacketMultiplexer | DispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag | |
redOut | Packet | 0 | PassivePacketSink | DispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag | |
yellowOut | Packet | 0 | BehaviorAggregateClassifier | DispatchProtocolInd, InterfaceInd, InterfaceReq, MacAddressInd, NetworkProtocolInd, PacketProtocolTag |
Source code
// // This module implements a Single Rate Three Color Meter (RFC 2697). // // IP packets are classified according to three parameters, // Committed Information Rate (cir), Committed Burst Size (cbs), // and Excess Burst Size (ebs), to be either green, yellow or red. // // The green traffic is guaranteed to be under (in bits) // <pre> // cir * (t1 - t0) + 8 * cbs // </pre> // and green+yellow traffic to be under // <pre> // cir * (t1 - t0) + 8 * (cbs + ebs) // </pre> // in every [t0,t1] interval. // // When operating in color-aware mode, the meter does not recolor // a packet that was colored by a previous marker to a lesser // conforming color. // simple SingleRateThreeColorMeter { parameters: @display("i=block/timer"); string interfaceTableModule; // The path to the InterfaceTable module string cir; // committed information rate, either absolute bitrate (e.g. "100kbps"), or relative to the link's datarate (e.g. "20%") int cbs @unit(B); // committed burst size int ebs @unit(B); // excess burst size bool colorAwareMode = default(false); // enables color-aware mode gates: input in; output greenOut; output yellowOut; output redOut; }File: src/inet/networklayer/diffserv/SingleRateThreeColorMeter.ned