Table Of Contents
Table Of Contents

Limiting the Data Rate of a Packet Stream

Rate meter modules (ExponentialRateMeter and SlidingWindowRateMeter) and rate limiter modules ():ned:StatisticalRateLimiter) 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 ExponentialRateMeter, and if the rate of packets is higher than a predefined threshold, then packets are dropped by the StatisticalRateLimiter.

network MeterTutorialStep
        producer: ActivePacketSource {
        meter: ExponentialRateMeter {
        limiter: StatisticalRateLimiter {
        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