RrMultiUserScheduler is a simple OFDMA scheduler that indicates to perform a DL OFDMA transmission if the AP has frames to transmit to at least one station. More...
#include "rr-multi-user-scheduler.h"
Classes | |
struct | MasterInfo |
Information used to sort stations. More... | |
Public Member Functions | |
RrMultiUserScheduler () | |
virtual | ~RrMultiUserScheduler () |
Public Member Functions inherited from ns3::MultiUserScheduler | |
MultiUserScheduler () | |
virtual | ~MultiUserScheduler () |
DlMuInfo & | GetDlMuInfo (void) |
Get the information required to perform a DL MU transmission. More... | |
UlMuInfo & | GetUlMuInfo (void) |
Get the information required to solicit an UL MU transmission. More... | |
TxFormat | NotifyAccessGranted (Ptr< QosTxop > edca, Time availableTime, bool initialFrame) |
Notify the Multi-user Scheduler that the given AC of the AP gained channel access. 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<> | |
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... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. 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[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] 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::MultiUserScheduler | |
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 | |
void | DoDispose (void) override |
Destructor implementation. More... | |
void | DoInitialize (void) override |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::MultiUserScheduler | |
TxFormat | GetLastTxFormat (void) const |
Get the format of the last transmission, as determined by the last call to NotifyAccessGranted that did not return NO_TX. More... | |
Ptr< WifiRemoteStationManager > | GetWifiRemoteStationManager (void) const |
Get the station manager attached to the AP. More... | |
void | NotifyNewAggregate (void) override |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. 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 Types | |
typedef std::pair< std::list< MasterInfo >::iterator, Ptr< const WifiMacQueueItem > > | CandidateInfo |
Information stored for candidate stations. More... | |
Private Member Functions | |
void | AssignRuIndices (WifiTxVector &txVector) |
Assign an RU index to all the RUs allocated by the given TXVECTOR. More... | |
DlMuInfo | ComputeDlMuInfo (void) override |
Compute the information required to perform a DL MU transmission. More... | |
UlMuInfo | ComputeUlMuInfo (void) override |
Prepare the information required to solicit an UL MU transmission. More... | |
void | NotifyStationAssociated (uint16_t aid, Mac48Address address) |
Notify the scheduler that a station associated with the AP. More... | |
void | NotifyStationDeassociated (uint16_t aid, Mac48Address address) |
Notify the scheduler that a station deassociated with the AP. More... | |
TxFormat | SelectTxFormat (void) override |
Select the format of the next transmission. More... | |
virtual TxFormat | TrySendingBasicTf (void) |
Check if it is possible to send a Basic Trigger Frame given the current time limits. More... | |
virtual TxFormat | TrySendingBsrpTf (void) |
Check if it is possible to send a BSRP Trigger Frame given the current time limits. More... | |
virtual TxFormat | TrySendingDlMuPpdu (void) |
Check if it is possible to send a DL MU PPDU given the current time limits. More... | |
Private Attributes | |
std::list< CandidateInfo > | m_candidates |
Candidate stations for MU TX. More... | |
bool | m_enableBsrp |
send a BSRP before an UL MU transmission More... | |
bool | m_enableTxopSharing |
allow A-MPDUs of different TIDs in a DL MU PPDU More... | |
bool | m_enableUlOfdma |
enable the scheduler to also return UL_OFDMA More... | |
bool | m_forceDlOfdma |
return DL_OFDMA even if no DL MU PPDU was built More... | |
Time | m_maxCredits |
Max amount of credits a station can have. More... | |
uint8_t | m_nStations |
Number of stations/slots to fill. More... | |
std::map< AcIndex, std::list< MasterInfo > > | m_staList |
Per-AC list of stations (next to serve first) More... | |
CtrlTriggerHeader | m_trigger |
Trigger Frame to send. More... | |
WifiMacHeader | m_triggerMacHdr |
MAC header for Trigger Frame. More... | |
WifiTxParameters | m_txParams |
TX parameters. More... | |
uint32_t | m_ulPsduSize |
the size in byte of the solicited PSDU More... | |
bool | m_useCentral26TonesRus |
whether to allocate central 26-tone RUs More... | |
Additional Inherited Members | |
Public Types inherited from ns3::MultiUserScheduler | |
enum | TxFormat { NO_TX = 0 , SU_TX , DL_MU_TX , UL_MU_TX } |
Enumeration of the possible transmission formats. More... | |
Protected Attributes inherited from ns3::MultiUserScheduler | |
Ptr< ApWifiMac > | m_apMac |
the AP wifi MAC More... | |
Time | m_availableTime |
the time available for frame exchange More... | |
Ptr< QosTxop > | m_edca |
the AC that gained channel access More... | |
Ptr< HeFrameExchangeManager > | m_heFem |
HE Frame Exchange Manager. More... | |
bool | m_initialFrame |
true if a TXOP is being started More... | |
uint32_t | m_sizeOf8QosNull |
size in bytes of 8 QoS Null frames More... | |
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... | |
RrMultiUserScheduler is a simple OFDMA scheduler that indicates to perform a DL OFDMA transmission if the AP has frames to transmit to at least one station.
Introspection did not find any typical Config paths.
RrMultiUserScheduler assigns RUs of equal size (in terms of tones) to stations to which the AP has frames to transmit belonging to the AC who gained access to the channel or higher. The maximum number of stations that can be granted an RU is configurable. Associated stations are served in a round robin fashion.
No TraceSources are defined for this type.
Size of this type is 896 bytes (on a 64-bit architecture).
Definition at line 42 of file rr-multi-user-scheduler.h.
|
private |
Information stored for candidate stations.
Definition at line 125 of file rr-multi-user-scheduler.h.
ns3::RrMultiUserScheduler::RrMultiUserScheduler | ( | ) |
Definition at line 93 of file rr-multi-user-scheduler.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 98 of file rr-multi-user-scheduler.cc.
References NS_LOG_FUNCTION_NOARGS.
|
private |
Assign an RU index to all the RUs allocated by the given TXVECTOR.
Allocated RUs must all have the same size, except for allocated central 26-tone RUs.
txVector | the given TXVECTOR |
Definition at line 784 of file rr-multi-user-scheduler.cc.
References ns3::WifiTxVector::GetChannelWidth(), ns3::WifiTxVector::GetHeMuUserInfoMap(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::WifiTxVector::SetRu().
Referenced by TrySendingBasicTf().
|
overrideprivatevirtual |
Compute the information required to perform a DL MU transmission.
Implements ns3::MultiUserScheduler.
Definition at line 627 of file rr-multi-user-scheduler.cc.
References ns3::RrMultiUserScheduler::MasterInfo::credits, ns3::WifiTxParameters::m_txDuration, ns3::WifiTxParameters::m_txVector, Min, min, NS_ASSERT, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::MultiUserScheduler::DlMuInfo::psduMap, ns3::QosUtilsMapTidToAc(), ns3::WifiTxVector::SetBssColor(), ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetGuardInterval(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiTxVector::SetPreambleType(), ns3::Time::ToDouble(), and ns3::MultiUserScheduler::DlMuInfo::txParams.
|
overrideprivatevirtual |
Prepare the information required to solicit an UL MU transmission.
Implements ns3::MultiUserScheduler.
Definition at line 833 of file rr-multi-user-scheduler.cc.
|
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::MultiUserScheduler.
Definition at line 120 of file rr-multi-user-scheduler.cc.
References ns3::WifiTxParameters::Clear(), ns3::MultiUserScheduler::DoDispose(), ns3::MultiUserScheduler::m_apMac, m_candidates, m_staList, m_txParams, ns3::MakeCallback(), NotifyStationAssociated(), NotifyStationDeassociated(), and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented from ns3::MultiUserScheduler.
Definition at line 104 of file rr-multi-user-scheduler.cc.
References ns3::MultiUserScheduler::DoInitialize(), ns3::MultiUserScheduler::m_apMac, m_staList, ns3::MakeCallback(), NotifyStationAssociated(), NotifyStationDeassociated(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::wifiAcList.
|
static |
Get the type ID.
Definition at line 38 of file rr-multi-user-scheduler.cc.
References m_enableBsrp, m_enableTxopSharing, m_enableUlOfdma, m_forceDlOfdma, m_maxCredits, m_nStations, m_ulPsduSize, m_useCentral26TonesRus, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MakeUintegerAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().
|
private |
Notify the scheduler that a station associated with the AP.
aid | the AID of the station |
address | the MAC address of the station |
Definition at line 456 of file rr-multi-user-scheduler.cc.
References first::address, ns3::MultiUserScheduler::GetWifiRemoteStationManager(), m_staList, and NS_LOG_FUNCTION.
Referenced by DoDispose(), and DoInitialize().
|
private |
Notify the scheduler that a station deassociated with the AP.
aid | the AID of the station |
address | the MAC address of the station |
Definition at line 470 of file rr-multi-user-scheduler.cc.
References first::address, ns3::RrMultiUserScheduler::MasterInfo::address, ns3::RrMultiUserScheduler::MasterInfo::aid, ns3::MultiUserScheduler::GetWifiRemoteStationManager(), m_staList, and NS_LOG_FUNCTION.
Referenced by DoDispose(), and DoInitialize().
|
overrideprivatevirtual |
Select the format of the next transmission.
Implements ns3::MultiUserScheduler.
Definition at line 134 of file rr-multi-user-scheduler.cc.
References ns3::BSRP_TRIGGER, ns3::MultiUserScheduler::DL_MU_TX, ns3::MultiUserScheduler::GetLastTxFormat(), ns3::CtrlTriggerHeader::GetType(), ns3::MultiUserScheduler::GetWifiRemoteStationManager(), ns3::MultiUserScheduler::m_edca, m_enableBsrp, m_enableUlOfdma, m_trigger, NS_LOG_FUNCTION, ns3::QosTxop::PeekNextMpdu(), ns3::MultiUserScheduler::SU_TX, TrySendingBasicTf(), TrySendingBsrpTf(), and TrySendingDlMuPpdu().
|
privatevirtual |
Check if it is possible to send a Basic Trigger Frame given the current time limits.
Definition at line 244 of file rr-multi-user-scheduler.cc.
References ns3::Packet::AddHeader(), ns3::Time::As(), AssignRuIndices(), ns3::BASIC_TRIGGER, ns3::WifiPhy::CalculateTxDuration(), ns3::WifiTxParameters::Clear(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::MultiUserScheduler::DL_MU_TX, ns3::CtrlTriggerHeader::FindUserInfoWithAid(), ns3::QosTxop::GetAccessCategory(), ns3::Mac48Address::GetBroadcast(), ns3::MultiUserScheduler::GetDlMuInfo(), ns3::HeRu::GetEqualSizedRusForStations(), ns3::CtrlTriggerHeader::GetGuardInterval(), ns3::HePhy::GetHeMcs(), ns3::MultiUserScheduler::GetLastTxFormat(), ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetNss(), ns3::GetPpduMaxTime(), ns3::WifiTxVector::GetPreambleType(), ns3::CtrlTriggerHeader::GetUlBandwidth(), ns3::MultiUserScheduler::GetUlMuInfo(), ns3::Time::IsNegative(), ns3::Time::IsZero(), ns3::WifiTxParameters::m_acknowledgment, ns3::MultiUserScheduler::m_apMac, ns3::MultiUserScheduler::m_availableTime, m_candidates, ns3::MultiUserScheduler::m_edca, ns3::MultiUserScheduler::m_heFem, ns3::WifiTxParameters::m_protection, m_trigger, m_triggerMacHdr, ns3::WifiTxParameters::m_txDuration, m_txParams, ns3::WifiTxParameters::m_txVector, m_ulPsduSize, m_useCentral26TonesRus, max, ns3::Max(), ns3::Time::Min(), min, ns3::Min(), ns3::Time::MS, ns3::MultiUserScheduler::NO_TX, NS_ABORT_MSG_IF, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::HeRu::RU_26_TONE, ns3::Seconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiTxVector::SetChannelWidth(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiTxVector::SetGuardInterval(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiTxVector::SetPreambleType(), ns3::CtrlTriggerHeader::SetUlLength(), ns3::MultiUserScheduler::UlMuInfo::trigger, ns3::MultiUserScheduler::DlMuInfo::txParams, ns3::MultiUserScheduler::UL_MU_TX, ns3::WIFI_MAC_CTL_TRIGGER, and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by SelectTxFormat().
|
privatevirtual |
Check if it is possible to send a BSRP Trigger Frame given the current time limits.
Definition at line 165 of file rr-multi-user-scheduler.cc.
References ns3::Packet::AddHeader(), ns3::Time::As(), ns3::CtrlTriggerHeader::begin(), ns3::BSRP_TRIGGER, ns3::WifiPhy::CalculateTxDuration(), ns3::WifiTxParameters::Clear(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Mac48Address::GetBroadcast(), ns3::MultiUserScheduler::GetDlMuInfo(), ns3::CtrlTriggerHeader::GetGuardInterval(), ns3::CtrlTriggerHeader::GetHeTbTxVector(), ns3::CtrlTriggerHeader::GetNUserInfoFields(), ns3::WifiTxParameters::m_acknowledgment, ns3::MultiUserScheduler::m_apMac, ns3::MultiUserScheduler::m_availableTime, ns3::MultiUserScheduler::m_heFem, ns3::WifiTxParameters::m_protection, ns3::MultiUserScheduler::m_sizeOf8QosNull, m_trigger, m_triggerMacHdr, ns3::WifiTxParameters::m_txDuration, m_txParams, ns3::WifiTxParameters::m_txVector, ns3::Max(), ns3::Time::Min(), ns3::Time::MS, ns3::MultiUserScheduler::NO_TX, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Seconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetDsNotFrom(), ns3::WifiMacHeader::SetDsNotTo(), ns3::WifiTxVector::SetGuardInterval(), ns3::CtrlTriggerHeader::SetUlLength(), ns3::MultiUserScheduler::DlMuInfo::txParams, ns3::MultiUserScheduler::UL_MU_TX, and ns3::WIFI_MAC_CTL_TRIGGER.
Referenced by SelectTxFormat().
|
privatevirtual |
Check if it is possible to send a DL MU PPDU given the current time limits.
Definition at line 485 of file rr-multi-user-scheduler.cc.
References ns3::WifiTxParameters::Clear(), ns3::QosTxop::GetAccessCategory(), ns3::WifiRemoteStationManager::GetDataTxVector(), ns3::HeRu::GetEqualSizedRusForStations(), ns3::WifiTxVector::GetMode(), ns3::WifiTxVector::GetNss(), ns3::MultiUserScheduler::GetWifiRemoteStationManager(), ns3::MultiUserScheduler::m_apMac, ns3::MultiUserScheduler::m_availableTime, m_candidates, ns3::MultiUserScheduler::m_edca, m_enableTxopSharing, ns3::MultiUserScheduler::m_heFem, ns3::MultiUserScheduler::m_initialFrame, m_nStations, m_staList, m_txParams, ns3::WifiTxParameters::m_txVector, m_useCentral26TonesRus, ns3::Time::Min(), min, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::QosTxop::PeekNextMpdu(), ns3::QosUtilsMapTidToAc(), ns3::HeRu::RU_26_TONE, ns3::WifiTxVector::SetBssColor(), ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetGuardInterval(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiTxVector::SetPreambleType(), ns3::WIFI_PREAMBLE_HE_MU, and ns3::wifiAcList.
Referenced by SelectTxFormat().
|
private |
Candidate stations for MU TX.
Definition at line 135 of file rr-multi-user-scheduler.h.
Referenced by DoDispose(), TrySendingBasicTf(), and TrySendingDlMuPpdu().
|
private |
send a BSRP before an UL MU transmission
Definition at line 131 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId(), and SelectTxFormat().
|
private |
allow A-MPDUs of different TIDs in a DL MU PPDU
Definition at line 128 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId(), and TrySendingDlMuPpdu().
|
private |
enable the scheduler to also return UL_OFDMA
Definition at line 130 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId(), and SelectTxFormat().
|
private |
return DL_OFDMA even if no DL MU PPDU was built
Definition at line 129 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId().
|
private |
Max amount of credits a station can have.
Definition at line 136 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId().
|
private |
Number of stations/slots to fill.
Definition at line 127 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId(), and TrySendingDlMuPpdu().
|
private |
Per-AC list of stations (next to serve first)
Definition at line 134 of file rr-multi-user-scheduler.h.
Referenced by DoDispose(), DoInitialize(), NotifyStationAssociated(), NotifyStationDeassociated(), and TrySendingDlMuPpdu().
|
private |
Trigger Frame to send.
Definition at line 137 of file rr-multi-user-scheduler.h.
Referenced by SelectTxFormat(), TrySendingBasicTf(), and TrySendingBsrpTf().
|
private |
MAC header for Trigger Frame.
Definition at line 138 of file rr-multi-user-scheduler.h.
Referenced by TrySendingBasicTf(), and TrySendingBsrpTf().
|
private |
TX parameters.
Definition at line 139 of file rr-multi-user-scheduler.h.
Referenced by DoDispose(), TrySendingBasicTf(), TrySendingBsrpTf(), and TrySendingDlMuPpdu().
|
private |
the size in byte of the solicited PSDU
Definition at line 133 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId(), and TrySendingBasicTf().
|
private |
whether to allocate central 26-tone RUs
Definition at line 132 of file rr-multi-user-scheduler.h.
Referenced by GetTypeId(), TrySendingBasicTf(), and TrySendingDlMuPpdu().