A Discrete-Event Network Simulator
API
he-ppdu.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2020 Orange Labs
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Rediet <getachew.redieteab@orange.com>
19 * Muhammad Iqbal Rochman <muhiqbalcr@uchicago.edu>
20 * S├ębastien Deronne <sebastien.deronne@gmail.com> (HeSigHeader)
21 */
22
23#ifndef HE_PPDU_H
24#define HE_PPDU_H
25
26#include "ns3/ofdm-ppdu.h"
27
34namespace ns3 {
35
36class WifiPsdu;
37
44class HePpdu : public OfdmPpdu
45{
46public:
47
51 class HeSigHeader : public Header
52 {
53 public:
54 HeSigHeader ();
55 virtual ~HeSigHeader ();
56
61 static TypeId GetTypeId (void);
62
63 TypeId GetInstanceTypeId (void) const override;
64 void Print (std::ostream &os) const override;
65 uint32_t GetSerializedSize (void) const override;
66 void Serialize (Buffer::Iterator start) const override;
68
74 void SetMuFlag (bool mu);
75
81 void SetMcs (uint8_t mcs);
87 uint8_t GetMcs (void) const;
93 void SetBssColor (uint8_t bssColor);
99 uint8_t GetBssColor (void) const;
105 void SetChannelWidth (uint16_t channelWidth);
111 uint16_t GetChannelWidth (void) const;
118 void SetGuardIntervalAndLtfSize (uint16_t gi, uint8_t ltf);
124 uint16_t GetGuardInterval (void) const;
130 void SetNStreams (uint8_t nStreams);
136 uint8_t GetNStreams (void) const;
137
138 private:
139 //HE-SIG-A1 fields
140 uint8_t m_format;
141 uint8_t m_bssColor;
142 uint8_t m_ul_dl;
143 uint8_t m_mcs;
145 uint8_t m_bandwidth;
147 uint8_t m_nsts;
148
150 bool m_mu;
151 }; //class HeSigHeader
152
158 {
161 };
162
173 HePpdu (Ptr<const WifiPsdu> psdu, const WifiTxVector& txVector, uint16_t txCenterFreq,
174 Time ppduDuration, WifiPhyBand band, uint64_t uid);
189 HePpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, uint16_t txCenterFreq,
190 Time ppduDuration, WifiPhyBand band, uint64_t uid, TxPsdFlag flag, uint8_t p20Index);
194 virtual ~HePpdu ();
195
196 Time GetTxDuration (void) const override;
197 Ptr<WifiPpdu> Copy (void) const override;
198 WifiPpduType GetType (void) const override;
199 uint16_t GetStaId (void) const override;
200 uint16_t GetTransmissionChannelWidth (void) const override;
201 bool CanBeReceived (uint16_t p20MinFreq, uint16_t p20MaxFreq) const override;
202
210 Ptr<const WifiPsdu> GetPsdu (uint8_t bssColor, uint16_t staId = SU_STA_ID) const;
211
217 TxPsdFlag GetTxPsdFlag (void) const;
218
224 void SetTxPsdFlag (TxPsdFlag flag);
225
226protected:
227 std::string PrintPayload (void) const override;
228 WifiTxVector DoGetTxVector (void) const override;
229
234 virtual bool IsMu (void) const;
239 virtual bool IsDlMu (void) const;
244 virtual bool IsUlMu (void) const;
245
252 virtual void SetPhyHeaders (const WifiTxVector& txVector, Time ppduDuration);
253
256
258}; //class HePpdu
259
267std::ostream& operator<< (std::ostream& os, const HePpdu::TxPsdFlag &flag);
268
269} //namespace ns3
270
271#endif /* HE_PPDU_H */
iterator in a Buffer instance
Definition: buffer.h:99
HE-SIG PHY header (HE-SIG-A1/A2/B)
Definition: he-ppdu.h:52
uint8_t m_bssColor
BSS color field.
Definition: he-ppdu.h:141
uint32_t GetSerializedSize(void) const override
Definition: he-ppdu.cc:333
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
Definition: he-ppdu.cc:441
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
Definition: he-ppdu.cc:378
uint8_t m_bandwidth
Bandwidth field.
Definition: he-ppdu.h:145
uint8_t m_mcs
MCS field.
Definition: he-ppdu.h:143
uint8_t m_format
Format bit.
Definition: he-ppdu.h:140
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
Definition: he-ppdu.cc:365
static TypeId GetTypeId(void)
Get the type ID.
Definition: he-ppdu.cc:305
uint32_t Deserialize(Buffer::Iterator start) override
Definition: he-ppdu.cc:501
uint8_t m_nsts
NSTS.
Definition: he-ppdu.h:147
TypeId GetInstanceTypeId(void) const override
Get the most derived TypeId for this Object.
Definition: he-ppdu.cc:316
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:359
uint8_t GetNStreams(void) const
Return the number of streams.
Definition: he-ppdu.cc:466
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: he-ppdu.cc:346
void Print(std::ostream &os) const override
Definition: he-ppdu.cc:322
void Serialize(Buffer::Iterator start) const override
Definition: he-ppdu.cc:472
uint8_t m_gi_ltf_size
GI+LTF Size field.
Definition: he-ppdu.h:146
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
Definition: he-ppdu.cc:372
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
Definition: he-ppdu.cc:420
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
Definition: he-ppdu.cc:352
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: he-ppdu.h:150
uint8_t m_spatialReuse
Spatial Reuse field.
Definition: he-ppdu.h:144
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
Definition: he-ppdu.cc:399
uint8_t m_ul_dl
UL/DL bit.
Definition: he-ppdu.h:142
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
Definition: he-ppdu.cc:459
HE PPDU (11ax)
Definition: he-ppdu.h:45
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: he-ppdu.h:254
void SetTxPsdFlag(TxPsdFlag flag)
Definition: he-ppdu.cc:265
virtual bool IsDlMu(void) const
Return true if the PPDU is a DL MU PPDU.
Definition: he-ppdu.cc:179
TxPsdFlag
The transmit power spectral density flag, namely used to correctly build PSDs for pre-HE and HE porti...
Definition: he-ppdu.h:158
@ PSD_HE_PORTION
HE portion of an HE PPDU.
Definition: he-ppdu.h:160
@ PSD_NON_HE_PORTION
Non-HE portion of an HE PPDU.
Definition: he-ppdu.h:159
uint16_t GetTransmissionChannelWidth(void) const override
Get the channel width over which the PPDU will effectively be transmitted.
Definition: he-ppdu.cc:228
WifiTxVector::HeMuUserInfoMap m_muUserInfos
the HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented)
Definition: he-ppdu.h:257
virtual ~HePpdu()
Destructor for HePpdu.
Definition: he-ppdu.cc:82
virtual void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the HE PHY headers.
Definition: he-ppdu.cc:87
uint16_t GetStaId(void) const override
Get the ID of the STA that transmitted the PPDU for UL MU, SU_STA_ID otherwise.
Definition: he-ppdu.cc:221
WifiTxVector DoGetTxVector(void) const override
Get the TXVECTOR used to send the PPDU.
Definition: he-ppdu.cc:113
virtual bool IsUlMu(void) const
Return true if the PPDU is an UL MU PPDU.
Definition: he-ppdu.cc:185
Ptr< WifiPpdu > Copy(void) const override
Copy this instance.
Definition: he-ppdu.cc:153
Time GetTxDuration(void) const override
Get the total transmission duration of the PPDU.
Definition: he-ppdu.cc:132
virtual bool IsMu(void) const
Return true if the PPDU is a MU PPDU.
Definition: he-ppdu.cc:173
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:72
std::string PrintPayload(void) const override
Print the payload of the PPDU.
Definition: he-ppdu.cc:272
WifiPpduType GetType(void) const override
Return the PPDU type (.
Definition: he-ppdu.cc:159
TxPsdFlag m_txPsdFlag
the transmit power spectral density flag
Definition: he-ppdu.h:255
TxPsdFlag GetTxPsdFlag(void) const
Definition: he-ppdu.cc:259
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:247
Protocol header serialization and deserialization.
Definition: header.h:43
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
a unique identifier for an interface.
Definition: type-id.h:59
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:81
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:139
def start()
Definition: core.py:1852
#define SU_STA_ID
Definition: wifi-mode.h:32