A Discrete-Event Network Simulator
API
ns3::OFSwitch13Queue Class Reference

The OpenFlow 1.3 queue interface. More...

#include "ofswitch13-queue.h"

+ Inheritance diagram for ns3::OFSwitch13Queue:
+ Collaboration diagram for ns3::OFSwitch13Queue:

Public Member Functions

 OFSwitch13Queue ()
 Default constructor. More...
 
 ~OFSwitch13Queue () override
 Dummy destructor, see DoDispose. More...
 
bool Enqueue (Ptr< Packet > packet) override
 
int GetNQueues () const
 Get the number of internal queues. More...
 
Ptr< Queue< Packet > > GetQueue (int queueId) const
 Get a pointer to internal queue with specific id. More...
 
void SetPortStruct (struct sw_port *port)
 Set the pointer to the internal BOFUSS port structure. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type. More...
 

Protected Member Functions

uint32_t AddQueue (Ptr< Queue< Packet >> queue)
 Add a new internal queue to this OpenFlow queue interface. More...
 
void DoDispose () override
 Destructor implementation. More...
 
void DoInitialize () override
 
void NotifyDequeue (Ptr< Packet > packet)
 Notify the parent class of a packet dequeued from any internal queue. More...
 
void NotifyRemove (Ptr< Packet > packet)
 Notify the parent class of a packet removed from any internal queue. More...
 

Protected Attributes

uint64_t m_dpId
 OpenFlow datapath ID. More...
 
uint32_t m_portNo
 OpenFlow port number. More...
 

Private Types

typedef std::vector< Ptr< Queue > > QueueList_t
 Structure to save the list of internal queues in this queue interface. More...
 

Private Attributes

QueueList_t m_queues
 List of internal queues. More...
 
struct sw_port * m_swPort
 BOFUSS port structure. More...
 
 NS_LOG_TEMPLATE_DECLARE
 Redefinition of the log component. More...
 

Detailed Description

The OpenFlow 1.3 queue interface.

An OpenFlow switch provides limited Quality-of-Service support (QoS) through a simple queuing mechanism. One (or more) queues can attach to a port and be used to map flow entries on it. Flow entries mapped to a specific queue will be treated according to that queue's configuration. Queue configuration takes place outside the OpenFlow protocol.

This class implements the queue interface, extending the ns3::Queue<Packet> class to allow compatibility with the CsmaNetDevice used by OFSwitch13Port. Internally, it holds a collection of N (possibly different) queues, identified by IDs ranging from 0 to N-1. The Enqueue () method uses the ns3::QueueTag to identify which internal queue will hold the packet. Subclasses can perform different output scheduling algorithms by implementing the Dequeue (), Remove () and Peek () methods, always calling the NotifyDequeue () and NotifyRemoved () methods from this base class to keep consistency.

Config Paths

ns3::OFSwitch13Queue is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::SimpleNetDevice/TxQueue/$ns3::OFSwitch13Queue"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::CsmaNetDevice/TxQueue/$ns3::OFSwitch13Queue"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::PointToPointNetDevice/TxQueue/$ns3::OFSwitch13Queue"
  • "/NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Queue/$ns3::OFSwitch13Queue"

Attributes

No TraceSources are defined for this type.

TraceSources defined in parent class ns3::Queue<Packet>

TraceSources defined in parent class ns3::QueueBase

Size of this type is 352 bytes (on a 64-bit architecture).

Definition at line 54 of file ofswitch13-queue.h.

Member Typedef Documentation

◆ QueueList_t

typedef std::vector<Ptr<Queue> > ns3::OFSwitch13Queue::QueueList_t
private

Structure to save the list of internal queues in this queue interface.

Definition at line 123 of file ofswitch13-queue.h.

Constructor & Destructor Documentation

◆ OFSwitch13Queue()

ns3::OFSwitch13Queue::OFSwitch13Queue ( )

Default constructor.

Definition at line 53 of file ofswitch13-queue.cc.

References NS_LOG_FUNCTION.

◆ ~OFSwitch13Queue()

ns3::OFSwitch13Queue::~OFSwitch13Queue ( )
override

Dummy destructor, see DoDispose.

Definition at line 63 of file ofswitch13-queue.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ AddQueue()

uint32_t ns3::OFSwitch13Queue::AddQueue ( Ptr< Queue< Packet >>  queue)
protected

Add a new internal queue to this OpenFlow queue interface.

Parameters
queueThe queue pointer.
Returns
The ID for this new internal queue.

Definition at line 162 of file ofswitch13-queue.cc.

References m_queues, m_swPort, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and time_msec().

Referenced by ns3::OFSwitch13PriorityQueue::DoInitialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoDispose()

void ns3::OFSwitch13Queue::DoDispose ( )
overrideprotected

Destructor implementation.

Definition at line 129 of file ofswitch13-queue.cc.

References ns3::Queue< Item, Container >::DoDispose(), GetNQueues(), m_queues, m_swPort, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoInitialize()

void ns3::OFSwitch13Queue::DoInitialize ( )
overrideprotected

Definition at line 153 of file ofswitch13-queue.cc.

References ns3::Object::DoInitialize(), and NS_LOG_FUNCTION.

Referenced by ns3::OFSwitch13PriorityQueue::DoInitialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Enqueue()

bool ns3::OFSwitch13Queue::Enqueue ( Ptr< Packet packet)
override

◆ GetNQueues()

int ns3::OFSwitch13Queue::GetNQueues ( ) const

Get the number of internal queues.

Returns
The number of internal queues.

Definition at line 107 of file ofswitch13-queue.cc.

References m_queues.

Referenced by DoDispose(), Enqueue(), and ns3::OFSwitch13PriorityQueue::GetNonEmptyQueue().

+ Here is the caller graph for this function:

◆ GetQueue()

Ptr< Queue< Packet > > ns3::OFSwitch13Queue::GetQueue ( int  queueId) const

Get a pointer to internal queue with specific id.

Parameters
queueIdThe queue id.
Returns
The queue pointer.
Internal: This function is marked as const to allow its usage inside
DoPeek () member function.

Definition at line 113 of file ofswitch13-queue.cc.

References m_queues.

Referenced by ns3::OFSwitch13PriorityQueue::Dequeue(), Enqueue(), ns3::OFSwitch13PriorityQueue::GetNonEmptyQueue(), ns3::OFSwitch13PriorityQueue::Peek(), and ns3::OFSwitch13PriorityQueue::Remove().

+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::OFSwitch13Queue::GetTypeId ( )
static

Register this type.

Returns
The object TypeId.

Definition at line 39 of file ofswitch13-queue.cc.

References m_queues, ns3::MakeObjectVectorAccessor(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ NotifyDequeue()

void ns3::OFSwitch13Queue::NotifyDequeue ( Ptr< Packet packet)
protected

Notify the parent class of a packet dequeued from any internal queue.

Parameters
packetThe packet.

Definition at line 196 of file ofswitch13-queue.cc.

References NS_LOG_FUNCTION, and NS_LOG_WARN.

Referenced by ns3::OFSwitch13PriorityQueue::Dequeue().

+ Here is the caller graph for this function:

◆ NotifyRemove()

void ns3::OFSwitch13Queue::NotifyRemove ( Ptr< Packet packet)
protected

Notify the parent class of a packet removed from any internal queue.

Parameters
packetThe packet.

Definition at line 214 of file ofswitch13-queue.cc.

References NS_LOG_FUNCTION, and NS_LOG_WARN.

Referenced by ns3::OFSwitch13PriorityQueue::Remove().

+ Here is the caller graph for this function:

◆ SetPortStruct()

void ns3::OFSwitch13Queue::SetPortStruct ( struct sw_port *  port)

Set the pointer to the internal BOFUSS port structure.

Parameters
portThe port structure pointer.

Definition at line 119 of file ofswitch13-queue.cc.

References m_dpId, m_portNo, m_swPort, NS_LOG_FUNCTION, and port.

Member Data Documentation

◆ m_dpId

uint64_t ns3::OFSwitch13Queue::m_dpId
protected

OpenFlow datapath ID.

Definition at line 117 of file ofswitch13-queue.h.

Referenced by SetPortStruct().

◆ m_portNo

uint32_t ns3::OFSwitch13Queue::m_portNo
protected

OpenFlow port number.

Definition at line 118 of file ofswitch13-queue.h.

Referenced by SetPortStruct().

◆ m_queues

QueueList_t ns3::OFSwitch13Queue::m_queues
private

List of internal queues.

Definition at line 126 of file ofswitch13-queue.h.

Referenced by AddQueue(), DoDispose(), GetNQueues(), GetQueue(), and GetTypeId().

◆ m_swPort

struct sw_port* ns3::OFSwitch13Queue::m_swPort
private

BOFUSS port structure.

Definition at line 125 of file ofswitch13-queue.h.

Referenced by AddQueue(), DoDispose(), Enqueue(), and SetPortStruct().

◆ NS_LOG_TEMPLATE_DECLARE

ns3::OFSwitch13Queue::NS_LOG_TEMPLATE_DECLARE
private

Redefinition of the log component.

Definition at line 128 of file ofswitch13-queue.h.


The documentation for this class was generated from the following files: