The OpenFlow 1.3 queue interface. More...
#include "ofswitch13-queue.h"
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... | |
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.
ns3::OFSwitch13Queue is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 352 bytes (on a 64-bit architecture).
Definition at line 54 of file ofswitch13-queue.h.
|
private |
Structure to save the list of internal queues in this queue interface.
Definition at line 123 of file ofswitch13-queue.h.
ns3::OFSwitch13Queue::OFSwitch13Queue | ( | ) |
|
override |
Dummy destructor, see DoDispose.
Definition at line 63 of file ofswitch13-queue.cc.
References NS_LOG_FUNCTION.
Add a new internal queue to this OpenFlow queue interface.
queue | The queue pointer. |
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().
|
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.
|
overrideprotected |
Definition at line 153 of file ofswitch13-queue.cc.
References ns3::Object::DoInitialize(), and NS_LOG_FUNCTION.
Referenced by ns3::OFSwitch13PriorityQueue::DoInitialize().
Definition at line 69 of file ofswitch13-queue.cc.
References GetNQueues(), GetQueue(), ns3::QueueTag::GetQueueId(), ns3::Packet::GetSize(), m_swPort, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Packet::PeekPacketTag().
int ns3::OFSwitch13Queue::GetNQueues | ( | ) | const |
Get 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().
Get a pointer to internal queue with specific id.
queueId | The queue id. |
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().
|
static |
Register this type.
Definition at line 39 of file ofswitch13-queue.cc.
References m_queues, ns3::MakeObjectVectorAccessor(), and ns3::TypeId::SetParent().
Notify the parent class of a packet dequeued from any internal queue.
packet | The packet. |
Definition at line 196 of file ofswitch13-queue.cc.
References NS_LOG_FUNCTION, and NS_LOG_WARN.
Referenced by ns3::OFSwitch13PriorityQueue::Dequeue().
Notify the parent class of a packet removed from any internal queue.
packet | The packet. |
Definition at line 214 of file ofswitch13-queue.cc.
References NS_LOG_FUNCTION, and NS_LOG_WARN.
Referenced by ns3::OFSwitch13PriorityQueue::Remove().
void ns3::OFSwitch13Queue::SetPortStruct | ( | struct sw_port * | port | ) |
Set the pointer to the internal BOFUSS port structure.
port | The port structure pointer. |
Definition at line 119 of file ofswitch13-queue.cc.
References m_dpId, m_portNo, m_swPort, NS_LOG_FUNCTION, and port.
|
protected |
OpenFlow datapath ID.
Definition at line 117 of file ofswitch13-queue.h.
Referenced by SetPortStruct().
|
protected |
OpenFlow port number.
Definition at line 118 of file ofswitch13-queue.h.
Referenced by SetPortStruct().
|
private |
List of internal queues.
Definition at line 126 of file ofswitch13-queue.h.
Referenced by AddQueue(), DoDispose(), GetNQueues(), GetQueue(), and GetTypeId().
|
private |
BOFUSS port structure.
Definition at line 125 of file ofswitch13-queue.h.
Referenced by AddQueue(), DoDispose(), Enqueue(), and SetPortStruct().
|
private |
Redefinition of the log component.
Definition at line 128 of file ofswitch13-queue.h.