Table Of Contents
Table Of Contents

Weighted Round-Robin Scheduler

The Weighted Round-Robin Scheduler (WrrScheduler) module connects multiple passive packet sources to a single active packet sink. When the collector requests a packet, the scheduler pops a packet from one of the connected packet sources.

The WrrScheduler schedules packets from one of its connected packet sources in a round-robin fashion, based on the configured weights of the inputs. For example, if the configured weights are [2,3], then the first two packets are popped from input 0, the next three from input 1.

In this example network, packets are created by two passive packet sources (PassivePacketSource). The sources are connected to a WrrScheduler. The scheduler is connected to an active packet sink (ActivePacketSink), which pops packets from the scheduler periodically. The inputs of the scheduler are configured to have the weights [1 3 2], thus the scheduler pops 1, 3 and 2 packet(s) from the three providers in one round.

network WrrSchedulerTutorialStep
        provider1: PassivePacketSource {
        provider2: PassivePacketSource {
        provider3: PassivePacketSource {

        scheduler: WrrScheduler {
        collector: ActivePacketSink {
    connections allowunconnected:
        provider1.out -->;
        provider2.out -->;
        provider3.out -->;
        scheduler.out -->;
[Config WrrScheduler]
network = WrrSchedulerTutorialStep
sim-time-limit = 100s

*.provider*.packetLength = 1B
*.collector.collectionInterval = 1s
*.scheduler.weights = "1 3 2"