LeakyBucket¶
Package: inet.queueing.shaper
compound module LeakyBucket
Implements a parameterizable leaky bucket algorithm.
Usage diagram¶
Inheritance diagram¶
Properties¶
Name |
Value |
Description |
|---|---|---|
display |
i=block/buffer |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
in |
input |
||
out |
output |
Unassigned submodule parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
queue.displayStringTextFormat |
string |
“contains %p pk (%l) pushed %u\npulled %o removed %r dropped %d” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
queue.packetCapacity |
int |
100 |
Maximum number of packets in the queue, no limit by default |
queue.dataCapacity |
int |
-1b |
Maximum total length of packets in the queue, no limit by default |
queue.dropperClass |
string |
“inet::queueing::PacketAtCollectionEndDropper” |
Determines which packets are dropped when the queue is overloaded, packets are not dropped by default; the parameter must be the name of a C++ class which implements the IPacketDropperFunction C++ interface and is registered via Register_Class |
queue.comparatorClass |
string |
“” |
Determines the order of packets in the queue, insertion order by default; the parameter must be the name of a C++ class which implements the IPacketComparatorFunction C++ interface and is registered via Register_Class |
queue.bufferModule |
string |
“” |
Relative module path to the IPacketBuffer module used by this queue, implicit buffer by default |
server.displayStringTextFormat |
string |
“served %p pk (%l)\n%s” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
server.clockModule |
string |
“” |
Relative path of a module that implements IClock(1,:ref:2 <neddoc-msg-inet-iclock>); optional |
server.serveSchedulingPriority |
int |
-1 |
Specifies the FES scheduling priority for the extra event that is pulling the packet, -1 means no extra event |
server.processingTime |
double |
Determines additional processing time per packet |
|
server.processingBitrate |
double |
inf bps |
Determines additional processing time per bit |
Source code¶
//
// Implements a parameterizable leaky bucket algorithm.
//
module LeakyBucket 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=125,120");
}
server: <default("PacketServer")> like IPacketServer {
parameters:
@display("p=325,120");
}
connections:
in --> { @display("m=w"); } --> queue.in;
queue.out --> server.in;
server.out --> { @display("m=e"); } --> out;
}