TokenBucket

Package: inet.queueing.shaper

TokenBucket

compound module

This module implements a parameterizable token bucket algorithm.

queue : like IPacketQueue

DropTailQueue: This module is a limited packet queue which drops packets at the tail of the queue.

IPacketQueue: This module interface is implemented by packet queue modules.

Source:
queue: <default("DropTailQueue")> like IPacketQueue {
    parameters:
        @display("p=150,120");
} server : like IPacketServer

TokenBasedServer: This module repeatedly pulls packets from the connected packet provider and it pushes them into the...

IPacketServer: This module interface is implemented by packet server modules.

Source:
server: <default("TokenBasedServer")> like IPacketServer {
    parameters:
        @display("p=350,120");
}

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.

Properties

Name Value Description
display i=block/buffer

Gates

Name Direction Size Description
in input
out output

Source code

//
// This module implements a parameterizable token bucket algorithm.
//
module TokenBucket like ITrafficConditioner
{
    parameters:
        @display("i=block/buffer");
    gates:
        input in @labels(push);
        output out @labels(pull);
    submodules:
        queue: <default("DropTailQueue")> like IPacketQueue {
            parameters:
                @display("p=150,120");
        }
        server: <default("TokenBasedServer")> like IPacketServer {
            parameters:
                @display("p=350,120");
        }
    connections:
        in --> { @display("m=w"); } --> queue.in;
        queue.out --> server.in;
        server.out --> { @display("m=e"); } --> out;
}

File: src/inet/queueing/shaper/TokenBucket.ned