A Discrete-Event Network Simulator
API
Traffic-control

The Traffic Control layer aims at introducing an equivalent of the Linux Traffic Control infrastructure into ns-3. More...

+ Collaboration diagram for Traffic-control:

Modules

 traffic-control module tests
 

Classes

class  ns3::ArpQueueDiscItem
 ArpQueueDiscItem is a subclass of QueueDiscItem which stores ARP packets. More...
 
class  ns3::CobaltQueueDisc
 Cobalt packet queue disc. More...
 
class  ns3::CoDelQueueDisc
 A CoDel packet queue disc. More...
 
class  ns3::FifoQueueDisc
 Simple queue disc implementing the FIFO (First-In First-Out) policy. More...
 
class  ns3::FqCobaltFlow
 A flow queue used by the FqCobalt queue disc. More...
 
class  ns3::FqCobaltQueueDisc
 A FqCobalt packet queue disc. More...
 
class  ns3::FqCoDelFlow
 A flow queue used by the FqCoDel queue disc. More...
 
class  ns3::FqCoDelQueueDisc
 A FqCoDel packet queue disc. More...
 
class  ns3::FqPieFlow
 A flow queue used by the FqPie queue disc. More...
 
class  ns3::FqPieQueueDisc
 A FqPie packet queue disc. More...
 
class  ns3::Ipv4PacketFilter
 Ipv4PacketFilter is the abstract base class for filters defined for IPv4 packets. More...
 
class  ns3::Ipv4QueueDiscItem
 Ipv4QueueDiscItem is a subclass of QueueDiscItem which stores IPv4 packets. More...
 
class  ns3::Ipv6PacketFilter
 Ipv6PacketFilter is the abstract base class for filters defined for IPv6 packets. More...
 
class  ns3::Ipv6QueueDiscItem
 Ipv6QueueDiscItem is a subclass of QueueDiscItem which stores IPv6 packets. More...
 
class  ns3::MqQueueDisc
 mq is a classful multi-queue aware dummy scheduler. More...
 
class  ns3::PacketFilter
 PacketFilter is the abstract base class for filters used by queue discs to classify packets. More...
 
class  ns3::PfifoFastQueueDisc
 Linux pfifo_fast is the default priority queue enabled on Linux systems. More...
 
class  ns3::PieQueueDisc
 Implements PIE Active Queue Management discipline. More...
 
class  ns3::PrioQueueDisc
 The Prio qdisc is a simple classful queueing discipline that contains an arbitrary number of classes of differing priority. More...
 
class  ns3::QKDKMSQueueLogic
 Linux pfifo_fast is the default priority queue enabled on Linux systems. More...
 
class  ns3::QueueDisc
 QueueDisc is an abstract base class providing the interface and implementing the operations common to all the queueing disciplines. More...
 
class  ns3::QueueDiscClass
 QueueDiscClass is the base class for classes that are included in a queue disc. More...
 
class  ns3::QueueDiscContainer
 Holds a vector of ns3::QueueDisc pointers. More...
 
class  ns3::QueueDiscFactory
 This class stores object factories required to create a queue disc and all of its components (packet filters, internal queues, classes). More...
 
class  ns3::RedQueueDisc
 A RED packet queue disc. More...
 
class  ns3::TbfQueueDisc
 A TBF packet queue disc. More...
 
class  ns3::TrafficControlHelper
 Build a set of QueueDisc objects. More...
 

Enumerations

enum  ns3::QueueDiscSizePolicy { ns3::SINGLE_INTERNAL_QUEUE , ns3::SINGLE_CHILD_QUEUE_DISC , ns3::MULTIPLE_QUEUES , ns3::NO_LIMITS }
 Enumeration of the available policies to handle the queue disc size. More...
 

Detailed Description

The Traffic Control layer aims at introducing an equivalent of the Linux Traffic Control infrastructure into ns-3.

The Traffic Control layer sits in between the NetDevices (L2) and any network protocol (e.g., IP). It is in charge of processing packets and performing actions on them: scheduling, dropping, marking, policing, etc.

Traffic control layer class

This object represents the main interface of the Traffic Control Module. Basically, we manage both IN and OUT directions (sometimes called RX and TX, respectively). The OUT direction is easy to follow, since it involves direct calls: upper layer (e.g. IP) calls the Send method on an instance of this class, which then calls the Enqueue method of the QueueDisc associated with the device. The Dequeue method of the QueueDisc finally calls the Send method of the NetDevice.

The IN direction uses a little trick to reduce dependencies between modules. In simple words, we use Callbacks to connect upper layer (which should register their Receive callback through RegisterProtocolHandler) and NetDevices.

An example of the IN connection between this layer and IP layer is the following:

Ptr<TrafficControlLayer> tc = m_node->GetObject<TrafficControlLayer> ();

NS_ASSERT (tc != 0);

m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
                                 Ipv4L3Protocol::PROT_NUMBER, device);
m_node->RegisterProtocolHandler (MakeCallback (&TrafficControlLayer::Receive, tc),
                                 ArpL3Protocol::PROT_NUMBER, device);

tc->RegisterProtocolHandler (MakeCallback (&Ipv4L3Protocol::Receive, this),
                             Ipv4L3Protocol::PROT_NUMBER, device);
tc->RegisterProtocolHandler (MakeCallback (&ArpL3Protocol::Receive, PeekPointer (GetObject<ArpL3Protocol> ())),
                             ArpL3Protocol::PROT_NUMBER, device);

On the node, for IPv4 and ARP packet, is registered the TrafficControlLayer::Receive callback. At the same time, on the TrafficControlLayer object, is registered the callbacks associated to the upper layers (IPv4 or ARP).

When the node receives an IPv4 or ARP packet, it calls the Receive method on TrafficControlLayer, that calls the right upper-layer callback once it finishes the operations on the packet received.

Discrimination through callbacks (in other words: what is the right upper-layer callback for this packet?) is done through checks over the device and the protocol number.

Enumeration Type Documentation

◆ QueueDiscSizePolicy

Enumeration of the available policies to handle the queue disc size.

  • SINGLE_INTERNAL_QUEUE is intended to handle the maxSize attribute of queue discs having a single internal queue. If no internal queue is yet attached to the queue disc, setting/getting this attribute involves setting/getting the member variable of the queue disc; otherwise, the corresponding attribute of the internal queue is set/get.
  • SINGLE_CHILD_QUEUE_DISC is intended to handle the maxSize attribute of queue discs having a single child queue disc. If no child queue disc is yet attached to the queue disc, setting/getting this attribute involves setting/getting the member variable of the queue disc; otherwise, the corresponding attribute of the child queue disc is set/get.
  • MULTIPLE_QUEUES is intended to handle the maxSize attribute of queue discs having multiple internal queues or child queue discs. Setting/getting this attribute always involves setting/getting the member variable of the queue disc. Queue discs should warn the user if a packet is dropped by an internal queue/child queue disc because of lack of space, while the queue disc limit is not exceeded.
Enumerator
SINGLE_INTERNAL_QUEUE 

Used by queue discs with single internal queue.

SINGLE_CHILD_QUEUE_DISC 

Used by queue discs with single child queue disc.

MULTIPLE_QUEUES 

Used by queue discs with multiple internal queues/child queue discs.

NO_LIMITS 

Used by queue discs with unlimited size.

Definition at line 103 of file queue-disc.h.