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 };
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 };
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<const WifiPsdu> GetPsdu(uint8_t bssColor, uint16_t staId = SU_STA_ID) const override;
94 Ptr<WifiPpdu> Copy() const override;
95
96 /**
97 * Get the number of RUs per EHT-SIG-B content channel.
98 * This function will be used once EHT PHY headers are implemented.
99 *
100 * @param channelWidth the channel width occupied by the PPDU
101 * @param ehtPpduType the EHT_PPDU_TYPE used by the PPDU
102 * @param ruAllocation 8 bit RU_ALLOCATION per 20 MHz
103 * @param compression flag whether compression mode is used by the PPDU
104 * @param numMuMimoUsers the number of MU-MIMO users addressed by the PPDU
105 * @return a pair containing the number of RUs in each EHT-SIG-B content channel (resp. 1 and 2)
106 */
107 static std::pair<std::size_t, std::size_t> GetNumRusPerEhtSigBContentChannel(
108 MHz_u channelWidth,
109 uint8_t ehtPpduType,
110 const RuAllocation& ruAllocation,
111 bool compression,
112 std::size_t numMuMimoUsers);
113
114 /**
115 * Get the EHT-SIG content channels for a given PPDU
116 * IEEE 802.11be-D3.1 36.3.12.8.2 EHT-SIG content channels
117 *
118 * @param txVector the TXVECTOR used for the PPDU
119 * @param p20Index the index of the primary20 channel
120 * @return EHT-SIG content channels
121 */
123 uint8_t p20Index);
124
125 /**
126 * Get variable length EHT-SIG field size
127 * @param channelWidth the channel width occupied by the PPDU
128 * @param ruAllocation 8 bit RU_ALLOCATION per 20 MHz
129 * @param ehtPpduType the EHT_PPDU_TYPE used by the PPDU
130 * @param compression flag whether compression mode is used by the PPDU
131 * @param numMuMimoUsers the number of MU-MIMO users addressed by the PPDU
132 * @return field size in bytes
133 */
134 static uint32_t GetEhtSigFieldSize(MHz_u channelWidth,
135 const RuAllocation& ruAllocation,
136 uint8_t ehtPpduType,
137 bool compression,
138 std::size_t numMuMimoUsers);
139
140 /**
141 * Get the Punctured Channel Information field in the U-SIG
142 * @param inactiveSubchannels the bitmap indexed by the 20 MHz subchannels in ascending order,
143 * where each bit indicates whether the corresponding 20 MHz subchannel is punctured or not
144 * within the transmission bandwidth
145 * @param ehtPpduType the EHT_PPDU_TYPE used by the PPDU
146 * @param isLow80MHz flag whether the 80 MHz frequency subblock where U-SIG processing is
147 * performed is the lowest in frequency (if OFDMA and if channel width is larger than 80 MHz)
148 * @return the value of the Punctured Channel Information field
149 */
150 static uint8_t GetPuncturedInfo(const std::vector<bool>& inactiveSubchannels,
151 uint8_t ehtPpduType,
152 std::optional<bool> isLow80MHz);
153
154 private:
155 bool IsDlMu() const override;
156 bool IsUlMu() const override;
157 void SetTxVectorFromPhyHeaders(WifiTxVector& txVector) const override;
158
159 /**
160 * Fill in the PHY headers.
161 *
162 * @param txVector the TXVECTOR that was used for this PPDU
163 * @param ppduDuration the transmission duration of this PPDU
164 */
165 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration) override;
166
167 /**
168 * Fill in the EHT PHY header.
169 *
170 * @param txVector the TXVECTOR that was used for this PPDU
171 */
172 void SetEhtPhyHeader(const WifiTxVector& txVector);
173
174 EhtPhyHeader m_ehtPhyHeader; //!< the EHT PHY header
175};
176
177} // namespace ns3
178
179#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:218
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:206
bool IsDlMu() const override
Return true if the PPDU is a DL MU PPDU.
Definition eht-ppdu.cc:109
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration) override
Fill in the PHY headers.
Definition eht-ppdu.cc:38
bool IsUlMu() const override
Return true if the PPDU is an UL MU PPDU.
Definition eht-ppdu.cc:115
void SetEhtPhyHeader(const WifiTxVector &txVector)
Fill in the EHT PHY header.
Definition eht-ppdu.cc:46
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:188
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition eht-ppdu.cc:356
void SetTxVectorFromPhyHeaders(WifiTxVector &txVector) const override
Fill in the TXVECTOR from PHY headers.
Definition eht-ppdu.cc:121
WifiPpduType GetType() const override
Return the PPDU type (.
Definition eht-ppdu.cc:90
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:261
EhtPhyHeader m_ehtPhyHeader
the EHT PHY header
Definition eht-ppdu.h:174
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.
Ptr< const WifiPsdu > GetPsdu() const
Get the payload of the PPDU.
Definition wifi-ppdu.cc:142
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.
Definition wifi-ppdu.h:38
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
Definition wifi-mode.h:24
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