A Discrete-Event Network Simulator
API
wifi-ppdu.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2019 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  * Author: Rediet <getachew.redieteab@orange.com>
19  */
20 
21 #include "ns3/log.h"
22 #include "ns3/packet.h"
23 #include "wifi-ppdu.h"
24 #include "wifi-psdu.h"
25 #include "wifi-phy.h"
26 #include "wifi-utils.h"
27 
28 namespace ns3 {
29 
30 NS_LOG_COMPONENT_DEFINE ("WifiPpdu");
31 
33  : m_preamble (txVector.GetPreambleType ()),
34  m_modulation (txVector.IsValid () ? txVector.GetMode ().GetModulationClass () : WIFI_MOD_CLASS_UNKNOWN),
35  m_psdu (psdu),
36  m_truncatedTx (false),
37  m_band (band),
38  m_channelWidth (txVector.GetChannelWidth ()),
39  m_txPowerLevel (txVector.GetTxPowerLevel ())
40 {
41  if (!txVector.IsValid ())
42  {
43  return;
44  }
45  NS_LOG_FUNCTION (this << psdu << txVector << ppduDuration << band);
46  switch (m_modulation)
47  {
50  {
51  m_dsssSig.SetRate (txVector.GetMode ().GetDataRate (22));
52  Time psduDuration = ppduDuration - WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
53  m_dsssSig.SetLength (psduDuration.GetMicroSeconds ());
54  break;
55  }
58  {
59  m_lSig.SetRate (txVector.GetMode ().GetDataRate (txVector), m_channelWidth);
60  m_lSig.SetLength (psdu->GetSize ());
61  break;
62  }
63  case WIFI_MOD_CLASS_HT:
64  {
65  uint8_t sigExtension = 0;
67  {
68  sigExtension = 6;
69  }
70  uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000) - (sigExtension * 1000)) / 1000) / 4.0) * 3) - 3);
71  m_lSig.SetLength (length);
72  m_htSig.SetMcs (txVector.GetMode ().GetMcsValue ());
74  m_htSig.SetHtLength (psdu->GetSize ());
75  m_htSig.SetAggregation (txVector.IsAggregation ());
76  m_htSig.SetShortGuardInterval (txVector.GetGuardInterval () == 400);
77  break;
78  }
79  case WIFI_MOD_CLASS_VHT:
80  {
81  uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000)) / 1000) / 4.0) * 3) - 3);
82  m_lSig.SetLength (length);
85  m_vhtSig.SetShortGuardInterval (txVector.GetGuardInterval () == 400);
86  uint32_t nSymbols = (static_cast<double> ((ppduDuration - WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector)).GetNanoSeconds ()) / (3200 + txVector.GetGuardInterval ()));
87  if (txVector.GetGuardInterval () == 400)
88  {
89  m_vhtSig.SetShortGuardIntervalDisambiguation ((nSymbols % 10) == 9);
90  }
91  m_vhtSig.SetSuMcs (txVector.GetMode ().GetMcsValue ());
92  m_vhtSig.SetNStreams (txVector.GetNss ());
93  break;
94  }
95  case WIFI_MOD_CLASS_HE:
96  {
97  uint8_t sigExtension = 0;
99  {
100  sigExtension = 6;
101  }
102  uint8_t m = 0;
104  {
105  m = 2;
106  }
107  else if (m_preamble == WIFI_PREAMBLE_HE_MU)
108  {
109  m = 1;
110  }
111  uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000) - (sigExtension * 1000)) / 1000) / 4.0) * 3) - 3 - m);
112  m_lSig.SetLength (length);
114  m_heSig.SetMcs (txVector.GetMode ().GetMcsValue ());
115  m_heSig.SetBssColor (txVector.GetBssColor ());
117  m_heSig.SetGuardIntervalAndLtfSize (txVector.GetGuardInterval (), 2/*NLTF currently unused*/);
118  m_heSig.SetNStreams (txVector.GetNss ());
119  break;
120  }
121  default:
122  NS_FATAL_ERROR ("unsupported modulation class");
123  break;
124  }
125 }
126 
128 {
129 }
130 
133 {
134  WifiTxVector txVector;
135  txVector.SetPreambleType (m_preamble);
136  switch (m_modulation)
137  {
138  case WIFI_MOD_CLASS_DSSS:
140  {
141  WifiMode mode;
142  switch (m_dsssSig.GetRate ())
143  {
144  case 1000000:
145  mode = WifiPhy::GetDsssRate1Mbps ();
146  break;
147  case 2000000:
148  mode = WifiPhy::GetDsssRate2Mbps ();
149  break;
150  case 5500000:
151  mode = WifiPhy::GetDsssRate5_5Mbps ();
152  break;
153  case 11000000:
154  mode = WifiPhy::GetDsssRate11Mbps ();
155  break;
156  default:
157  NS_ASSERT_MSG (false, "Invalid rate encoded in DSSS SIG header");
158  break;
159  }
160  txVector.SetMode (mode);
161  txVector.SetChannelWidth (22);
162  break;
163  }
164  case WIFI_MOD_CLASS_OFDM:
165  {
166  WifiMode mode;
167  switch (m_lSig.GetRate (m_channelWidth))
168  {
169  case 1500000:
171  break;
172  case 2250000:
174  break;
175  case 3000000:
177  break;
178  case 4500000:
180  break;
181  case 6000000:
182  if (m_channelWidth == 5)
183  {
185  }
186  else if (m_channelWidth == 10)
187  {
189  }
190  else
191  {
192  mode = WifiPhy::GetOfdmRate6Mbps ();
193  }
194  break;
195  case 9000000:
196  if (m_channelWidth == 5)
197  {
199  }
200  else if (m_channelWidth == 10)
201  {
203  }
204  else
205  {
206  mode = WifiPhy::GetOfdmRate9Mbps ();
207  }
208  break;
209  case 12000000:
210  if (m_channelWidth == 5)
211  {
213  }
214  else if (m_channelWidth == 10)
215  {
217  }
218  else
219  {
220  mode = WifiPhy::GetOfdmRate12Mbps ();
221  }
222  break;
223  case 13500000:
225  break;
226  case 18000000:
228  break;
229  case 24000000:
231  break;
232  case 27000000:
234  break;
235  case 36000000:
236  mode = WifiPhy::GetOfdmRate36Mbps ();
237  break;
238  case 48000000:
239  mode = WifiPhy::GetOfdmRate48Mbps ();
240  break;
241  case 54000000:
242  mode = WifiPhy::GetOfdmRate54Mbps ();
243  break;
244  default:
245  NS_ASSERT_MSG (false, "Invalid rate encoded in L-SIG header");
246  break;
247  }
248  txVector.SetMode (mode);
249  //OFDM uses 20 MHz, unless PHY channel width is 5 MHz or 10 MHz
250  txVector.SetChannelWidth (m_channelWidth < 20 ? m_channelWidth : 20);
251  break;
252  }
254  {
255  WifiMode mode;
256  switch (m_lSig.GetRate ())
257  {
258  case 6000000:
260  break;
261  case 9000000:
263  break;
264  case 12000000:
266  break;
267  case 18000000:
269  break;
270  case 24000000:
272  break;
273  case 36000000:
275  break;
276  case 48000000:
278  break;
279  case 54000000:
281  break;
282  default:
283  NS_ASSERT_MSG (false, "Invalid rate encoded in L-SIG header");
284  break;
285  }
286  txVector.SetMode (mode);
287  //ERP-OFDM uses 20 MHz, unless PHY channel width is 5 MHz or 10 MHz
288  txVector.SetChannelWidth (m_channelWidth < 20 ? m_channelWidth : 20);
289  break;
290  }
291  case WIFI_MOD_CLASS_HT:
292  {
293  txVector.SetMode (WifiPhy::GetHtMcs (m_htSig.GetMcs ()));
295  txVector.SetNss (1 + (m_htSig.GetMcs () / 8));
296  txVector.SetGuardInterval(m_htSig.GetShortGuardInterval () ? 400 : 800);
297  txVector.SetAggregation (m_htSig.GetAggregation ());
298  break;
299  }
300  case WIFI_MOD_CLASS_VHT:
301  {
304  txVector.SetNss (m_vhtSig.GetNStreams ());
305  txVector.SetGuardInterval (m_vhtSig.GetShortGuardInterval () ? 400 : 800);
306  txVector.SetAggregation (m_psdu->IsAggregate ());
307  break;
308  }
309  case WIFI_MOD_CLASS_HE:
310  {
311  txVector.SetMode (WifiPhy::GetHeMcs (m_heSig.GetMcs ()));
313  txVector.SetNss (m_heSig.GetNStreams ());
315  txVector.SetBssColor (m_heSig.GetBssColor ());
316  txVector.SetAggregation (m_psdu->IsAggregate ());
317  break;
318  }
319  default:
320  NS_FATAL_ERROR ("unsupported modulation class");
321  break;
322  }
323  txVector.SetTxPowerLevel (m_txPowerLevel);
324  return txVector;
325 }
326 
328 WifiPpdu::GetPsdu (void) const
329 {
330  return m_psdu;
331 }
332 
333 bool
335 {
336  return m_truncatedTx;
337 }
338 
339 void
341 {
342  NS_LOG_FUNCTION (this);
343  m_truncatedTx = true;
344 }
345 
346 Time
348 {
349  Time ppduDuration = Seconds (0);
350  WifiTxVector txVector = GetTxVector ();
351  switch (m_modulation)
352  {
353  case WIFI_MOD_CLASS_DSSS:
356  break;
357  case WIFI_MOD_CLASS_OFDM:
359  ppduDuration = WifiPhy::CalculateTxDuration (m_lSig.GetLength (), txVector, m_band);
360  break;
361  case WIFI_MOD_CLASS_HT:
362  ppduDuration = WifiPhy::CalculateTxDuration (m_htSig.GetHtLength (), txVector, m_band);
363  break;
364  case WIFI_MOD_CLASS_VHT:
365  {
366  Time tSymbol = NanoSeconds (3200 + txVector.GetGuardInterval ());
367  Time preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
368  Time calculatedDuration = MicroSeconds (((ceil (static_cast<double> (m_lSig.GetLength () + 3) / 3)) * 4) + 20);
369  uint32_t nSymbols = floor (static_cast<double> ((calculatedDuration - preambleDuration).GetNanoSeconds ()) / tSymbol.GetNanoSeconds ());
371  {
372  nSymbols--;
373  }
374  ppduDuration = preambleDuration + (nSymbols * tSymbol);
375  break;
376  }
377  case WIFI_MOD_CLASS_HE:
378  {
379  Time tSymbol = NanoSeconds (12800 + txVector.GetGuardInterval ());
380  Time preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
381  uint8_t sigExtension = 0;
383  {
384  sigExtension = 6;
385  }
386  uint8_t m = 0;
388  {
389  m = 2;
390  }
391  else if (m_preamble == WIFI_PREAMBLE_HE_MU)
392  {
393  m = 1;
394  }
395  //Equation 27-11 of IEEE P802.11ax/D4.0
396  Time calculatedDuration = MicroSeconds (((ceil (static_cast<double> (m_lSig.GetLength () + 3 + m) / 3)) * 4) + 20 + sigExtension);
397  uint32_t nSymbols = floor (static_cast<double> ((calculatedDuration - preambleDuration).GetNanoSeconds () - (sigExtension * 1000)) / tSymbol.GetNanoSeconds ());
398  ppduDuration = preambleDuration + (nSymbols * tSymbol) + MicroSeconds (sigExtension);
399  break;
400  }
401  default:
402  NS_FATAL_ERROR ("unsupported modulation class");
403  break;
404  }
405  return ppduDuration;
406 }
407 
408 void
409 WifiPpdu::Print (std::ostream& os) const
410 {
411  os << "preamble=" << m_preamble
412  << ", modulation=" << m_modulation
413  << ", truncatedTx=" << (m_truncatedTx ? "Y" : "N")
414  << ", PSDU=" << m_psdu;
415 }
416 
417 std::ostream & operator << (std::ostream &os, const WifiPpdu &ppdu)
418 {
419  ppdu.Print (os);
420  return os;
421 }
422 
423 } //namespace ns3
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3605
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:3296
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:3233
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:3308
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:54
void SetMcs(uint8_t mcs)
Fill the MCS field of HT-SIG.
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:3359
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3506
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static WifiMode GetOfdmRate27MbpsBW10MHz()
Return a WifiMode for OFDM at 27Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3530
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of VHT-SIG-A1 (in MHz).
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3569
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:3194
Ptr< const WifiPsdu > GetPsdu(void) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:328
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
void SetBssColor(uint8_t color)
Set the BSS color.
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:3284
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of HE-SIG-A1.
void SetTruncatedTx(void)
Indicate that the PPDU&#39;s transmission was aborted due to transmitter switch off.
Definition: wifi-ppdu.cc:340
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:3371
WifiTxVector GetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
Definition: wifi-ppdu.cc:132
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: wifi-ppdu.h:91
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3545
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3458
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:3431
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
void SetShortGuardIntervalDisambiguation(bool disambiguation)
Fill the short GI NSYM disambiguation field of VHT-SIG-A2.
uint16_t GetGuardInterval(void) const
void SetRate(uint64_t rate, uint16_t channelWidth=20)
Fill the RATE field of L-SIG (in bit/s).
VHT PHY (Clause 22)
Definition: wifi-mode.h:60
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
HR/DSSS PHY (Clause 18)
Definition: wifi-mode.h:48
void SetRate(uint64_t rate)
Fill the RATE field of L-SIG (in bit/s).
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:97
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:3407
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3593
uint8_t GetMcs(void) const
Return the MCS field of HE-SIG-A1.
uint16_t GetLength(void) const
Return the LENGTH field of L-SIG (in bytes).
Modulation class unknown or unspecified.
Definition: wifi-mode.h:40
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:3332
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
void SetMcs(uint8_t mcs)
Fill the MCS field of HE-SIG-A1.
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, WifiPhyBand band)
Definition: wifi-phy.cc:2539
void SetNStreams(uint8_t nStreams)
Fill the number of streams field of VHT-SIG-A1.
void SetSuMcs(uint8_t mcs)
Fill the SU VHT MCS field of VHT-SIG-A2.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1302
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
bool GetShortGuardInterval(void) const
Return the short guard interval field of HT-SIG.
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:3320
void Print(std::ostream &os) const
Print the PPDU contents.
Definition: wifi-ppdu.cc:409
WifiPreamble m_preamble
the PHY preamble
Definition: wifi-ppdu.h:92
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: wifi-ppdu.h:89
uint16_t GetLength(void) const
Return the LENGTH field of L-SIG (in bytes).
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3494
WifiMode GetMode(void) const
static WifiMode GetHeMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HE modulation class.
Definition: wifi-phy.cc:4308
HT PHY (Clause 20)
Definition: wifi-mode.h:58
void SetMuFlag(bool mu)
Set the Multi-User (MU) flag.
uint8_t GetNStreams(void) const
Return the number of streams.
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:3383
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3482
uint8_t GetNStreams(void) const
Return the number of streams.
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3617
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range.
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:3419
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
WifiPpdu stores a preamble, a modulation class, PHY headers and a PSDU.
Definition: wifi-ppdu.h:40
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HE-SIG-A1 (in MHz).
int64_t GetMicroSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:387
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
Definition: wifi-ppdu.h:96
bool IsTruncatedTx(void) const
Return true if the PPDU&#39;s transmission was aborted due to transmitter switch off. ...
Definition: wifi-ppdu.cc:334
Every class exported by the ns3 library is enclosed in the ns3 namespace.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:391
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
bool GetAggregation(void) const
Return the aggregation field of HT-SIG.
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:3395
uint8_t GetMcs(void) const
Return the MCS field of HT-SIG.
virtual ~WifiPpdu()
Definition: wifi-ppdu.cc:127
uint8_t m_txPowerLevel
the transmission power level (used only for TX and initializing the returned WifiTxVector) ...
Definition: wifi-ppdu.h:98
void SetChannelWidth(uint16_t channelWidth)
Fill the channel width field of HT-SIG (in MHz).
uint64_t GetRate(void) const
Return the RATE field of L-SIG (in bit/s).
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:3221
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3557
The 2.4 GHz band.
Definition: wifi-phy-band.h:33
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:3260
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
bool m_truncatedTx
flag indicating whether the frame&#39;s transmission was aborted due to transmitter switch off ...
Definition: wifi-ppdu.h:95
#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
void SetHtLength(uint16_t length)
Fill the HT length field of HT-SIG (in bytes).
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:30
uint8_t GetSuMcs(void) const
Return the SU VHT MCS field of VHT-SIG-A2.
Ptr< const WifiPsdu > m_psdu
the PSDU contained in this PPDU
Definition: wifi-ppdu.h:94
bool GetShortGuardInterval(void) const
Return the short GI field of VHT-SIG-A2.
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:3248
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:3272
DsssSigHeader m_dsssSig
the DSSS SIG PHY header
Definition: wifi-ppdu.h:87
uint16_t GetHtLength(void) const
Return the HT length field of HT-SIG (in bytes).
void SetGuardIntervalAndLtfSize(uint16_t gi, uint8_t ltf)
Fill the GI + LTF size field of HE-SIG-A1.
uint8_t GetBssColor(void) const
Get the BSS color.
LSigHeader m_lSig
the L-SIG PHY header
Definition: wifi-ppdu.h:88
void SetLength(uint16_t length)
Fill the LENGTH field of L-SIG (in bytes).
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1278
OFDM PHY (Clause 17)
Definition: wifi-mode.h:56
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
Definition: wifi-ppdu.h:90
WifiPpdu(Ptr< const WifiPsdu > psdu, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
Create a single user PPDU storing a PSDU.
Definition: wifi-ppdu.cc:32
uint16_t m_channelWidth
the channel width used to transmit that PPDU in MHz
Definition: wifi-ppdu.h:97
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of VHT-SIG-A2.
uint16_t GetGuardInterval(void) const
Return the guard interval (in nanoseconds).
uint64_t GetRate(uint16_t channelWidth=20) const
Return the RATE field of L-SIG (in bit/s).
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1294
uint8_t GetBssColor(void) const
Return the BSS Color field in the HE-SIG-A1.
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
Definition: wifi-phy.cc:3206
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3470
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
Time GetTxDuration() const
Get the total transmission duration of the PPDU.
Definition: wifi-ppdu.cc:347
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3518
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3629
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:441
WifiModulationClass m_modulation
the modulation used for the transmission of this PPDU
Definition: wifi-ppdu.h:93
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:3347
HE PHY (Clause 26)
Definition: wifi-mode.h:62
static WifiMode GetVhtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the VHT modulation class.
Definition: wifi-phy.cc:4265
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:119
DSSS PHY (Clause 15)
Definition: wifi-mode.h:46
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3581
bool GetShortGuardIntervalDisambiguation(void) const
Return the short GI NSYM disambiguation field of VHT-SIG-A2.
uint8_t GetNss(void) const
static WifiMode GetHtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HT modulation class.
Definition: wifi-phy.cc:4156
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3446
static Time CalculatePhyPreambleAndHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2525