c++ns-3

What is the difference between queue and queue discipline in ns3?


I found that there are two classes about the queue in NS3

The first one is the https://github.com/nsnam/ns-3-dev-git/blob/master/src/network/utils/queue.h, which is named queue and a drop tail queue is implemented based on this.

The other is the https://github.com/nsnam/ns-3-dev-git/blob/master/src/traffic-control/model/queue-disc.h, which is named queue discipline and many queue are implemented

I now want to know what's the difference between these two notations?


Solution

  • First, I want to encourage you to read the ns-3 tutorial. You will find many of the answers to your questions there.

    Queue and QueueDisc are not merely notations, they're distinct objects that serve distinct purposes. According to the ns-3 tutorial,

    Architecturally, ns-3 separates the device layer from the IP layers or traffic control layers of an Internet host. Since recent releases of ns-3, outgoing packets traverse two queueing layers before reaching the channel object. The first queueing layer encountered is what is called the ‘traffic control layer’ in ns-3; here, active queue management (RFC7567) and prioritization due to quality-of-service (QoS) takes place in a device-independent manner through the use of queueing disciplines. The second queueing layer is typically found in the NetDevice objects. Different devices (e.g. LTE, Wi-Fi) have different implementations of these queues.

    So, Queue's are the lowest level objects that actually store packets. A QueueDisc is an abstract class that provides a queue-like interface, but it actually implements Active Queue Management (AQM). More information about QueueDiscs can be found in the 'Detailed Description' section of the QueueDisc API documentation.

    An implementation detail specific to ns-3: QueueDisc's actually encapsulate a Queue. This makes sense since a QueueDisc still needs to store the packets it gets.

    You will find many of ns-3's interfaces attempt to mirror the network subsystem of Linux.