Table Of Contents
Table Of Contents

Leaky Bucket

The LeakyBucket compound module implements the leaky bucket algorithm. By default, the module contains a DropTailQueue, and a PacketServer. The queue capacity and the processing time of the server can be used to parameterize the leaky bucket algorithm.

In this example network, packets are produced by an active packet source (ActivePacketSource). The packet source pushes packets into a LeakyBucket module, which pushes them into a passive packet sink (PassivePacketSink). The leaky bucket is configured with a processing time of 1s, and a packet capacity of 1.

network LeakyBucketTutorialStep
        producer: ActivePacketSource {
        bucket: LeakyBucket {
        consumer: PassivePacketSink {
    connections allowunconnected:
        producer.out -->;
        bucket.out -->;
[Config LeakyBucket]
network = LeakyBucketTutorialStep
sim-time-limit = 10s

*.producer.packetLength = 1B
*.producer.productionInterval = uniform(0s, 0.5s)
*.bucket.server.processingTime = 1s