QueueBasedTokenGenerator

Package: inet.queueing.tokengenerator

QueueBasedTokenGenerator

simple module

This module generates tokens for a TokenBasedServer based on the observed state changes of a packet queue. It's primary purpose is to allow applications to produce traffic which completely utilizes a network interface. This is achieved by generating tokens whenever the observed packet queue becomes empty.

Available display string text format directives: %p - number of processed packets %l - processed total packet length %t - number of generated tokens

QueueBasedTokenGenerator

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
QueueFiller compound module

This module produces packets in order to prevent a queue from becoming empty.

Extends

Name Type Description
TokenGeneratorBase simple module

This is a base module for various token generator modules.

Parameters

Name Type Default value Description
serverModule string

module path of the packet server where the tokens are generated via C++ method call

displayStringTextFormat string "generated %t tk\nto %s"

determines display string text above the submodule

queueModule string

module path of the observed packet queue

minNumPackets int 1
minTotalLength int 0 b
numTokens double 1

number of tokens generated when the queue becomes empty

Properties

Name Value Description
class QueueBasedTokenGenerator
display i=block/control

Signals

Name Type Unit
tokensCreated double

Statistics

Name Title Source Record Unit Interpolation Mode
tokensCreated tokens created count, sum, vector none

Source code

//
// This module generates tokens for a ~TokenBasedServer based on the observed state
// changes of a packet queue. It's primary purpose is to allow applications to
// produce traffic which completely utilizes a network interface. This is achieved
// by generating tokens whenever the observed packet queue becomes empty.
//
// Available display string text format directives:
//  %p - number of processed packets
//  %l - processed total packet length
//  %t - number of generated tokens
//
simple QueueBasedTokenGenerator extends TokenGeneratorBase
{
    parameters:
        string queueModule; // module path of the observed packet queue
        int minNumPackets = default(1);
        int minTotalLength @unit(b) = default(0 b);
        volatile double numTokens = default(1); // number of tokens generated when the queue becomes empty
        @class(QueueBasedTokenGenerator);
        @display("i=block/control");
        @signal[tokensCreated](type=double);
        @statistic[tokensCreated](title="tokens created"; record=count,sum,vector; interpolationmode=none);
}
File: src/inet/queueing/tokengenerator/QueueBasedTokenGenerator.ned