A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
vht-ppdu.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 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> (VhtSigHeader)
20 */
21
22#ifndef VHT_PPDU_H
23#define VHT_PPDU_H
24
25#include "ns3/ofdm-ppdu.h"
26#include "ns3/wifi-phy-operating-channel.h"
27
28/**
29 * \file
30 * \ingroup wifi
31 * Declaration of ns3::VhtPpdu class.
32 */
33
34namespace ns3
35{
36
37class WifiPsdu;
38
39/**
40 * \brief VHT PPDU (11ac)
41 * \ingroup wifi
42 *
43 * VhtPpdu stores a preamble, PHY headers and a PSDU of a PPDU with VHT header
44 */
45class VhtPpdu : public OfdmPpdu
46{
47 public:
48 /**
49 * VHT PHY header (VHT-SIG-A1/A2/B).
50 * See section 21.3.8 in IEEE 802.11-2016.
51 */
53 {
54 public:
56
57 /**
58 * Set the Multi-User (MU) flag.
59 *
60 * \param mu the MU flag
61 */
62 void SetMuFlag(bool mu);
63
64 /**
65 * Fill the channel width field of VHT-SIG-A1 (in MHz).
66 *
67 * \param channelWidth the channel width (in MHz)
68 */
69 void SetChannelWidth(uint16_t channelWidth);
70 /**
71 * Return the channel width (in MHz).
72 *
73 * \return the channel width (in MHz)
74 */
75 uint16_t GetChannelWidth() const;
76 /**
77 * Fill the number of streams field of VHT-SIG-A1.
78 *
79 * \param nStreams the number of streams
80 */
81 void SetNStreams(uint8_t nStreams);
82 /**
83 * Return the number of streams.
84 *
85 * \return the number of streams
86 */
87 uint8_t GetNStreams() const;
88
89 /**
90 * Fill the short guard interval field of VHT-SIG-A2.
91 *
92 * \param sgi whether short guard interval is used or not
93 */
94 void SetShortGuardInterval(bool sgi);
95 /**
96 * Return the short GI field of VHT-SIG-A2.
97 *
98 * \return the short GI field of VHT-SIG-A2
99 */
100 bool GetShortGuardInterval() const;
101 /**
102 * Fill the short GI NSYM disambiguation field of VHT-SIG-A2.
103 *
104 * \param disambiguation whether short GI NSYM disambiguation is set or not
105 */
106 void SetShortGuardIntervalDisambiguation(bool disambiguation);
107 /**
108 * Return the short GI NSYM disambiguation field of VHT-SIG-A2.
109 *
110 * \return the short GI NSYM disambiguation field of VHT-SIG-A2
111 */
113 /**
114 * Fill the SU VHT MCS field of VHT-SIG-A2.
115 *
116 * \param mcs the SU VHT MCS field of VHT-SIG-A2
117 */
118 void SetSuMcs(uint8_t mcs);
119 /**
120 * Return the SU VHT MCS field of VHT-SIG-A2.
121 *
122 * \return the SU VHT MCS field of VHT-SIG-A2
123 */
124 uint8_t GetSuMcs() const;
125
126 private:
127 // VHT-SIG-A1 fields
128 uint8_t m_bw; ///< BW
129 uint8_t m_nsts; ///< NSTS
130
131 // VHT-SIG-A2 fields
132 uint8_t m_sgi; ///< Short GI
133 uint8_t m_sgi_disambiguation; ///< Short GI NSYM Disambiguation
134 uint8_t m_suMcs; ///< SU VHT MCS
135
136 /// This is used to decide whether MU SIG-B should be added or not
137 bool m_mu;
138 }; // class VhtSigHeader
139
140 /**
141 * Create a VHT PPDU.
142 *
143 * \param psdu the PHY payload (PSDU)
144 * \param txVector the TXVECTOR that was used for this PPDU
145 * \param channel the operating channel of the PHY used to transmit this PPDU
146 * \param ppduDuration the transmission duration of this PPDU
147 * \param uid the unique ID of this PPDU
148 */
150 const WifiTxVector& txVector,
151 const WifiPhyOperatingChannel& channel,
152 Time ppduDuration,
153 uint64_t uid);
154
155 Time GetTxDuration() const override;
156 Ptr<WifiPpdu> Copy() const override;
157 WifiPpduType GetType() const override;
158
159 private:
160 WifiTxVector DoGetTxVector() const override;
161
162 /**
163 * Fill in the PHY headers.
164 *
165 * \param txVector the TXVECTOR that was used for this PPDU
166 * \param ppduDuration the transmission duration of this PPDU
167 */
168 virtual void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration);
169
170 /**
171 * Fill in the L-SIG header.
172 *
173 * \param lSig the L-SIG header to fill in
174 * \param ppduDuration the transmission duration of this PPDU
175 */
176 virtual void SetLSigHeader(LSigHeader& lSig, Time ppduDuration) const;
177
178 /**
179 * Fill in the VHT-SIG header.
180 *
181 * \param vhtSig the VHT-SIG header to fill in
182 * \param txVector the TXVECTOR that was used for this PPDU
183 * \param ppduDuration the transmission duration of this PPDU
184 */
185 void SetVhtSigHeader(VhtSigHeader& vhtSig,
186 const WifiTxVector& txVector,
187 Time ppduDuration) const;
188
189 /**
190 * Fill in the TXVECTOR from PHY headers.
191 *
192 * \param txVector the TXVECTOR to fill in
193 * \param lSig the L-SIG header
194 * \param vhtSig the VHT-SIG header
195 */
197 const LSigHeader& lSig,
198 const VhtSigHeader& vhtSig) const;
199
200 VhtSigHeader m_vhtSig; //!< the VHT-SIG PHY header
201}; // class VhtPpdu
202
203} // namespace ns3
204
205#endif /* VHT_PPDU_H */
OFDM and ERP OFDM L-SIG PHY header.
Definition: ofdm-ppdu.h:54
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:47
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
VHT PHY header (VHT-SIG-A1/A2/B).
Definition: vht-ppdu.h:53
uint8_t m_suMcs
SU VHT MCS.
Definition: vht-ppdu.h:134
bool m_mu
This is used to decide whether MU SIG-B should be added or not.
Definition: vht-ppdu.h:137
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of VHT-SIG-A1.
Definition: vht-ppdu.cc:203
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of VHT-SIG-A1 (in MHz).
Definition: vht-ppdu.cc:161
uint16_t GetChannelWidth() const
Return the channel width (in MHz).
Definition: vht-ppdu.cc:182
uint8_t GetSuMcs() const
Return the SU VHT MCS field of VHT-SIG-A2.
Definition: vht-ppdu.cc:247
uint8_t GetNStreams() const
Return the number of streams.
Definition: vht-ppdu.cc:210
bool GetShortGuardInterval() const
Return the short GI field of VHT-SIG-A2.
Definition: vht-ppdu.cc:222
uint8_t m_sgi_disambiguation
Short GI NSYM Disambiguation.
Definition: vht-ppdu.h:133
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
Definition: vht-ppdu.cc:155
uint8_t m_sgi
Short GI.
Definition: vht-ppdu.h:132
void SetSuMcs(uint8_t mcs)
Fill the SU VHT MCS field of VHT-SIG-A2.
Definition: vht-ppdu.cc:240
void SetShortGuardIntervalDisambiguation(bool disambiguation)
Fill the short GI NSYM disambiguation field of VHT-SIG-A2.
Definition: vht-ppdu.cc:228
bool GetShortGuardIntervalDisambiguation() const
Return the short GI NSYM disambiguation field of VHT-SIG-A2.
Definition: vht-ppdu.cc:234
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of VHT-SIG-A2.
Definition: vht-ppdu.cc:216
VHT PPDU (11ac)
Definition: vht-ppdu.h:46
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
Definition: vht-ppdu.h:200
virtual void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration)
Fill in the PHY headers.
Definition: vht-ppdu.cc:52
WifiPpduType GetType() const override
Return the PPDU type (.
Definition: vht-ppdu.cc:139
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: vht-ppdu.cc:91
void SetTxVectorFromPhyHeaders(WifiTxVector &txVector, const LSigHeader &lSig, const VhtSigHeader &vhtSig) const
Fill in the TXVECTOR from PHY headers.
Definition: vht-ppdu.cc:100
void SetVhtSigHeader(VhtSigHeader &vhtSig, const WifiTxVector &txVector, Time ppduDuration) const
Fill in the VHT-SIG header.
Definition: vht-ppdu.cc:70
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: vht-ppdu.cc:112
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: vht-ppdu.cc:133
virtual void SetLSigHeader(LSigHeader &lSig, Time ppduDuration) const
Fill in the L-SIG header.
Definition: vht-ppdu.cc:60
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.