WifiMacQueueSchedulerImpl is a template class enabling the definition of different types of priority values for the container queues. More...
#include "wifi-mac-queue-scheduler-impl.h"
Classes | |
struct | PerAcInfo |
Information specific to a wifi MAC queue. More... | |
struct | QueueInfo |
Information associated with a container queue. More... | |
Public Member Functions | |
WifiMacQueueSchedulerImpl () | |
Constructor. More... | |
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. More... | |
std::list< uint8_t > | GetLinkIds (AcIndex ac, Ptr< const WifiMpdu > mpdu) final |
Get the list of the IDs of the links the given MPDU (belonging to the given Access Category) can be sent over. More... | |
std::optional< WifiContainerQueueId > | GetNext (AcIndex ac, std::optional< uint8_t > linkId) final |
Get the next queue to serve, which is guaranteed to contain at least an MPDU whose lifetime has not expired. More... | |
std::optional< WifiContainerQueueId > | GetNext (AcIndex ac, std::optional< uint8_t > linkId, const WifiContainerQueueId &prevQueueId) final |
Get the next queue to serve, which is guaranteed to contain at least an MPDU whose lifetime has not expired. More... | |
std::optional< Mask > | GetQueueLinkMask (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. More... | |
Ptr< WifiMpdu > | HasToDropBeforeEnqueue (AcIndex ac, Ptr< WifiMpdu > mpdu) final |
Check whether an MPDU has to be dropped before enqueuing the given MPDU. More... | |
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. More... | |
void | NotifyEnqueue (AcIndex ac, Ptr< WifiMpdu > mpdu) final |
Notify the scheduler that the given MPDU has been enqueued by the given Access Category. More... | |
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. More... | |
void | SetWifiMac (Ptr< WifiMac > mac) final |
Set the wifi MAC. More... | |
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. More... | |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
~Object () override | |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose () |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator () const |
Get an iterator to the Objects aggregated to this one. More... | |
TypeId | GetInstanceTypeId () const override |
Get the most derived TypeId for this Object. More... | |
template<typename T > | |
Ptr< T > | GetObject () const |
Get a pointer to the requested aggregated Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
void | Initialize () |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized () 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[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () 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 errors. 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 () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::WifiMacQueueScheduler | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId () |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId () |
Get the type ID. More... | |
Protected Types | |
using | QueueInfoMap = std::unordered_map< WifiContainerQueueId, QueueInfo > |
Map identifiers (QueueIds) to information associated with container queues. More... | |
using | QueueInfoPair = std::pair< const WifiContainerQueueId, QueueInfo > |
typedef for a QueueInfoMap element More... | |
using | SortedQueues = std::multimap< Priority, std::reference_wrapper< QueueInfoPair >, Compare > |
List of container queues sorted in decreasing order of priority. More... | |
Protected Member Functions | |
void | DoDispose () override |
Destructor implementation. More... | |
const SortedQueues & | GetSortedQueues (AcIndex ac) const |
Get a const reference to the sorted list of container queues for the given Access Category. More... | |
Ptr< WifiMacQueue > | GetWifiMacQueue (AcIndex ac) const |
Get the wifi MAC queue associated with the given Access Category. More... | |
void | SetPriority (AcIndex ac, const WifiContainerQueueId &queueId, const Priority &priority) |
Set the priority for the given container queue belonging to the given Access Category. More... | |
Protected Member Functions inherited from ns3::WifiMacQueueScheduler | |
void | DoDispose () override |
Destructor implementation. More... | |
Ptr< WifiMac > | GetMac () const |
Get the wifi MAC. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | DoInitialize () |
Initialize() implementation. More... | |
virtual void | NotifyNewAggregate () |
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 () |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Member Functions | |
void | DoBlockQueues (bool block, 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) |
Block or 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. More... | |
std::optional< WifiContainerQueueId > | DoGetNext (AcIndex ac, std::optional< uint8_t > linkId, typename SortedQueues::iterator sortedQueuesIt) |
Get the next queue to serve. More... | |
virtual void | DoNotifyDequeue (AcIndex ac, const std::list< Ptr< WifiMpdu >> &mpdus)=0 |
Notify the scheduler that the given list of MPDUs have been dequeued by the given Access Category. More... | |
virtual void | DoNotifyEnqueue (AcIndex ac, Ptr< WifiMpdu > mpdu)=0 |
Notify the scheduler that the given MPDU has been enqueued by the given Access Category. More... | |
virtual void | DoNotifyRemove (AcIndex ac, const std::list< Ptr< WifiMpdu >> &mpdus)=0 |
Notify the scheduler that the given list of MPDUs have been removed by the given Access Category. More... | |
virtual Ptr< WifiMpdu > | HasToDropBeforeEnqueuePriv (AcIndex ac, Ptr< WifiMpdu > mpdu)=0 |
Check whether an MPDU has to be dropped before enqueuing the given MPDU. More... | |
QueueInfoMap::iterator | InitQueueInfo (AcIndex ac, Ptr< const WifiMpdu > mpdu) |
If no information for the container queue used to store the given MPDU of the given Access Category is present in the queue info map, add the information for such a container queue and initialize the list of the IDs of the links over which packets contained in that container queue can be sent. More... | |
Private Attributes | |
std::vector< PerAcInfo > | m_perAcInfo {AC_UNDEF} |
vector of per-AC information More... | |
NS_LOG_TEMPLATE_DECLARE | |
the log component More... | |
Friends | |
class | ::WifiMacQueueDropOldestTest |
allow WifiMacQueueDropOldestTest class access More... | |
Additional Inherited Members | |
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. More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid () |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
WifiMacQueueSchedulerImpl is a template class enabling the definition of different types of priority values for the container queues.
The function to compare priority values can be customized as well.
Definition at line 51 of file wifi-mac-queue-scheduler-impl.h.
|
protected |
Map identifiers (QueueIds) to information associated with container queues.
Empty queues shall be kept in this data structure because queue information (such as the set of link IDs) may be configured just once.
Definition at line 131 of file wifi-mac-queue-scheduler-impl.h.
|
protected |
typedef for a QueueInfoMap element
Definition at line 134 of file wifi-mac-queue-scheduler-impl.h.
|
protected |
List of container queues sorted in decreasing order of priority.
Empty queues shall not be kept in this data structure.
Definition at line 145 of file wifi-mac-queue-scheduler-impl.h.
ns3::WifiMacQueueSchedulerImpl< Priority, Compare >::WifiMacQueueSchedulerImpl |
Constructor.
Implementation of the templates declared above.
Definition at line 286 of file wifi-mac-queue-scheduler-impl.h.
|
finalvirtual |
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.
reason | the reason for blocking the queues |
ac | the given Access Category |
types | the types of the queues to block |
rxAddress | the Receiver Address (RA) of the frames |
txAddress | the Transmitter Address (TA) of the frames |
tids | the TIDs optionally identifying the queues to block |
linkIds | set of links to block (empty to block all setup links) |
Implements ns3::WifiMacQueueScheduler.
Definition at line 521 of file wifi-mac-queue-scheduler-impl.h.
|
private |
Block or 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.
block | true to block the queues, false to unblock |
reason | the reason for blocking the queues |
ac | the given Access Category |
types | the types of the queues to block |
rxAddress | the Receiver Address (RA) of the frames |
txAddress | the Transmitter Address (TA) of the frames |
tids | the TIDs optionally identifying the queues to block |
linkIds | set of links to block (empty to block all setup links) |
Definition at line 466 of file wifi-mac-queue-scheduler-impl.h.
References NS_ASSERT_MSG, NS_LOG_FUNCTION, ns3::WIFI_CTL_QUEUE, ns3::WIFI_DATA_QUEUE, ns3::WIFI_MAC_CTL_BACKREQ, ns3::WIFI_MAC_DATA, ns3::WIFI_MAC_MGT_ACTION, ns3::WIFI_MAC_QOSDATA, ns3::WIFI_MGT_QUEUE, and ns3::WIFI_QOSDATA_QUEUE.
|
overrideprotectedvirtual |
Destructor implementation.
This method is called by Dispose() or by the Object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.
It is safe to call GetObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 303 of file wifi-mac-queue-scheduler-impl.h.
References ns3::WifiMacQueueScheduler::DoDispose().
|
private |
Get the next queue to serve.
The search starts from the given one. The returned queue is guaranteed to contain at least an MPDU whose lifetime has not expired. Queues containing MPDUs that cannot be sent over the given link are ignored.
ac | the Access Category that we want to serve |
linkId | the ID of the link on which MPDUs contained in the returned queue must be allowed to be sent |
sortedQueuesIt | iterator pointing to the queue we start the search from |
Definition at line 600 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, NS_ASSERT, NS_LOG_FUNCTION, and prev.
|
privatepure virtual |
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.
ac | the Access Category of the dequeued MPDUs |
mpdus | the list of dequeued MPDUs |
Implemented in ns3::FcfsWifiQueueScheduler.
|
privatepure virtual |
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.
ac | the Access Category of the enqueued MPDU |
mpdu | the enqueued MPDU |
Implemented in ns3::FcfsWifiQueueScheduler.
|
privatepure virtual |
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.
ac | the Access Category of the removed MPDUs |
mpdus | the list of removed MPDUs |
Implemented in ns3::FcfsWifiQueueScheduler.
|
finalvirtual |
Get the list of the IDs of the links the given MPDU (belonging to the given Access Category) can be sent over.
ac | the given Access Category |
mpdu | the given MPDU |
Implements ns3::WifiMacQueueScheduler.
Definition at line 447 of file wifi-mac-queue-scheduler-impl.h.
|
finalvirtual |
Get the next queue to serve, which is guaranteed to contain at least an MPDU whose lifetime has not expired.
Queues containing MPDUs that cannot be sent over the given link (if any) are ignored.
ac | the Access Category that we want to serve |
linkId | the ID of the link on which MPDUs contained in the returned queue must be allowed to be sent |
Implements ns3::WifiMacQueueScheduler.
Definition at line 574 of file wifi-mac-queue-scheduler-impl.h.
References NS_LOG_FUNCTION.
|
finalvirtual |
Get the next queue to serve, which is guaranteed to contain at least an MPDU whose lifetime has not expired.
The returned queue is guaranteed to contain at least an MPDU whose lifetime has not expired. Queues containing MPDUs that cannot be sent over the given link (if any) are ignored.
ac | the Access Category that we want to serve |
linkId | the ID of the link on which MPDUs contained in the returned queue must be allowed to be sent |
prevQueueId | the ID of the container queue served previously |
Implements ns3::WifiMacQueueScheduler.
Definition at line 582 of file wifi-mac-queue-scheduler-impl.h.
References NS_ABORT_IF, and NS_LOG_FUNCTION.
|
finalvirtual |
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.
ac | the given Access Category |
queueId | the ID of the given container queue |
linkId | the ID of the given link |
Implements ns3::WifiMacQueueScheduler.
Definition at line 549 of file wifi-mac-queue-scheduler-impl.h.
References NS_LOG_FUNCTION.
|
protected |
Get a const reference to the sorted list of container queues for the given Access Category.
ac | the given Access Category |
Definition at line 334 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, and NS_ASSERT.
|
static |
Get the type ID.
Definition at line 293 of file wifi-mac-queue-scheduler-impl.h.
References ns3::TypeId::SetParent().
|
protected |
Get the wifi MAC queue associated with the given Access Category.
ac | the given Access Category |
Definition at line 326 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, and NS_ASSERT.
|
finalvirtual |
Check whether an MPDU has to be dropped before enqueuing the given MPDU.
ac | the Access Category of the MPDU being enqueued |
mpdu | the MPDU to enqueue |
Implements ns3::WifiMacQueueScheduler.
Definition at line 653 of file wifi-mac-queue-scheduler-impl.h.
References NS_LOG_FUNCTION.
|
privatepure virtual |
Check whether an MPDU has to be dropped before enqueuing the given MPDU.
ac | the Access Category of the MPDU being enqueued |
mpdu | the MPDU to enqueue |
Implemented in ns3::FcfsWifiQueueScheduler.
|
private |
If no information for the container queue used to store the given MPDU of the given Access Category is present in the queue info map, add the information for such a container queue and initialize the list of the IDs of the links over which packets contained in that container queue can be sent.
ac | the given Access Category |
mpdu | the given MPDU |
Definition at line 342 of file wifi-mac-queue-scheduler-impl.h.
References ns3::WifiMacQueueContainer::GetQueueId(), NS_ASSERT, NS_ASSERT_MSG, NS_LOG_FUNCTION, and ns3::SINGLE_LINK_OP_ID.
|
finalvirtual |
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.
ac | the Access Category of the dequeued MPDUs |
mpdus | the list of dequeued MPDUs |
Implements ns3::WifiMacQueueScheduler.
Definition at line 680 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, ns3::WifiMacQueueContainer::GetQueueId(), NS_ASSERT, and NS_LOG_FUNCTION.
|
finalvirtual |
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.
ac | the Access Category of the enqueued MPDU |
mpdu | the enqueued MPDU |
Implements ns3::WifiMacQueueScheduler.
Definition at line 661 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, NS_ABORT_MSG, NS_ASSERT, and NS_LOG_FUNCTION.
|
finalvirtual |
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.
ac | the Access Category of the removed MPDUs |
mpdus | the list of removed MPDUs |
Implements ns3::WifiMacQueueScheduler.
Definition at line 714 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, ns3::WifiMacQueueContainer::GetQueueId(), NS_ASSERT, and NS_LOG_FUNCTION.
|
protected |
Set the priority for the given container queue belonging to the given Access Category.
ac | the Access Category of the container queue |
queueId | the ID of the given container queue |
priority | the priority value |
Definition at line 407 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_UNDEF, NS_ABORT_MSG_IF, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
|
finalvirtual |
Set the wifi MAC.
mac | the wifi MAC |
Reimplemented from ns3::WifiMacQueueScheduler.
Definition at line 311 of file wifi-mac-queue-scheduler-impl.h.
References ns3::AC_BE, ns3::AC_BE_NQOS, ns3::AC_BEACON, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, third::mac, and ns3::WifiMacQueueScheduler::SetWifiMac().
|
finalvirtual |
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.
reason | the reason for unblocking the queues |
ac | the given Access Category |
types | the types of the queues to unblock |
rxAddress | the Receiver Address (RA) of the frames |
txAddress | the Transmitter Address (TA) of the frames |
tids | the TIDs optionally identifying the queues to unblock |
linkIds | set of links to unblock (empty to unblock all setup links) |
Implements ns3::WifiMacQueueScheduler.
Definition at line 535 of file wifi-mac-queue-scheduler-impl.h.
|
friend |
allow WifiMacQueueDropOldestTest class access
Definition at line 55 of file wifi-mac-queue-scheduler-impl.h.
|
private |
vector of per-AC information
Definition at line 277 of file wifi-mac-queue-scheduler-impl.h.
|
private |
the log component
Definition at line 278 of file wifi-mac-queue-scheduler-impl.h.