PacketBasedTokenGenerator

Package: inet.queueing.tokengenerator

PacketBasedTokenGenerator

simple module

This module generates tokens into the configured TokenBasedServer for each consumed packet.

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

This module contains a configurable pre-composed telnet traffic source and traffic sink as part of a telnet server application.

Extends

Name Type Description
TokenGeneratorBase simple module

This is a base module for various token generator modules.

Parameters

Name Type Default value Description
displayStringTextFormat string "processed %p pk (%l)\ngenerated %t tk\nto %s"

determines the text that is written on top of the submodule

storageModule string

module path of the token storage where the tokens are generated via C++ method call

numTokensPerPacket double 1

number of tokens per consumed packet

numTokensPerBit double 0

number of tokens per consumed bit

Properties

Name Value Description
display i=block/control
class PacketBasedTokenGenerator

Gates

Name Direction Size Description
in input

Signals

Name Type Unit
tokensCreated double

Statistics

Name Title Source Record Unit Interpolation Mode
tokensCreated tokens created count(tokensCreated) count tk
numTokensCreated number of created tokens tokensCreated sum, vector tk none

Direct method calls (observed)

call tofunctioninfo
ContentBasedClassifierinet::queueing::ContentBasedClassifier::handleCanPushPacketChangedhandleCanPushPacketChanged
PacketClassifierinet::queueing::PacketClassifier::handleCanPushPacketChangedhandleCanPushPacketChanged
TokenBasedServerinet::queueing::TokenBasedServer::addTokensaddTokens
ActivePacketSourceinet::queueing::ActivePacketSource::handleCanPushPacketChangedhandleCanPushPacketChanged
PacketBasedTokenGeneratorinet::queueing::PacketBasedTokenGenerator::receiveSignaltokensDepleted

Called methods (observed)

functioninfocall from
inet::queueing::PacketBasedTokenGenerator::pushPacketpushPacketContentBasedClassifier, PacketClassifier, ActivePacketSource
inet::queueing::PacketBasedTokenGenerator::receiveSignaltokensDepletedTokenBasedServer, PacketBasedTokenGenerator

Pushed in messages (observed)

gatemsgkindctrlsrcModuletags
inPacket0ContentBasedClassifierDirectionTag, PacketProtocolTag
inPacket0PacketClassifierDirectionTag?, DscpInd?, EcnInd?, HopLimitInd?, InterfaceInd?, L3AddressInd?, L4PortInd?, NetworkProtocolInd?, PacketProtocolTag?, TosInd?, TransportProtocolInd?
inPacket0ActivePacketSourceDirectionTag, PacketProtocolTag
inPacket1PacketClassifier

Source code

//
// This module generates tokens into the configured ~TokenBasedServer for each
// consumed packet.
//
simple PacketBasedTokenGenerator extends TokenGeneratorBase like IPassivePacketSink
{
    parameters:
        volatile double numTokensPerPacket = default(1); // number of tokens per consumed packet
        volatile double numTokensPerBit = default(0); // number of tokens per consumed bit
        displayStringTextFormat = default("processed %p pk (%l)\ngenerated %t tk\nto %s"); // %p number of packet, %l total length
        @class(PacketBasedTokenGenerator);
    gates:
        input in;
}
File: src/inet/queueing/tokengenerator/PacketBasedTokenGenerator.ned