A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
eht-ppdu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 DERONNE SOFTWARE ENGINEERING
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
7 */
8
9#ifndef EHT_PPDU_H
10#define EHT_PPDU_H
11
12#include "ns3/he-ppdu.h"
13
14#include <optional>
15
16/**
17 * @file
18 * @ingroup wifi
19 * Declaration of ns3::EhtPpdu class.
20 */
21
22namespace ns3
23{
24
25/**
26 * @brief EHT PPDU (11be)
27 * @ingroup wifi
28 *
29 * EhtPpdu is currently identical to HePpdu
30 */
31class EhtPpdu : public HePpdu
32{
33 public:
34 /**
35 * PHY header for EHT TB PPDUs
36 */
38 {
39 // U-SIG fields
40 uint8_t m_phyVersionId : 3 {0}; ///< PHY Version Identifier field
41 uint8_t m_bandwidth : 3 {0}; ///< Bandwidth field
42 uint8_t m_bssColor : 6 {0}; ///< BSS color field
43 uint8_t m_ppduType : 2 {0}; ///< PPDU Type And Compressed Mode field
44 }; // struct EhtTbPhyHeader
45
46 /**
47 * PHY header for EHT MU PPDUs
48 */
50 {
51 // U-SIG fields
52 uint8_t m_phyVersionId : 3 {0}; ///< PHY Version Identifier field
53 uint8_t m_bandwidth : 3 {0}; ///< Bandwidth field
54 uint8_t m_bssColor : 6 {0}; ///< BSS color field
55 uint8_t m_ppduType : 2 {0}; ///< PPDU Type And Compressed Mode field
56 uint8_t m_puncturedChannelInfo : 5 {0}; ///< Punctured Channel Information field
57 uint8_t m_ehtSigMcs : 2 {0}; ///< EHT-SIG-B MCS
58
59 // EHT-SIG fields
60 uint8_t m_giLtfSize{0}; ///< GI+LTF Size field
61
62 std::optional<RuAllocation> m_ruAllocationA; //!< RU Allocation-A that are going to be
63 //!< carried in EHT-SIG common subfields
64 std::optional<RuAllocation> m_ruAllocationB; //!< RU Allocation-B that are going to be
65 //!< carried in EHT-SIG common subfields
66
67 HeSigBContentChannels m_contentChannels; //!< EHT-SIG Content Channels
68 }; // struct EhtMuPhyHeader
69
70 /// type of the EHT PHY header
71 using EhtPhyHeader = std::variant<std::monostate, EhtTbPhyHeader, EhtMuPhyHeader>;
72
73 /**
74 * Create an EHT PPDU, storing a map of PSDUs.
75 *
76 * This PPDU can either be UL or DL.
77 *
78 * @param psdus the PHY payloads (PSDUs)
79 * @param txVector the TXVECTOR that was used for this PPDU
80 * @param channel the operating channel of the PHY used to transmit this PPDU
81 * @param ppduDuration the transmission duration of this PPDU
82 * @param uid the unique ID of this PPDU or of the triggering PPDU if this is an EHT TB PPDU
83 * @param flag the flag indicating the type of Tx PSD to build
84 */
85 EhtPpdu(const WifiConstPsduMap& psdus,
86 const WifiTxVector& txVector,
87 const WifiPhyOperatingChannel& channel,
88 Time ppduDuration,
89 uint64_t uid,
90 TxPsdFlag flag);
91
92 WifiPpduType GetType() const override;
93 Ptr<WifiPpdu> Copy() const override;
94
95 /**
96 * Get the number of RUs per EHT-SIG-B content channel.
97 * This function will be used once EHT PHY headers are implemented.
98 *
99 * @param channelWidth the channel width occupied by the PPDU
100 * @param ehtPpduType the EHT_PPDU_TYPE used by the PPDU
101 * @param ruAllocation 8 bit RU_ALLOCATION per 20 MHz
102 * @param compression flag whether compression mode is used by the PPDU
103 * @param numMuMimoUsers the number of MU-MIMO users addressed by the PPDU
104 * @return a pair containing the number of RUs in each EHT-SIG-B content channel (resp. 1 and 2)
105 */
106 static std::pair<std::size_t, std::size_t> GetNumRusPerEhtSigBContentChannel(
107 MHz_u channelWidth,
108 uint8_t ehtPpduType,
109 const RuAllocation& ruAllocation,
110 bool compression,
111 std::size_t numMuMimoUsers);
112
113 /**
114 * Get the EHT-SIG content channels for a given PPDU
115 * IEEE 802.11be-D3.1 36.3.12.8.2 EHT-SIG content channels
116 *
117 * @param txVector the TXVECTOR used for the PPDU
118 * @param p20Index the index of the primary20 channel
119 * @return EHT-SIG content channels
120 */
122 uint8_t p20Index);
123
124 /**
125 * Get variable length EHT-SIG field size
126 * @param channelWidth the channel width occupied by the PPDU
127 * @param ruAllocation 8 bit RU_ALLOCATION per 20 MHz
128 * @param ehtPpduType the EHT_PPDU_TYPE used by the PPDU
129 * @param compression flag whether compression mode is used by the PPDU
130 * @param numMuMimoUsers the number of MU-MIMO users addressed by the PPDU
131 * @return field size in bytes
132 */
133 static uint32_t GetEhtSigFieldSize(MHz_u channelWidth,
134 const RuAllocation& ruAllocation,
135 uint8_t ehtPpduType,
136 bool compression,
137 std::size_t numMuMimoUsers);
138
139 /**
140 * Get the Punctured Channel Information field in the U-SIG
141 * @param inactiveSubchannels the bitmap indexed by the 20 MHz subchannels in ascending order,
142 * where each bit indicates whether the corresponding 20 MHz subchannel is punctured or not
143 * within the transmission bandwidth
144 * @param ehtPpduType the EHT_PPDU_TYPE used by the PPDU
145 * @param isLow80MHz flag whether the 80 MHz frequency subblock where U-SIG processing is
146 * performed is the lowest in frequency (if OFDMA and if channel width is larger than 80 MHz)
147 * @return the value of the Punctured Channel Information field
148 */
149 static uint8_t GetPuncturedInfo(const std::vector<bool>& inactiveSubchannels,
150 uint8_t ehtPpduType,
151 std::optional<bool> isLow80MHz);
152
153 private:
154 bool IsDlMu() const override;
155 bool IsUlMu() const override;
156 void SetTxVectorFromPhyHeaders(WifiTxVector& txVector) const override;
157
158 /**
159 * Fill in the PHY headers.
160 *
161 * @param txVector the TXVECTOR that was used for this PPDU
162 * @param ppduDuration the transmission duration of this PPDU
163 */
164 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
165
166 /**
167 * Fill in the EHT PHY header.
168 *
169 * @param txVector the TXVECTOR that was used for this PPDU
170 */
171 void SetEhtPhyHeader(const WifiTxVector& txVector);
172
173 EhtPhyHeader m_ehtPhyHeader; //!< the EHT PHY header
174}; // class EhtPpdu
175
176} // namespace ns3
177
178#endif /* EHT_PPDU_H */
EHT PPDU (11be)
Definition eht-ppdu.h:32
static uint32_t GetEhtSigFieldSize(MHz_u channelWidth, const RuAllocation &ruAllocation, uint8_t ehtPpduType, bool compression, std::size_t numMuMimoUsers)
Get variable length EHT-SIG field size.
Definition eht-ppdu.cc:205
static HeSigBContentChannels GetEhtSigContentChannels(const WifiTxVector &txVector, uint8_t p20Index)
Get the EHT-SIG content channels for a given PPDU IEEE 802.11be-D3.1 36.3.12.8.2 EHT-SIG content chan...
Definition eht-ppdu.cc:193
bool IsDlMu() const override
Return true if the PPDU is a DL MU PPDU.
Definition eht-ppdu.cc:106
bool IsUlMu() const override
Return true if the PPDU is an UL MU PPDU.
Definition eht-ppdu.cc:112
void SetEhtPhyHeader(const WifiTxVector &txVector)
Fill in the EHT PHY header.
Definition eht-ppdu.cc:45
std::variant< std::monostate, EhtTbPhyHeader, EhtMuPhyHeader > EhtPhyHeader
type of the EHT PHY header
Definition eht-ppdu.h:71
static std::pair< std::size_t, std::size_t > GetNumRusPerEhtSigBContentChannel(MHz_u channelWidth, uint8_t ehtPpduType, const RuAllocation &ruAllocation, bool compression, std::size_t numMuMimoUsers)
Get the number of RUs per EHT-SIG-B content channel.
Definition eht-ppdu.cc:176
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition eht-ppdu.cc:304
void SetTxVectorFromPhyHeaders(WifiTxVector &txVector) const override
Fill in the TXVECTOR from PHY headers.
Definition eht-ppdu.cc:118
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
Definition eht-ppdu.cc:38
WifiPpduType GetType() const override
Return the PPDU type (.
Definition eht-ppdu.cc:87
static uint8_t GetPuncturedInfo(const std::vector< bool > &inactiveSubchannels, uint8_t ehtPpduType, std::optional< bool > isLow80MHz)
Get the Punctured Channel Information field in the U-SIG.
Definition eht-ppdu.cc:247
EhtPhyHeader m_ehtPhyHeader
the EHT PHY header
Definition eht-ppdu.h:173
EhtPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, const WifiPhyOperatingChannel &channel, Time ppduDuration, uint64_t uid, TxPsdFlag flag)
Create an EHT PPDU, storing a map of PSDUs.
Definition eht-ppdu.cc:25
HE PPDU (11ax)
Definition he-ppdu.h:39
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
Definition he-ppdu.h:104
std::vector< std::vector< HeSigBUserSpecificField > > HeSigBContentChannels
HE SIG-B Content Channels.
Definition he-ppdu.h:50
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
Class that keeps track of all information about the current PHY operating channel.
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::vector< uint16_t > RuAllocation
9 bits RU_ALLOCATION per 20 MHz
PHY header for EHT MU PPDUs.
Definition eht-ppdu.h:50
uint8_t m_bandwidth
Bandwidth field.
Definition eht-ppdu.h:53
uint8_t m_puncturedChannelInfo
Punctured Channel Information field.
Definition eht-ppdu.h:56
HeSigBContentChannels m_contentChannels
EHT-SIG Content Channels.
Definition eht-ppdu.h:67
uint8_t m_phyVersionId
PHY Version Identifier field.
Definition eht-ppdu.h:52
uint8_t m_ppduType
PPDU Type And Compressed Mode field.
Definition eht-ppdu.h:55
uint8_t m_giLtfSize
GI+LTF Size field.
Definition eht-ppdu.h:60
std::optional< RuAllocation > m_ruAllocationB
RU Allocation-B that are going to be carried in EHT-SIG common subfields.
Definition eht-ppdu.h:64
uint8_t m_ehtSigMcs
EHT-SIG-B MCS.
Definition eht-ppdu.h:57
uint8_t m_bssColor
BSS color field.
Definition eht-ppdu.h:54
std::optional< RuAllocation > m_ruAllocationA
RU Allocation-A that are going to be carried in EHT-SIG common subfields.
Definition eht-ppdu.h:62
PHY header for EHT TB PPDUs.
Definition eht-ppdu.h:38
uint8_t m_ppduType
PPDU Type And Compressed Mode field.
Definition eht-ppdu.h:43
uint8_t m_bandwidth
Bandwidth field.
Definition eht-ppdu.h:41
uint8_t m_bssColor
BSS color field.
Definition eht-ppdu.h:42
uint8_t m_phyVersionId
PHY Version Identifier field.
Definition eht-ppdu.h:40