A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
he-ppdu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Orange Labs
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Rediet <getachew.redieteab@orange.com>
18 * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
19 * Sébastien Deronne <sebastien.deronne@gmail.com> (HeSigHeader)
20 */
21
22#ifndef HE_PPDU_H
23#define HE_PPDU_H
24
25#include "ns3/ofdm-ppdu.h"
26
27#include <variant>
28
35namespace ns3
36{
37
40
41class WifiPsdu;
42
49class HePpdu : public OfdmPpdu
50{
51 public:
54 {
55 uint16_t staId : 11;
56 uint8_t nss : 4;
57 uint8_t mcs : 4;
58 };
59
61 using HeSigBContentChannels = std::vector<std::vector<HeSigBUserSpecificField>>;
62
67 {
68 uint8_t m_format{1};
69 uint8_t m_bssColor{0};
70 uint8_t m_mcs{0};
71 uint8_t m_bandwidth{0};
72 uint8_t m_giLtfSize{0};
73 uint8_t m_nsts{0};
74 }; // struct HeSuSigHeader
75
80 {
81 uint8_t m_format{0};
82 uint8_t m_bssColor{0};
83 uint8_t m_bandwidth{0};
84 }; // struct HeTbSigHeader
85
90 {
91 // HE-SIG-A fields
92 uint8_t m_bssColor{0};
93 uint8_t m_bandwidth{0};
94 uint8_t m_sigBMcs{0};
95 uint8_t m_giLtfSize{0};
96
97 // HE-SIG-B fields
101 std::optional<Center26ToneRuIndication>
103 }; // struct HeMuSigHeader
104
106 using HeSigHeader = std::variant<std::monostate, HeSuSigHeader, HeTbSigHeader, HeMuSigHeader>;
107
113 {
116 };
117
128 const WifiTxVector& txVector,
129 const WifiPhyOperatingChannel& channel,
130 Time ppduDuration,
131 uint64_t uid);
144 HePpdu(const WifiConstPsduMap& psdus,
145 const WifiTxVector& txVector,
146 const WifiPhyOperatingChannel& channel,
147 Time ppduDuration,
148 uint64_t uid,
149 TxPsdFlag flag);
150
151 Time GetTxDuration() const override;
152 Ptr<WifiPpdu> Copy() const override;
153 WifiPpduType GetType() const override;
154 uint16_t GetStaId() const override;
155 uint16_t GetTransmissionChannelWidth() const override;
156
164 Ptr<const WifiPsdu> GetPsdu(uint8_t bssColor, uint16_t staId = SU_STA_ID) const;
165
171 TxPsdFlag GetTxPsdFlag() const;
172
178 void SetTxPsdFlag(TxPsdFlag flag) const;
179
187 void UpdateTxVectorForUlMu(const std::optional<WifiTxVector>& trigVector) const;
188
199 static std::pair<std::size_t, std::size_t> GetNumRusPerHeSigBContentChannel(
200 uint16_t channelWidth,
201 const RuAllocation& ruAllocation);
202
212 uint8_t p20Index);
213
220 static uint32_t GetSigBFieldSize(uint16_t channelWidth, const RuAllocation& ruAllocation);
221
222 protected:
228 virtual void SetTxVectorFromPhyHeaders(WifiTxVector& txVector) const;
229
237 void SetHeMuUserInfos(WifiTxVector& txVector,
238 const RuAllocation& ruAllocation,
239 const HeSigBContentChannels& contentChannels) const;
240
247 static uint8_t GetChannelWidthEncodingFromMhz(uint16_t channelWidth);
248
255 static uint8_t GetNstsEncodingFromNss(uint8_t nss);
256
264 static uint8_t GetGuardIntervalAndNltfEncoding(uint16_t gi, uint8_t nltf);
265
272 static uint8_t GetNssFromNstsEncoding(uint8_t nsts);
273
280 static uint16_t GetChannelWidthMhzFromEncoding(uint8_t bandwidth);
281
288 static uint16_t GetGuardIntervalFromEncoding(uint8_t giAndNltfSize);
289
291
292 private:
293 std::string PrintPayload() const override;
294 WifiTxVector DoGetTxVector() const override;
295
302 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
303
309 void SetLSigHeader(Time ppduDuration);
310
316 void SetHeSigHeader(const WifiTxVector& txVector);
317
322 virtual bool IsMu() const;
323
328 virtual bool IsDlMu() const;
329
334 virtual bool IsUlMu() const;
335
337}; // class HePpdu
338
346std::ostream& operator<<(std::ostream& os, const HePpdu::TxPsdFlag& flag);
347
348} // namespace ns3
349
350#endif /* HE_PPDU_H */
HE PPDU (11ax)
Definition: he-ppdu.h:50
std::vector< std::vector< HeSigBUserSpecificField > > HeSigBContentChannels
HE SIG-B Content Channels.
Definition: he-ppdu.h:61
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: he-ppdu.h:336
void SetTxPsdFlag(TxPsdFlag flag) const
Definition: he-ppdu.cc:406
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: he-ppdu.cc:160
virtual void SetTxVectorFromPhyHeaders(WifiTxVector &txVector) const
Fill in the TXVECTOR from PHY headers.
Definition: he-ppdu.cc:169
void UpdateTxVectorForUlMu(const std::optional< WifiTxVector > &trigVector) const
Update the TXVECTOR for HE TB PPDUs, since the information to decode HE TB PPDUs is not available fro...
Definition: he-ppdu.cc:413
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: he-ppdu.cc:299
static std::pair< std::size_t, std::size_t > GetNumRusPerHeSigBContentChannel(uint16_t channelWidth, const RuAllocation &ruAllocation)
Get the number of RUs per HE-SIG-B content channel.
Definition: he-ppdu.cc:449
static uint16_t GetGuardIntervalFromEncoding(uint8_t giAndNltfSize)
Convert guard interval (in ns) from its encoding in HE-SIG-A.
Definition: he-ppdu.cc:671
static uint16_t GetChannelWidthMhzFromEncoding(uint8_t bandwidth)
Convert channel width expressed in MHz from bandwidth field encoding in HE-SIG-A.
Definition: he-ppdu.cc:629
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
Definition: he-ppdu.h:113
@ PSD_HE_PORTION
HE portion of an HE PPDU.
Definition: he-ppdu.h:115
@ PSD_NON_HE_PORTION
Non-HE portion of an HE PPDU.
Definition: he-ppdu.h:114
virtual bool IsDlMu() const
Return true if the PPDU is a DL MU PPDU.
Definition: he-ppdu.cc:325
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: he-ppdu.cc:277
virtual bool IsUlMu() const
Return true if the PPDU is an UL MU PPDU.
Definition: he-ppdu.cc:331
void SetHeMuUserInfos(WifiTxVector &txVector, const RuAllocation &ruAllocation, const HeSigBContentChannels &contentChannels) const
Reconstruct HeMuUserInfoMap from HE-SIG-B header.
Definition: he-ppdu.cc:209
static uint8_t GetNstsEncodingFromNss(uint8_t nss)
Convert number of spatial streams to NSTS field encoding in HE-SIG-A.
Definition: he-ppdu.cc:689
void SetHeSigHeader(const WifiTxVector &txVector)
Fill in the HE-SIG header.
Definition: he-ppdu.cc:119
static uint8_t GetNssFromNstsEncoding(uint8_t nsts)
Convert number of spatial streams from NSTS field encoding in HE-SIG-A.
Definition: he-ppdu.cc:696
std::variant< std::monostate, HeSuSigHeader, HeTbSigHeader, HeMuSigHeader > HeSigHeader
type of the HE-SIG PHY header
Definition: he-ppdu.h:106
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
Definition: he-ppdu.cc:92
std::string PrintPayload() const override
Print the payload of the PPDU.
Definition: he-ppdu.cc:592
uint16_t GetStaId() const override
Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
Definition: he-ppdu.cc:374
static HeSigBContentChannels GetHeSigBContentChannels(const WifiTxVector &txVector, uint8_t p20Index)
Get the HE SIG-B content channels for a given PPDU IEEE 802.11ax-2021 27.3.11.8.2 HE-SIG-B content ch...
Definition: he-ppdu.cc:497
WifiPpduType GetType() const override
Return the PPDU type (.
Definition: he-ppdu.cc:305
TxPsdFlag GetTxPsdFlag() const
Definition: he-ppdu.cc:400
virtual bool IsMu() const
Return true if the PPDU is a MU PPDU.
Definition: he-ppdu.cc:319
static uint8_t GetGuardIntervalAndNltfEncoding(uint16_t gi, uint8_t nltf)
Convert guard interval (in ns) and NLTF to its encoding in HE-SIG-A.
Definition: he-ppdu.cc:650
static uint32_t GetSigBFieldSize(uint16_t channelWidth, const RuAllocation &ruAllocation)
Get variable length HE SIG-B field size.
Definition: he-ppdu.cc:560
void SetLSigHeader(Time ppduDuration)
Fill in the L-SIG header.
Definition: he-ppdu.cc:100
static uint8_t GetChannelWidthEncodingFromMhz(uint16_t channelWidth)
Convert channel width expressed in MHz to bandwidth field encoding in HE-SIG-A.
Definition: he-ppdu.cc:608
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:290
uint16_t GetTransmissionChannelWidth() const override
Get the channel width over which the PPDU will effectively be transmitted.
Definition: he-ppdu.cc:381
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:47
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
Class that keeps track of all information about the current PHY operating channel.
Ptr< const WifiPsdu > GetPsdu() const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:117
WifiPsdu stores an MPDU, S-MPDU or A-MPDU, by keeping header(s) and payload(s) separate for each cons...
Definition: wifi-psdu.h:43
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
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:129
std::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
Definition: wifi-mode.h:35
constexpr size_t WIFI_MAX_NUM_HE_SIGB_CONTENT_CHANNELS
HE SIG-B Content Channels.
Definition: he-ppdu.h:39
HE-SIG PHY header for HE MU PPDUs (HE-SIG-A1/A2/B)
Definition: he-ppdu.h:90
uint8_t m_giLtfSize
GI+LTF Size field.
Definition: he-ppdu.h:95
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:92
HeSigBContentChannels m_contentChannels
HE SIG-B Content Channels.
Definition: he-ppdu.h:100
RuAllocation m_ruAllocation
RU allocations that are going to be carried in SIG-B common subfields.
Definition: he-ppdu.h:98
uint8_t m_sigBMcs
HE-SIG-B MCS.
Definition: he-ppdu.h:94
std::optional< Center26ToneRuIndication > m_center26ToneRuIndication
center 26 tone RU indication in SIG-B common subfields
Definition: he-ppdu.h:102
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:93
User Specific Fields in HE-SIG-Bs.
Definition: he-ppdu.h:54
uint8_t nss
number of spatial streams
Definition: he-ppdu.h:56
HE-SIG PHY header for HE SU PPDUs (HE-SIG-A1/A2)
Definition: he-ppdu.h:67
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:69
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:70
uint8_t m_giLtfSize
GI+LTF Size field.
Definition: he-ppdu.h:72
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:71
uint8_t m_nsts
NSTS.
Definition: he-ppdu.h:73
uint8_t m_format
Format bit.
Definition: he-ppdu.h:68
HE-SIG PHY header for HE TB PPDUs (HE-SIG-A1/A2)
Definition: he-ppdu.h:80
uint8_t m_format
Format bit.
Definition: he-ppdu.h:81
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:83
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:82