Package: inet.queueing.classifier
MultiTokenBucketClassifier
simple moduleThis module classifies packets into the first bucket that contains the required number of tokens. The packet is forwarded on the output gate that corresponds to the selected bucket.
Inheritance diagram
The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.
Known subclasses
Name | Type | Description |
---|---|---|
DualRateThreeColorClassifier | simple module |
This packet classifier module classifies packets using two token buckets. Each packet is classified depending on which token bucket is the first one that contains the required number of tokens for the packet. |
SingleRateThreeColorClassifier | simple module |
This packet classifier module classifies packets using two token buckets. Each packet is classified depending on which token bucket is the first one that contains the required number of tokens for the packet. |
Extends
Name | Type | Description |
---|---|---|
PacketClassifierBase | simple module |
This is a base module for various packet classifier modules. Derived modules must implement a single packet classifier function which determines the index of the output gate for the next pushed packet. |
Parameters
Name | Type | Default value | Description |
---|---|---|---|
displayStringTextFormat | string | "contains %n tk\nmetered %p pk (%l)" |
determines the text that is written on top of the submodule |
reverseOrder | bool | false | |
buckets | object |
array of objects specifying the token buckets example: [{initialNumTokens: 100, maxNumTokens: 1000, tokenProductionRate: 10, excessTokenModule: ".other"}] |
|
tokenConsumptionPerPacket | double | 0 |
how many tokens are consumed per packet |
tokenConsumptionPerBit | double | 1 |
how many tokens are consumed per bit |
Properties
Name | Value | Description |
---|---|---|
display | i=block/classifier | |
class | MultiTokenBucketClassifier |
Gates
Name | Direction | Size | Description |
---|---|---|---|
in | input | ||
out [ ] | output |
Signals
Name | Type | Unit |
---|---|---|
tokensChanged | double |
Statistics
Name | Title | Source | Record | Unit | Interpolation Mode |
---|---|---|---|---|---|
numTokens | number of tokens | tokensChanged | vector | tk | linear |
Source code
// // This module classifies packets into the first bucket that contains the required // number of tokens. The packet is forwarded on the output gate that corresponds to // the selected bucket. // simple MultiTokenBucketClassifier extends PacketClassifierBase like IPacketClassifier { parameters: object buckets; // array of objects specifying the token buckets // example: [{initialNumTokens: 100, maxNumTokens: 1000, tokenProductionRate: 10, excessTokenModule: ".other"}] double tokenConsumptionPerPacket = default(0); // how many tokens are consumed per packet double tokenConsumptionPerBit = default(1); // how many tokens are consumed per bit displayStringTextFormat = default("contains %n tk\nmetered %p pk (%l)"); @signal[tokensChanged](type=double); @statistic[numTokens](title="number of tokens"; source=tokensChanged; record=vector; unit=tk; interpolationmode=linear); @class(MultiTokenBucketClassifier); }File: src/inet/queueing/classifier/MultiTokenBucketClassifier.ned