27#include "ns3/qos-txop.h"
28#include "ns3/wifi-acknowledgment.h"
29#include "ns3/wifi-mac-trailer.h"
30#include "ns3/wifi-protection.h"
43 TypeId(
"ns3::MultiUserScheduler")
46 .AddAttribute(
"AccessReqInterval",
47 "Duration of the interval between two consecutive requests for "
48 "channel access made by the MultiUserScheduler. Such requests are "
49 "made independently of the presence of frames in the queues of the "
50 "AP and are intended to allow the AP to coordinate UL MU transmissions "
51 "even without DL traffic. A null duration indicates that such "
52 "requests shall not be made.",
56 .AddAttribute(
"AccessReqAc",
57 "The Access Category for which the MultiUserScheduler makes requests "
58 "for channel access.",
69 .AddAttribute(
"DelayAccessReqUponAccess",
70 "If enabled, the access request interval is measured starting "
71 "from the last time an EDCA function obtained channel access. "
72 "Otherwise, the access request interval is measured starting "
73 "from the last time the MultiUserScheduler made a request for "
142 "MultiUserScheduler can only be installed on HE APs");
145 m_heFem->SetMultiUserScheduler(
this);
176 uint16_t allowedWidth)
178 NS_LOG_FUNCTION(
this << edca << availableTime << initialFrame << allowedWidth);
206 if (txFormat !=
NO_TX)
224#ifdef NS3_BUILD_PROFILE_DEBUG
229 "Station " << psdu.second->GetAddr1() <<
" does not support HE");
255 auto aid = trigger.
begin()->GetAid12();
258 receiver = aidAddrMapIt->second;
267 return Create<WifiMpdu>(packet, hdr);
287 uint8_t maxNTids = 0;
288 for (
const auto& userInfo : trigger)
292 uint8_t staNTids = 0;
293 for (uint8_t tid = 0; tid < 8; tid++)
295 if (
m_heFem->GetBaAgreementEstablished(staIt->second, tid))
300 maxNTids =
std::max(maxNTids, staNTids);
310 for (uint8_t i = 0; i < maxNTids; i++)
const std::map< uint16_t, Mac48Address > & GetStaList(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get a const reference to the map of associated stations on the given link.
AttributeValue implementation for Boolean.
void RequestAccess(Ptr< Txop > txop)
Hold variables of type enum.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
bool IsRunning() const
This method is syntactic sugar for !IsExpired().
static Mac48Address GetBroadcast()
static uint32_t GetSizeIfAggregated(uint32_t mpduSize, uint32_t ampduSize)
Compute the size of the A-MPDU resulting from the aggregation of an MPDU of size mpduSize and an A-MP...
bool m_initialFrame
true if a TXOP is being started
Ptr< WifiMpdu > GetTriggerFrame(const CtrlTriggerHeader &trigger) const
Get an MPDU containing the given Trigger Frame.
void NotifyNewAggregate() override
Notify all Objects aggregated to this one of a new Object being aggregated.
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
Get the station manager attached to the AP.
~MultiUserScheduler() override
void DoInitialize() override
Initialize() implementation.
DlMuInfo & GetDlMuInfo()
Get the information required to perform a DL MU transmission.
void AccessReqTimeout()
Perform actions required on expiration of the channel access request timer, such as requesting channe...
UlMuInfo m_ulInfo
information required to solicit an UL MU transmission
TxFormat m_lastTxFormat
the format of last transmission
TxFormat NotifyAccessGranted(Ptr< QosTxop > edca, Time availableTime, bool initialFrame, uint16_t allowedWidth)
Notify the Multi-user Scheduler that the given AC of the AP gained channel access.
Ptr< ApWifiMac > m_apMac
the AP wifi MAC
void CheckTriggerFrame()
Ensure that the Trigger Frame returned in case of UL MU transmission is correct.
static TypeId GetTypeId()
Get the type ID.
uint16_t m_allowedWidth
the allowed width in MHz for the current transmission
UlMuInfo & GetUlMuInfo()
Get the information required to solicit an UL MU transmission.
Time m_availableTime
the time available for frame exchange
EventId m_accessReqTimer
the timer controlling additional channel access requests
virtual TxFormat SelectTxFormat()=0
Select the format of the next transmission.
DlMuInfo m_dlInfo
information required to perform a DL MU transmission
Ptr< HeFrameExchangeManager > m_heFem
HE Frame Exchange Manager.
TxFormat GetLastTxFormat() const
Get the format of the last transmission, as determined by the last call to NotifyAccessGranted that d...
uint32_t GetMaxSizeOfQosNullAmpdu(const CtrlTriggerHeader &trigger) const
Get the maximum size in bytes among the A-MPDUs containing QoS Null frames and solicited by the given...
bool m_restartTimerUponAccess
whether the channel access timer has to be restarted upon channel access
virtual DlMuInfo ComputeDlMuInfo()=0
Compute the information required to perform a DL MU transmission.
Ptr< QosTxop > m_edca
the AC that gained channel access
virtual UlMuInfo ComputeUlMuInfo()=0
Prepare the information required to solicit an UL MU transmission.
void DoDispose() override
Destructor implementation.
AcIndex m_accessReqAc
AC we request channel access for.
Time m_accessReqInterval
duration of the interval between channel access requests
void SetWifiMac(Ptr< ApWifiMac > mac)
Set the wifi MAC.
TxFormat
Enumeration of the possible transmission formats.
A base class which provides memory management and object aggregation.
virtual void NotifyNewAggregate()
Notify all Objects aggregated to this one of a new Object being aggregated.
virtual void DoDispose()
Destructor implementation.
void AddHeader(const Header &header)
Add header to this packet.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Simulation virtual time values and global simulation resolution.
bool IsStrictlyPositive() const
Exactly equivalent to t > 0.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Ptr< FrameExchangeManager > GetFrameExchangeManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Frame Exchange Manager associated with the given link.
Ptr< HeConfiguration > GetHeConfiguration() const
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Mac48Address GetAddress() const
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Ptr< ChannelAccessManager > GetChannelAccessManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Channel Access Manager associated with the given link.
void Clear()
Reset the TX parameters.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octects of the IEEE 802.11 MAC FCS field.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Information to be provided in case of DL MU transmission.
WifiTxParameters txParams
the transmission parameters
WifiPsduMap psduMap
the DL MU PPDU to transmit
Information to be provided in case of UL MU transmission.
WifiTxParameters txParams
the transmission parameters for the Trigger Frame
CtrlTriggerHeader trigger
the Trigger Frame used to solicit TB PPDUs