Simple Module REDDropper

Package: inet.common.queue
File: src/inet/common/queue/REDDropper.ned

C++ definition

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 output gates must be connected to simple modules implementing the IQueueAccess C++ interface (e.g. FIFOQueue).

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.

REDDropper

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.

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).

DSQueue2 compound module

Diffserv Queue used in Experiment 2.1 - 2.4.

REDQueue compound module (no description)

Parameters:

Name Type Default value Description
numGates int 1
wq double 0.002

weight of the current queue length in the averaged queue length

minths string "5"

minimum thresholds for avg queue length (one number for each gate, last one repeated if needed)

maxths string "50"

maximum thresholds for avg queue length (=buffer capacity) (one number for each gate, last one repeated if needed)

maxps string "0.02"

maximum value for pbs (one number for each gate, last one repeated if needed)

pkrates string "150"

average packet rate for calculations when queue is empty

Properties:

Name Value Description
display i=block/downarrow

Gates:

Name Direction Size Description
in [ ] input numGates
out [ ] output numGates

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 output
// gates must be connected to simple modules implementing
// the IQueueAccess C++ interface (e.g. FIFOQueue).
//
// 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
{
    parameters:
        int numGates = default(1);

        double wq = default(0.002);  // weight of the current queue length in the averaged queue length
        string minths = default("5");  // minimum thresholds for avg queue length (one number for each gate, last one repeated if needed)
        string maxths = default("50");  // maximum thresholds for avg queue length (=buffer capacity) (one number for each gate, last one repeated if needed)
        string maxps = default("0.02");  // maximum value for pbs (one number for each gate, last one repeated if needed)
        string pkrates = default("150");  // average packet rate for calculations when queue is empty
        @display("i=block/downarrow");

    gates:
        input in[numGates];
        output out[numGates];
}