A Discrete-Event Network Simulator
API
rr-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 RR_MULTI_USER_SCHEDULER_H
22#define RR_MULTI_USER_SCHEDULER_H
23
25#include <list>
26
27namespace ns3 {
28
43{
44public:
49 static TypeId GetTypeId (void);
51 virtual ~RrMultiUserScheduler ();
52
53protected:
54 void DoDispose (void) override;
55 void DoInitialize (void) override;
56
57private:
58 TxFormat SelectTxFormat (void) override;
59 DlMuInfo ComputeDlMuInfo (void) override;
60 UlMuInfo ComputeUlMuInfo (void) override;
61
68 virtual TxFormat TrySendingBsrpTf (void);
69
77 virtual TxFormat TrySendingBasicTf (void);
78
87 virtual TxFormat TrySendingDlMuPpdu (void);
88
99 template <class Func>
100 WifiTxVector GetTxVectorForUlMu (Func canBeSolicited);
101
108 void NotifyStationAssociated (uint16_t aid, Mac48Address address);
116
121 {
122 uint16_t aid;
124 double credits;
125 };
126
138 void FinalizeTxVector (WifiTxVector& txVector);
147 void UpdateCredits (std::list<MasterInfo>& staList, Time txDuration, const WifiTxVector& txVector);
148
152 typedef std::pair<std::list<MasterInfo>::iterator, Ptr<const WifiMacQueueItem>> CandidateInfo;
153
154 uint8_t m_nStations;
161 std::map<AcIndex, std::list<MasterInfo>> m_staListDl;
162 std::list<MasterInfo> m_staListUl;
163 std::list<CandidateInfo> m_candidates;
168};
169
170} //namespace ns3
171
172#endif /* RR_MULTI_USER_SCHEDULER_H */
Headers for Trigger frames.
Definition: ctrl-headers.h:886
an EUI-48 address
Definition: mac48-address.h:44
MultiUserScheduler is an abstract base class defining the API that APs supporting at least VHT can us...
TxFormat
Enumeration of the possible transmission formats.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
RrMultiUserScheduler is a simple OFDMA scheduler that indicates to perform a DL OFDMA transmission if...
virtual TxFormat TrySendingBsrpTf(void)
Check if it is possible to send a BSRP Trigger Frame given the current time limits.
void DoDispose(void) override
Destructor implementation.
bool m_enableBsrp
send a BSRP before an UL MU transmission
void NotifyStationAssociated(uint16_t aid, Mac48Address address)
Notify the scheduler that a station associated with the AP.
uint32_t m_ulPsduSize
the size in byte of the solicited PSDU
std::list< CandidateInfo > m_candidates
Candidate stations for MU TX.
bool m_useCentral26TonesRus
whether to allocate central 26-tone RUs
DlMuInfo ComputeDlMuInfo(void) override
Compute the information required to perform a DL MU transmission.
bool m_forceDlOfdma
return DL_OFDMA even if no DL MU PPDU was built
bool m_enableUlOfdma
enable the scheduler to also return UL_OFDMA
virtual TxFormat TrySendingDlMuPpdu(void)
Check if it is possible to send a DL MU PPDU given the current time limits.
void UpdateCredits(std::list< MasterInfo > &staList, Time txDuration, const WifiTxVector &txVector)
Update credits of the stations in the given list considering that a PPDU having the given duration is...
WifiMacHeader m_triggerMacHdr
MAC header for Trigger Frame.
TxFormat SelectTxFormat(void) override
Select the format of the next transmission.
uint8_t m_nStations
Number of stations/slots to fill.
WifiTxParameters m_txParams
TX parameters.
virtual TxFormat TrySendingBasicTf(void)
Check if it is possible to send a Basic Trigger Frame given the current time limits.
void NotifyStationDeassociated(uint16_t aid, Mac48Address address)
Notify the scheduler that a station deassociated with the AP.
Time m_maxCredits
Max amount of credits a station can have.
bool m_enableTxopSharing
allow A-MPDUs of different TIDs in a DL MU PPDU
CtrlTriggerHeader m_trigger
Trigger Frame to send.
std::map< AcIndex, std::list< MasterInfo > > m_staListDl
Per-AC list of stations (next to serve for DL first)
UlMuInfo ComputeUlMuInfo(void) override
Prepare the information required to solicit an UL MU transmission.
WifiTxVector GetTxVectorForUlMu(Func canBeSolicited)
Compute a TXVECTOR that can be used to construct a Trigger Frame to solicit transmissions from suitab...
void FinalizeTxVector(WifiTxVector &txVector)
Finalize the given TXVECTOR by only including the largest subset of the current set of candidate stat...
void DoInitialize(void) override
Initialize() implementation.
std::pair< std::list< MasterInfo >::iterator, Ptr< const WifiMacQueueItem > > CandidateInfo
Information stored for candidate stations.
static TypeId GetTypeId(void)
Get the type ID.
std::list< MasterInfo > m_staListUl
List of stations to serve for UL.
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,...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
address
Definition: first.py:40
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Information to be provided in case of DL MU transmission.
Information to be provided in case of UL MU transmission.
Information used to sort stations.
Mac48Address address
station's MAC Address
double credits
credits accumulated by the station