A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::NetDeviceQueueInterface Class Reference

Network device transmission queue interface. More...

#include "net-device-queue-interface.h"

+ Inheritance diagram for ns3::NetDeviceQueueInterface:
+ Collaboration diagram for ns3::NetDeviceQueueInterface:

Public Types

typedef std::function< std::size_t(Ptr< QueueItem >)> SelectQueueCallback
 Callback invoked to determine the tx queue selected for a given packet.
 

Public Member Functions

 NetDeviceQueueInterface ()
 Constructor.
 
 ~NetDeviceQueueInterface () override
 
std::size_t GetNTxQueues () const
 Get the number of device transmission queues.
 
SelectQueueCallback GetSelectQueueCallback () const
 Get the select queue callback.
 
Ptr< NetDeviceQueueGetTxQueue (std::size_t i) const
 Get the i-th transmission queue of the device.
 
void SetNTxQueues (std::size_t numTxQueues)
 Set the number of device transmission queues to create.
 
void SetSelectQueueCallback (SelectQueueCallback cb)
 Set the select queue callback.
 
void SetTxQueuesType (TypeId type)
 Set the type of device transmission queues to create.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
virtual TypeId GetInstanceTypeId () const =0
 Get the most derived TypeId for this Object.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Protected Member Functions

void DoDispose () override
 Dispose of the object.
 
void NotifyNewAggregate () override
 Notify that an object was aggregated.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Attributes

SelectQueueCallback m_selectQueueCallback
 Select queue callback.
 
ObjectFactory m_txQueues
 Device transmission queues TypeId.
 
std::vector< Ptr< NetDeviceQueue > > m_txQueuesVector
 Device transmission queues.
 

Additional Inherited Members

Detailed Description

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:

  • set the number of transmission queues
  • set the method used (by upper layers) to determine the transmission queue in which the netdevice would enqueue a given packet NetDevice helpers create this interface and aggregate it to the device.


Attributes

  • NTxQueues: The number of device transmission queues
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 1:65535
    • Initial value: 1
    • Flags: constructread
  • TxQueuesType: The type of transmission queues to be used

No TraceSources are defined for this type.
Size of this type is 112 bytes (on a 64-bit architecture).

Definition at line 230 of file net-device-queue-interface.h.

Member Typedef Documentation

◆ SelectQueueCallback

typedef std::function<std::size_t(Ptr<QueueItem>)> ns3::NetDeviceQueueInterface::SelectQueueCallback

Callback invoked to determine the tx queue selected for a given packet.

Definition at line 282 of file net-device-queue-interface.h.

Constructor & Destructor Documentation

◆ NetDeviceQueueInterface()

ns3::NetDeviceQueueInterface::NetDeviceQueueInterface ( )

Constructor.

Definition at line 199 of file net-device-queue-interface.cc.

References m_selectQueueCallback, and NS_LOG_FUNCTION.

◆ ~NetDeviceQueueInterface()

ns3::NetDeviceQueueInterface::~NetDeviceQueueInterface ( )
override

Definition at line 207 of file net-device-queue-interface.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ DoDispose()

void ns3::NetDeviceQueueInterface::DoDispose ( )
overrideprotectedvirtual

Dispose of the object.

Reimplemented from ns3::Object.

Definition at line 226 of file net-device-queue-interface.cc.

References ns3::Object::DoDispose(), m_txQueuesVector, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetNTxQueues()

std::size_t ns3::NetDeviceQueueInterface::GetNTxQueues ( ) const

Get the number of device transmission queues.

Returns
the number of device transmission queues.

Definition at line 220 of file net-device-queue-interface.cc.

References m_txQueuesVector.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ GetSelectQueueCallback()

NetDeviceQueueInterface::SelectQueueCallback ns3::NetDeviceQueueInterface::GetSelectQueueCallback ( ) const

Get the select queue callback.

Returns
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 282 of file net-device-queue-interface.cc.

References m_selectQueueCallback.

◆ GetTxQueue()

Ptr< NetDeviceQueue > ns3::NetDeviceQueueInterface::GetTxQueue ( std::size_t  i) const

Get the i-th transmission queue of the device.

Parameters
ithe index of the requested queue.
Returns
the i-th transmission queue of the device.

The index of the first transmission queue is zero.

Definition at line 213 of file net-device-queue-interface.cc.

References m_txQueuesVector, and NS_ASSERT.

◆ GetTypeId()

TypeId ns3::NetDeviceQueueInterface::GetTypeId ( )
static

◆ NotifyNewAggregate()

void ns3::NetDeviceQueueInterface::NotifyNewAggregate ( )
overrideprotectedvirtual

Notify that an object was aggregated.

Reimplemented from ns3::Object.

Definition at line 235 of file net-device-queue-interface.cc.

References m_txQueuesVector, ns3::Object::NotifyNewAggregate(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetNTxQueues()

void ns3::NetDeviceQueueInterface::SetNTxQueues ( std::size_t  numTxQueues)

Set the number of device transmission queues to create.

Parameters
numTxQueuesnumber of device transmission queues to create.

This method is called when the NTxQueues attribute is set to create the corresponding number of device transmission queues. It cannot be called again afterwards.

Definition at line 260 of file net-device-queue-interface.cc.

References ns3::ObjectFactory::Create(), ns3::Object::GetObject(), m_txQueues, m_txQueuesVector, NS_ABORT_MSG_IF, NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

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

◆ SetSelectQueueCallback()

void ns3::NetDeviceQueueInterface::SetSelectQueueCallback ( SelectQueueCallback  cb)

Set the select queue callback.

Parameters
cbthe callback to set.

This method is called to set the select queue callback, i.e., the method used to select a device transmission queue for a given packet.

Definition at line 276 of file net-device-queue-interface.cc.

References m_selectQueueCallback.

◆ SetTxQueuesType()

void ns3::NetDeviceQueueInterface::SetTxQueuesType ( TypeId  type)

Set the type of device transmission queues to create.

Parameters
typetype of device transmission queues to create.

This method is called when the TxQueuesType attribute is set to create the corresponding type of device transmission queues. It cannot be called again afterwards.

Definition at line 248 of file net-device-queue-interface.cc.

References m_txQueues, m_txQueuesVector, NS_ABORT_MSG_IF, NS_LOG_FUNCTION, ns3::Object::ObjectFactory, and ns3::ObjectFactory::SetTypeId().

Referenced by GetTypeId().

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

Member Data Documentation

◆ m_selectQueueCallback

SelectQueueCallback ns3::NetDeviceQueueInterface::m_selectQueueCallback
private

Select queue callback.

Definition at line 315 of file net-device-queue-interface.h.

Referenced by NetDeviceQueueInterface(), GetSelectQueueCallback(), and SetSelectQueueCallback().

◆ m_txQueues

ObjectFactory ns3::NetDeviceQueueInterface::m_txQueues
private

Device transmission queues TypeId.

Definition at line 313 of file net-device-queue-interface.h.

Referenced by SetNTxQueues(), and SetTxQueuesType().

◆ m_txQueuesVector

std::vector<Ptr<NetDeviceQueue> > ns3::NetDeviceQueueInterface::m_txQueuesVector
private

Device transmission queues.

Definition at line 314 of file net-device-queue-interface.h.

Referenced by DoDispose(), GetNTxQueues(), GetTxQueue(), NotifyNewAggregate(), SetNTxQueues(), and SetTxQueuesType().


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