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
34namespace ns3 {
35
36class WifiPsdu;
37
44class HePpdu : public OfdmPpdu
45{
46public:
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;
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;
145 uint8_t m_bandwidth;
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);
189 HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration,
190 WifiPhyBand band, uint64_t uid, TxPsdFlag flag, uint8_t p20Index);
194 virtual ~HePpdu ();
195
196 Time GetTxDuration (void) const override;
197 Ptr<WifiPpdu> Copy (void) const override;
198 WifiPpduType GetType (void) const override;
199 uint16_t GetStaId (void) const override;
200 uint16_t GetTransmissionChannelWidth (void) const override;
201 bool CanBeReceived (uint16_t txCenterFreq, uint16_t p20MinFreq,
202 uint16_t p20MaxFreq) const override;
203
211 Ptr<const WifiPsdu> GetPsdu (uint8_t bssColor, uint16_t staId = SU_STA_ID) const;
212
218 TxPsdFlag GetTxPsdFlag (void) const;
219
225 void SetTxPsdFlag (TxPsdFlag flag);
226
227protected:
228 std::string PrintPayload (void) const override;
229
234 bool IsMu (void) const;
239 bool IsDlMu (void) const;
244 bool IsUlMu (void) const;
245
247
248private:
249 WifiTxVector DoGetTxVector (void) const override;
250
257 void SetPhyHeaders (const WifiTxVector& txVector, Time ppduDuration);
258
261}; //class HePpdu
262
270std::ostream& operator<< (std::ostream& os, const HePpdu::TxPsdFlag &flag);
271
272} //namespace ns3
273
274#endif /* HE_PPDU_H */
iterator in a Buffer instance
Definition: buffer.h:99
HE-SIG PHY header (HE-SIG-A1/A2/B)
Definition: he-ppdu.h:52
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:141
uint32_t GetSerializedSize(void) const override
Definition: he-ppdu.cc:350
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
Definition: he-ppdu.cc:458
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
Definition: he-ppdu.cc:395
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:145
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:143
uint8_t m_format
Format bit.
Definition: he-ppdu.h:140
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
Definition: he-ppdu.cc:382
static TypeId GetTypeId(void)
Get the type ID.
Definition: he-ppdu.cc:322
uint32_t Deserialize(Buffer::Iterator start) override
Definition: he-ppdu.cc:518
uint8_t m_nsts
NSTS.
Definition: he-ppdu.h:147
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: he-ppdu.cc:333
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:376
uint8_t GetNStreams(void) const
Return the number of streams.
Definition: he-ppdu.cc:483
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: he-ppdu.cc:363
void Print(std::ostream &os) const override
Definition: he-ppdu.cc:339
void Serialize(Buffer::Iterator start) const override
Definition: he-ppdu.cc:489
uint8_t m_gi_ltf_size
GI+LTF Size field.
Definition: he-ppdu.h:146
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
Definition: he-ppdu.cc:389
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
Definition: he-ppdu.cc:437
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:369
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: he-ppdu.h:150
uint8_t m_spatialReuse
Spatial Reuse field.
Definition: he-ppdu.h:144
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: he-ppdu.cc:416
uint8_t m_ul_dl
UL/DL bit.
Definition: he-ppdu.h:142
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
Definition: he-ppdu.cc:476
HE PPDU (11ax)
Definition: he-ppdu.h:45
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: he-ppdu.h:259
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:262
void SetTxPsdFlag(TxPsdFlag flag)
Definition: he-ppdu.cc:281
bool IsDlMu(void) const
Return true if the PPDU is a DL MU PPDU.
Definition: he-ppdu.cc:193
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSD for HE TB PPDU non-OFDMA...
Definition: he-ppdu.h:159
@ PSD_HE_TB_OFDMA_PORTION
OFDMA portion of HE TB PPDU, which should only be sent on RU.
Definition: he-ppdu.h:162
@ PSD_NON_HE_TB
non-HE TB PPDU transmissions
Definition: he-ppdu.h:160
@ 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
uint16_t GetTransmissionChannelWidth(void) const override
Get the channel width over which the PPDU will effectively be transmitted.
Definition: he-ppdu.cc:242
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:246
virtual ~HePpdu()
Destructor for HePpdu.
Definition: he-ppdu.cc:85
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:75
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the HE PHY headers.
Definition: he-ppdu.cc:90
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:235
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: he-ppdu.cc:128
bool IsUlMu(void) const
Return true if the PPDU is an UL MU PPDU.
Definition: he-ppdu.cc:199
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: he-ppdu.cc:167
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: he-ppdu.cc:147
bool IsMu(void) const
Return true if the PPDU is a MU PPDU.
Definition: he-ppdu.cc:187
std::string PrintPayload(void) const override
Print the payload of the PPDU.
Definition: he-ppdu.cc:289
WifiPpduType GetType(void) const override
Return the PPDU type (.
Definition: he-ppdu.cc:173
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:260
TxPsdFlag GetTxPsdFlag(void) const
Definition: he-ppdu.cc:275
Protocol header serialization and deserialization.
Definition: header.h:43
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
a unique identifier for an interface.
Definition: type-id.h:59
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:79
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
WifiPpduType
The type of PPDU (SU, DL MU, or UL MU)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139
def start()
Definition: core.py:1853
#define SU_STA_ID
Definition: wifi-mode.h:32