A Discrete-Event Network Simulator
API
multi-user-scheduler.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Stefano Avallone <stavallo@unina.it>
18 */
19
20#ifndef MULTI_USER_SCHEDULER_H
21#define MULTI_USER_SCHEDULER_H
22
23#include "he-ru.h"
24
25#include "ns3/ap-wifi-mac.h"
26#include "ns3/ctrl-headers.h"
27#include "ns3/object.h"
28#include "ns3/wifi-remote-station-manager.h"
29#include "ns3/wifi-tx-parameters.h"
30
31#include <unordered_map>
32
33namespace ns3
34{
35
36class HeFrameExchangeManager;
37
38typedef std::unordered_map<uint16_t /* staId */, Ptr<WifiPsdu> /* PSDU */> WifiPsduMap;
39
52{
53 public:
58 static TypeId GetTypeId();
60 ~MultiUserScheduler() override;
61
64 {
65 NO_TX = 0,
69 };
70
72 struct DlMuInfo
73 {
76 };
77
79 struct UlMuInfo
80 {
84 };
85
100 Time availableTime,
101 bool initialFrame,
102 uint16_t allowedWidth);
103
111
119
120 protected:
127
134 Ptr<WifiMpdu> GetTriggerFrame(const CtrlTriggerHeader& trigger) const;
135
143
156
157 void DoDispose() override;
158 void NotifyNewAggregate() override;
159 void DoInitialize() override;
160
166 uint16_t m_allowedWidth;
167
168 private:
175
181 void AccessReqTimeout();
182
189
196
203
209 void CheckTriggerFrame();
210
219};
220
221} // namespace ns3
222
223#endif /* MULTI_USER_SCHEDULER_H */
Headers for Trigger frames.
Definition: ctrl-headers.h:886
An identifier for simulation events.
Definition: event-id.h:55
MultiUserScheduler is an abstract base class defining the API that APs supporting at least VHT can us...
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.
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.
Definition: object.h:89
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
Implements the IEEE 802.11 MAC header.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
Definition: qos-utils.h:74
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
mac
Definition: third.py:85
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
WifiMacHeader macHdr
the MAC header for the Trigger Frame