Network device transmission queue interface. More...
#include "net-device-queue-interface.h"
Public Types | |
typedef Callback< uint8_t, Ptr< QueueItem > > | SelectQueueCallback |
Callback invoked to determine the tx queue selected for a given packet. More... | |
Public Member Functions | |
NetDeviceQueueInterface () | |
Constructor. More... | |
virtual | ~NetDeviceQueueInterface () |
template<typename Item > | |
void | ConnectQueueTraces (Ptr< Queue< Item > > queue, uint8_t txq) |
Connect the traced callbacks of a queue to the static methods of the NetDeviceQueue class to support flow control and dynamic queue limits. More... | |
void | CreateTxQueues (void) |
Create the device transmission queues. More... | |
bool | GetLateTxQueuesCreation (void) const |
Get the value of the late TX queues creation flag. More... | |
uint8_t | GetNTxQueues (void) const |
Get the number of device transmission queues. More... | |
SelectQueueCallback | GetSelectQueueCallback (void) const |
Get the select queue callback. More... | |
Ptr< NetDeviceQueue > | GetTxQueue (uint8_t i) const |
Get the i-th transmission queue of the device. More... | |
void | SetLateTxQueuesCreation (bool value) |
Set the late TX queues creation flag. More... | |
void | SetSelectQueueCallback (SelectQueueCallback cb) |
Set the select queue callback. More... | |
void | SetTxQueuesN (uint8_t numTxQueues) |
Set the number of device transmission queues to create. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
Dispose of the object. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Attributes | |
bool | m_lateTxQueuesCreation |
True if a device wants to create the TX queues by itself. More... | |
uint8_t | m_numTxQueues |
Number of transmission queues to create. More... | |
SelectQueueCallback | m_selectQueueCallback |
Select queue callback. More... | |
std::map< Ptr< QueueBase >, std::vector< CallbackBase > > | m_traceMap |
Map storing all the connected traces. More... | |
std::vector< Ptr< NetDeviceQueue > > | m_txQueuesVector |
Device transmission queues. More... | |
Additional Inherited Members | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
Network device transmission queue interface.
Introspection did not find any typical Config paths.
This interface is used by the traffic control layer and by the aggregated device to access the transmission queues of the device. Additionally, through this interface, traffic control aware netdevices can:
No Attributes are defined for this type.
No TraceSources are defined for this type.
Size of this type is 96 bytes (on a 64-bit architecture).
Definition at line 218 of file net-device-queue-interface.h.
typedef Callback< uint8_t, Ptr<QueueItem> > ns3::NetDeviceQueueInterface::SelectQueueCallback |
Callback invoked to determine the tx queue selected for a given packet.
Definition at line 288 of file net-device-queue-interface.h.
ns3::NetDeviceQueueInterface::NetDeviceQueueInterface | ( | ) |
Constructor.
Creates one NetDeviceQueue by default
Definition at line 161 of file net-device-queue-interface.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 168 of file net-device-queue-interface.cc.
References NS_LOG_FUNCTION.
void ns3::NetDeviceQueueInterface::ConnectQueueTraces | ( | Ptr< Queue< Item > > | queue, |
uint8_t | txq | ||
) |
Connect the traced callbacks of a queue to the static methods of the NetDeviceQueue class to support flow control and dynamic queue limits.
Implementation of the templates declared above.
queue | the queue |
txq | the index of the tx queue |
Definition at line 339 of file net-device-queue-interface.h.
References GetNTxQueues(), m_traceMap, ns3::MakeBoundCallback(), and NS_ASSERT.
void ns3::NetDeviceQueueInterface::CreateTxQueues | ( | void | ) |
Create the device transmission queues.
Called by the traffic control layer just after aggregating this netdevice queue interface to the netdevice.
Definition at line 221 of file net-device-queue-interface.cc.
References m_numTxQueues, m_txQueuesVector, NS_ABORT_MSG_IF, and NS_LOG_FUNCTION.
Referenced by PointToPointTest::DoRun().
|
protectedvirtual |
Dispose of the object.
Reimplemented from ns3::Object.
Definition at line 187 of file net-device-queue-interface.cc.
References ns3::Object::DoDispose(), m_traceMap, m_txQueuesVector, NS_LOG_FUNCTION, and NS_LOG_WARN.
bool ns3::NetDeviceQueueInterface::GetLateTxQueuesCreation | ( | void | ) | const |
Get the value of the late TX queues creation flag.
Definition at line 236 of file net-device-queue-interface.cc.
References m_lateTxQueuesCreation.
uint8_t ns3::NetDeviceQueueInterface::GetNTxQueues | ( | void | ) | const |
Get the number of device transmission queues.
Definition at line 181 of file net-device-queue-interface.cc.
References m_txQueuesVector.
Referenced by ConnectQueueTraces().
NetDeviceQueueInterface::SelectQueueCallback ns3::NetDeviceQueueInterface::GetSelectQueueCallback | ( | void | ) | const |
Get the select queue callback.
Called by the traffic control layer to get the select queue callback set by a multi-queue device.
Definition at line 255 of file net-device-queue-interface.cc.
References m_selectQueueCallback.
Ptr< NetDeviceQueue > ns3::NetDeviceQueueInterface::GetTxQueue | ( | uint8_t | i | ) | const |
Get the i-th transmission queue of the device.
i | the index of the requested queue. |
The index of the first transmission queue is zero.
Definition at line 174 of file net-device-queue-interface.cc.
References m_txQueuesVector, and NS_ASSERT.
Referenced by TcFlowControlTestCase::CheckDeviceQueueStopped().
|
static |
Get the type ID.
Definition at line 151 of file net-device-queue-interface.cc.
References ns3::TypeId::SetParent().
void ns3::NetDeviceQueueInterface::SetLateTxQueuesCreation | ( | bool | value | ) |
Set the late TX queues creation flag.
value | the boolean value |
By default, the late TX queues creation flag is false, which leads the traffic control layer to create the TX queues right after the netdevice queue interface is aggregated to the device. Netdevices that want to explicitly create TX queues at a later stage need to set this flag to true in the NotifyNewAggregate method.
Definition at line 242 of file net-device-queue-interface.cc.
References m_lateTxQueuesCreation, and NS_LOG_FUNCTION.
void ns3::NetDeviceQueueInterface::SetSelectQueueCallback | ( | SelectQueueCallback | cb | ) |
Set the select queue callback.
cb | the callback to set. |
A multi-queue netdevice must call this method from within its NotifyNewAggregate method to set the select queue callback, i.e., the method used to select a device transmission queue for a given packet.
Definition at line 249 of file net-device-queue-interface.cc.
References m_selectQueueCallback.
void ns3::NetDeviceQueueInterface::SetTxQueuesN | ( | uint8_t | numTxQueues | ) |
Set the number of device transmission queues to create.
numTxQueues | number of device transmission queues to create. |
A multi-queue netdevice must call this method from within its NotifyNewAggregate method to set the number of device transmission queues to create.
Definition at line 209 of file net-device-queue-interface.cc.
References m_numTxQueues, m_txQueuesVector, NS_ABORT_MSG_IF, NS_ASSERT, and NS_LOG_FUNCTION.
|
private |
True if a device wants to create the TX queues by itself.
Definition at line 328 of file net-device-queue-interface.h.
Referenced by GetLateTxQueuesCreation(), and SetLateTxQueuesCreation().
|
private |
Number of transmission queues to create.
Definition at line 327 of file net-device-queue-interface.h.
Referenced by CreateTxQueues(), and SetTxQueuesN().
|
private |
Select queue callback.
Definition at line 326 of file net-device-queue-interface.h.
Referenced by GetSelectQueueCallback(), and SetSelectQueueCallback().
|
private |
Map storing all the connected traces.
Definition at line 329 of file net-device-queue-interface.h.
Referenced by ConnectQueueTraces(), and DoDispose().
|
private |
Device transmission queues.
Definition at line 325 of file net-device-queue-interface.h.
Referenced by CreateTxQueues(), DoDispose(), GetNTxQueues(), GetTxQueue(), and SetTxQueuesN().