A Discrete-Event Network Simulator
API
dsss-phy.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2020 Orange Labs
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Rediet <getachew.redieteab@orange.com>
19  * Sébastien Deronne <sebastien.deronne@gmail.com> (for logic ported from wifi-phy)
20  * Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (for logic ported from wifi-phy)
21  */
22 
23 #include <array>
24 #include "dsss-phy.h"
25 #include "dsss-ppdu.h"
26 #include "ns3/wifi-psdu.h"
27 #include "ns3/wifi-phy.h" //only used for static mode constructor
28 #include "ns3/wifi-utils.h"
29 #include "ns3/simulator.h"
30 #include "ns3/log.h"
31 
32 namespace ns3 {
33 
34 NS_LOG_COMPONENT_DEFINE ("DsssPhy");
35 
36 /*******************************************************
37  * HR/DSSS PHY (IEEE 802.11-2016, clause 16)
38  *******************************************************/
39 
40 /* *NS_CHECK_STYLE_OFF* */
42  { WIFI_PREAMBLE_LONG, { WIFI_PPDU_FIELD_PREAMBLE, //PHY preamble
43  WIFI_PPDU_FIELD_NON_HT_HEADER, //PHY header
45  { WIFI_PREAMBLE_SHORT, { WIFI_PPDU_FIELD_PREAMBLE, //Short PHY preamble
46  WIFI_PPDU_FIELD_NON_HT_HEADER, //Short PHY header
48 };
49 
51  // Unique name Code rate Constellation size
52  { "DsssRate1Mbps", { WIFI_CODE_RATE_UNDEFINED, 2 } },
53  { "DsssRate2Mbps", { WIFI_CODE_RATE_UNDEFINED, 4 } },
54  { "DsssRate5_5Mbps", { WIFI_CODE_RATE_UNDEFINED, 16 } },
55  { "DsssRate11Mbps", { WIFI_CODE_RATE_UNDEFINED, 256 } }
56 };
57 /* *NS_CHECK_STYLE_ON* */
58 
60 static const std::array<uint64_t, 4> s_dsssRatesBpsList = {1000000, 2000000, 5500000, 11000000};
61 
67 const std::array<uint64_t, 4>& GetDsssRatesBpsList (void)
68 {
69  return s_dsssRatesBpsList;
70 };
71 
73 {
74  NS_LOG_FUNCTION (this);
75  for (const auto & rate : GetDsssRatesBpsList ())
76  {
77  WifiMode mode = GetDsssRate (rate);
78  NS_LOG_LOGIC ("Add " << mode << " to list");
79  m_modeList.emplace_back (mode);
80  }
81 }
82 
84 {
85  NS_LOG_FUNCTION (this);
86 }
87 
89 DsssPhy::GetSigMode (WifiPpduField field, const WifiTxVector& txVector) const
90 {
91  switch (field)
92  {
93  case WIFI_PPDU_FIELD_PREAMBLE: //consider header mode for preamble (useful for InterferenceHelper)
95  return GetHeaderMode (txVector);
96  default:
97  return PhyEntity::GetSigMode (field, txVector);
98  }
99 }
100 
101 WifiMode
102 DsssPhy::GetHeaderMode (const WifiTxVector& txVector) const
103 {
104  if (txVector.GetPreambleType () == WIFI_PREAMBLE_LONG
105  || txVector.GetMode () == GetDsssRate1Mbps ())
106  {
107  //Section 16.2.3 "PPDU field definitions" and Section 16.2.2.2 "Long PPDU format"; IEEE Std 802.11-2016
108  return GetDsssRate1Mbps ();
109  }
110  else
111  {
112  //Section 16.2.2.3 "Short PPDU format"; IEEE Std 802.11-2016
113  return GetDsssRate2Mbps ();
114  }
115 }
116 
119 {
120  return m_dsssPpduFormats;
121 }
122 
123 Time
124 DsssPhy::GetDuration (WifiPpduField field, const WifiTxVector& txVector) const
125 {
126  if (field == WIFI_PPDU_FIELD_PREAMBLE)
127  {
128  return GetPreambleDuration (txVector); //SYNC + SFD or shortSYNC + shortSFD
129  }
130  else if (field == WIFI_PPDU_FIELD_NON_HT_HEADER)
131  {
132  return GetHeaderDuration (txVector); //PHY header or short PHY header
133  }
134  else
135  {
136  return PhyEntity::GetDuration (field, txVector);
137  }
138 }
139 
140 Time
142 {
143  if (txVector.GetPreambleType () == WIFI_PREAMBLE_SHORT
144  && (txVector.GetMode ().GetDataRate (22) > 1000000))
145  {
146  //Section 16.2.2.3 "Short PPDU format" Figure 16-2 "Short PPDU format"; IEEE Std 802.11-2016
147  return MicroSeconds (72);
148  }
149  else
150  {
151  //Section 16.2.2.2 "Long PPDU format" Figure 16-1 "Long PPDU format"; IEEE Std 802.11-2016
152  return MicroSeconds (144);
153  }
154 }
155 
156 Time
158 {
159  if (txVector.GetPreambleType () == WIFI_PREAMBLE_SHORT
160  && (txVector.GetMode ().GetDataRate (22) > 1000000))
161  {
162  //Section 16.2.2.3 "Short PPDU format" and Figure 16-2 "Short PPDU format"; IEEE Std 802.11-2016
163  return MicroSeconds (24);
164  }
165  else
166  {
167  //Section 16.2.2.2 "Long PPDU format" and Figure 16-1 "Short PPDU format"; IEEE Std 802.11-2016
168  return MicroSeconds (48);
169  }
170 }
171 
172 Time
173 DsssPhy::GetPayloadDuration (uint32_t size, const WifiTxVector& txVector, WifiPhyBand /* band */, MpduType /* mpdutype */,
174  bool /* incFlag */, uint32_t & /* totalAmpduSize */, double & /* totalAmpduNumSymbols */,
175  uint16_t /* staId */) const
176 {
177  return MicroSeconds (lrint (ceil ((size * 8.0) / (txVector.GetMode ().GetDataRate (22) / 1.0e6))));
178 }
179 
181 DsssPhy::BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration)
182 {
183  NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration);
184  return Create<DsssPpdu> (psdus.begin ()->second, txVector, ppduDuration,
185  ObtainNextUid (txVector));
186 }
187 
190 {
191  NS_LOG_FUNCTION (this << field << *event);
192  if (field == WIFI_PPDU_FIELD_NON_HT_HEADER)
193  {
194  return EndReceiveHeader (event); //PHY header or short PHY header
195  }
196  return PhyEntity::DoEndReceiveField (field, event);
197 }
198 
201 {
202  NS_LOG_FUNCTION (this << *event);
204  NS_LOG_DEBUG ("Long/Short PHY header: SNR(dB)=" << RatioToDb (snrPer.snr) << ", PER=" << snrPer.per);
205  PhyFieldRxStatus status (GetRandomValue () > snrPer.per);
206  if (status.isSuccess)
207  {
208  NS_LOG_DEBUG ("Received long/short PHY header");
209  if (!IsConfigSupported (event->GetPpdu ()))
210  {
211  status = PhyFieldRxStatus (false, UNSUPPORTED_SETTINGS, DROP);
212  }
213  }
214  else
215  {
216  NS_LOG_DEBUG ("Abort reception because long/short PHY header reception failed");
217  status.reason = L_SIG_FAILURE;
218  status.actionIfFailure = ABORT;
219  }
220  return status;
221 }
222 
223 uint16_t
225 {
226  if (m_wifiPhy->GetChannelWidth () > 20)
227  {
228  /*
229  * This is a workaround necessary with HE-capable PHYs,
230  * since their DSSS entity will reuse its RxSpectrumModel.
231  * Without this hack, SpectrumWifiPhy::GetBand will crash.
232  * FIXME: see issue #402 for a better solution.
233  */
234  return 20;
235  }
236  return PhyEntity::GetRxChannelWidth (txVector);
237 }
238 
241 {
242  const WifiTxVector& txVector = ppdu->GetTxVector ();
243  uint16_t centerFrequency = GetCenterFrequencyForChannelWidth (txVector);
244  uint16_t channelWidth = txVector.GetChannelWidth ();
245  NS_LOG_FUNCTION (this << centerFrequency << channelWidth << txPowerW);
246  NS_ABORT_MSG_IF (channelWidth != 22, "Invalid channel width for DSSS");
248  return v;
249 }
250 
251 void
253 {
254  for (const auto & rate : GetDsssRatesBpsList ())
255  {
256  GetDsssRate (rate);
257  }
258 }
259 
260 WifiMode
261 DsssPhy::GetDsssRate (uint64_t rate)
262 {
263  switch (rate)
264  {
265  case 1000000:
266  return GetDsssRate1Mbps ();
267  case 2000000:
268  return GetDsssRate2Mbps ();
269  case 5500000:
270  return GetDsssRate5_5Mbps ();
271  case 11000000:
272  return GetDsssRate11Mbps ();
273  default:
274  NS_ABORT_MSG ("Inexistent rate (" << rate << " bps) requested for HR/DSSS");
275  return WifiMode ();
276  }
277 }
278 
279 #define GET_DSSS_MODE(x, m) \
280 WifiMode \
281 DsssPhy::Get ## x (void) \
282 { \
283  static WifiMode mode = CreateDsssMode (#x, WIFI_MOD_CLASS_ ## m); \
284  return mode; \
285 }; \
286 
287 // Clause 15 rates (DSSS)
288 GET_DSSS_MODE (DsssRate1Mbps, DSSS)
289 GET_DSSS_MODE (DsssRate2Mbps, DSSS)
290 // Clause 16 rates (HR/DSSS)
291 GET_DSSS_MODE (DsssRate5_5Mbps, HR_DSSS)
292 GET_DSSS_MODE (DsssRate11Mbps, HR_DSSS)
293 #undef GET_DSSS_MODE
294 
295 WifiMode
296 DsssPhy::CreateDsssMode (std::string uniqueName,
297  WifiModulationClass modClass)
298 {
299  // Check whether uniqueName is in lookup table
300  const auto it = m_dsssModulationLookupTable.find (uniqueName);
301  NS_ASSERT_MSG (it != m_dsssModulationLookupTable.end (), "DSSS or HR/DSSS mode cannot be created because it is not in the lookup table!");
302  NS_ASSERT_MSG (modClass == WIFI_MOD_CLASS_DSSS || modClass == WIFI_MOD_CLASS_HR_DSSS, "DSSS or HR/DSSS mode must be either WIFI_MOD_CLASS_DSSS or WIFI_MOD_CLASS_HR_DSSS!");
303 
304  return WifiModeFactory::CreateWifiMode (uniqueName,
305  modClass,
306  true,
307  MakeBoundCallback (&GetCodeRate, uniqueName),
309  MakeBoundCallback (&GetDataRate, uniqueName, modClass), //PhyRate is equivalent to DataRate
310  MakeCallback (&GetDataRateFromTxVector), //PhyRate is equivalent to DataRate
311  MakeBoundCallback (&GetDataRate, uniqueName, modClass),
314 }
315 
317 DsssPhy::GetCodeRate (const std::string& name)
318 {
319  return m_dsssModulationLookupTable.at (name).first;
320 }
321 
322 uint16_t
323 DsssPhy::GetConstellationSize (const std::string& name)
324 {
325  return m_dsssModulationLookupTable.at (name).second;
326 }
327 
328 uint64_t
329 DsssPhy::GetDataRateFromTxVector (const WifiTxVector& txVector, uint16_t /* staId */)
330 {
331  WifiMode mode = txVector.GetMode ();
332  return DsssPhy::GetDataRate (mode.GetUniqueName (),
333  mode.GetModulationClass (),
334  22, 0, 1); //dummy values since unused
335 }
336 
337 uint64_t
338 DsssPhy::GetDataRate (const std::string& name, WifiModulationClass modClass, uint16_t /* channelWidth */, uint16_t /* guardInterval */, uint8_t /* nss */)
339 {
340  uint16_t constellationSize = GetConstellationSize (name);
341  uint16_t divisor = 0;
342  if (modClass == WIFI_MOD_CLASS_DSSS)
343  {
344  divisor = 11;
345  }
346  else if (modClass == WIFI_MOD_CLASS_HR_DSSS)
347  {
348  divisor = 8;
349  }
350  else
351  {
352  NS_FATAL_ERROR ("Incorrect modulation class, must specify either WIFI_MOD_CLASS_DSSS or WIFI_MOD_CLASS_HR_DSSS!");
353  }
354  uint16_t numberOfBitsPerSubcarrier = static_cast<uint16_t> (log2 (constellationSize));
355  uint64_t dataRate = ((11000000 / divisor) * numberOfBitsPerSubcarrier);
356  return dataRate;
357 }
358 
359 bool
360 DsssPhy::IsModeAllowed (uint16_t /* channelWidth */, uint8_t /* nss */)
361 {
362  return true;
363 }
364 
365 uint32_t
367 {
368  return 4095;
369 }
370 
371 } //namespace ns3
372 
373 namespace {
374 
378 static class ConstructorDsss
379 {
380 public:
382  {
384  ns3::Ptr<ns3::DsssPhy> phyEntity = ns3::Create<ns3::DsssPhy> ();
386  ns3::WifiPhy::AddStaticPhyEntity (ns3::WIFI_MOD_CLASS_DSSS, phyEntity); //use same entity when plain DSSS modes are used
387  }
389 
390 }
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::DsssPhy::GetPpduFormats
const PpduFormats & GetPpduFormats(void) const override
Return the PPDU formats of the PHY.
Definition: dsss-phy.cc:118
ns3::PhyEntity::PpduFormats
std::map< WifiPreamble, std::vector< WifiPpduField > > PpduFormats
A map of PPDU field elements per preamble type.
Definition: phy-entity.h:477
dsss-phy.h
Declaration of ns3::DsssPhy class.
ns3::PhyEntity::GetRxChannelWidth
virtual uint16_t GetRxChannelWidth(const WifiTxVector &txVector) const
Return the channel width used in the reception spectrum model.
Definition: phy-entity.cc:1013
anonymous_namespace{dsss-phy.cc}::ConstructorDsss::ConstructorDsss
ConstructorDsss()
Definition: dsss-phy.cc:381
ns3::PhyEntity::m_modeList
std::list< WifiMode > m_modeList
the list of supported modes
Definition: phy-entity.h:786
ns3::DsssPhy::GetDsssRate
static WifiMode GetDsssRate(uint64_t rate)
Return a WifiMode for HR/DSSS corresponding to the provided rate.
Definition: dsss-phy.cc:261
ns3::PhyEntity::GetCenterFrequencyForChannelWidth
uint16_t GetCenterFrequencyForChannelWidth(const WifiTxVector &txVector) const
Get the center frequency of the channel corresponding the current TxVector rather than that of the su...
Definition: phy-entity.cc:1026
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::PhyEntity::GetGuardBandwidth
uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const
Definition: phy-entity.cc:1059
ns3::PhyEntity::SnrPer::snr
double snr
SNR in linear scale.
Definition: phy-entity.h:138
ns3::MicroSeconds
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1305
ns3::DsssPhy::GetCodeRate
static WifiCodeRate GetCodeRate(const std::string &name)
Return the WifiCodeRate from the DSSS or HR/DSSS mode's unique name using ModulationLookupTable.
Definition: dsss-phy.cc:317
ns3::DsssPhy::GetDataRateFromTxVector
static uint64_t GetDataRateFromTxVector(const WifiTxVector &txVector, uint16_t staId)
Return the data rate corresponding to the supplied TXVECTOR.
Definition: dsss-phy.cc:329
ns3::PhyEntity::PhyFieldRxStatus::actionIfFailure
PhyRxFailureAction actionIfFailure
action to perform in case of failure
Definition: phy-entity.h:115
ns3::WifiMode::GetModulationClass
WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:159
ns3::WIFI_CODE_RATE_UNDEFINED
const uint16_t WIFI_CODE_RATE_UNDEFINED
undefined coding rate
Definition: wifi-phy-common.h:57
ns3::DsssPhy::m_dsssModulationLookupTable
static const ModulationLookupTable m_dsssModulationLookupTable
lookup table to retrieve code rate and constellation size corresponding to a unique name of modulatio...
Definition: dsss-phy.h:203
ns3::DsssPhy::CreateDsssMode
static WifiMode CreateDsssMode(std::string uniqueName, WifiModulationClass modClass)
Create a DSSS or HR/DSSS mode from a unique name, the unique name must already be contained inside Mo...
Definition: dsss-phy.cc:296
ns3::PhyEntity::ABORT
@ ABORT
abort reception of PPDU
Definition: phy-entity.h:103
ns3::WifiTxVector
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Definition: wifi-tx-vector.h:71
ns3::s_dsssRatesBpsList
static const std::array< uint64_t, 4 > s_dsssRatesBpsList
DSSS rates in bits per second.
Definition: dsss-phy.cc:60
ns3::WIFI_PPDU_FIELD_PREAMBLE
@ WIFI_PPDU_FIELD_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
Definition: wifi-phy-common.h:178
ns3::WifiConstPsduMap
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Definition: he-frame-exchange-manager.h:43
ns3::DsssPhy::GetPreambleDuration
Time GetPreambleDuration(const WifiTxVector &txVector) const
Definition: dsss-phy.cc:141
ns3::DsssPhy::m_dsssPpduFormats
static const PpduFormats m_dsssPpduFormats
DSSS and HR/DSSS PPDU formats.
Definition: dsss-phy.h:201
ns3::WifiPhy::AddStaticPhyEntity
static void AddStaticPhyEntity(WifiModulationClass modulation, Ptr< PhyEntity > phyEntity)
Add the PHY entity to the map of implemented PHY entities for the given modulation class.
Definition: wifi-phy.cc:886
ns3::DsssPhy::GetDsssRate1Mbps
static WifiMode GetDsssRate1Mbps(void)
Return a WifiMode for DSSS at 1 Mbps.
ns3::DsssPhy::GetDsssRate2Mbps
static WifiMode GetDsssRate2Mbps(void)
Return a WifiMode for DSSS at 2 Mbps.
anonymous_namespace{dsss-phy.cc}::g_constructor_dsss
static class anonymous_namespace{dsss-phy.cc}::ConstructorDsss g_constructor_dsss
the constructor for DSSS modes
ns3::WIFI_MOD_CLASS_HR_DSSS
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
Definition: wifi-phy-common.h:127
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
NS_FATAL_ERROR
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
ns3::DsssPhy::GetMaxPsduSize
uint32_t GetMaxPsduSize(void) const override
Get the maximum PSDU size in bytes.
Definition: dsss-phy.cc:366
ns3::WifiCodeRate
uint16_t WifiCodeRate
These constants define the various convolutional coding rates used for the OFDM transmission modes in...
Definition: wifi-phy-common.h:45
anonymous_namespace{dsss-phy.cc}::ConstructorDsss
Constructor class for DSSS modes.
Definition: dsss-phy.cc:379
ns3::WifiMode
represent a single transmission mode
Definition: wifi-mode.h:48
ns3::PhyEntity::PhyFieldRxStatus::reason
WifiPhyRxfailureReason reason
failure reason
Definition: phy-entity.h:114
ns3::PhyEntity::PhyFieldRxStatus
Status of the reception of the PPDU field.
Definition: phy-entity.h:111
ns3::DsssPhy::~DsssPhy
virtual ~DsssPhy()
Destructor for HR/DSSS PHY.
Definition: dsss-phy.cc:83
ns3::WifiModeFactory::CreateWifiMode
static WifiMode CreateWifiMode(std::string uniqueName, WifiModulationClass modClass, bool isMandatory, CodeRateCallback codeRateCallback, ConstellationSizeCallback constellationSizeCallback, PhyRateCallback phyRateCallback, PhyRateFromTxVectorCallback phyRateFromTxVectorCallback, DataRateCallback dataRateCallback, DataRateFromTxVectorCallback dataRateFromTxVectorCallback, ModeAllowedCallback isModeAllowedCallback)
Definition: wifi-mode.cc:242
ns3::L_SIG_FAILURE
@ L_SIG_FAILURE
Definition: wifi-phy-common.h:273
ns3::PhyEntity::m_wifiPhy
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
Definition: phy-entity.h:783
ns3::DsssPhy::BuildPpdu
Ptr< WifiPpdu > BuildPpdu(const WifiConstPsduMap &psdus, const WifiTxVector &txVector, Time ppduDuration) override
Build amendment-specific PPDU.
Definition: dsss-phy.cc:181
ns3::GetDsssRatesBpsList
const std::array< uint64_t, 4 > & GetDsssRatesBpsList(void)
Get the array of possible DSSS rates.
Definition: dsss-phy.cc:67
ns3::DsssPhy::GetRxChannelWidth
uint16_t GetRxChannelWidth(const WifiTxVector &txVector) const override
Return the channel width used in the reception spectrum model.
Definition: dsss-phy.cc:224
ns3::DsssPhy::InitializeModes
static void InitializeModes(void)
Initialize all HR/DSSS modes.
Definition: dsss-phy.cc:252
ns3::WifiMode::GetUniqueName
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:122
ns3::WifiTxVector::GetPreambleType
WifiPreamble GetPreambleType(void) const
Definition: wifi-tx-vector.cc:148
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
GET_DSSS_MODE
#define GET_DSSS_MODE(x, m)
Definition: dsss-phy.cc:279
ns3::DsssPhy::DsssPhy
DsssPhy()
Constructor for HR/DSSS PHY.
Definition: dsss-phy.cc:72
NS_ABORT_MSG_IF
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Definition: abort.h:108
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::PhyEntity::DoEndReceiveField
virtual PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event)
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
Definition: phy-entity.cc:350
ns3::WifiTxVector::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-tx-vector.cc:154
ns3::WifiPpduField
WifiPpduField
The type of PPDU field (grouped for convenience)
Definition: wifi-phy-common.h:171
ns3::PhyEntity::PhyFieldRxStatus::isSuccess
bool isSuccess
outcome (true if success) of the reception
Definition: phy-entity.h:113
ns3::MakeCallback
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:289
ns3::RatioToDb
double RatioToDb(double ratio)
Convert from ratio to dB.
Definition: wifi-utils.cc:49
ns3::DsssPhy::GetHeaderDuration
Time GetHeaderDuration(const WifiTxVector &txVector) const
Definition: dsss-phy.cc:157
ns3::WIFI_PREAMBLE_LONG
@ WIFI_PREAMBLE_LONG
Definition: wifi-phy-common.h:69
ns3::PhyEntity::GetRandomValue
double GetRandomValue(void) const
Obtain a random value from the WifiPhy's generator.
Definition: phy-entity.cc:989
ns3::PhyEntity::GetPhyHeaderSnrPer
SnrPer GetPhyHeaderSnrPer(WifiPpduField field, Ptr< Event > event) const
Obtain the SNR and PER of the PPDU field from the WifiPhy's InterferenceHelper class.
Definition: phy-entity.cc:250
ns3::DsssPhy::GetDuration
Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const override
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
Definition: dsss-phy.cc:124
ns3::DsssPhy::GetConstellationSize
static uint16_t GetConstellationSize(const std::string &name)
Return the constellation size from the DSSS or HR/DSSS mode's unique name using ModulationLookupTable...
Definition: dsss-phy.cc:323
ns3::PhyEntity::SnrPer::per
double per
PER.
Definition: phy-entity.h:139
ns3::DsssPhy::GetHeaderMode
WifiMode GetHeaderMode(const WifiTxVector &txVector) const
Definition: dsss-phy.cc:102
ns3::DsssPhy::DoEndReceiveField
PhyFieldRxStatus DoEndReceiveField(WifiPpduField field, Ptr< Event > event) override
End receiving a given field, perform amendment-specific actions, and provide the status of the recept...
Definition: dsss-phy.cc:189
NS_LOG_DEBUG
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
ns3::DsssPhy::GetDsssRate5_5Mbps
static WifiMode GetDsssRate5_5Mbps(void)
Return a WifiMode for HR/DSSS at 5.5 Mbps.
ns3::MakeBoundCallback
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1703
ns3::PhyEntity::GetDuration
virtual Time GetDuration(WifiPpduField field, const WifiTxVector &txVector) const
Get the duration of the PPDU field (or group of fields) used by this entity for the given transmissio...
Definition: phy-entity.cc:176
ns3::DsssPhy::IsModeAllowed
static bool IsModeAllowed(uint16_t channelWidth, uint8_t nss)
Check whether the combination of <WifiMode, channel width, NSS> is allowed.
Definition: dsss-phy.cc:360
ns3::WifiPhy::GetChannelWidth
uint16_t GetChannelWidth(void) const
Definition: wifi-phy.cc:1233
ns3::UNSUPPORTED_SETTINGS
@ UNSUPPORTED_SETTINGS
Definition: wifi-phy-common.h:265
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::PhyEntity::ModulationLookupTable
std::map< std::string, CodeRateConstellationSizePair > ModulationLookupTable
A modulation lookup table using unique name of modulation as key.
Definition: phy-entity.h:487
ns3::WIFI_PPDU_FIELD_DATA
@ WIFI_PPDU_FIELD_DATA
data field
Definition: wifi-phy-common.h:190
ns3::PhyEntity::SnrPer
A struct for both SNR and PER.
Definition: phy-entity.h:137
ns3::WifiPhyBand
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
ns3::DsssPhy::GetDsssRate11Mbps
static WifiMode GetDsssRate11Mbps(void)
Return a WifiMode for HR/DSSS at 11 Mbps.
ns3::WifiMode::GetDataRate
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:100
ns3::PhyEntity::GetSigMode
virtual WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const
Get the WifiMode for the SIG field specified by the PPDU field.
Definition: phy-entity.cc:141
ns3::PhyEntity::IsConfigSupported
virtual bool IsConfigSupported(Ptr< const WifiPpdu > ppdu) const
Checks if the signaled configuration (excluding bandwidth) is supported by the PHY.
Definition: phy-entity.cc:899
ns3::DsssPhy::GetDataRate
static uint64_t GetDataRate(const std::string &name, WifiModulationClass modClass, uint16_t channelWidth, uint16_t guardInterval, uint8_t nss)
Return the data rate from the DSSS or HR/DSSS mode's unique name and the supplied parameters.
Definition: dsss-phy.cc:338
ns3::DsssPhy::EndReceiveHeader
PhyFieldRxStatus EndReceiveHeader(Ptr< Event > event)
End receiving the header, perform DSSS-specific actions, and provide the status of the reception.
Definition: dsss-phy.cc:200
ns3::DsssPhy::GetPayloadDuration
Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype, bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols, uint16_t staId) const override
Definition: dsss-phy.cc:173
ns3::WIFI_PPDU_FIELD_NON_HT_HEADER
@ WIFI_PPDU_FIELD_NON_HT_HEADER
PHY header field for DSSS or ERP, short PHY header field for HR/DSSS or ERP, field not present for HT...
Definition: wifi-phy-common.h:185
ns3::WifiSpectrumValueHelper::CreateDsssTxPowerSpectralDensity
static Ptr< SpectrumValue > CreateDsssTxPowerSpectralDensity(uint32_t centerFrequency, double txPowerW, uint16_t guardBandwidth)
Create a transmit power spectral density corresponding to DSSS.
Definition: wifi-spectrum-value-helper.cc:136
ns3::WIFI_PREAMBLE_SHORT
@ WIFI_PREAMBLE_SHORT
Definition: wifi-phy-common.h:70
ns3::WIFI_MOD_CLASS_DSSS
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
Definition: wifi-phy-common.h:126
ns3::WifiTxVector::GetMode
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
Definition: wifi-tx-vector.cc:112
ns3::WifiModulationClass
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
Definition: wifi-phy-common.h:122
ns3::PhyEntity::DROP
@ DROP
drop PPDU and set CCA_BUSY
Definition: phy-entity.h:102
ns3::PhyEntity::ObtainNextUid
virtual uint64_t ObtainNextUid(const WifiTxVector &txVector)
Obtain the next UID for the PPDU to transmit.
Definition: phy-entity.cc:1019
ns3::DsssPhy::GetTxPowerSpectralDensity
Ptr< SpectrumValue > GetTxPowerSpectralDensity(double txPowerW, Ptr< const WifiPpdu > ppdu) const override
Definition: dsss-phy.cc:240
ns3::MpduType
MpduType
The type of an MPDU.
Definition: wifi-mpdu-type.h:31
NS_ABORT_MSG
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
Definition: abort.h:50
ns3::DsssPhy::GetSigMode
WifiMode GetSigMode(WifiPpduField field, const WifiTxVector &txVector) const override
Get the WifiMode for the SIG field specified by the PPDU field.
Definition: dsss-phy.cc:89
dsss-ppdu.h
Declaration of ns3::DsssPpdu class.