Table Of Contents
Table Of Contents

Priority Scheduler

This step demonstrates the PriorityScheduler module. The module pops packets from the first connected non-empty queue or packet provider.

In this example network, two active packet sources (ActivePacketSource) generate packets in random periods. The packets are pushed into queues (PacketQueue), where they are stored temporarily. The queues are connected to a priority scheduler (PriorityScheduler). An active packet sink (ActivePacketSink) pops packets from the scheduler, which in turn pops packets from one of the queues in a prioritized way, favoring the first queue.

network PrioritySchedulerTutorialStep
        producer1: ActivePacketSource {
        producer2: ActivePacketSource {
        queue1: PacketQueue {
        queue2: PacketQueue {
        scheduler: PriorityScheduler {
        collector: ActivePacketSink {
    connections allowunconnected:
        producer1.out -->;
        producer2.out -->;
        queue1.out -->;
        queue2.out -->;
        scheduler.out -->;
[Config PriorityScheduler]
network = PrioritySchedulerTutorialStep
sim-time-limit = 10s

*.producer*.packetLength = 1B
*.producer*.productionInterval = uniform(0s, 2s)
*.collector.collectionInterval = uniform(0s, 1s)