DiffservQueue

Package: inet.networklayer.diffserv

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.

The incoming packets are first classified according to their DSCP field. DSCPs other than AFxy and EF are handled as BE (best effort).

EF packets are stored in a dedicated queue, and served first when a packet is requested. Because they can preempt the other queues, the rate of the EF packets should be limited to a fraction of the bandwith of the link. This is achieved by metering the EF traffic with a token bucket meter and dropping packets that does not conform to the traffic profile.

There are other queues for AFx classes and BE. The AFx queues use RED to implement 3 different drop priorities within the class. BE packets are stored in a drop tail queue. Packets from AFxy and BE queues are sheduled by a WRR scheduler, which ensures that the remaining bandwith is allocated among the classes according to the specified weights.

See also: AFxyQueue

BehaviorAggregateClassifier TokenBucketMeter Sink DropTailQueue AFxyQueue AFxyQueue AFxyQueue AFxyQueue DropTailQueue WrrScheduler PriorityScheduler

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.

Parameters

Name Type Default value Description
interfaceTableModule string

Gates

Name Direction Size Description
in input
out output

Unassigned submodule parameters

Name Type Default value Description
efMeter.interfaceTableModule string

The path to the InterfaceTable module

efMeter.cir string "10%"

committed information rate, either absolute bitrate (e.g. "100kbps"), or relative to the link's datarate (e.g. "20%")

efMeter.cbs int 5000B

committed burst size

efMeter.colorAwareMode bool false

enables color-aware mode

efQueue.frameCapacity int 5
efQueue.queueName string "l2queue"

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

af1xQueue.fifoQueue.queueName string "l2queue"

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

af1xQueue.redDropper.pkrates string "150"

average packet rate for calculations when queue is empty

af2xQueue.fifoQueue.queueName string "l2queue"

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

af2xQueue.redDropper.pkrates string "150"

average packet rate for calculations when queue is empty

af3xQueue.fifoQueue.queueName string "l2queue"

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

af3xQueue.redDropper.pkrates string "150"

average packet rate for calculations when queue is empty

af4xQueue.fifoQueue.queueName string "l2queue"

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

af4xQueue.redDropper.pkrates string "150"

average packet rate for calculations when queue is empty

beQueue.frameCapacity int 100
beQueue.queueName string "l2queue"

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

wrr.weights string "1 1 1 1 1"

Source code

//
// 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.
//
// The incoming packets are first classified according to
// their DSCP field. DSCPs other than AFxy and EF are handled
// as BE (best effort).
//
// EF packets are stored in a dedicated queue, and served first
// when a packet is requested. Because they can preempt the other
// queues, the rate of the EF packets should be limited to a fraction
// of the bandwith of the link. This is achieved by metering the EF
// traffic with a token bucket meter and dropping packets that
// does not conform to the traffic profile.
//
// There are other queues for AFx classes and BE. The AFx queues
// use RED to implement 3 different drop priorities within the class.
// BE packets are stored in a drop tail queue.
// Packets from AFxy and BE queues are sheduled by a WRR scheduler,
// which ensures that the remaining bandwith is allocated among the classes
// according to the specified weights.
//
// @see ~AFxyQueue
//
module DiffservQueue like IOutputQueue
{
    parameters:
        string interfaceTableModule;
        *.interfaceTableModule = default(absPath(interfaceTableModule));
    gates:
        input in;
        output out;
    submodules:
        classifier: BehaviorAggregateClassifier {
            dscps = "EF AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43";
            @display("p=100,330");
        }
        efMeter: TokenBucketMeter {
            cir = default("10%"); // reserved EF bandwith as percentage of datarate of the interface
            cbs = default(5000B); // 5 1000B packets
            @display("p=250,130");
        }
        sink: Sink {
            @display("p=400,80");
        }
        efQueue: DropTailQueue {
            frameCapacity = default(5); // keep low, for low delay and jitter
            @display("p=400,180");
        }
        af1xQueue: AFxyQueue {
            @display("p=250,230");
        }
        af2xQueue: AFxyQueue {
            @display("p=250,330");
        }
        af3xQueue: AFxyQueue {
            @display("p=250,430");
        }
        af4xQueue: AFxyQueue {
            @display("p=250,530");
        }
        beQueue: DropTailQueue {
            @display("p=250,630");
        }
        wrr: WrrScheduler {
            weights = default("1 1 1 1 1");
            @display("p=400,330");
        }
        priority: PriorityScheduler {
            @display("p=550,330");
        }

    connections:
        in --> classifier.in;
        classifier.outs++ --> efMeter.in++;
        classifier.outs++ --> af1xQueue.afx1In;
        classifier.outs++ --> af1xQueue.afx2In;
        classifier.outs++ --> af1xQueue.afx3In;
        classifier.outs++ --> af2xQueue.afx1In;
        classifier.outs++ --> af2xQueue.afx2In;
        classifier.outs++ --> af2xQueue.afx3In;
        classifier.outs++ --> af3xQueue.afx1In;
        classifier.outs++ --> af3xQueue.afx2In;
        classifier.outs++ --> af3xQueue.afx3In;
        classifier.outs++ --> af4xQueue.afx1In;
        classifier.outs++ --> af4xQueue.afx2In;
        classifier.outs++ --> af4xQueue.afx3In;
        classifier.defaultOut --> beQueue.in;

        efMeter.greenOut --> { @display("ls=green"); } --> efQueue.in;
        efMeter.redOut --> { @display("ls=red"); } --> sink.in++;

        af1xQueue.out --> wrr.in++;
        af2xQueue.out --> wrr.in++;
        af3xQueue.out --> wrr.in++;
        af4xQueue.out --> wrr.in++;
        beQueue.out --> wrr.in++;
        efQueue.out --> priority.in++;
        wrr.out --> priority.in++;
        priority.out --> out;
}

File: src/inet/networklayer/diffserv/DiffservQueue.ned