A Discrete-Event Network Simulator
API
he-ppdu.h
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
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: Rediet <getachew.redieteab@orange.com>
19  * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
20  * S├ębastien Deronne <sebastien.deronne@gmail.com> (HeSigHeader)
21  */
22 
23 #ifndef HE_PPDU_H
24 #define HE_PPDU_H
25 
26 #include "ns3/ofdm-ppdu.h"
27 
34 namespace ns3 {
35 
36 class WifiPsdu;
37 
44 class HePpdu : public OfdmPpdu
45 {
46 public:
47 
51  class HeSigHeader : public Header
52  {
53  public:
54  HeSigHeader ();
55  virtual ~HeSigHeader ();
56 
61  static TypeId GetTypeId (void);
62 
63  TypeId GetInstanceTypeId (void) const override;
64  void Print (std::ostream &os) const override;
65  uint32_t GetSerializedSize (void) const override;
66  void Serialize (Buffer::Iterator start) const override;
67  uint32_t Deserialize (Buffer::Iterator start) override;
68 
74  void SetMuFlag (bool mu);
75 
81  void SetMcs (uint8_t mcs);
87  uint8_t GetMcs (void) const;
93  void SetBssColor (uint8_t bssColor);
99  uint8_t GetBssColor (void) const;
105  void SetChannelWidth (uint16_t channelWidth);
111  uint16_t GetChannelWidth (void) const;
118  void SetGuardIntervalAndLtfSize (uint16_t gi, uint8_t ltf);
124  uint16_t GetGuardInterval (void) const;
130  void SetNStreams (uint8_t nStreams);
136  uint8_t GetNStreams (void) const;
137 
138  private:
139  //HE-SIG-A1 fields
140  uint8_t m_format;
141  uint8_t m_bssColor;
142  uint8_t m_ul_dl;
143  uint8_t m_mcs;
144  uint8_t m_spatialReuse;
145  uint8_t m_bandwidth;
146  uint8_t m_gi_ltf_size;
147  uint8_t m_nsts;
148 
150  bool m_mu;
151  }; //class HeSigHeader
152 
159  {
163  };
164 
174  HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, Time ppduDuration,
175  WifiPhyBand band, uint64_t uid);
188  HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration,
189  WifiPhyBand band, uint64_t uid, TxPsdFlag flag);
193  virtual ~HePpdu ();
194 
195  Time GetTxDuration (void) const override;
196  Ptr<WifiPpdu> Copy (void) const override;
197  WifiPpduType GetType (void) const override;
198  uint16_t GetStaId (void) const override;
199  uint16_t GetTransmissionChannelWidth (void) const override;
200  bool CanBeReceived (uint16_t txCenterFreq, uint16_t p20MinFreq,
201  uint16_t p20MaxFreq) const override;
202 
210  Ptr<const WifiPsdu> GetPsdu (uint8_t bssColor, uint16_t staId = SU_STA_ID) const;
211 
217  TxPsdFlag GetTxPsdFlag (void) const;
218 
224  void SetTxPsdFlag (TxPsdFlag flag);
225 
226 protected:
227  std::string PrintPayload (void) const override;
228 
233  bool IsMu (void) const;
238  bool IsDlMu (void) const;
243  bool IsUlMu (void) const;
244 
246 
247 private:
248  WifiTxVector DoGetTxVector (void) const override;
249 
256  void SetPhyHeaders (const WifiTxVector& txVector, Time ppduDuration);
257 
260 }; //class HePpdu
261 
269 std::ostream& operator<< (std::ostream& os, const HePpdu::TxPsdFlag &flag);
270 
271 } //namespace ns3
272 
273 #endif /* HE_PPDU_H */
ns3::HePpdu::GetTxDuration
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: he-ppdu.cc:140
ns3::OfdmPpdu
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
ns3::HePpdu::HeSigHeader
HE-SIG PHY header (HE-SIG-A1/A2/B)
Definition: he-ppdu.h:52
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::HePpdu::m_heSig
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: he-ppdu.h:258
ns3::HePpdu::HePpdu
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
ns3::HePpdu::TxPsdFlag
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSD for HE TB PPDU non-OFDMA...
Definition: he-ppdu.h:159
ns3::HePpdu::GetTxPsdFlag
TxPsdFlag GetTxPsdFlag(void) const
Definition: he-ppdu.cc:268
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::HePpdu
HE PPDU (11ax)
Definition: he-ppdu.h:45
ns3::HePpdu::HeSigHeader::Serialize
void Serialize(Buffer::Iterator start) const override
Definition: he-ppdu.cc:482
ns3::HePpdu::HeSigHeader::m_bandwidth
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:145
ns3::HePpdu::HeSigHeader::SetBssColor
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
Definition: he-ppdu.cc:375
ns3::HePpdu::HeSigHeader::m_nsts
uint8_t m_nsts
NSTS.
Definition: he-ppdu.h:147
ns3::HePpdu::HeSigHeader::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: he-ppdu.cc:315
ns3::HePpdu::HeSigHeader::m_bssColor
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:141
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::WifiConstPsduMap
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition: he-frame-exchange-manager.h:43
ns3::HePpdu::IsUlMu
bool IsUlMu(void) const
Return true if the PPDU is an UL MU PPDU.
Definition: he-ppdu.cc:192
ns3::HePpdu::PSD_NON_HE_TB
@ PSD_NON_HE_TB
non-HE TB PPDU transmissions
Definition: he-ppdu.h:160
ns3::HePpdu::HeSigHeader::SetChannelWidth
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
Definition: he-ppdu.cc:388
ns3::Ptr< const WifiPsdu >
visualizer.core.start
def start()
Definition: core.py:1855
ns3::HePpdu::HeSigHeader::m_mcs
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:143
ns3::HePpdu::HeSigHeader::Print
void Print(std::ostream &os) const override
Definition: he-ppdu.cc:332
ns3::HePpdu::HeSigHeader::HeSigHeader
HeSigHeader()
Definition: he-ppdu.cc:297
ns3::HePpdu::~HePpdu
virtual ~HePpdu()
Destructor for HePpdu.
Definition: he-ppdu.cc:79
ns3::HePpdu::GetTransmissionChannelWidth
uint16_t GetTransmissionChannelWidth(void) const override
Get the channel width over which the PPDU will effectively be transmitted.
Definition: he-ppdu.cc:235
ns3::HePpdu::CanBeReceived
bool CanBeReceived(uint16_t txCenterFreq, uint16_t p20MinFreq, uint16_t p20MaxFreq) const override
Check whether the given PPDU can be received on the specified primary channel.
Definition: he-ppdu.cc:255
ns3::HePpdu::m_muUserInfos
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
SU_STA_ID
#define SU_STA_ID
Definition: wifi-mode.h:32
ns3::HePpdu::m_txPsdFlag
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:259
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::Header
Protocol header serialization and deserialization.
Definition: header.h:43
ns3::HePpdu::HeSigHeader::GetMcs
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:369
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::HePpdu::PSD_HE_TB_NON_OFDMA_PORTION
@ PSD_HE_TB_NON_OFDMA_PORTION
preamble of HE TB PPDU, which should only be sent on minimum subset of 20 MHz channels containing RU
Definition: he-ppdu.h:161
ns3::HePpdu::HeSigHeader::GetInstanceTypeId
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: he-ppdu.cc:326
ns3::Header::Deserialize
virtual uint32_t Deserialize(Buffer::Iterator start)=0
Deserialize the object from a buffer iterator.
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition: buffer.h:99
ns3::HePpdu::HeSigHeader::GetChannelWidth
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: he-ppdu.cc:409
ns3::HePpdu::PSD_HE_TB_OFDMA_PORTION
@ PSD_HE_TB_OFDMA_PORTION
OFDMA portion of HE TB PPDU, which should only be sent on RU.
Definition: he-ppdu.h:162
ns3::HePpdu::Copy
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: he-ppdu.cc:160
ns3::HePpdu::PrintPayload
std::string PrintPayload(void) const override
Print the payload of the PPDU.
Definition: he-ppdu.cc:282
ns3::HePpdu::HeSigHeader::m_mu
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: he-ppdu.h:150
ns3::HePpdu::SetPhyHeaders
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the HE PHY headers.
Definition: he-ppdu.cc:84
ns3::HePpdu::HeSigHeader::GetNStreams
uint8_t GetNStreams(void) const
Return the number of streams.
Definition: he-ppdu.cc:476
ns3::HePpdu::HeSigHeader::m_format
uint8_t m_format
Format bit.
Definition: he-ppdu.h:140
ns3::WifiPpduType
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
Definition: wifi-phy-common.h:229
ns3::HePpdu::HeSigHeader::SetGuardIntervalAndLtfSize
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
Definition: he-ppdu.cc:430
ns3::HePpdu::GetStaId
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
ns3::HePpdu::HeSigHeader::~HeSigHeader
virtual ~HeSigHeader()
Definition: he-ppdu.cc:310
ns3::HePpdu::HeSigHeader::m_spatialReuse
uint8_t m_spatialReuse
Spatial Reuse field.
Definition: he-ppdu.h:144
ns3::HePpdu::GetType
WifiPpduType GetType(void) const override
Return the PPDU type (.
Definition: he-ppdu.cc:166
ns3::HePpdu::HeSigHeader::SetNStreams
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
Definition: he-ppdu.cc:469
ns3::HePpdu::SetTxPsdFlag
void SetTxPsdFlag(TxPsdFlag flag)
Definition: he-ppdu.cc:274
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
ns3::HePpdu::HeSigHeader::m_gi_ltf_size
uint8_t m_gi_ltf_size
GI+LTF Size field.
Definition: he-ppdu.h:146
ns3::HePpdu::HeSigHeader::GetGuardInterval
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
Definition: he-ppdu.cc:451
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:137
ns3::HePpdu::HeSigHeader::m_ul_dl
uint8_t m_ul_dl
UL/DL bit.
Definition: he-ppdu.h:142
ns3::WifiPpdu::GetPsdu
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:79
ns3::HePpdu::IsDlMu
bool IsDlMu(void) const
Return true if the PPDU is a DL MU PPDU.
Definition: he-ppdu.cc:186
ns3::HePpdu::DoGetTxVector
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: he-ppdu.cc:122
ns3::HePpdu::IsMu
bool IsMu(void) const
Return true if the PPDU is a MU PPDU.
Definition: he-ppdu.cc:180
ns3::HePpdu::HeSigHeader::GetSerializedSize
uint32_t GetSerializedSize(void) const override
Definition: he-ppdu.cc:343
ns3::HePpdu::HeSigHeader::SetMuFlag
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: he-ppdu.cc:356
ns3::HePpdu::HeSigHeader::GetBssColor
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
Definition: he-ppdu.cc:382
ns3::HePpdu::HeSigHeader::SetMcs
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:362