A Discrete-Event Network Simulator
API
wifi-tx-vector.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2010 CTTC
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 * Authors: Nicola Baldo <nbaldo@cttc.es>
18 * Ghada Badawy <gbadawy@gmail.com>
19 */
20
21#ifndef WIFI_TX_VECTOR_H
22#define WIFI_TX_VECTOR_H
23
24#include "wifi-mode.h"
25#include "wifi-phy-common.h"
26
27#include "ns3/he-ru.h"
28
29#include <list>
30#include <vector>
31
32namespace ns3
33{
34
37{
40 uint8_t nss;
41
48 bool operator==(const HeMuUserInfo& other) const;
55 bool operator!=(const HeMuUserInfo& other) const;
56};
57
59using SubcarrierGroups = std::vector<HeRu::SubcarrierGroup>;
60
63
65using ContentChannelAllocation = std::vector<std::vector<uint16_t>>;
66
68using RuAllocation = std::vector<uint8_t>;
69
101{
102 public:
104 typedef std::map<uint16_t /* staId */, HeMuUserInfo /* HE MU specific user info */>
106
107 WifiTxVector();
127 uint8_t powerLevel,
128 WifiPreamble preamble,
129 uint16_t guardInterval,
130 uint8_t nTx,
131 uint8_t nss,
132 uint8_t ness,
133 uint16_t channelWidth,
134 bool aggregation,
135 bool stbc = false,
136 bool ldpc = false,
137 uint8_t bssColor = 0,
138 uint16_t length = 0);
143 WifiTxVector(const WifiTxVector& txVector);
144
148 bool GetModeInitialized() const;
158 WifiMode GetMode(uint16_t staId = SU_STA_ID) const;
164 void SetMode(WifiMode mode);
171 void SetMode(WifiMode mode, uint16_t staId);
172
179
183 uint8_t GetTxPowerLevel() const;
189 void SetTxPowerLevel(uint8_t powerlevel);
199 void SetPreambleType(WifiPreamble preamble);
203 uint16_t GetChannelWidth() const;
209 void SetChannelWidth(uint16_t channelWidth);
213 uint16_t GetGuardInterval() const;
219 void SetGuardInterval(uint16_t guardInterval);
223 uint8_t GetNTx() const;
229 void SetNTx(uint8_t nTx);
239 uint8_t GetNss(uint16_t staId = SU_STA_ID) const;
243 uint8_t GetNssMax() const;
249 void SetNss(uint8_t nss);
256 void SetNss(uint8_t nss, uint16_t staId);
260 uint8_t GetNess() const;
266 void SetNess(uint8_t ness);
272 bool IsAggregation() const;
278 void SetAggregation(bool aggregation);
285 bool IsStbc() const;
291 void SetStbc(bool stbc);
298 bool IsLdpc() const;
304 void SetLdpc(bool ldpc);
309 void SetBssColor(uint8_t color);
314 uint8_t GetBssColor() const;
319 void SetLength(uint16_t length);
324 uint16_t GetLength() const;
332 bool IsValid() const;
338 bool IsMu() const;
344 bool IsDlMu() const;
350 bool IsUlMu() const;
358 HeRu::RuSpec GetRu(uint16_t staId) const;
366 void SetRu(HeRu::RuSpec ru, uint16_t staId);
374 HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const;
382 void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo);
389 const HeMuUserInfoMap& GetHeMuUserInfoMap() const;
405 std::pair<std::size_t, std::size_t> GetNumRusPerHeSigBContentChannel() const;
406
414 void SetInactiveSubchannels(const std::vector<bool>& inactiveSubchannels);
422 const std::vector<bool>& GetInactiveSubchannels() const;
423
428 void SetSigBMode(const WifiMode& mode);
429
434 WifiMode GetSigBMode() const;
435
440 void SetRuAllocation(const RuAllocation& ruAlloc);
441
446 const RuAllocation& GetRuAllocation() const;
447
454
455 private:
463
471 uint16_t m_channelWidth;
473 uint8_t m_nTx;
474 uint8_t m_nss;
475 uint8_t m_ness;
477 bool m_stbc;
478 bool m_ldpc;
479 uint8_t m_bssColor;
480 uint16_t m_length;
484 // MU information
489 std::vector<bool>
496};
497
506std::ostream& operator<<(std::ostream& os, const WifiTxVector& v);
507
508} // namespace ns3
509
510#endif /* WIFI_TX_VECTOR_H */
RU Specification.
Definition: he-ru.h:66
represent a single transmission mode
Definition: wifi-mode.h:50
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint16_t m_channelWidth
channel width in MHz
void SetStbc(bool stbc)
Sets if STBC is being used.
void SetNess(uint8_t ness)
Sets the Ness number.
bool m_aggregation
Flag whether the PSDU contains A-MPDU.
const RuAllocation & GetRuAllocation() const
Get RU Allocation of SIG-B.
uint16_t GetGuardInterval() const
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
bool IsValid() const
The standard disallows certain combinations of WifiMode, number of spatial streams,...
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
uint8_t GetBssColor() const
Get the BSS color.
bool GetModeInitialized() const
std::vector< bool > m_inactiveSubchannels
Bitmap of inactive subchannels used for preamble puncturing.
WifiMode m_mode
The DATARATE parameter in Table 15-4.
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
uint8_t GetNTx() const
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
RuAllocation m_ruAllocation
RU allocations that are going to be carried in SIG-B common field per Table 27-1 IEEE.
void SetInactiveSubchannels(const std::vector< bool > &inactiveSubchannels)
Set the 20 MHz subchannels that are punctured.
bool IsStbc() const
Check if STBC is used or not.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
WifiPreamble GetPreambleType() const
HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const
Get the HE MU user-specific transmission information for the given STA-ID.
uint8_t m_nTx
number of TX antennas
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
HeMuUserInfoMap m_muUserInfos
HE MU specific per-user information indexed by station ID (STA-ID) corresponding to the 11 LSBs of th...
uint8_t m_txPowerLevel
The TXPWR_LEVEL parameter in Table 15-4.
bool m_ldpc
LDPC FEC coding if true, BCC otherwise.
uint16_t GetLength() const
Get the LENGTH field of the L-SIG.
uint16_t m_guardInterval
guard interval duration in nanoseconds
bool IsDlMu() const
Return true if this TX vector is used for a downlink multi-user transmission.
bool m_stbc
STBC used or not.
uint8_t m_nss
number of spatial streams
void SetRuAllocation(const RuAllocation &ruAlloc)
Set RU Allocation of SIG-B common field.
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
RuAllocation DeriveRuAllocation() const
Derive the RU allocation from the TXVECTOR for which its RU allocation has not been set yet.
ContentChannelAllocation GetContentChannelAllocation() const
Get the HE SIG-B content channel STA ID allocation IEEE 802.11ax-2021 27.3.11.8.2 HE-SIG-B content ch...
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
uint8_t GetNssMax() const
bool IsUlMu() const
Return true if this TX vector is used for an uplink multi-user transmission.
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
bool IsMu() const
Return true if this TX vector is used for a multi-user transmission.
uint16_t m_length
LENGTH field of the L-SIG.
uint8_t m_bssColor
BSS color.
std::pair< std::size_t, std::size_t > GetNumRusPerHeSigBContentChannel() const
Get the number of RUs per HE-SIG-B content channel.
WifiMode m_sigBMcs
MCS_SIG_B per Table 27-1 IEEE 802.11ax-2021.
void SetBssColor(uint8_t color)
Set the BSS color.
bool IsLdpc() const
Check if LDPC FEC coding is used or not.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint8_t GetTxPowerLevel() const
bool IsAggregation() const
Checks whether the PSDU contains A-MPDU.
uint16_t GetChannelWidth() const
WifiPreamble m_preamble
preamble
bool m_modeInitialized
Internal initialization flag.
uint8_t GetNess() const
uint8_t m_ness
number of spatial streams in beamforming
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiMode GetSigBMode() const
Get MCS used for SIG-B.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
const std::vector< bool > & GetInactiveSubchannels() const
Get the 20 MHz subchannels that are punctured.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
std::vector< std::vector< uint16_t > > ContentChannelAllocation
HE SIG-B Content Channels STA ID Allocation.
std::vector< HeRu::SubcarrierGroup > SubcarrierGroups
A vector of subcarrier group.
std::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
constexpr size_t WIFI_MAX_NUM_HE_SIGB_CONTENT_CHANNELS
Maximum number of HE-SIG-B content channels.
HE MU specific user transmission parameters.
HeRu::RuSpec ru
RU specification.
uint8_t nss
number of spatial streams
bool operator!=(const HeMuUserInfo &other) const
Compare this user info to the given user info.
bool operator==(const HeMuUserInfo &other) const
Compare this user info to the given user info.
WifiMode mcs
MCS.
#define SU_STA_ID
Definition: wifi-mode.h:34
Declaration of the following enums: