A Discrete-Event Network Simulator
API
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 
33 namespace ns3
34 {
35 
42 class EhtPpdu : public HePpdu
43 {
44  public:
49  {
50  // U-SIG fields
51  uint8_t m_phyVersionId{0};
52  uint8_t m_bandwidth{0};
53  uint8_t m_bssColor{0};
54  uint8_t m_ppduType{0};
55 
56  }; // struct EhtTbPhyHeader
57 
62  {
63  // U-SIG fields
64  uint8_t m_phyVersionId{0};
65  uint8_t m_bandwidth{0};
66  uint8_t m_bssColor{0};
67  uint8_t m_ppduType{0};
68  uint8_t m_ehtSigMcs{0};
69 
70  // EHT-SIG fields
71  uint8_t m_giLtfSize{0};
72 
73  std::optional<RuAllocation> m_ruAllocationA;
75  std::optional<RuAllocation> m_ruAllocationB;
77 
79  }; // struct EhtMuPhyHeader
80 
82  using EhtPhyHeader = std::variant<std::monostate, EhtTbPhyHeader, EhtMuPhyHeader>;
83 
96  EhtPpdu(const WifiConstPsduMap& psdus,
97  const WifiTxVector& txVector,
99  Time ppduDuration,
100  uint64_t uid,
101  TxPsdFlag flag);
102 
103  WifiPpduType GetType() const override;
104  Ptr<WifiPpdu> Copy() const override;
105 
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 
133  uint8_t p20Index);
134 
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 
161  void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
162 
168  void SetEhtPhyHeader(const WifiTxVector& txVector);
169 
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
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:35
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.
channel
Definition: third.py:88
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