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 */
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:388
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:258
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
Definition: he-ppdu.cc:375
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:144
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:469
def start()
Definition: core.py:1855
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:145
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
Definition: he-ppdu.cc:430
uint32_t Deserialize(Buffer::Iterator start) override
Definition: he-ppdu.cc:511
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:259
uint8_t m_ul_dl
UL/DL bit.
Definition: he-ppdu.h:142
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
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
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
Definition: he-ppdu.cc:382
void SetTxPsdFlag(TxPsdFlag flag)
Definition: he-ppdu.cc:274
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
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:143
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:141
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSD for HE TB PPDU non-OFDMA...
Definition: he-ppdu.h:158
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:476
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: he-ppdu.cc:326
uint32_t GetSerializedSize(void) const override
Definition: he-ppdu.cc:343
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
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
Definition: he-ppdu.cc:451
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
WifiPpduType
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:160
uint8_t m_format
Format bit.
Definition: he-ppdu.h:140
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:369
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: he-ppdu.cc:409
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:32
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:150
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
uint16_t GetTransmissionChannelWidth(void) const override
Get the channel width over which the PPDU will effectively be transmitted.
Definition: he-ppdu.cc:235
static TypeId GetTypeId(void)
Get the type ID.
Definition: he-ppdu.cc:315
void Serialize(Buffer::Iterator start) const override
Definition: he-ppdu.cc:482
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: he-ppdu.cc:356
OFDMA portion of HE TB PPDU, which should only be sent on RU.
Definition: he-ppdu.h:162
a unique identifier for an interface.
Definition: type-id.h:58
uint8_t m_nsts
NSTS.
Definition: he-ppdu.h:147
TxPsdFlag GetTxPsdFlag(void) const
Definition: he-ppdu.cc:268
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:282
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:362
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:161
void Print(std::ostream &os) const override
Definition: he-ppdu.cc:332
uint8_t m_gi_ltf_size
GI+LTF Size field.
Definition: he-ppdu.h:146