Table Of Contents
Table Of Contents

Enqueueing Packets

This step demonstrates the PacketQueue module, which can store a configurable number of packets. By default, it works as a FIFO queue and has unlimited capacity. Optionally, the queue can be limited (both by number of packets and byte count), and ordering can be specified.

In the following example network, packets are produced at random intervals by an active packet source (ActivePacketSource). The packets are pushed into an unlimited FIFO queue (PacketQueue), where they are stored temporarily. An active packet sink (ActivePacketSink) module pops packets from the queue at random intervals.

network PacketQueueTutorialStep
        producer: ActivePacketSource {
        queue: PacketQueue {
        collector: ActivePacketSink {
    connections allowunconnected:
        producer.out -->;
        queue.out -->;
[Config PacketQueue]
network = PacketQueueTutorialStep
sim-time-limit = 10s

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