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{0}; ///< PHY Version Identifier field
41 uint8_t m_bandwidth{0}; ///< Bandwidth field
42 uint8_t m_bssColor{0}; ///< BSS color field
43 uint8_t m_ppduType{0}; ///< PPDU Type And Compressed Mode field
44
45 }; // struct EhtTbPhyHeader
46
47 /**
48 * PHY header for EHT MU PPDUs
49 */
51 {
52 // U-SIG fields
53 uint8_t m_phyVersionId{0}; ///< PHY Version Identifier field
54 uint8_t m_bandwidth{0}; ///< Bandwidth field
55 uint8_t m_bssColor{0}; ///< BSS color field
56 uint8_t m_ppduType{0}; ///< PPDU Type And Compressed Mode field
57 uint8_t m_ehtSigMcs{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 std::vector<uint8_t>& 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 std::vector<uint8_t>& ruAllocation,
135 uint8_t ehtPpduType,
136 bool compression,
137 std::size_t numMuMimoUsers);
138
139 private:
140 bool IsDlMu() const override;
141 bool IsUlMu() const override;
142 void SetTxVectorFromPhyHeaders(WifiTxVector& txVector) const override;
143
144 /**
145 * Fill in the PHY headers.
146 *
147 * \param txVector the TXVECTOR that was used for this PPDU
148 * \param ppduDuration the transmission duration of this PPDU
149 */
150 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
151
152 /**
153 * Fill in the EHT PHY header.
154 *
155 * \param txVector the TXVECTOR that was used for this PPDU
156 */
157 void SetEhtPhyHeader(const WifiTxVector& txVector);
158
159 EhtPhyHeader m_ehtPhyHeader; //!< the EHT PHY header
160}; // class EhtPpdu
161
162} // namespace ns3
163
164#endif /* EHT_PPDU_H */
EHT PPDU (11be)
Definition eht-ppdu.h:32
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:180
bool IsDlMu() const override
Return true if the PPDU is a DL MU PPDU.
Definition eht-ppdu.cc:98
bool IsUlMu() const override
Return true if the PPDU is an UL MU PPDU.
Definition eht-ppdu.cc:104
void SetEhtPhyHeader(const WifiTxVector &txVector)
Fill in the EHT PHY header.
Definition eht-ppdu.cc:44
static uint32_t GetEhtSigFieldSize(MHz_u 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:192
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 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:163
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition eht-ppdu.cc:234
void SetTxVectorFromPhyHeaders(WifiTxVector &txVector) const override
Fill in the TXVECTOR from PHY headers.
Definition eht-ppdu.cc:110
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
Definition eht-ppdu.cc:37
WifiPpduType GetType() const override
Return the PPDU type (.
Definition eht-ppdu.cc:79
EhtPhyHeader m_ehtPhyHeader
the EHT PHY header
Definition eht-ppdu.h:159
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:24
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.
PHY header for EHT MU PPDUs.
Definition eht-ppdu.h:51
uint8_t m_bandwidth
Bandwidth field.
Definition eht-ppdu.h:54
HeSigBContentChannels m_contentChannels
EHT-SIG Content Channels.
Definition eht-ppdu.h:67
uint8_t m_phyVersionId
PHY Version Identifier field.
Definition eht-ppdu.h:53
uint8_t m_ppduType
PPDU Type And Compressed Mode field.
Definition eht-ppdu.h:56
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:55
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