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