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