A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
erp-ofdm-phy.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 * Authors: Rediet <getachew.redieteab@orange.com>
7 * Sébastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy)
8 * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (for logic ported from wifi-phy)
9 */
10
11#ifndef ERP_OFDM_PHY_H
12#define ERP_OFDM_PHY_H
13
14#include "ofdm-phy.h"
15
16/**
17 * @file
18 * @ingroup wifi
19 * Declaration of ns3::ErpOfdmPhy class.
20 */
21
22namespace ns3
23{
24
25/**
26 * @brief PHY entity for ERP-OFDM (11g)
27 * @ingroup wifi
28 *
29 * ERP-OFDM PHY is based on OFDM PHY.
30 * ERP-DSSS/CCK mode is not supported.
31 *
32 * Refer to IEEE 802.11-2016, clause 18.
33 */
34class ErpOfdmPhy : public OfdmPhy
35{
36 public:
37 /**
38 * Constructor for ERP-OFDM PHY
39 */
40 ErpOfdmPhy();
41 /**
42 * Destructor for ERP-OFDM PHY
43 */
44 ~ErpOfdmPhy() override;
45
47 const WifiTxVector& txVector,
48 Time ppduDuration) override;
49 uint32_t GetMaxPsduSize() const override;
50
51 /**
52 * Initialize all ERP-OFDM modes.
53 */
54 static void InitializeModes();
55 /**
56 * Return a WifiMode for ERP-OFDM
57 * corresponding to the provided rate.
58 *
59 * @param rate the rate in bps
60 * @return a WifiMode for ERP-OFDM
61 */
62 static WifiMode GetErpOfdmRate(uint64_t rate);
63
64 /**
65 * Return a WifiMode for ERP-OFDM at 6 Mbps.
66 *
67 * @return a WifiMode for ERP-OFDM at 6 Mbps
68 */
70 /**
71 * Return a WifiMode for ERP-OFDM at 9 Mbps.
72 *
73 * @return a WifiMode for ERP-OFDM at 9 Mbps
74 */
76 /**
77 * Return a WifiMode for ERP-OFDM at 12 Mbps.
78 *
79 * @return a WifiMode for ERP-OFDM at 12 Mbps
80 */
82 /**
83 * Return a WifiMode for ERP-OFDM at 18 Mbps.
84 *
85 * @return a WifiMode for ERP-OFDM at 18 Mbps
86 */
88 /**
89 * Return a WifiMode for ERP-OFDM at 24 Mbps.
90 *
91 * @return a WifiMode for ERP-OFDM at 24 Mbps
92 */
94 /**
95 * Return a WifiMode for ERP-OFDM at 36 Mbps.
96 *
97 * @return a WifiMode for ERP-OFDM at 36 Mbps
98 */
100 /**
101 * Return a WifiMode for ERP-OFDM at 48 Mbps.
102 *
103 * @return a WifiMode for ERP-OFDM at 48 Mbps
104 */
106 /**
107 * Return a WifiMode for ERP-OFDM at 54 Mbps.
108 *
109 * @return a WifiMode for ERP-OFDM at 54 Mbps
110 */
112
113 /**
114 * Return the WifiCodeRate from the ERP-OFDM mode's unique name using
115 * ModulationLookupTable. This is mainly used as a callback for
116 * WifiMode operation.
117 *
118 * @param name the unique name of the ERP-OFDM mode
119 * @return WifiCodeRate corresponding to the unique name
120 */
121 static WifiCodeRate GetCodeRate(const std::string& name);
122 /**
123 * Return the constellation size from the ERP-OFDM mode's unique name using
124 * ModulationLookupTable. This is mainly used as a callback for
125 * WifiMode operation.
126 *
127 * @param name the unique name of the ERP-OFDM mode
128 * @return constellation size corresponding to the unique name
129 */
130 static uint16_t GetConstellationSize(const std::string& name);
131 /**
132 * Return the PHY rate from the ERP-OFDM mode's unique name and
133 * the supplied parameters. This function calls OfdmPhy::CalculatePhyRate
134 * and is mainly used as a callback for WifiMode operation.
135 *
136 * @param name the unique name of the ERP-OFDM mode
137 * @param channelWidth the considered channel width
138 *
139 * @return the physical bit rate of this signal in bps.
140 */
141 static uint64_t GetPhyRate(const std::string& name, MHz_u channelWidth);
142 /**
143 * Return the PHY rate corresponding to
144 * the supplied TXVECTOR.
145 * This function is mainly used as a callback
146 * for WifiMode operation.
147 *
148 * @param txVector the TXVECTOR used for the transmission
149 * @param staId the station ID (only here to have a common signature for all callbacks)
150 * @return the physical bit rate of this signal in bps.
151 */
152 static uint64_t GetPhyRateFromTxVector(const WifiTxVector& txVector, uint16_t staId);
153 /**
154 * Return the data rate corresponding to
155 * the supplied TXVECTOR.
156 * This function is mainly used as a callback
157 * for WifiMode operation.
158 *
159 * @param txVector the TXVECTOR used for the transmission
160 * @param staId the station ID (only here to have a common signature for all callbacks)
161 * @return the data bit rate in bps.
162 */
163 static uint64_t GetDataRateFromTxVector(const WifiTxVector& txVector, uint16_t staId);
164 /**
165 * Return the data rate from the ERP-OFDM mode's unique name and
166 * the supplied parameters. This function calls OfdmPhy::CalculateDataRate
167 * and is mainly used as a callback for WifiMode operation.
168 *
169 * @param name the unique name of the ERP-OFDM mode
170 * @param channelWidth the considered channel width
171 *
172 * @return the data bit rate of this signal in bps.
173 */
174 static uint64_t GetDataRate(const std::string& name, MHz_u channelWidth);
175 /**
176 * Check whether the combination in TXVECTOR is allowed.
177 * This function is used as a callback for WifiMode operation.
178 *
179 * @param txVector the TXVECTOR
180 * @returns true if this combination is allowed, false otherwise.
181 */
182 static bool IsAllowed(const WifiTxVector& txVector);
183
184 private:
185 WifiMode GetHeaderMode(const WifiTxVector& txVector) const override;
186 Time GetPreambleDuration(const WifiTxVector& txVector) const override;
187 Time GetHeaderDuration(const WifiTxVector& txVector) const override;
188
189 /**
190 * Create an ERP-OFDM mode from a unique name, the unique name
191 * must already be contained inside ModulationLookupTable.
192 * This method binds all the callbacks used by WifiMode.
193 *
194 * @param uniqueName the unique name of the WifiMode
195 * @param isMandatory whether the WifiMode is mandatory
196 * @return the ERP-OFDM WifiMode
197 */
198 static WifiMode CreateErpOfdmMode(std::string uniqueName, bool isMandatory);
199
200 static const ModulationLookupTable
201 m_erpOfdmModulationLookupTable; //!< lookup table to retrieve code rate and constellation
202 //!< size corresponding to a unique name of modulation
203}; // class ErpOfdmPhy
204
205} // namespace ns3
206
207#endif /* ERP_OFDM_PHY_H */
PHY entity for ERP-OFDM (11g)
~ErpOfdmPhy() override
Destructor for ERP-OFDM PHY.
static uint64_t GetPhyRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the PHY rate corresponding to the supplied TXVECTOR.
static const ModulationLookupTable m_erpOfdmModulationLookupTable
lookup table to retrieve code rate and constellation size corresponding to a unique name of modulatio...
static WifiCodeRate GetCodeRate(const std::string &name)
Return the WifiCodeRate from the ERP-OFDM mode's unique name using ModulationLookupTable.
Time GetPreambleDuration(const WifiTxVector &txVector) const override
Time GetHeaderDuration(const WifiTxVector &txVector) const override
static void InitializeModes()
Initialize all ERP-OFDM modes.
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
uint32_t GetMaxPsduSize() const override
Get the maximum PSDU size in bytes.
static WifiMode GetErpOfdmRate(uint64_t rate)
Return a WifiMode for ERP-OFDM corresponding to the provided rate.
static uint64_t GetPhyRate(const std::string &name, MHz_u channelWidth)
Return the PHY rate from the ERP-OFDM mode's unique name and the supplied parameters.
static bool IsAllowed(const WifiTxVector &txVector)
Check whether the combination in TXVECTOR is allowed.
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6 Mbps.
ErpOfdmPhy()
Constructor for ERP-OFDM PHY.
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18 Mbps.
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24 Mbps.
static uint16_t GetConstellationSize(const std::string &name)
Return the constellation size from the ERP-OFDM mode's unique name using ModulationLookupTable.
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12 Mbps.
static WifiMode CreateErpOfdmMode(std::string uniqueName, bool isMandatory)
Create an ERP-OFDM mode from a unique name, the unique name must already be contained inside Modulati...
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9 Mbps.
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48 Mbps.
static uint64_t GetDataRate(const std::string &name, MHz_u channelWidth)
Return the data rate from the ERP-OFDM mode's unique name and the supplied parameters.
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54 Mbps.
WifiMode GetHeaderMode(const WifiTxVector &txVector) const override
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36 Mbps.
PHY entity for OFDM (11a)
Definition ofdm-phy.h:50
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
Definition phy-entity.h:548
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
Simulation virtual time values and global simulation resolution.
Definition nstime.h:94
represent a single transmission mode
Definition wifi-mode.h:40
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition wifi-ppdu.h:38
WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
Declaration of ns3::OfdmPhy class and ns3::OfdmPhyVariant enum.