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
{
@display("bgb=600,400");
submodules:
provider1: PassivePacketSource {
@display("p=100,100");
}
provider2: PassivePacketSource {
@display("p=100,200");
}
provider3: PassivePacketSource {
@display("p=100,300");
}
scheduler: WrrScheduler {
@display("p=300,100");
}
collector: ActivePacketSink {
@display("p=500,100");
}
connections allowunconnected:
provider1.out --> scheduler.in++;
provider2.out --> scheduler.in++;
provider3.out --> scheduler.in++;
scheduler.out --> collector.in;
}
[Config WrrScheduler]
network = WrrSchedulerTutorialStep
sim-time-limit = 100s
*.provider*.packetLength = 1B
*.collector.collectionInterval = 1s
*.scheduler.weights = "1 3 2"