A Discrete-Event Network Simulator
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Orange Labs
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
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: Rediet <getachew.redieteab@orange.com>
19  * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
20  * S├ębastien Deronne <sebastien.deronne@gmail.com> (HeSigHeader)
21  */
23 #ifndef HE_PPDU_H
24 #define HE_PPDU_H
26 #include "ns3/ofdm-ppdu.h"
34 namespace ns3 {
36 class WifiPsdu;
44 class HePpdu : public OfdmPpdu
45 {
46 public:
51  class HeSigHeader : public Header
52  {
53  public:
54  HeSigHeader ();
55  virtual ~HeSigHeader ();
61  static TypeId GetTypeId (void);
63  // Inherited
64  TypeId GetInstanceTypeId (void) const;
65  void Print (std::ostream &os) const;
66  uint32_t GetSerializedSize (void) const;
67  void Serialize (Buffer::Iterator start) const;
75  void SetMuFlag (bool mu);
82  void SetMcs (uint8_t mcs);
88  uint8_t GetMcs (void) const;
94  void SetBssColor (uint8_t bssColor);
100  uint8_t GetBssColor (void) const;
106  void SetChannelWidth (uint16_t channelWidth);
112  uint16_t GetChannelWidth (void) const;
119  void SetGuardIntervalAndLtfSize (uint16_t gi, uint8_t ltf);
125  uint16_t GetGuardInterval (void) const;
131  void SetNStreams (uint8_t nStreams);
137  uint8_t GetNStreams (void) const;
139  private:
140  //HE-SIG-A1 fields
141  uint8_t m_format;
142  uint8_t m_bssColor;
143  uint8_t m_ul_dl;
144  uint8_t m_mcs;
145  uint8_t m_spatialReuse;
146  uint8_t m_bandwidth;
147  uint8_t m_gi_ltf_size;
148  uint8_t m_nsts;
151  bool m_mu;
152  }; //class HeSigHeader
160  {
164  };
175  HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
176  WifiPhyBand band, uint64_t uid);
189  HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration,
190  WifiPhyBand band, uint64_t uid, TxPsdFlag flag);
194  virtual ~HePpdu ();
196  // Inherited
197  Time GetTxDuration (void) const override;
198  Ptr<WifiPpdu> Copy (void) const override;
199  WifiPpduType GetType (void) const override;
200  uint16_t GetStaId (void) const override;
209  Ptr<const WifiPsdu> GetPsdu (uint8_t bssColor, uint16_t staId = SU_STA_ID) const;
216  TxPsdFlag GetTxPsdFlag (void) const;
223  void SetTxPsdFlag (TxPsdFlag flag);
225 protected:
226  // Inherited
227  std::string PrintPayload (void) const override;
233  bool IsMu (void) const;
238  bool IsDlMu (void) const;
243  bool IsUlMu (void) const;
247 private:
248  // Inherited
249  WifiTxVector DoGetTxVector (void) const override;
257  void SetPhyHeaders (const WifiTxVector& txVector, Time ppduDuration);
261 }; //class HePpdu
270 std::ostream& operator<< (std::ostream& os, const HePpdu::TxPsdFlag &flag);
272 } //namespace ns3
274 #endif /* HE_PPDU_H */
Protocol header serialization and deserialization.
Definition: header.h:42
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
Definition: he-ppdu.cc:355
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: he-ppdu.cc:160
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: he-ppdu.h:259
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
Definition: he-ppdu.cc:342
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint8_t m_spatialReuse
Spatial Reuse field.
Definition: he-ppdu.h:145
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:79
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
Definition: he-ppdu.cc:436
def start()
Definition: core.py:1855
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:146
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
Definition: he-ppdu.cc:397
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:260
uint32_t Deserialize(Buffer::Iterator start)
Definition: he-ppdu.cc:478
uint8_t m_ul_dl
UL/DL bit.
Definition: he-ppdu.h:143
WifiTxVector::HeMuUserInfoMap m_muUserInfos
the HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented) ...
Definition: he-ppdu.h:245
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
Definition: he-ppdu.cc:349
void SetTxPsdFlag(TxPsdFlag flag)
Definition: he-ppdu.cc:241
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the HE PHY headers.
Definition: he-ppdu.cc:84
iterator in a Buffer instance
Definition: buffer.h:98
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: he-ppdu.cc:140
void Print(std::ostream &os) const
Definition: he-ppdu.cc:299
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:144
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:142
The transmit power spectral density flag, namely used to correctly build PSD for HE TB PPDU non-OFDMA...
Definition: he-ppdu.h:159
WifiPpduType GetType(void) const override
Return the PPDU type (.
Definition: he-ppdu.cc:166
uint8_t GetNStreams(void) const
Return the number of streams.
Definition: he-ppdu.cc:443
virtual ~HePpdu()
Destructor for HePpdu.
Definition: he-ppdu.cc:79
OFDM PPDU (11a)OfdmPpdu stores a preamble, PHY headers and a PSDU of a PPDU with non-HT header...
Definition: ofdm-ppdu.h:47
TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
Definition: he-ppdu.cc:293
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
Definition: he-ppdu.cc:418
bool IsMu(void) const
Return true if the PPDU is a MU PPDU.
Definition: he-ppdu.cc:180
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool IsUlMu(void) const
Return true if the PPDU is an UL MU PPDU.
Definition: he-ppdu.cc:192
The type of PPDU (SU, DL MU, or UL MU)
HE PPDU (11ax)HePpdu stores a preamble, PHY headers and a map of PSDUs of a PPDU with HE header...
Definition: he-ppdu.h:44
non-HE TB PPDU transmissions
Definition: he-ppdu.h:161
uint8_t m_format
Format bit.
Definition: he-ppdu.h:141
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:336
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: he-ppdu.cc:376
Identifies the PHY band.
Definition: wifi-phy-band.h:32
uint32_t GetSerializedSize(void) const
Definition: he-ppdu.cc:310
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: he-ppdu.cc:122
HE-SIG PHY header (HE-SIG-A1/A2/B)
Definition: he-ppdu.h:51
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: he-ppdu.h:151
HePpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create an SU HE PPDU, storing a PSDU.
Definition: he-ppdu.cc:69
static TypeId GetTypeId(void)
Get the type ID.
Definition: he-ppdu.cc:282
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: he-ppdu.cc:323
OFDMA portion of HE TB PPDU, which should only be sent on RU.
Definition: he-ppdu.h:163
a unique identifier for an interface.
Definition: type-id.h:58
uint8_t m_nsts
Definition: he-ppdu.h:148
TxPsdFlag GetTxPsdFlag(void) const
Definition: he-ppdu.cc:235
uint16_t GetStaId(void) const override
Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
Definition: he-ppdu.cc:228
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
#define SU_STA_ID
Definition: wifi-mode.h:32
std::string PrintPayload(void) const override
Print the payload of the PPDU.
Definition: he-ppdu.cc:249
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:329
bool IsDlMu(void) const
Return true if the PPDU is a DL MU PPDU.
Definition: he-ppdu.cc:186
preamble of HE TB PPDU, which should only be sent on minimum subset of 20 MHz channels containing RU ...
Definition: he-ppdu.h:162
uint8_t m_gi_ltf_size
GI+LTF Size field.
Definition: he-ppdu.h:147
void Serialize(Buffer::Iterator start) const
Definition: he-ppdu.cc:449