A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ht-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> (HtSigHeader)
20 */
21
22#ifndef HT_PPDU_H
23#define HT_PPDU_H
24
25#include "ns3/ofdm-ppdu.h"
26
27/**
28 * \file
29 * \ingroup wifi
30 * Declaration of ns3::HtPpdu class.
31 */
32
33namespace ns3
34{
35
36class WifiPsdu;
37
38/**
39 * \brief HT PPDU (11n)
40 * \ingroup wifi
41 *
42 * HtPpdu stores a preamble, PHY headers and a PSDU of a PPDU with HT header
43 */
44class HtPpdu : public OfdmPpdu
45{
46 public:
47 /**
48 * HT PHY header (HT-SIG1/2).
49 * See section 19.3.9 in IEEE 802.11-2016.
50 */
52 {
53 public:
55
56 /**
57 * Fill the MCS field of HT-SIG.
58 *
59 * \param mcs the MCS field of HT-SIG
60 */
61 void SetMcs(uint8_t mcs);
62 /**
63 * Return the MCS field of HT-SIG.
64 *
65 * \return the MCS field of HT-SIG
66 */
67 uint8_t GetMcs() const;
68 /**
69 * Fill the channel width field of HT-SIG (in MHz).
70 *
71 * \param channelWidth the channel width (in MHz)
72 */
73 void SetChannelWidth(uint16_t channelWidth);
74 /**
75 * Return the channel width (in MHz).
76 *
77 * \return the channel width (in MHz)
78 */
79 uint16_t GetChannelWidth() const;
80 /**
81 * Fill the aggregation field of HT-SIG.
82 *
83 * \param aggregation whether the PSDU contains A-MPDU or not
84 */
85 void SetAggregation(bool aggregation);
86 /**
87 * Return the aggregation field of HT-SIG.
88 *
89 * \return the aggregation field of HT-SIG
90 */
91 bool GetAggregation() const;
92 /**
93 * Fill the short guard interval field of HT-SIG.
94 *
95 * \param sgi whether short guard interval is used or not
96 */
97 void SetShortGuardInterval(bool sgi);
98 /**
99 * Return the short guard interval field of HT-SIG.
100 *
101 * \return the short guard interval field of HT-SIG
102 */
103 bool GetShortGuardInterval() const;
104 /**
105 * Fill the HT length field of HT-SIG (in bytes).
106 *
107 * \param length the HT length field of HT-SIG (in bytes)
108 */
109 void SetHtLength(uint16_t length);
110 /**
111 * Return the HT length field of HT-SIG (in bytes).
112 *
113 * \return the HT length field of HT-SIG (in bytes)
114 */
115 uint16_t GetHtLength() const;
116
117 private:
118 uint8_t m_mcs; ///< Modulation and Coding Scheme index
119 uint8_t m_cbw20_40; ///< CBW 20/40
120 uint16_t m_htLength; ///< HT length
121 uint8_t m_aggregation; ///< Aggregation
122 uint8_t m_sgi; ///< Short Guard Interval
123 }; // HtSigHeader
124
125 /**
126 * Create an HT PPDU.
127 *
128 * \param psdu the PHY payload (PSDU)
129 * \param txVector the TXVECTOR that was used for this PPDU
130 * \param channel the operating channel of the PHY used to transmit this PPDU
131 * \param ppduDuration the transmission duration of this PPDU
132 * \param uid the unique ID of this PPDU
133 */
135 const WifiTxVector& txVector,
136 const WifiPhyOperatingChannel& channel,
137 Time ppduDuration,
138 uint64_t uid);
139
140 Time GetTxDuration() const override;
141 Ptr<WifiPpdu> Copy() const override;
142
143 private:
144 WifiTxVector DoGetTxVector() const override;
145
146 /**
147 * Fill in the PHY headers.
148 *
149 * \param txVector the TXVECTOR that was used for this PPDU
150 * \param ppduDuration the transmission duration of this PPDU
151 * \param psduSize the size duration of the PHY payload (PSDU)
152 */
153 void SetPhyHeaders(const WifiTxVector& txVector, Time ppduDuration, std::size_t psduSize);
154
155 /**
156 * Fill in the L-SIG header.
157 *
158 * \param lSig the L-SIG header to fill in
159 * \param ppduDuration the transmission duration of this PPDU
160 */
161 virtual void SetLSigHeader(LSigHeader& lSig, Time ppduDuration) const;
162
163 /**
164 * Fill in the HT-SIG header.
165 *
166 * \param htSig the HT-SIG header to fill in
167 * \param txVector the TXVECTOR that was used for this PPDU
168 * \param psduSize the size duration of the PHY payload (PSDU)
169 */
170 void SetHtSigHeader(HtSigHeader& htSig,
171 const WifiTxVector& txVector,
172 std::size_t psduSize) const;
173
174 /**
175 * Fill in the TXVECTOR from PHY headers.
176 *
177 * \param txVector the TXVECTOR to fill in
178 * \param lSig the L-SIG header
179 * \param htSig the HT-SIG header
180 */
182 const LSigHeader& lSig,
183 const HtSigHeader& htSig) const;
184
185 HtSigHeader m_htSig; //!< the HT-SIG PHY header
186}; // class HtPpdu
187
188} // namespace ns3
189
190#endif /* HT_PPDU_H */
HT PHY header (HT-SIG1/2).
Definition: ht-ppdu.h:52
uint8_t m_mcs
Modulation and Coding Scheme index.
Definition: ht-ppdu.h:118
uint16_t GetHtLength() const
Return the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:165
uint8_t GetMcs() const
Return the MCS field of HT-SIG.
Definition: ht-ppdu.cc:141
void SetHtLength(uint16_t length)
Fill the HT length field of HT-SIG (in bytes).
Definition: ht-ppdu.cc:159
bool GetAggregation() const
Return the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:177
uint16_t m_htLength
HT length.
Definition: ht-ppdu.h:120
void SetMcs(uint8_t mcs)
Fill the MCS field of HT-SIG.
Definition: ht-ppdu.cc:134
bool GetShortGuardInterval() const
Return the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:189
uint16_t GetChannelWidth() const
Return the channel width (in MHz).
Definition: ht-ppdu.cc:153
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
Definition: ht-ppdu.cc:171
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HT-SIG (in MHz).
Definition: ht-ppdu.cc:147
uint8_t m_sgi
Short Guard Interval.
Definition: ht-ppdu.h:122
uint8_t m_cbw20_40
CBW 20/40.
Definition: ht-ppdu.h:119
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
Definition: ht-ppdu.cc:183
uint8_t m_aggregation
Aggregation.
Definition: ht-ppdu.h:121
HT PPDU (11n)
Definition: ht-ppdu.h:45
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: ht-ppdu.h:185
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: ht-ppdu.cc:89
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: ht-ppdu.cc:119
void SetHtSigHeader(HtSigHeader &htSig, const WifiTxVector &txVector, std::size_t psduSize) const
Fill in the HT-SIG header.
Definition: ht-ppdu.cc:79
virtual void SetLSigHeader(LSigHeader &lSig, Time ppduDuration) const
Fill in the L-SIG header.
Definition: ht-ppdu.cc:61
void SetPhyHeaders(const WifiTxVector &txVector, Time ppduDuration, std::size_t psduSize)
Fill in the PHY headers.
Definition: ht-ppdu.cc:53
void SetTxVectorFromPhyHeaders(WifiTxVector &txVector, const LSigHeader &lSig, const HtSigHeader &htSig) const
Fill in the TXVECTOR from PHY headers.
Definition: ht-ppdu.cc:98
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: ht-ppdu.cc:110
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
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...
Every class exported by the ns3 library is enclosed in the ns3 namespace.