Table Of Contents
Table Of Contents

Content-Based Scheduler

The ContentBasedScheduler pops packets from the connected passive packet sources based on the configured packet filter and packet data filter functions. There is one filter (of both kinds) per packet source. The scheduler iterates over the packet filter expressions and the packets offered by each connected packet source, and chooses the first matching packet to pop. It inherently prioritizes earlier expressions and earlier input gates.

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

The providers generate packets at random intervals between 0 and 2 seconds, randomly containing either 0 or 1 as data; the collector pops a packet from the scheduler every second. The scheduler’s packet data filter is configured to first match packets containing 1, then those containing 0.

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

*.provider*.providingInterval = uniform(0s, 2s)
*.provider*.packetLength = 1B
*.provider*.packetData = intuniform(0,1)
*.collector.collectionInterval = 1s
*.scheduler.packetFilters = [expr( == 1), expr( == 0)]