A Discrete-Event Network Simulator
API
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/header.h"
26#include "ns3/wifi-phy-band.h"
27#include "ns3/wifi-ppdu.h"
28
35namespace ns3
36{
37
38class WifiPsdu;
39
47class OfdmPpdu : public WifiPpdu
48{
49 public:
54 class LSigHeader : public Header
55 {
56 public:
57 LSigHeader();
58 ~LSigHeader() override;
59
64 static TypeId GetTypeId();
65
66 TypeId GetInstanceTypeId() const override;
67 void Print(std::ostream& os) const override;
68 uint32_t GetSerializedSize() const override;
69 void Serialize(Buffer::Iterator start) const override;
71
78 void SetRate(uint64_t rate, uint16_t channelWidth = 20);
85 uint64_t GetRate(uint16_t channelWidth = 20) const;
91 void SetLength(uint16_t length);
97 uint16_t GetLength() const;
98
99 private:
100 uint8_t m_rate;
101 uint16_t m_length;
102 }; // class LSigHeader
103
116 const WifiTxVector& txVector,
117 uint16_t txCenterFreq,
118 WifiPhyBand band,
119 uint64_t uid,
120 bool instantiateLSig = true);
124 ~OfdmPpdu() override;
125
126 Time GetTxDuration() const override;
127 Ptr<WifiPpdu> Copy() const override;
128
129 protected:
131 uint16_t m_channelWidth;
133
134 private:
135 WifiTxVector DoGetTxVector() const override;
136}; // class OfdmPpdu
137
138} // namespace ns3
139
140#endif /* OFDM_PPDU_H */
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
OFDM and ERP OFDM L-SIG PHY header.
Definition: ofdm-ppdu.h:55
void SetRate(uint64_t rate, uint16_t channelWidth=20)
Fill the RATE field of L-SIG (in bit/s).
Definition: ofdm-ppdu.cc:123
uint64_t GetRate(uint16_t channelWidth=20) const
Return the RATE field of L-SIG (in bit/s).
Definition: ofdm-ppdu.cc:176
uint16_t GetLength() const
Return the LENGTH field of L-SIG (in bytes).
Definition: ofdm-ppdu.cc:228
uint8_t m_rate
RATE field.
Definition: ofdm-ppdu.h:100
void Print(std::ostream &os) const override
Definition: ofdm-ppdu.cc:111
uint32_t Deserialize(Buffer::Iterator start) override
Definition: ofdm-ppdu.cc:248
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: ofdm-ppdu.cc:105
uint32_t GetSerializedSize() const override
Definition: ofdm-ppdu.cc:117
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
Definition: ofdm-ppdu.cc:221
static TypeId GetTypeId()
Get the type ID.
Definition: ofdm-ppdu.cc:95
void Serialize(Buffer::Iterator start) const override
Definition: ofdm-ppdu.cc:234
uint16_t m_length
LENGTH field.
Definition: ofdm-ppdu.h:101
OFDM PPDU (11a)
Definition: ofdm-ppdu.h:48
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
Definition: ofdm-ppdu.h:130
OfdmPpdu(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint16_t txCenterFreq, WifiPhyBand band, uint64_t uid, bool instantiateLSig=true)
Create an OFDM PPDU.
Definition: ofdm-ppdu.cc:35
~OfdmPpdu() override
Destructor for OfdmPpdu.
Definition: ofdm-ppdu.cc:53
LSigHeader m_lSig
the L-SIG PHY header
Definition: ofdm-ppdu.h:132
Time GetTxDuration() const override
Get the total transmission duration of the PPDU.
Definition: ofdm-ppdu.cc:70
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz
Definition: ofdm-ppdu.h:131
Ptr< WifiPpdu > Copy() const override
Copy this instance.
Definition: ofdm-ppdu.cc:79
WifiTxVector DoGetTxVector() const override
Get the TXVECTOR used to send the PPDU.
Definition: ofdm-ppdu.cc:58
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
a unique identifier for an interface.
Definition: type-id.h:60
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:54
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
Every class exported by the ns3 library is enclosed in the ns3 namespace.
def start()
Definition: core.py:1861