A Discrete-Event Network Simulator
API
he-ppdu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Orange Labs
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: Rediet <getachew.redieteab@orange.com>
18 * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
19 * Sébastien Deronne <sebastien.deronne@gmail.com> (HeSigHeader)
20 */
21
22#ifndef HE_PPDU_H
23#define HE_PPDU_H
24
25#include "ns3/ofdm-ppdu.h"
26
33namespace ns3
34{
35
36class WifiPsdu;
37
44class HePpdu : public OfdmPpdu
45{
46 public:
50 class HeSigHeader : public Header
51 {
52 public:
54 ~HeSigHeader() override;
55
60 static TypeId GetTypeId();
61
62 TypeId GetInstanceTypeId() const override;
63 void Print(std::ostream& os) const override;
64 uint32_t GetSerializedSize() const override;
65 void Serialize(Buffer::Iterator start) const override;
67
73 void SetMuFlag(bool mu);
74
80 void SetMcs(uint8_t mcs);
86 uint8_t GetMcs() const;
92 void SetBssColor(uint8_t bssColor);
98 uint8_t GetBssColor() const;
104 void SetChannelWidth(uint16_t channelWidth);
110 uint16_t GetChannelWidth() const;
117 void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf);
123 uint16_t GetGuardInterval() const;
129 void SetNStreams(uint8_t nStreams);
135 uint8_t GetNStreams() const;
136
137 private:
138 // HE-SIG-A1 fields
139 uint8_t m_format;
140 uint8_t m_bssColor;
141 uint8_t m_ul_dl;
142 uint8_t m_mcs;
144 uint8_t m_bandwidth;
146 uint8_t m_nsts;
147
149 bool m_mu;
150 }; // class HeSigHeader
151
157 {
160 };
161
173 const WifiTxVector& txVector,
174 uint16_t txCenterFreq,
175 Time ppduDuration,
176 WifiPhyBand band,
177 uint64_t uid);
192 HePpdu(const WifiConstPsduMap& psdus,
193 const WifiTxVector& txVector,
194 uint16_t txCenterFreq,
195 Time ppduDuration,
196 WifiPhyBand band,
197 uint64_t uid,
198 TxPsdFlag flag,
199 uint8_t p20Index);
203 ~HePpdu() override;
204
205 Time GetTxDuration() const override;
206 Ptr<WifiPpdu> Copy() const override;
207 WifiPpduType GetType() const override;
208 uint16_t GetStaId() const override;
209 uint16_t GetTransmissionChannelWidth() const override;
210 bool CanBeReceived(uint16_t p20MinFreq, uint16_t p20MaxFreq) const override;
211
219 Ptr<const WifiPsdu> GetPsdu(uint8_t bssColor, uint16_t staId = SU_STA_ID) const;
220
226 TxPsdFlag GetTxPsdFlag() const;
227
233 void SetTxPsdFlag(TxPsdFlag flag);
234
241 bool IsStaInContentChannel(uint16_t staId, size_t channelId) const;
242
248 bool IsAllocated(uint16_t staId) const;
249
250 protected:
251 std::string PrintPayload() const override;
252 WifiTxVector DoGetTxVector() const override;
253
258 virtual bool IsMu() const;
263 virtual bool IsDlMu() const;
268 virtual bool IsUlMu() const;
269
276 virtual void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
277
280
288}; // class HePpdu
289
297std::ostream& operator<<(std::ostream& os, const HePpdu::TxPsdFlag& flag);
298
299} // namespace ns3
300
301#endif /* HE_PPDU_H */
iterator in a Buffer instance
Definition: buffer.h:100
HE-SIG PHY header (HE-SIG-A1/A2/B)
Definition: he-ppdu.h:51
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:140
static TypeId GetTypeId()
Get the type ID.
Definition: he-ppdu.cc:361
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
Definition: he-ppdu.cc:429
uint16_t GetGuardInterval() const
Return the guard interval (in nanoseconds).
Definition: he-ppdu.cc:492
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:144
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:142
uint8_t m_format
Format bit.
Definition: he-ppdu.h:139
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
Definition: he-ppdu.cc:416
uint8_t GetBssColor() const
Return the BSS Color field in the HE-SIG-A1.
Definition: he-ppdu.cc:423
uint32_t Deserialize(Buffer::Iterator start) override
Definition: he-ppdu.cc:552
uint8_t GetMcs() const
Return the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:410
uint8_t m_nsts
NSTS.
Definition: he-ppdu.h:146
uint32_t GetSerializedSize() const override
Definition: he-ppdu.cc:384
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: he-ppdu.cc:371
~HeSigHeader() override
Definition: he-ppdu.cc:356
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: he-ppdu.cc:397
uint16_t GetChannelWidth() const
Return the channel width (in MHz).
Definition: he-ppdu.cc:450
void Print(std::ostream &os) const override
Definition: he-ppdu.cc:377
void Serialize(Buffer::Iterator start) const override
Definition: he-ppdu.cc:523
uint8_t m_gi_ltf_size
GI+LTF Size field.
Definition: he-ppdu.h:145
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
Definition: he-ppdu.cc:471
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:403
uint8_t GetNStreams() const
Return the number of streams.
Definition: he-ppdu.cc:517
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: he-ppdu.h:149
uint8_t m_spatialReuse
Spatial Reuse field.
Definition: he-ppdu.h:143
uint8_t m_ul_dl
UL/DL bit.
Definition: he-ppdu.h:141
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
Definition: he-ppdu.cc:510
HE PPDU (11ax)
Definition: he-ppdu.h:45
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: he-ppdu.h:278
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: he-ppdu.cc:145
void SetTxPsdFlag(TxPsdFlag flag)
Definition: he-ppdu.cc:306
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: he-ppdu.cc:194
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
Definition: he-ppdu.h:157
@ PSD_HE_PORTION
HE portion of an HE PPDU.
Definition: he-ppdu.h:159
@ PSD_NON_HE_PORTION
Non-HE portion of an HE PPDU.
Definition: he-ppdu.h:158
virtual bool IsDlMu() const
Return true if the PPDU is a DL MU PPDU.
Definition: he-ppdu.cc:220
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: he-ppdu.cc:169
virtual bool IsUlMu() const
Return true if the PPDU is an UL MU PPDU.
Definition: he-ppdu.cc:226
ContentChannelAllocation m_contentChannelAlloc
HE SIG-B Content Channel allocation (to be removed once HE-SIG-B headers are implemented)
Definition: he-ppdu.h:284
WifiTxVector::HeMuUserInfoMap m_muUserInfos
HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented)
Definition: he-ppdu.h:281
virtual void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the HE PHY headers.
Definition: he-ppdu.cc:113
bool IsAllocated(uint16_t staId) const
Check if STA ID is allocated.
Definition: he-ppdu.cc:313
std::string PrintPayload() const override
Print the payload of the PPDU.
Definition: he-ppdu.cc:328
uint16_t GetStaId() const override
Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
Definition: he-ppdu.cc:262
WifiPpduType GetType() const override
Return the PPDU type (.
Definition: he-ppdu.cc:200
TxPsdFlag GetTxPsdFlag() const
Definition: he-ppdu.cc:300
HePpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint16_t txCenterFreq, Time ppduDuration, WifiPhyBand band, uint64_t uid)
Create an SU HE PPDU, storing a PSDU.
Definition: he-ppdu.cc:89
virtual bool IsMu() const
Return true if the PPDU is a MU PPDU.
Definition: he-ppdu.cc:214
RuAllocation m_ruAllocation
RU_ALLOCATION in SIG-B common field (to be removed once HE-SIG-B headers are implemented)
Definition: he-ppdu.h:286
~HePpdu() override
Destructor for HePpdu.
Definition: he-ppdu.cc:108
bool IsStaInContentChannel(uint16_t staId, size_t channelId) const
Check if STA ID is in HE SIG-B Content Channel ID.
Definition: he-ppdu.cc:319
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:279
bool CanBeReceived(uint16_t p20MinFreq, uint16_t p20MaxFreq) const override
Check whether the given PPDU can be received on the specified primary channel.
Definition: he-ppdu.cc:288
uint16_t GetTransmissionChannelWidth() const override
Get the channel width over which the PPDU will effectively be transmitted.
Definition: he-ppdu.cc:269
Protocol header serialization and deserialization.
Definition: header.h:44
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
Ptr< const WifiPsdu > GetPsdu() const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:91
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
std::map< uint16_t, HeMuUserInfo > HeMuUserInfoMap
map of HE MU specific user info paramters indexed by STA-ID
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
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::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
std::vector< std::vector< uint16_t > > ContentChannelAllocation
HE SIG-B Content Channels STA ID Allocation.
std::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
def start()
Definition: core.py:1861
#define SU_STA_ID
Definition: wifi-mode.h:34