Package: inet.queueing.filter
RedDropper
simple moduleThis module implements Random Early Detection (RED).
It has n input and n output gates (specified by the 'numGates' parameter). Packets arrived at the ith input gate are forwarded to the ith output gate, or dropped.
The module sums the used buffer space of the queues attached to the output gates. If it is below a minimum threshold, the packet won't be dropped, if above a maximum threshold, it will be dropped, if it is between the minimum and maximum threshold, it will be dropped by a given probability. This probability determined by a linear function which is 0 at the minth and maxp at maxth.
The queue length can be smoothed by specifying the 'wq' parameter. The average queue length used in the tests are computed by the formula:
avg = (1-wq)*avg + wq*qlen
The minth, maxth, and maxp parameters can be specified separately for each input gate, so this module can be used to implement different packet drop priorities.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Used in compound modules
Name | Type | Description |
---|---|---|
AFxyQueue | compound module |
This is an example queue, that implements one class of the Assured Forwarding PHB group (RFC 2597). |
EthernetQosRedQueue | compound module |
Queue module that gives the PAUSE frames a higher priority, and using Random Early Detection algorithm on data frames, and can be parametrized with an IPacketQueue for serving the data frames. |
RedDropperQueue | compound module |
Combines a packet queue with random early detection (RED) dropper. |
Extends
Name | Type | Description |
---|---|---|
PacketFilterBase | simple module |
This is a base module for various packet filter modules. Derived modules must implement a single packet matcher function which determines if a packet is to be passed through or filtered out. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
displayStringTextFormat | string | "dropped %d/%p pk (%k/%l)" |
determines the text that is written on top of the submodule |
backpressure | bool | false | |
collectionModule | string | "" | |
wq | double | 0.002 |
weight of the current queue length in the averaged queue length, in range [0.0, 1.0] |
minth | double | 5 |
minimum threshold for avg queue length |
maxth | double | 50 |
maximum threshold for avg queue length (=buffer capacity), in range (minth,packetCapacity] |
maxp | double | 0.02 |
maximum value for pbs, in range [0.0, 1.0] |
pkrate | double | 150 |
average packet rate for calculations when queue is empty |
useEcn | bool | false |
if enabled, packets are marked with ECN if applicable |
packetCapacity | int | int(maxth) |
packets are dropped if queue length is greater |
Properties
Name | Value | Description |
---|---|---|
display | i=block/downarrow | |
class | RedDropper |
Gates
Name | Direction | Size | Description |
---|---|---|---|
in | input | ||
out | output |
Signals
Name | Type | Unit |
---|---|---|
packetDropped | inet::Packet |
Statistics
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
packetDropCongestion | packet drop: congestion | packetDropReasonIsCongestion(packetDropped) | count, sum(packetBytes), vector(packetBytes) | none |
Direct method calls (observed)
call to | function | info |
---|---|---|
inet.examples.inet.netperfmeter.REDQueue | inet::queueing::CompoundPacketQueueBase::receiveSignal | packetDropped |
BehaviorAggregateClassifier | inet::BehaviorAggregateClassifier::handleCanPushPacketChanged | handleCanPushPacketChanged |
PacketMultiplexer | inet::queueing::PacketMultiplexer::pushPacket | pushPacket |
RedDropper | inet::queueing::RedDropper::pushPacket | pushPacket |
PacketQueue | inet::queueing::PacketQueue::pushPacket | pushPacket |
RedDropperQueue | inet::queueing::CompoundPacketQueueBase::receiveSignal | packetDropped |
ActivePacketSource | inet::queueing::ActivePacketSource::handleCanPushPacketChanged | handleCanPushPacketChanged |
Called methods (observed)
function | info | call from |
---|---|---|
inet::queueing::RedDropper::handleCanPushPacketChanged | handleCanPushPacketChanged | PacketMultiplexer, PacketQueue |
inet::queueing::RedDropper::pushPacket | pushPacket | BehaviorAggregateClassifier, DiffservQueue, RedDropper, ActivePacketSource |
inet::queueing::RedDropper::receiveSignal | packetPulled | PacketQueue |
Incoming messages (observed)
Pushed in messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
in | Packet | 0 | BehaviorAggregateClassifier | DispatchProtocolInd, InterfaceInd, InterfaceReq, NetworkProtocolInd, PacketProtocolTag, MacAddressInd? | |
in | Packet | 0 | ActivePacketSource | DirectionTag, PacketProtocolTag |
Push out messages (observed)
gate | msg | kind | ctrl | destModule | tags |
---|---|---|---|---|---|
out | Packet | 0 | PacketMultiplexer | DispatchProtocolInd, InterfaceInd, InterfaceReq, NetworkProtocolInd, PacketProtocolTag, MacAddressInd? | |
out | Packet | 0 | PacketQueue | PacketProtocolTag, DirectionTag?, DispatchProtocolInd?, EncapsulationProtocolReq?, InterfaceInd?, InterfaceReq?, MacAddressInd?, MacAddressReq?, NetworkProtocolInd? |
Packet operations (observed)
chunkType | packetAction |
---|---|
EthernetMacHeader | peekDataAt |
Ipv4Header | insertDataAt, peekDataAt, removeDataAt |
Shared Tagging operations (observed)
tagType | tagAction |
---|---|
NetworkProtocolInd | addTagIfAbsent, removeTagIfPresent |
PacketProtocolTag | getTag |
Region Tagging operations (observed)
tagType | tagAction |
---|---|
FlowTag | mapAllTags |
Source code
// // This module implements Random Early Detection (RED). // // It has n input and n output gates (specified by the 'numGates' // parameter). Packets arrived at the ith input gate are // forwarded to the ith output gate, or dropped. // // The module sums the used buffer space of the queues attached // to the output gates. If it is below a minimum threshold, // the packet won't be dropped, if above a maximum threshold, // it will be dropped, if it is between the minimum and // maximum threshold, it will be dropped by a given probability. // This probability determined by a linear function which is // 0 at the minth and maxp at maxth. // // The queue length can be smoothed by specifying the 'wq' // parameter. The average queue length used in the tests // are computed by the formula: // // avg = (1-wq)*avg + wq*qlen // // The minth, maxth, and maxp parameters can be specified // separately for each input gate, so this module can be // used to implement different packet drop priorities. // simple RedDropper extends PacketFilterBase { parameters: string collectionModule = default(""); double wq = default(0.002); // weight of the current queue length in the averaged queue length, in range [0.0, 1.0] double minth = default(5); // minimum threshold for avg queue length double maxth = default(50); // maximum threshold for avg queue length (=buffer capacity), in range (minth,packetCapacity] double maxp = default(0.02); // maximum value for pbs, in range [0.0, 1.0] double pkrate = default(150); // average packet rate for calculations when queue is empty bool useEcn = default(false); // if enabled, packets are marked with ECN if applicable int packetCapacity = default(int(maxth)); // packets are dropped if queue length is greater @class(RedDropper); @display("i=block/downarrow"); @signal[packetDropped](type=inet::Packet); @statistic[packetDropCongestion](title="packet drop: congestion"; source=packetDropReasonIsCongestion(packetDropped); record=count,sum(packetBytes),vector(packetBytes); interpolationmode=none); }File: src/inet/queueing/filter/RedDropper.ned