A Discrete-Event Network Simulator
API
wifi-tx-vector.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2010 CTTC
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  * Authors: Nicola Baldo <nbaldo@cttc.es>
19  * Ghada Badawy <gbadawy@gmail.com>
20  */
21 
22 #ifndef WIFI_TX_VECTOR_H
23 #define WIFI_TX_VECTOR_H
24 
25 #include <list>
26 #include "wifi-mode.h"
27 #include "wifi-phy-common.h"
28 #include "ns3/he-ru.h"
29 
30 namespace ns3 {
31 
34 {
37  uint8_t nss;
38 };
39 
71 {
72 public:
74  typedef std::map <uint16_t /* staId */, HeMuUserInfo /* HE MU specific user info */> HeMuUserInfoMap;
75 
76  WifiTxVector ();
77  ~WifiTxVector ();
95  WifiTxVector (WifiMode mode,
96  uint8_t powerLevel,
97  WifiPreamble preamble,
98  uint16_t guardInterval,
99  uint8_t nTx,
100  uint8_t nss,
101  uint8_t ness,
102  uint16_t channelWidth,
103  bool aggregation,
104  bool stbc = false,
105  bool ldpc = false,
106  uint8_t bssColor = 0,
107  uint16_t length = 0);
112  WifiTxVector (const WifiTxVector& txVector);
113 
117  bool GetModeInitialized (void) const;
127  WifiMode GetMode (uint16_t staId = SU_STA_ID) const;
133  void SetMode (WifiMode mode);
140  void SetMode (WifiMode mode, uint16_t staId);
141 
148 
152  uint8_t GetTxPowerLevel (void) const;
158  void SetTxPowerLevel (uint8_t powerlevel);
162  WifiPreamble GetPreambleType (void) const;
168  void SetPreambleType (WifiPreamble preamble);
172  uint16_t GetChannelWidth (void) const;
178  void SetChannelWidth (uint16_t channelWidth);
182  uint16_t GetGuardInterval (void) const;
188  void SetGuardInterval (uint16_t guardInterval);
192  uint8_t GetNTx (void) const;
198  void SetNTx (uint8_t nTx);
208  uint8_t GetNss (uint16_t staId = SU_STA_ID) const;
212  uint8_t GetNssMax (void) const;
218  void SetNss (uint8_t nss);
225  void SetNss (uint8_t nss, uint16_t staId);
229  uint8_t GetNess (void) const;
235  void SetNess (uint8_t ness);
241  bool IsAggregation (void) const;
247  void SetAggregation (bool aggregation);
254  bool IsStbc (void) const;
260  void SetStbc (bool stbc);
267  bool IsLdpc (void) const;
273  void SetLdpc (bool ldpc);
278  void SetBssColor (uint8_t color);
283  uint8_t GetBssColor (void) const;
288  void SetLength (uint16_t length);
293  uint16_t GetLength (void) const;
301  bool IsValid (void) const;
307  bool IsMu (void) const;
313  bool IsDlMu (void) const;
319  bool IsUlMu (void) const;
327  HeRu::RuSpec GetRu (uint16_t staId) const;
335  void SetRu (HeRu::RuSpec ru, uint16_t staId);
343  HeMuUserInfo GetHeMuUserInfo (uint16_t staId) const;
351  void SetHeMuUserInfo (uint16_t staId, HeMuUserInfo userInfo);
358  const HeMuUserInfoMap& GetHeMuUserInfoMap (void) const;
374  std::pair<std::size_t, std::size_t> GetNumRusPerHeSigBContentChannel (void) const;
375 
376 
377 private:
381  uint8_t m_txPowerLevel;
385  uint16_t m_channelWidth;
386  uint16_t m_guardInterval;
387  uint8_t m_nTx;
388  uint8_t m_nss;
389  uint8_t m_ness;
391  bool m_stbc;
392  bool m_ldpc;
393  uint8_t m_bssColor;
394  uint16_t m_length;
398  //MU information
403 };
404 
413 std::ostream & operator << (std::ostream & os,const WifiTxVector &v);
414 
415 } //namespace ns3
416 
417 #endif /* WIFI_TX_VECTOR_H */
ns3::WifiTxVector::IsStbc
bool IsStbc(void) const
Check if STBC is used or not.
Definition: wifi-tx-vector.cc:214
ns3::WifiTxVector::GetBssColor
uint8_t GetBssColor(void) const
Get the BSS color.
Definition: wifi-tx-vector.cc:316
ns3::WifiTxVector::SetTxPowerLevel
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
Definition: wifi-tx-vector.cc:242
ns3::WifiTxVector::m_aggregation
bool m_aggregation
Flag whether the PSDU contains A-MPDU.
Definition: wifi-tx-vector.h:390
ns3::WifiTxVector::~WifiTxVector
~WifiTxVector()
Definition: wifi-tx-vector.cc:100
ns3::WifiTxVector::GetRu
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
Definition: wifi-tx-vector.cc:388
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::WifiTxVector::IsValid
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams,...
Definition: wifi-tx-vector.cc:334
ns3::WifiTxVector::SetGuardInterval
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
Definition: wifi-tx-vector.cc:260
ns3::WifiTxVector::IsLdpc
bool IsLdpc(void) const
Check if LDPC FEC coding is used or not.
Definition: wifi-tx-vector.cc:220
ns3::WifiTxVector::GetNssMax
uint8_t GetNssMax(void) const
Definition: wifi-tx-vector.cc:184
ns3::WifiTxVector::m_channelWidth
uint16_t m_channelWidth
channel width in MHz
Definition: wifi-tx-vector.h:385
ns3::WifiTxVector::SetNss
void SetNss(uint8_t nss)
Sets the number of Nss.
Definition: wifi-tx-vector.cc:272
ns3::WifiTxVector::SetAggregation
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
Definition: wifi-tx-vector.cc:292
wifi-phy-common.h
Declaration of the following enums:
ns3::WifiTxVector::SetMode
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
Definition: wifi-tx-vector.cc:226
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::WifiTxVector::m_mode
WifiMode m_mode
The DATARATE parameter in Table 15-4.
Definition: wifi-tx-vector.h:378
ns3::WifiTxVector::IsUlMu
bool IsUlMu(void) const
Return true if this TX vector is used for an uplink multi-user transmission.
Definition: wifi-tx-vector.cc:382
ns3::WifiTxVector::SetLength
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
Definition: wifi-tx-vector.cc:322
ns3::HeRu::RuSpec
RU Specification.
Definition: he-ru.h:68
ns3::WifiTxVector::GetModulationClass
WifiModulationClass GetModulationClass(void) const
Get the modulation class specified by this TXVECTOR.
Definition: wifi-tx-vector.cc:128
ns3::WifiTxVector::m_txPowerLevel
uint8_t m_txPowerLevel
The TXPWR_LEVEL parameter in Table 15-4.
Definition: wifi-tx-vector.h:381
ns3::HeMuUserInfo
HE MU specific user transmission parameters.
Definition: wifi-tx-vector.h:34
ns3::WifiTxVector::m_nss
uint8_t m_nss
number of spatial streams
Definition: wifi-tx-vector.h:388
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::WifiTxVector::SetNess
void SetNess(uint8_t ness)
Sets the Ness number.
Definition: wifi-tx-vector.cc:286
ns3::WifiTxVector::m_ness
uint8_t m_ness
number of spatial streams in beamforming
Definition: wifi-tx-vector.h:389
ns3::WifiTxVector::GetHeMuUserInfoMap
const HeMuUserInfoMap & GetHeMuUserInfoMap(void) const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
Definition: wifi-tx-vector.cc:421
SU_STA_ID
#define SU_STA_ID
Definition: wifi-mode.h:32
ns3::WifiTxVector::IsAggregation
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
Definition: wifi-tx-vector.cc:208
ns3::WifiTxVector::m_ldpc
bool m_ldpc
LDPC FEC coding if true, BCC otherwise.
Definition: wifi-tx-vector.h:392
ns3::WifiTxVector::GetNess
uint8_t GetNess(void) const
Definition: wifi-tx-vector.cc:202
ns3::WifiTxVector::GetPreambleType
WifiPreamble GetPreambleType(void) const
Definition: wifi-tx-vector.cc:148
ns3::WifiTxVector::GetHeMuUserInfo
HeMuUserInfo GetHeMuUserInfo(uint16_t staId) const
Get the HE MU user-specific transmission information for the given STA-ID.
Definition: wifi-tx-vector.cc:404
ns3::WifiTxVector::SetChannelWidth
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
Definition: wifi-tx-vector.cc:254
wifi-mode.h
ns3::WifiTxVector::m_length
uint16_t m_length
LENGTH field of the L-SIG.
Definition: wifi-tx-vector.h:394
ns3::WifiTxVector::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-tx-vector.cc:154
ns3::WifiTxVector::HeMuUserInfoMap
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
Definition: wifi-tx-vector.h:74
ns3::WifiTxVector::m_guardInterval
uint16_t m_guardInterval
guard interval duration in nanoseconds
Definition: wifi-tx-vector.h:386
ns3::WifiTxVector::IsMu
bool IsMu(void) const
Return true if this TX vector is used for a multi-user transmission.
Definition: wifi-tx-vector.cc:370
ns3::HeMuUserInfo::ru
HeRu::RuSpec ru
RU specification.
Definition: wifi-tx-vector.h:35
ns3::WifiPreamble
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-phy-common.h:68
ns3::HeMuUserInfo::nss
uint8_t nss
number of spatial streams
Definition: wifi-tx-vector.h:37
ns3::WifiTxVector::GetGuardInterval
uint16_t GetGuardInterval(void) const
Definition: wifi-tx-vector.cc:160
ns3::WifiTxVector::GetNss
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.
Definition: wifi-tx-vector.cc:172
ns3::WifiTxVector::m_muUserInfos
HeMuUserInfoMap m_muUserInfos
HE MU specific per-user information indexed by station ID (STA-ID) corresponding to the 11 LSBs of th...
Definition: wifi-tx-vector.h:399
ns3::WifiTxVector::m_nTx
uint8_t m_nTx
number of TX antennas
Definition: wifi-tx-vector.h:387
ns3::WifiTxVector::SetHeMuUserInfo
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
Definition: wifi-tx-vector.cc:411
ns3::HeMuUserInfo::mcs
WifiMode mcs
MCS.
Definition: wifi-tx-vector.h:36
ns3::WifiTxVector::GetTxPowerLevel
uint8_t GetTxPowerLevel(void) const
Definition: wifi-tx-vector.cc:142
ns3::WifiTxVector::m_preamble
WifiPreamble m_preamble
preamble
Definition: wifi-tx-vector.h:384
ns3::WifiTxVector::SetNTx
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
Definition: wifi-tx-vector.cc:266
ns3::WifiTxVector::SetStbc
void SetStbc(bool stbc)
Sets if STBC is being used.
Definition: wifi-tx-vector.cc:298
ns3::WifiTxVector::GetLength
uint16_t GetLength(void) const
Get the LENGTH field of the L-SIG.
Definition: wifi-tx-vector.cc:328
ns3::WifiTxVector::GetNTx
uint8_t GetNTx(void) const
Definition: wifi-tx-vector.cc:166
ns3::WifiTxVector::SetRu
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
Definition: wifi-tx-vector.cc:396
ns3::WifiTxVector::WifiTxVector
WifiTxVector()
Definition: wifi-tx-vector.cc:28
ns3::WifiTxVector::SetBssColor
void SetBssColor(uint8_t color)
Set the BSS color.
Definition: wifi-tx-vector.cc:310
ns3::WifiTxVector::m_stbc
bool m_stbc
STBC used or not.
Definition: wifi-tx-vector.h:391
ns3::WifiTxVector::GetNumRusPerHeSigBContentChannel
std::pair< std::size_t, std::size_t > GetNumRusPerHeSigBContentChannel(void) const
Get the number of RUs per HE-SIG-B content channel.
Definition: wifi-tx-vector.cc:435
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::WifiTxVector::m_bssColor
uint8_t m_bssColor
BSS color.
Definition: wifi-tx-vector.h:393
ns3::WifiTxVector::m_modeInitialized
bool m_modeInitialized
Internal initialization flag.
Definition: wifi-tx-vector.h:396
ns3::WifiTxVector::SetPreambleType
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
Definition: wifi-tx-vector.cc:248
ns3::WifiTxVector::IsDlMu
bool IsDlMu(void) const
Return true if this TX vector is used for a downlink multi-user transmission.
Definition: wifi-tx-vector.cc:376
ns3::WifiTxVector::GetModeInitialized
bool GetModeInitialized(void) const
Definition: wifi-tx-vector.cc:106
ns3::WifiTxVector::GetMode
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.
Definition: wifi-tx-vector.cc:112
ns3::WifiModulationClass
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Definition: wifi-phy-common.h:122
ns3::WifiTxVector::SetLdpc
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
Definition: wifi-tx-vector.cc:304