A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ofdm-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> (LSigHeader)
20 */
21
22#ifndef OFDM_PPDU_H
23#define OFDM_PPDU_H
24
25#include "ns3/wifi-phy-band.h"
26#include "ns3/wifi-ppdu.h"
27
28/**
29 * \file
30 * \ingroup wifi
31 * Declaration of ns3::OfdmPpdu class.
32 */
33
34namespace ns3
35{
36
37class WifiPsdu;
38
39/**
40 * \brief OFDM PPDU (11a)
41 * \ingroup wifi
42 *
43 * OfdmPpdu stores a preamble, PHY headers and a PSDU of a PPDU with non-HT header,
44 * i.e., PPDU that uses OFDM modulation.
45 */
46class OfdmPpdu : public WifiPpdu
47{
48 public:
49 /**
50 * OFDM and ERP OFDM L-SIG PHY header.
51 * See section 17.3.4 in IEEE 802.11-2016.
52 */
54 {
55 public:
56 LSigHeader();
57
58 /**
59 * Fill the RATE field of L-SIG (in bit/s).
60 *
61 * \param rate the RATE field of L-SIG expressed in bit/s
62 * \param channelWidth the channel width (in MHz)
63 */
64 void SetRate(uint64_t rate, uint16_t channelWidth = 20);
65 /**
66 * Return the RATE field of L-SIG (in bit/s).
67 *
68 * \param channelWidth the channel width (in MHz)
69 * \return the RATE field of L-SIG expressed in bit/s
70 */
71 uint64_t GetRate(uint16_t channelWidth = 20) const;
72 /**
73 * Fill the LENGTH field of L-SIG (in bytes).
74 *
75 * \param length the LENGTH field of L-SIG expressed in bytes
76 */
77 void SetLength(uint16_t length);
78 /**
79 * Return the LENGTH field of L-SIG (in bytes).
80 *
81 * \return the LENGTH field of L-SIG expressed in bytes
82 */
83 uint16_t GetLength() const;
84
85 private:
86 uint8_t m_rate; ///< RATE field
87 uint16_t m_length; ///< LENGTH field
88 }; // class LSigHeader
89
90 /**
91 * Create an OFDM PPDU.
92 *
93 * \param psdu the PHY payload (PSDU)
94 * \param txVector the TXVECTOR that was used for this PPDU
95 * \param channel the operating channel of the PHY used to transmit this PPDU
96 * \param uid the unique ID of this PPDU
97 * \param instantiateLSig flag used to instantiate LSigHeader (set LSigHeader's
98 * rate and length), should be disabled by child classes
99 */
101 const WifiTxVector& txVector,
102 const WifiPhyOperatingChannel& channel,
103 uint64_t uid,
104 bool instantiateLSig = true);
105
106 Time GetTxDuration() const override;
107 Ptr<WifiPpdu> Copy() const override;
108
109 protected:
110 LSigHeader m_lSig; //!< the L-SIG PHY header
111
112 private:
113 WifiTxVector DoGetTxVector() const override;
114
115 /**
116 * Fill in the PHY headers.
117 *
118 * \param txVector the TXVECTOR that was used for this PPDU
119 * \param psduSize the size duration of the PHY payload (PSDU)
120 */
121 void SetPhyHeaders(const WifiTxVector& txVector, std::size_t psduSize);
122
123 /**
124 * Fill in the L-SIG header.
125 *
126 * \param lSig the L-SIG header to fill in
127 * \param txVector the TXVECTOR that was used for this PPDU
128 * \param psduSize the size duration of the PHY payload (PSDU)
129 */
130 void SetLSigHeader(LSigHeader& lSig, const WifiTxVector& txVector, std::size_t psduSize) const;
131
132 /**
133 * Fill in the TXVECTOR from L-SIG header.
134 *
135 * \param txVector the TXVECTOR to fill in
136 * \param lSig the L-SIG header
137 */
138 virtual void SetTxVectorFromLSigHeader(WifiTxVector& txVector, const LSigHeader& lSig) const;
139
140 uint16_t m_channelWidth; //!< the channel width used to transmit that PPDU in MHz (needed to
141 //!< distinguish 5 MHz, 10 MHz or 20 MHz PPDUs)
142}; // class OfdmPpdu
143
144} // namespace ns3
145
146#endif /* OFDM_PPDU_H */
OFDM and ERP OFDM L-SIG PHY header.
Definition: ofdm-ppdu.h:54
void SetRate(uint64_t rate, uint16_t channelWidth=20)
Fill the RATE field of L-SIG (in bit/s).
Definition: ofdm-ppdu.cc:105
uint64_t GetRate(uint16_t channelWidth=20) const
Return the RATE field of L-SIG (in bit/s).
Definition: ofdm-ppdu.cc:158
uint16_t GetLength() const
Return the LENGTH field of L-SIG (in bytes).
Definition: ofdm-ppdu.cc:210
uint8_t m_rate
RATE field.
Definition: ofdm-ppdu.h:86
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
Definition: ofdm-ppdu.cc:203
uint16_t m_length
LENGTH field.
Definition: ofdm-ppdu.h:87
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:47
void SetLSigHeader(LSigHeader &lSig, const WifiTxVector &txVector, std::size_t psduSize) const
Fill in the L-SIG header.
Definition: ofdm-ppdu.cc:59
void SetPhyHeaders(const WifiTxVector &txVector, std::size_t psduSize)
Fill in the PHY headers.
Definition: ofdm-ppdu.cc:52
LSigHeader m_lSig
the L-SIG PHY header
Definition: ofdm-ppdu.h:110
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: ofdm-ppdu.cc:84
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz (needed to distinguish 5 MHz, 10 MHz or 20 MHz PP...
Definition: ofdm-ppdu.h:140
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: ofdm-ppdu.cc:93
virtual void SetTxVectorFromLSigHeader(WifiTxVector &txVector, const LSigHeader &lSig) const
Fill in the TXVECTOR from L-SIG header.
Definition: ofdm-ppdu.cc:75
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: ofdm-ppdu.cc:66
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.
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:57
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.