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