Compound Module AFxyQueue

Package: inet.networklayer.diffserv
File: src/inet/networklayer/diffserv/AFxyQueue.ned

This is an example queue, that implements one class of the Assured Forwarding PHB group (RFC 2597).

Packets with the same AFx class, but different drop priorities arrive at the afx1In, afx2In, and afx3In gates. The received packets are stored in the same queue. Before the packet is enqueued, a RED dropping algorithm may decide to selectively drop them, based on the average length of the queue and the RED parameters of the drop priority of the packet.

The afxyMinth, afxyMaxth, and afxyMaxp parameters must have values that ensures that packets with lower drop priorities are dropped with lower or equal probability than packets with higher drop priorities.

See also: DiffservQueue

FIFOQueue 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
DiffservQueue compound module

This is an example queue, that can be used in interfaces of DS core and edge nodes to support the AFxy (RFC 2597) and EF (RFC 3246) PHBs.

Parameters:

Name Type Default value Description
wq double 0.002

smoothing factor, i.e. the weight of the current queue length in the averaged queue length

afx1Minth double 50

minimum queue length thresholds for dropping packets with drop priority 1

afx1Maxth double 100

maximum queue length thresholds for dropping packets with drop priority 1

afx1Maxp double 0.3

maximum probability of drop when the queue length is between thresholds for drop priority 1

afx2Minth double 30

minimum queue length thresholds for dropping packets with drop priority 2

afx2Maxth double 60

maximum queue length thresholds for dropping packets with drop priority 2

afx2Maxp double 0.6

maximum probability of drop when the queue length is between thresholds for drop priority 2

afx3Minth double 10

minimum queue length thresholds for dropping packets with drop priority 3

afx3Maxth double 40

maximum queue length thresholds for dropping packets with drop priority 3

afx3Maxp double 0.9

maximum probability of drop when the queue length is between thresholds for drop priority 3

Properties:

Name Value Description
display i=block/queue;q=l2queue

Gates:

Name Direction Size Description
afx1In input
afx2In input
afx3In input
out output

Unassigned submodule parameters:

Name Type Default value Description
fifoQueue.queueName string "l2queue"

name of the cQueue object, used in the 'q' tag of the display string

redDropper.pkrates string "150"

average packet rate for calculations when queue is empty

Source code:

//
// This is an example queue, that implements
// one class of the Assured Forwarding PHB group (RFC 2597).
//
// Packets with the same AFx class, but different drop priorities
// arrive at the afx1In, afx2In, and afx3In gates. The received
// packets are stored in the same queue. Before the packet
// is enqueued, a RED dropping algorithm may decide to selectively
// drop them, based on the average length of the queue and the RED parameters
// of the drop priority of the packet.
//
// The afxyMinth, afxyMaxth, and afxyMaxp parameters must have values that
// ensures that packets with lower drop priorities are dropped with lower
// or equal probability than packets with higher drop priorities.
//
// @see ~DiffservQueue
//
module AFxyQueue
{
    parameters:
        double wq = default(0.002); // smoothing factor, i.e.  the weight of the current queue length in the averaged queue length

        double afx1Minth = default(50);  // minimum queue length thresholds for dropping packets with drop priority 1
        double afx1Maxth = default(100); // maximum queue length thresholds for dropping packets with drop priority 1
        double afx1Maxp = default(0.3);  // maximum probability of drop when the queue length is between thresholds for drop priority 1

        double afx2Minth = default(30); // minimum queue length thresholds for dropping packets with drop priority 2
        double afx2Maxth = default(60); // maximum queue length thresholds for dropping packets with drop priority 2
        double afx2Maxp = default(0.6); // maximum probability of drop when the queue length is between thresholds for drop priority 2

        double afx3Minth = default(10); // minimum queue length thresholds for dropping packets with drop priority 3
        double afx3Maxth = default(40); // maximum queue length thresholds for dropping packets with drop priority 3
        double afx3Maxp = default(0.9); // maximum probability of drop when the queue length is between thresholds for drop priority 3

        @display("i=block/queue;q=l2queue");

    gates:
        input afx1In;
        input afx2In;
        input afx3In;
        output out;
    submodules:
        fifoQueue: FIFOQueue {
            @display("p=251,102");
        }
        redDropper: REDDropper {
            numGates = 3;
            wq = wq;
            minths = string(afx1Minth) + " " + string(afx2Minth) + " " + string(afx3Minth);
            maxths = string(afx1Maxth) + " " + string(afx2Maxth) + " " + string(afx3Maxth);
            maxps = string(afx1Maxp) + " " + string(afx2Maxp) + " " + string(afx3Maxp);
            @display("p=105,102");
        }
    connections:
        afx1In --> { @display("m=w"); } --> redDropper.in[0];
        afx2In --> { @display("m=w"); } --> redDropper.in[1];
        afx3In --> { @display("m=w"); } --> redDropper.in[2];
        redDropper.out[0] --> { @display("m=m,100,20,0,50"); } --> fifoQueue.in++;
        redDropper.out[1] --> { @display("m=m,100,50,0,50"); } --> fifoQueue.in++;
        redDropper.out[2] --> { @display("m=m,100,80,0,50"); } --> fifoQueue.in++;
        fifoQueue.out --> { @display("m=e"); } --> out;
}