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

RrWifiQueueScheduler is a wifi queue scheduler that serves container queues in a round robin fashion. More...

#include "rr-wifi-queue-scheduler.h"

Inheritance diagram for ns3::RrWifiQueueScheduler:
Collaboration diagram for ns3::RrWifiQueueScheduler:

Public Member Functions

 RrWifiQueueScheduler ()
void SetWifiMac (Ptr< WifiMac > mac) override
 Set the wifi MAC.
Public Member Functions inherited from ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >
 WifiMacQueueSchedulerImpl ()
 Constructor.
void BlockAllQueues (WifiQueueBlockedReason reason, const std::set< uint8_t > &linkIds, const std::set< WifiRcvAddr > &addrTypes) final
 Block the given set of links for all the container queues of the given receiver address types for the given reason.
void BlockQueues (WifiQueueBlockedReason reason, AcIndex ac, const std::list< WifiContainerQueueType > &types, const Mac48Address &rxAddress, const Mac48Address &txAddress, const std::set< uint8_t > &tids, const std::set< uint8_t > &linkIds) final
 Block the given set of links for the container queues of the given types and Access Category that hold frames having the given Receiver Address (RA), Transmitter Address (TA) and TID (if needed) for the given reason, such that frames in these queues are not transmitted on the given set of links.
bool GetAllQueuesBlockedOnLink (uint8_t linkId, WifiRcvAddr addrType, WifiQueueBlockedReason reason) final
 Return whether all the container queues of the given receiver address type (if different than COUNT, or of any receiver address type, otherwise) are blocked for the given link for the given reason (if different than REASONS_COUNT, or for any reason, otherwise).
std::list< uint8_t > GetLinkIds (AcIndex ac, Ptr< const WifiMpdu > mpdu, const std::list< WifiQueueBlockedReason > &ignoredReasons) final
 Get the list of the IDs of the links the given MPDU (belonging to the given Access Category) can be sent over.
std::optional< WifiContainerQueueIdGetNext (AcIndex ac, std::optional< uint8_t > linkId, bool skipBlockedQueues=true) final
 Get the next queue to serve, which is guaranteed to contain at least an MPDU whose lifetime has not expired.
std::optional< MaskGetQueueLinkMask (AcIndex ac, const WifiContainerQueueId &queueId, uint8_t linkId) final
 Get the mask associated with the given container queue indicating whether the given link is blocked and for which reason, provided that the given container queue exists and has a mask for the given link.
Ptr< WifiMpduHasToDropBeforeEnqueue (AcIndex ac, Ptr< WifiMpdu > mpdu) override
 Check whether an MPDU has to be dropped before enqueuing the given MPDU.
void NotifyDequeue (AcIndex ac, const std::list< Ptr< WifiMpdu > > &mpdus) final
 Notify the scheduler that the given list of MPDUs have been dequeued by the given Access Category.
void NotifyEnqueue (AcIndex ac, Ptr< WifiMpdu > mpdu) final
 Notify the scheduler that the given MPDU has been enqueued by the given Access Category.
void NotifyRemove (AcIndex ac, const std::list< Ptr< WifiMpdu > > &mpdus) final
 Notify the scheduler that the given list of MPDUs have been removed by the given Access Category.
void SetWifiMac (Ptr< WifiMac > mac) override
 Set the wifi MAC.
void SetWifiMacQueue (AcIndex ac, Ptr< WifiMacQueue > queue) override
 Set the Wifi MAC queue associated with the given Access Category.
void UnblockAllQueues (WifiQueueBlockedReason reason, const std::set< uint8_t > &linkIds, const std::set< WifiRcvAddr > &addrTypes) final
 Unblock the given set of links for all the container queues of the given receiver address types for the given reason.
void UnblockQueues (WifiQueueBlockedReason reason, AcIndex ac, const std::list< WifiContainerQueueType > &types, const Mac48Address &rxAddress, const Mac48Address &txAddress, const std::set< uint8_t > &tids, const std::set< uint8_t > &linkIds) final
 Unblock the given set of links for the container queues of the given types and Access Category that hold frames having the given Receiver Address (RA), Transmitter Address (TA) and TID (if needed) for the given reason, such that frames in these queues can be transmitted on the given set of links.
Public Member Functions inherited from ns3::WifiMacQueueScheduler
virtual std::optional< WifiContainerQueueIdGetNext (AcIndex ac, std::optional< uint8_t > linkId, const WifiContainerQueueId &prevQueueId, bool skipBlockedQueues=true)=0
 Get the next queue to serve after the given one.
Public Member Functions inherited from ns3::Object
 Object ()
 Caller graph was not generated because of its size.
 ~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 final
 Get the most derived TypeId for this Object.
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
template<typename T>
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) 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.
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
bool IsInitialized () const
 Check if the object has been initialized.
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default 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, bool permissive=false) 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.
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::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >
static TypeId GetTypeId ()
 Get the type ID.
Static Public Member Functions inherited from ns3::WifiMacQueueScheduler
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.

Private Types

using QueueIdLastTimeMap = std::unordered_map<WifiContainerQueueId, Time>
 Maps the queue Id of containers to the last time a frame from each of them was transmitted.

Private Member Functions

void DoNotifyDequeue (AcIndex ac, const std::list< Ptr< WifiMpdu > > &mpdus) override
 Notify the scheduler that the given list of MPDUs have been dequeued by the given Access Category.
void DoNotifyEnqueue (AcIndex ac, Ptr< WifiMpdu > mpdu) override
 Notify the scheduler that the given MPDU has been enqueued by the given Access Category.
void DoNotifyRemove (AcIndex ac, const std::list< Ptr< WifiMpdu > > &mpdus) override
 Notify the scheduler that the given list of MPDUs have been removed by the given Access Category.
void PsduTransmitted (uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, Watt_u txPower)
 Callback connected to the PHY trace that is fired every time a PSDU (map) is transmitted.

Private Attributes

std::vector< QueueIdLastTimeMapm_perAcQueueIdLastTxTime {AC_UNDEF}
 per-AC map of last time a frame in each container queue was transmitted
 NS_LOG_TEMPLATE_DECLARE
 redefinition of the log component

Additional Inherited Members

Public Types inherited from ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >
enum  DropPolicy
 drop policy More...
Public Types inherited from ns3::WifiMacQueueScheduler
using Mask = std::bitset<static_cast<std::size_t>(WifiQueueBlockedReason::REASONS_COUNT)>
 Bitset identifying the reasons to block individual links for a container queue.
Protected Types inherited from ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >
using QueueInfoMap
 Map identifiers (QueueIds) to information associated with container queues.
using QueueInfoPair
 typedef for a QueueInfoMap element
using SortedQueues
 List of container queues sorted in decreasing order of priority.
Protected Member Functions inherited from ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >
void DoDispose () override
 Destructor implementation.
const SortedQueuesGetSortedQueues (AcIndex ac) const
 Get a const reference to the sorted list of container queues for the given Access Category.
Ptr< WifiMacQueueGetWifiMacQueue (AcIndex ac) const
 Get the wifi MAC queue associated with the given Access Category.
void SetPriority (AcIndex ac, const WifiContainerQueueId &queueId, const WifiSchedPrecedence< Time > &priority)
 Set the priority for the given container queue belonging to the given Access Category.
Protected Member Functions inherited from ns3::WifiMacQueueScheduler
Ptr< WifiMacGetMac () const
 Get the wifi MAC.
Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
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.

Detailed Description

RrWifiQueueScheduler is a wifi queue scheduler that serves container queues in a round robin fashion.

The priority of a container queue is defined as the last time a frame contained in that container queue was transmitted. Specifically, every time a frame is transmitted (regardless of the link used) within a TXOP of which this device is the holder, the priority of the container queue containing the frame is set to the current time. Container queues of a same AC are therefore sorted in increasing order of last serving time and, every time an AC of this device can transmit, the container queue at the front of the list for that AC is served.

Definition at line 36 of file rr-wifi-queue-scheduler.h.

Member Typedef Documentation

◆ QueueIdLastTimeMap

Maps the queue Id of containers to the last time a frame from each of them was transmitted.

Definition at line 70 of file rr-wifi-queue-scheduler.h.

Constructor & Destructor Documentation

◆ RrWifiQueueScheduler()

ns3::RrWifiQueueScheduler::RrWifiQueueScheduler ( )

Definition at line 36 of file rr-wifi-queue-scheduler.cc.

References NS_LOG_TEMPLATE_DEFINE.

Referenced by GetTypeId().

Here is the caller graph for this function:

Member Function Documentation

◆ DoNotifyDequeue()

void ns3::RrWifiQueueScheduler::DoNotifyDequeue ( AcIndex ac,
const std::list< Ptr< WifiMpdu > > & mpdus )
overrideprivatevirtual

Notify the scheduler that the given list of MPDUs have been dequeued by the given Access Category.

The container queues which became empty after dequeuing the MPDUs are removed from the sorted list of queues.

Parameters
acthe Access Category of the dequeued MPDUs
mpdusthe list of dequeued MPDUs

Implements ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >.

Definition at line 101 of file rr-wifi-queue-scheduler.cc.

References NS_LOG_FUNCTION.

◆ DoNotifyEnqueue()

void ns3::RrWifiQueueScheduler::DoNotifyEnqueue ( AcIndex ac,
Ptr< WifiMpdu > mpdu )
overrideprivatevirtual

Notify the scheduler that the given MPDU has been enqueued by the given Access Category.

The container queue in which the MPDU has been enqueued must be assigned a priority value.

Parameters
acthe Access Category of the enqueued MPDU
mpduthe enqueued MPDU

Implements ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >.

Definition at line 87 of file rr-wifi-queue-scheduler.cc.

References ns3::WifiMacQueueContainer::GetQueueId(), m_perAcQueueIdLastTxTime, NS_LOG_FUNCTION, and ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >::SetPriority().

Here is the call graph for this function:

◆ DoNotifyRemove()

void ns3::RrWifiQueueScheduler::DoNotifyRemove ( AcIndex ac,
const std::list< Ptr< WifiMpdu > > & mpdus )
overrideprivatevirtual

Notify the scheduler that the given list of MPDUs have been removed by the given Access Category.

The container queues which became empty after removing the MPDUs are removed from the sorted list of queues.

Parameters
acthe Access Category of the removed MPDUs
mpdusthe list of removed MPDUs

Implements ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >.

Definition at line 108 of file rr-wifi-queue-scheduler.cc.

References NS_LOG_FUNCTION.

◆ GetTypeId()

TypeId ns3::RrWifiQueueScheduler::GetTypeId ( )
static

Get the type ID.

Returns
the object TypeId

Definition at line 27 of file rr-wifi-queue-scheduler.cc.

References RrWifiQueueScheduler(), ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >::WifiMacQueueSchedulerImpl(), and ns3::TypeId::SetParent().

Here is the call graph for this function:

◆ PsduTransmitted()

void ns3::RrWifiQueueScheduler::PsduTransmitted ( uint8_t phyId,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
Watt_u txPower )
private

Callback connected to the PHY trace that is fired every time a PSDU (map) is transmitted.

If the PSDU is transmitted in a TXOP of which this device is the holder, the priority of the queue(s) containing the transmitted MPDUs is updated.

Parameters
phyIdthe ID of the PHY transmitting the PSDUs
psduMapthe PSDU map
txVectorthe TX vector
txPowerthe tx power

Definition at line 56 of file rr-wifi-queue-scheduler.cc.

References ns3::WifiMacQueueScheduler::GetMac(), ns3::WifiMacQueueContainer::GetQueueId(), m_perAcQueueIdLastTxTime, ns3::Simulator::Now(), NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >::SetPriority(), and ns3::StaticCast().

Referenced by SetWifiMac().

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

◆ SetWifiMac()

void ns3::RrWifiQueueScheduler::SetWifiMac ( Ptr< WifiMac > mac)
overridevirtual

Set the wifi MAC.

Parameters
macthe wifi MAC

Reimplemented from ns3::WifiMacQueueScheduler.

Definition at line 42 of file rr-wifi-queue-scheduler.cc.

References ns3::WifiMacQueueSchedulerImpl< WifiSchedPrecedence< Time > >::WifiMacQueueSchedulerImpl(), ns3::MakeCallback(), PsduTransmitted(), and SetWifiMac().

Referenced by SetWifiMac().

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

Member Data Documentation

◆ m_perAcQueueIdLastTxTime

std::vector<QueueIdLastTimeMap> ns3::RrWifiQueueScheduler::m_perAcQueueIdLastTxTime {AC_UNDEF}
private

per-AC map of last time a frame in each container queue was transmitted

Definition at line 73 of file rr-wifi-queue-scheduler.h.

Referenced by DoNotifyEnqueue(), and PsduTransmitted().

◆ NS_LOG_TEMPLATE_DECLARE

ns3::RrWifiQueueScheduler::NS_LOG_TEMPLATE_DECLARE
private

redefinition of the log component

Definition at line 75 of file rr-wifi-queue-scheduler.h.


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