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 = MHz_u{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 = MHz_u{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
78 // end of class LSigHeader
79 };
80
81 /**
82 * Create an OFDM PPDU.
83 *
84 * @param psdu the PHY payload (PSDU)
85 * @param txVector the TXVECTOR that was used for this PPDU
86 * @param channel the operating channel of the PHY used to transmit this PPDU
87 * @param uid the unique ID of this PPDU
88 * @param instantiateLSig flag used to instantiate LSigHeader (set LSigHeader's
89 * rate and length), should be disabled by child classes
90 */
92 const WifiTxVector& txVector,
93 const WifiPhyOperatingChannel& channel,
94 uint64_t uid,
95 bool instantiateLSig = true);
96
97 Time GetTxDuration() const override;
98 Ptr<WifiPpdu> Copy() const override;
99
100 protected:
101 LSigHeader m_lSig; //!< the L-SIG PHY header
102
103 private:
104 WifiTxVector DoGetTxVector() const override;
105
106 /**
107 * Fill in the PHY headers.
108 *
109 * @param txVector the TXVECTOR that was used for this PPDU
110 * @param psduSize the size duration of the PHY payload (PSDU)
111 */
112 void SetPhyHeaders(const WifiTxVector& txVector, std::size_t psduSize);
113
114 /**
115 * Fill in the L-SIG header.
116 *
117 * @param lSig the L-SIG header to fill in
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 SetLSigHeader(LSigHeader& lSig, const WifiTxVector& txVector, std::size_t psduSize) const;
122
123 /**
124 * Fill in the TXVECTOR from L-SIG header.
125 *
126 * @param txVector the TXVECTOR to fill in
127 * @param lSig the L-SIG header
128 */
129 virtual void SetTxVectorFromLSigHeader(WifiTxVector& txVector, const LSigHeader& lSig) const;
130
131 MHz_u m_channelWidth; //!< the channel width used to transmit that PPDU
132 //!< (needed to distinguish 5 MHz, 10 MHz or 20 MHz PPDUs)
133};
134
135} // namespace ns3
136
137#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=MHz_u{20})
Fill the RATE field of L-SIG (in bit/s).
Definition ofdm-ppdu.cc:94
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
Definition ofdm-ppdu.cc:192
uint64_t GetRate(MHz_u channelWidth=MHz_u{20}) const
Return the RATE field of L-SIG (in bit/s).
Definition ofdm-ppdu.cc:147
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:131
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:101
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.