A Discrete-Event Network Simulator
API
multi-user-scheduler.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2020 Universita' degli Studi di Napoli Federico II
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Stefano Avallone <stavallo@unina.it>
19 */
20
21#ifndef MULTI_USER_SCHEDULER_H
22#define MULTI_USER_SCHEDULER_H
23
24#include "ns3/object.h"
25#include "he-ru.h"
26#include "ns3/ctrl-headers.h"
27#include "ns3/ap-wifi-mac.h"
28#include "ns3/wifi-mac-queue.h"
29#include "ns3/wifi-tx-parameters.h"
30#include "ns3/wifi-remote-station-manager.h"
31#include <unordered_map>
32
33namespace ns3 {
34
35class HeFrameExchangeManager;
36
37typedef std::unordered_map <uint16_t /* staId */, Ptr<WifiPsdu> /* PSDU */> WifiPsduMap;
38
51{
52public:
57 static TypeId GetTypeId (void);
59 virtual ~MultiUserScheduler ();
60
63 {
64 NO_TX = 0,
68 };
69
71 struct DlMuInfo
72 {
75 };
76
78 struct UlMuInfo
79 {
83 };
84
97 TxFormat NotifyAccessGranted (Ptr<QosTxop> edca, Time availableTime, bool initialFrame);
98
105 DlMuInfo& GetDlMuInfo (void);
106
113 UlMuInfo& GetUlMuInfo (void);
114
115protected:
122
130
137 TxFormat GetLastTxFormat (void) const;
138
151
152 void DoDispose (void) override;
153 void NotifyNewAggregate (void) override;
154 void DoInitialize (void) override;
155
161
162private:
169
175 void AccessReqTimeout (void);
176
182 virtual TxFormat SelectTxFormat (void) = 0;
183
189 virtual DlMuInfo ComputeDlMuInfo (void) = 0;
190
196 virtual UlMuInfo ComputeUlMuInfo (void) = 0;
197
203 void CheckTriggerFrame (void);
204
213};
214
215} //namespace ns3
216
217#endif /* MULTI_USER_SCHEDULER_H */
Headers for Trigger frames.
Definition: ctrl-headers.h:886
An identifier for simulation events.
Definition: event-id.h:54
MultiUserScheduler is an abstract base class defining the API that APs supporting at least VHT can us...
virtual TxFormat SelectTxFormat(void)=0
Select the format of the next transmission.
bool m_initialFrame
true if a TXOP is being started
void DoInitialize(void) override
Initialize() implementation.
UlMuInfo m_ulInfo
information required to solicit an UL MU transmission
TxFormat m_lastTxFormat
the format of last transmission
Ptr< ApWifiMac > m_apMac
the AP wifi MAC
Ptr< WifiMacQueueItem > GetTriggerFrame(const CtrlTriggerHeader &trigger) const
Get an MPDU containing the given Trigger Frame.
Time m_availableTime
the time available for frame exchange
void DoDispose(void) override
Destructor implementation.
EventId m_accessReqTimer
the timer controlling additional channel access requests
TxFormat GetLastTxFormat(void) const
Get the format of the last transmission, as determined by the last call to NotifyAccessGranted that d...
virtual UlMuInfo ComputeUlMuInfo(void)=0
Prepare the information required to solicit an UL MU transmission.
DlMuInfo m_dlInfo
information required to perform a DL MU transmission
void NotifyNewAggregate(void) override
Notify all Objects aggregated to this one of a new Object being aggregated.
Ptr< HeFrameExchangeManager > m_heFem
HE Frame Exchange Manager.
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...
virtual DlMuInfo ComputeDlMuInfo(void)=0
Compute the information required to perform a DL MU transmission.
bool m_restartTimerUponAccess
whether the channel access timer has to be restarted upon channel access
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
Get the station manager attached to the AP.
Ptr< QosTxop > m_edca
the AC that gained channel access
void AccessReqTimeout(void)
Perform actions required on expiration of the channel access request timer, such as requesting channe...
UlMuInfo & GetUlMuInfo(void)
Get the information required to solicit an UL MU transmission.
DlMuInfo & GetDlMuInfo(void)
Get the information required to perform a DL MU transmission.
AcIndex m_accessReqAc
AC we request channel access for.
Time m_accessReqInterval
duration of the interval between channel access requests
void CheckTriggerFrame(void)
Ensure that the Trigger Frame returned in case of UL MU transmission is correct.
static TypeId GetTypeId(void)
Get the type ID.
void SetWifiMac(Ptr< ApWifiMac > mac)
Set the wifi MAC.
TxFormat
Enumeration of the possible transmission formats.
TxFormat NotifyAccessGranted(Ptr< QosTxop > edca, Time availableTime, bool initialFrame)
Notify the Multi-user Scheduler that the given AC of the AP gained channel access.
A base class which provides memory management and object aggregation.
Definition: object.h:88
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
a unique identifier for an interface.
Definition: type-id.h:59
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:71
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:87
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