Table Of Contents
Table Of Contents

Generic Scheduler

The PacketScheduler connects to multiple passive packet sources on its inputs, and one active packet sink on its output. When a packet is popped from the scheduler, it pops a packet from one of its inputs, based on the configured packet scheduler function.

In this network, packets are generated by two passive packet sources (PassivePacketSource). The sources are connected to a PacketScheduler. An active packet sink (ActivePacketSink) pops packets from the scheduler, which pops packets from one of the packet sources.

Packets are generated by the providers at random intervals of 0 to 2 seconds; the collector pops a packet each second. The packets contain one byte of random data (0-255). The scheduler is configured to use the PacketDataScheduler function to schedule packets. The function selects the highest data value of the packets currently offered by the connected schedulers.

Note that when a provider generates a packet, it cannot generate another one for the configured providing interval. In this period, the provider doesn’t have an available packet. In this case, the scheduler pops packets from the other provider if it has an available packet; if it doesn’t, the next packet is popped as soon as one becomes available.

network GenericSchedulerTutorialStep
        provider1: PassivePacketSource {
        provider2: PassivePacketSource {
        scheduler: PacketScheduler {
        collector: ActivePacketSink {
    connections allowunconnected:
        provider1.out -->;
        provider2.out -->;
        scheduler.out -->;
[Config GenericScheduler]
network = GenericSchedulerTutorialStep
sim-time-limit = 10s

*.provider*.providingInterval = uniform(0s, 2s)
*.provider*.packetLength = 1B
*.provider*.packetData = intuniform(0,255)
*.collector.collectionInterval = 1s