Table Of Contents
Table Of Contents

Dropping Packets from a Finite Queue

The DropTailQueue module extends PacketQueue by specifying a packet capacity, and setting a packet dropper function. By default, the packet capacity is set to 100, and packets are dropped from the end of the queue.

In this example network, packets are created at random intervals by an active packet source (ActivePacketSource) The packets are pushed into a drop-tail queue (DropTailQueue) with a capacity of 4 packets. The packets are popped from the queue at random intervals by an active packet sink (ActivePacketSink).

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

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