Package: inet.queueing.server
TokenBasedServer
simple moduleThis module repeatedly pulls packets from the connected packet provider and it pushes them into the connected packet consumer. The packets are processed in zero simulation time, and the process continues until the available number of tokens is not sufficient anymore.
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 |
---|---|---|
ResponseProducer | compound module |
This module is capable of generating several different streams of packets, one after the other. For each traffic category, the packets are produced by a separate token based server. The traffic stream can be started by adding tokens the corresponding server module. The packet data, packet length, and timing distributions can be configured in the corresponding packet provider. |
Extends
Name | Type | Description |
---|---|---|
PacketServerBase | simple module |
This is a base module for various packet server modules. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
displayStringTextFormat | string | "contains %n tk\nserved %p pk (%l)" |
determines the text that is written on top of the submodule |
initialNumTokens | double | 0 |
initial number of tokens |
maxNumTokens | double | nan |
maximum number of tokens |
tokenConsumptionPerPacket | double | 1 |
how many tokens are consumed per processed packet |
tokenConsumptionPerBit | double | 0 |
how many tokens are consumed per processed bit |
Properties
Name | Value | Description |
---|---|---|
display | i=block/server | |
class | TokenBasedServer |
Gates
Name | Direction | Size | Description |
---|---|---|---|
in | input | ||
out | output |
Signals
Name | Type | Unit |
---|---|---|
tokensAdded | double | |
tokensRemoved | double | |
tokensDepleted | double |
Statistics
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
addedTokens | added tokens | tokensAdded | sum | tk | none |
removedTokens | removed tokens | tokensRemoved | sum | tk | none |
numTokensDepleted | number of times tokens are depleted | tokensDepleted | count | tk | none |
numTokens | number of tokens | sum(tokensAdded) - sum(tokensRemoved) | vector | tk | sample-hold |
Direct method calls (observed)
call to | function | info |
---|---|---|
ContentBasedClassifier | inet::queueing::ContentBasedClassifier::pushPacket | pushPacket |
PacketClassifier | inet::queueing::PacketClassifier::pushPacket | pushPacket |
PacketMultiplexer | inet::queueing::PacketMultiplexer::pushPacket | pushPacket |
DropTailQueue | inet::queueing::PacketQueue::pullPacket | pullPacket |
PacketQueue | inet::queueing::PacketQueue::pullPacket | pullPacket |
PacketQueue | inet::queueing::PacketQueue::pushPacket | pushPacket |
PassivePacketSink | inet::queueing::PassivePacketSink::pushPacket | pushPacket |
PassivePacketSource | inet::queueing::PassivePacketSource::canPullPacket | canPullPacket |
PassivePacketSource | inet::queueing::PassivePacketSource::pullPacket | pullPacket |
PacketBasedTokenGenerator | inet::queueing::PacketBasedTokenGenerator::receiveSignal | tokensDepleted |
SignalBasedTokenGenerator | inet::queueing::SignalBasedTokenGenerator::receiveSignal | tokensDepleted |
Called methods (observed)
function | info | call from |
---|---|---|
inet::queueing::TokenBasedServer::addTokens | addTokens | PacketBasedTokenGenerator, QueueBasedTokenGenerator, SignalBasedTokenGenerator, TimeBasedTokenGenerator |
inet::queueing::TokenBasedServer::handleCanPullPacketChanged | handleCanPullPacketChanged | DropTailQueue, PacketQueue, PassivePacketSource |
inet::queueing::TokenBasedServer::handleCanPushPacketChanged | handleCanPushPacketChanged | ContentBasedClassifier, PacketClassifier, PacketMultiplexer, PacketQueue, PassivePacketSink |
Pull in messages (observed)
gate | msg | kind | ctrl | srcModule | tags |
---|---|---|---|---|---|
in | Packet | 0 | DropTailQueue | DirectionTag, PacketProtocolTag | |
in | Packet | 0 | PacketQueue | DirectionTag?, DscpInd?, EcnInd?, HopLimitInd?, InterfaceInd?, L3AddressInd?, L4PortInd?, NetworkProtocolInd?, PacketProtocolTag?, TosInd?, TransportProtocolInd? | |
in | Packet | 0 | PassivePacketSource | DirectionTag, PacketProtocolTag | |
in | Packet | 1 | PacketQueue |
Push out messages (observed)
Source code
// // This module repeatedly pulls packets from the connected packet provider and // it pushes them into the connected packet consumer. The packets are processed // in zero simulation time, and the process continues until the available number // of tokens is not sufficient anymore. // simple TokenBasedServer extends PacketServerBase like IPacketServer { parameters: double initialNumTokens = default(0); // initial number of tokens double maxNumTokens = default(nan); // maximum number of tokens volatile double tokenConsumptionPerPacket = default(1); // how many tokens are consumed per processed packet volatile double tokenConsumptionPerBit = default(0); // how many tokens are consumed per processed bit displayStringTextFormat = default("contains %n tk\nserved %p pk (%l)"); // determines display string text above the submodule @signal[tokensAdded](type=double); @signal[tokensRemoved](type=double); @signal[tokensDepleted](type=double); @statistic[addedTokens](title="added tokens"; source=tokensAdded; record=sum; unit=tk; interpolationmode=none); @statistic[removedTokens](title="removed tokens"; source=tokensRemoved; record=sum; unit=tk; interpolationmode=none); @statistic[numTokensDepleted](title="number of times tokens are depleted"; source=tokensDepleted; record=count; unit=tk; interpolationmode=none); @statistic[numTokens](title="number of tokens"; source=sum(tokensAdded) - sum(tokensRemoved); record=vector; unit=tk; interpolationmode=sample-hold); @class(TokenBasedServer); }File: src/inet/queueing/server/TokenBasedServer.ned