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 
33 namespace ns3 {
34 
35 class HeFrameExchangeManager;
36 
37 typedef std::unordered_map <uint16_t /* staId */, Ptr<WifiPsdu> /* PSDU */> WifiPsduMap;
38 
50 class MultiUserScheduler : public Object
51 {
52 public:
57  static TypeId GetTypeId (void);
59  virtual ~MultiUserScheduler ();
60 
62  enum TxFormat
63  {
64  NO_TX = 0,
67  UL_MU_TX
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 
115 protected:
122 
129  TxFormat GetLastTxFormat (void) const;
130 
131  void DoDispose (void) override;
132  void NotifyNewAggregate (void) override;
133  void DoInitialize (void) override;
134 
140  uint32_t m_sizeOf8QosNull;
141 
142 private:
149 
155  virtual TxFormat SelectTxFormat (void) = 0;
156 
162  virtual DlMuInfo ComputeDlMuInfo (void) = 0;
163 
169  virtual UlMuInfo ComputeUlMuInfo (void) = 0;
170 
174 };
175 
176 } //namespace ns3
177 
178 #endif /* MULTI_USER_SCHEDULER_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::MultiUserScheduler::NotifyAccessGranted
TxFormat NotifyAccessGranted(Ptr< QosTxop > edca, Time availableTime, bool initialFrame)
Notify the Multi-user Scheduler that the given AC of the AP gained channel access.
Definition: multi-user-scheduler.cc:127
ns3::MultiUserScheduler::DL_MU_TX
@ DL_MU_TX
Definition: multi-user-scheduler.h:66
ns3::MultiUserScheduler::ComputeUlMuInfo
virtual UlMuInfo ComputeUlMuInfo(void)=0
Prepare the information required to solicit an UL MU transmission.
ns3::MultiUserScheduler::UlMuInfo
Information to be provided in case of UL MU transmission.
Definition: multi-user-scheduler.h:79
ns3::MultiUserScheduler::m_edca
Ptr< QosTxop > m_edca
the AC that gained channel access
Definition: multi-user-scheduler.h:137
ns3::MultiUserScheduler::GetDlMuInfo
DlMuInfo & GetDlMuInfo(void)
Get the information required to perform a DL MU transmission.
Definition: multi-user-scheduler.cc:161
ns3::WifiPsduMap
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
Definition: he-frame-exchange-manager.h:34
ns3::MultiUserScheduler::m_dlInfo
DlMuInfo m_dlInfo
information required to perform a DL MU transmission
Definition: multi-user-scheduler.h:172
ns3::MultiUserScheduler
MultiUserScheduler is an abstract base class defining the API that APs supporting at least VHT can us...
Definition: multi-user-scheduler.h:51
ns3::MultiUserScheduler::MultiUserScheduler
MultiUserScheduler()
Definition: multi-user-scheduler.cc:47
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::MultiUserScheduler::DlMuInfo::txParams
WifiTxParameters txParams
the transmission parameters
Definition: multi-user-scheduler.h:74
ns3::MultiUserScheduler::DlMuInfo::psduMap
WifiPsduMap psduMap
the DL MU PPDU to transmit
Definition: multi-user-scheduler.h:73
ns3::MultiUserScheduler::NotifyNewAggregate
void NotifyNewAggregate(void) override
Notify all Objects aggregated to this one of a new Object being aggregated.
Definition: multi-user-scheduler.cc:71
ns3::MultiUserScheduler::DoDispose
void DoDispose(void) override
Destructor implementation.
Definition: multi-user-scheduler.cc:57
ns3::MultiUserScheduler::m_initialFrame
bool m_initialFrame
true if a TXOP is being started
Definition: multi-user-scheduler.h:139
ns3::MultiUserScheduler::SelectTxFormat
virtual TxFormat SelectTxFormat(void)=0
Select the format of the next transmission.
third.mac
mac
Definition: third.py:99
ns3::WifiTxParameters
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
Definition: wifi-tx-parameters.h:45
ns3::MultiUserScheduler::SU_TX
@ SU_TX
Definition: multi-user-scheduler.h:65
ns3::MultiUserScheduler::UlMuInfo::trigger
Ptr< WifiMacQueueItem > trigger
the Trigger frame used to solicit TB PPDUs
Definition: multi-user-scheduler.h:80
ns3::MultiUserScheduler::ComputeDlMuInfo
virtual DlMuInfo ComputeDlMuInfo(void)=0
Compute the information required to perform a DL MU transmission.
ns3::MultiUserScheduler::UlMuInfo::tbPpduDuration
Time tbPpduDuration
the duration of the solicited TB PPDU
Definition: multi-user-scheduler.h:81
ns3::MultiUserScheduler::~MultiUserScheduler
virtual ~MultiUserScheduler()
Definition: multi-user-scheduler.cc:51
ns3::Ptr< WifiMacQueueItem >
ns3::MultiUserScheduler::GetUlMuInfo
UlMuInfo & GetUlMuInfo(void)
Get the information required to solicit an UL MU transmission.
Definition: multi-user-scheduler.cc:178
ns3::MultiUserScheduler::m_availableTime
Time m_availableTime
the time available for frame exchange
Definition: multi-user-scheduler.h:138
ns3::MultiUserScheduler::DlMuInfo
Information to be provided in case of DL MU transmission.
Definition: multi-user-scheduler.h:72
ns3::Object
A base class which provides memory management and object aggregation.
Definition: object.h:88
ns3::MultiUserScheduler::m_heFem
Ptr< HeFrameExchangeManager > m_heFem
HE Frame Exchange Manager.
Definition: multi-user-scheduler.h:136
ns3::MultiUserScheduler::UL_MU_TX
@ UL_MU_TX
Definition: multi-user-scheduler.h:67
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::MultiUserScheduler::SetWifiMac
void SetWifiMac(Ptr< ApWifiMac > mac)
Set the wifi MAC.
Definition: multi-user-scheduler.cc:106
ns3::MultiUserScheduler::m_apMac
Ptr< ApWifiMac > m_apMac
the AP wifi MAC
Definition: multi-user-scheduler.h:135
ns3::MultiUserScheduler::GetWifiRemoteStationManager
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(void) const
Get the station manager attached to the AP.
Definition: multi-user-scheduler.cc:121
ns3::MultiUserScheduler::UlMuInfo::txParams
WifiTxParameters txParams
the transmission parameters for the Trigger Frame
Definition: multi-user-scheduler.h:82
ns3::MultiUserScheduler::NO_TX
@ NO_TX
Definition: multi-user-scheduler.h:64
ns3::MultiUserScheduler::GetLastTxFormat
TxFormat GetLastTxFormat(void) const
Get the format of the last transmission, as determined by the last call to NotifyAccessGranted that d...
Definition: multi-user-scheduler.cc:155
ns3::MultiUserScheduler::m_sizeOf8QosNull
uint32_t m_sizeOf8QosNull
size in bytes of 8 QoS Null frames
Definition: multi-user-scheduler.h:140
ns3::MultiUserScheduler::TxFormat
TxFormat
Enumeration of the possible transmission formats.
Definition: multi-user-scheduler.h:63
ns3::MultiUserScheduler::DoInitialize
void DoInitialize(void) override
Initialize() implementation.
Definition: multi-user-scheduler.cc:88
he-ru.h
ns3::MultiUserScheduler::m_lastTxFormat
TxFormat m_lastTxFormat
the format of last transmission
Definition: multi-user-scheduler.h:171
ns3::MultiUserScheduler::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: multi-user-scheduler.cc:38
ns3::MultiUserScheduler::m_ulInfo
UlMuInfo m_ulInfo
information required to solicit an UL MU transmission
Definition: multi-user-scheduler.h:173