Table Of Contents
Table Of Contents

Limiting the Data Rate of a Packet Stream

The RateMeter and RateLimiter modules can be used to limit the data rate of a stream of packets. The meter measures the data rate of the incoming stream of packets, and attaches a rate tag to each packet. The limiter module, based on the rate tag, limits the outgoing data rate to a configurable value.

In this step, packets are produced periodically by an active packet source (ActivePacketSource). The packets are consumed by a passive packet sink (PassivePacketSink). The packet rate is measured by a RateMeter, and if the rate of packets is higher than a predefined threshold, then packets are dropped by the RateLimiter.

network MeterTutorialStep
        producer: ActivePacketSource {
        meter: RateMeter {
        limiter: RateLimiter {
        consumer: PassivePacketSink {
    connections allowunconnected:
        producer.out -->;
        meter.out -->;
        limiter.out -->;
[Config Meter]
network = MeterTutorialStep
sim-time-limit = 100s

*.producer.packetLength = 1B
*.producer.productionInterval = 1s
*.meter.alpha = 0.9
*.limiter.maxPacketrate = 0.5