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