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_truncatedTx (false),
36  m_band (band),
37  m_channelWidth (txVector.GetChannelWidth ()),
38  m_txPowerLevel (txVector.GetTxPowerLevel ())
39 {
40  NS_LOG_FUNCTION (this << *psdu << txVector << ppduDuration << band);
41  m_psdus.insert (std::make_pair (SU_STA_ID, psdu));
42  SetPhyHeaders (txVector, ppduDuration, band);
43 }
44 
45 WifiPpdu::WifiPpdu (const WifiConstPsduMap & psdus, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
46  : m_preamble (txVector.GetPreambleType ()),
47  m_modulation (txVector.IsValid () ? txVector.GetMode (psdus.begin()->first).GetModulationClass () : WIFI_MOD_CLASS_UNKNOWN),
48  m_psdus (psdus),
49  m_truncatedTx (false),
50  m_band (band),
51  m_channelWidth (txVector.GetChannelWidth ()),
52  m_txPowerLevel (txVector.GetTxPowerLevel ())
53 {
54  NS_LOG_FUNCTION (this << psdus << txVector << ppduDuration << band);
56  {
57  m_muUserInfos = txVector.GetHeMuUserInfoMap ();
58  }
59  SetPhyHeaders (txVector, ppduDuration, band);
60 }
61 
63 {
64 }
65 
66 void
67 WifiPpdu::SetPhyHeaders (WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
68 {
69  if (!txVector.IsValid ())
70  {
71  return;
72  }
73  NS_LOG_FUNCTION (this << txVector << ppduDuration << band);
74  switch (m_modulation)
75  {
78  {
79  NS_ASSERT (m_psdus.size () == 1);
80  m_dsssSig.SetRate (txVector.GetMode ().GetDataRate (22));
81  Time psduDuration = ppduDuration - WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
82  m_dsssSig.SetLength (psduDuration.GetMicroSeconds ());
83  break;
84  }
87  {
88  NS_ASSERT (m_psdus.size () == 1);
89  m_lSig.SetRate (txVector.GetMode ().GetDataRate (txVector), m_channelWidth);
90  m_lSig.SetLength (m_psdus.at (SU_STA_ID)->GetSize ());
91  break;
92  }
93  case WIFI_MOD_CLASS_HT:
94  {
95  NS_ASSERT (m_psdus.size () == 1);
96  uint8_t sigExtension = 0;
98  {
99  sigExtension = 6;
100  }
101  uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000) - (sigExtension * 1000)) / 1000) / 4.0) * 3) - 3);
102  m_lSig.SetLength (length);
103  m_htSig.SetMcs (txVector.GetMode ().GetMcsValue ());
105  m_htSig.SetHtLength (m_psdus.at (SU_STA_ID)->GetSize ());
106  m_htSig.SetAggregation (txVector.IsAggregation ());
107  m_htSig.SetShortGuardInterval (txVector.GetGuardInterval () == 400);
108  m_htSig.SetFecCoding (txVector.IsLdpc ());
109  break;
110  }
111  case WIFI_MOD_CLASS_VHT:
112  {
113  uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000)) / 1000) / 4.0) * 3) - 3);
114  m_lSig.SetLength (length);
117  m_vhtSig.SetShortGuardInterval (txVector.GetGuardInterval () == 400);
118  uint32_t nSymbols = (static_cast<double> ((ppduDuration - WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector)).GetNanoSeconds ()) / (3200 + txVector.GetGuardInterval ()));
119  if (txVector.GetGuardInterval () == 400)
120  {
121  m_vhtSig.SetShortGuardIntervalDisambiguation ((nSymbols % 10) == 9);
122  }
123  m_vhtSig.SetSuMcs (txVector.GetMode ().GetMcsValue ());
124  m_vhtSig.SetNStreams (txVector.GetNss ());
125  m_vhtSig.SetCoding (txVector.IsLdpc ());
126  break;
127  }
128  case WIFI_MOD_CLASS_HE:
129  {
130  uint8_t sigExtension = 0;
132  {
133  sigExtension = 6;
134  }
135  uint8_t m = 0;
137  {
138  m = 2;
139  }
140  else if (m_preamble == WIFI_PREAMBLE_HE_MU)
141  {
142  m = 1;
143  }
144  else
145  {
146  NS_ASSERT_MSG (false, "Unsupported preamble type");
147  }
148  uint16_t length = ((ceil ((static_cast<double> (ppduDuration.GetNanoSeconds () - (20 * 1000) - (sigExtension * 1000)) / 1000) / 4.0) * 3) - 3 - m);
149  m_lSig.SetLength (length);
151  {
152  m_heSig.SetMuFlag (true);
153  }
154  else if (m_preamble != WIFI_PREAMBLE_HE_TB)
155  {
156  m_heSig.SetMcs (txVector.GetMode ().GetMcsValue ());
157  m_heSig.SetNStreams (txVector.GetNss ());
158  }
159  m_heSig.SetBssColor (txVector.GetBssColor ());
161  m_heSig.SetGuardIntervalAndLtfSize (txVector.GetGuardInterval (), 2/*NLTF currently unused*/);
162  m_heSig.SetCoding (txVector.IsLdpc ());
163  break;
164  }
165  default:
166  NS_FATAL_ERROR ("unsupported modulation class");
167  break;
168  }
169 }
170 
173 {
174  WifiTxVector txVector;
175  txVector.SetPreambleType (m_preamble);
176  switch (m_modulation)
177  {
178  case WIFI_MOD_CLASS_DSSS:
180  {
181  WifiMode mode;
182  switch (m_dsssSig.GetRate ())
183  {
184  case 1000000:
185  mode = WifiPhy::GetDsssRate1Mbps ();
186  break;
187  case 2000000:
188  mode = WifiPhy::GetDsssRate2Mbps ();
189  break;
190  case 5500000:
191  mode = WifiPhy::GetDsssRate5_5Mbps ();
192  break;
193  case 11000000:
194  mode = WifiPhy::GetDsssRate11Mbps ();
195  break;
196  default:
197  NS_ASSERT_MSG (false, "Invalid rate encoded in DSSS SIG header");
198  break;
199  }
200  txVector.SetMode (mode);
201  txVector.SetChannelWidth (22);
202  break;
203  }
204  case WIFI_MOD_CLASS_OFDM:
205  {
206  WifiMode mode;
207  switch (m_lSig.GetRate (m_channelWidth))
208  {
209  case 1500000:
211  break;
212  case 2250000:
214  break;
215  case 3000000:
217  break;
218  case 4500000:
220  break;
221  case 6000000:
222  if (m_channelWidth == 5)
223  {
225  }
226  else if (m_channelWidth == 10)
227  {
229  }
230  else
231  {
232  mode = WifiPhy::GetOfdmRate6Mbps ();
233  }
234  break;
235  case 9000000:
236  if (m_channelWidth == 5)
237  {
239  }
240  else if (m_channelWidth == 10)
241  {
243  }
244  else
245  {
246  mode = WifiPhy::GetOfdmRate9Mbps ();
247  }
248  break;
249  case 12000000:
250  if (m_channelWidth == 5)
251  {
253  }
254  else if (m_channelWidth == 10)
255  {
257  }
258  else
259  {
260  mode = WifiPhy::GetOfdmRate12Mbps ();
261  }
262  break;
263  case 13500000:
265  break;
266  case 18000000:
268  break;
269  case 24000000:
271  break;
272  case 27000000:
274  break;
275  case 36000000:
276  mode = WifiPhy::GetOfdmRate36Mbps ();
277  break;
278  case 48000000:
279  mode = WifiPhy::GetOfdmRate48Mbps ();
280  break;
281  case 54000000:
282  mode = WifiPhy::GetOfdmRate54Mbps ();
283  break;
284  default:
285  NS_ASSERT_MSG (false, "Invalid rate encoded in L-SIG header");
286  break;
287  }
288  txVector.SetMode (mode);
289  //OFDM uses 20 MHz, unless PHY channel width is 5 MHz or 10 MHz
290  txVector.SetChannelWidth (m_channelWidth < 20 ? m_channelWidth : 20);
291  break;
292  }
294  {
295  WifiMode mode;
296  switch (m_lSig.GetRate ())
297  {
298  case 6000000:
300  break;
301  case 9000000:
303  break;
304  case 12000000:
306  break;
307  case 18000000:
309  break;
310  case 24000000:
312  break;
313  case 36000000:
315  break;
316  case 48000000:
318  break;
319  case 54000000:
321  break;
322  default:
323  NS_ASSERT_MSG (false, "Invalid rate encoded in L-SIG header");
324  break;
325  }
326  txVector.SetMode (mode);
327  //ERP-OFDM uses 20 MHz, unless PHY channel width is 5 MHz or 10 MHz
328  txVector.SetChannelWidth (m_channelWidth < 20 ? m_channelWidth : 20);
329  break;
330  }
331  case WIFI_MOD_CLASS_HT:
332  {
333  txVector.SetMode (WifiPhy::GetHtMcs (m_htSig.GetMcs ()));
335  txVector.SetNss (1 + (m_htSig.GetMcs () / 8));
336  txVector.SetGuardInterval(m_htSig.GetShortGuardInterval () ? 400 : 800);
337  txVector.SetLdpc (m_htSig.IsLdpcFecCoding ());
338  break;
339  }
340  case WIFI_MOD_CLASS_VHT:
341  {
344  txVector.SetNss (m_vhtSig.GetNStreams ());
345  txVector.SetGuardInterval (m_vhtSig.GetShortGuardInterval () ? 400 : 800);
346  txVector.SetLdpc (m_vhtSig.IsLdpcCoding ());
347  break;
348  }
349  case WIFI_MOD_CLASS_HE:
350  {
351  txVector.SetMode (WifiPhy::GetHeMcs (m_heSig.GetMcs ()));
353  txVector.SetNss (m_heSig.GetNStreams ());
355  txVector.SetBssColor (m_heSig.GetBssColor ());
356  txVector.SetLdpc (m_heSig.IsLdpcCoding ());
357  break;
358  }
359  default:
360  NS_FATAL_ERROR ("unsupported modulation class");
361  break;
362  }
363  txVector.SetTxPowerLevel (m_txPowerLevel);
364  txVector.SetAggregation (m_psdus.size () > 1 || m_psdus.begin ()->second->IsAggregate ());
365  for (auto const& muUserInfo : m_muUserInfos)
366  {
367  txVector.SetHeMuUserInfo (muUserInfo.first, muUserInfo.second);
368  }
369  return txVector;
370 }
371 
373 WifiPpdu::GetPsdu (uint8_t bssColor, uint16_t staId) const
374 {
375  if (!IsMu ())
376  {
377  NS_ASSERT (m_psdus.size () == 1);
378  return m_psdus.at (SU_STA_ID);
379  }
380  else
381  {
382  if (bssColor == m_heSig.GetBssColor ())
383  {
384  auto it = m_psdus.find (staId);
385  if (it != m_psdus.end ())
386  {
387  return it->second;
388  }
389  }
390  }
391  return nullptr;
392 }
393 
394 bool
396 {
397  return m_truncatedTx;
398 }
399 
400 void
402 {
403  NS_LOG_FUNCTION (this);
404  m_truncatedTx = true;
405 }
406 
407 Time
409 {
410  Time ppduDuration = Seconds (0);
411  WifiTxVector txVector = GetTxVector ();
412  switch (m_modulation)
413  {
414  case WIFI_MOD_CLASS_DSSS:
417  break;
418  case WIFI_MOD_CLASS_OFDM:
420  ppduDuration = WifiPhy::CalculateTxDuration (m_lSig.GetLength (), txVector, m_band);
421  break;
422  case WIFI_MOD_CLASS_HT:
423  ppduDuration = WifiPhy::CalculateTxDuration (m_htSig.GetHtLength (), txVector, m_band);
424  break;
425  case WIFI_MOD_CLASS_VHT:
426  {
427  Time tSymbol = NanoSeconds (3200 + txVector.GetGuardInterval ());
428  Time preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
429  Time calculatedDuration = MicroSeconds (((ceil (static_cast<double> (m_lSig.GetLength () + 3) / 3)) * 4) + 20);
430  uint32_t nSymbols = floor (static_cast<double> ((calculatedDuration - preambleDuration).GetNanoSeconds ()) / tSymbol.GetNanoSeconds ());
432  {
433  nSymbols--;
434  }
435  ppduDuration = preambleDuration + (nSymbols * tSymbol);
436  break;
437  }
438  case WIFI_MOD_CLASS_HE:
439  {
440  Time tSymbol = NanoSeconds (12800 + txVector.GetGuardInterval ());
441  Time preambleDuration = WifiPhy::CalculatePhyPreambleAndHeaderDuration (txVector);
442  uint8_t sigExtension = 0;
444  {
445  sigExtension = 6;
446  }
447  uint8_t m = 0;
449  {
450  m = 2;
451  }
452  else if (m_preamble == WIFI_PREAMBLE_HE_MU)
453  {
454  m = 1;
455  }
456  //Equation 27-11 of IEEE P802.11ax/D4.0
457  Time calculatedDuration = MicroSeconds (((ceil (static_cast<double> (m_lSig.GetLength () + 3 + m) / 3)) * 4) + 20 + sigExtension);
458  uint32_t nSymbols = floor (static_cast<double> ((calculatedDuration - preambleDuration).GetNanoSeconds () - (sigExtension * 1000)) / tSymbol.GetNanoSeconds ());
459  ppduDuration = preambleDuration + (nSymbols * tSymbol) + MicroSeconds (sigExtension);
460  break;
461  }
462  default:
463  NS_FATAL_ERROR ("unsupported modulation class");
464  break;
465  }
466  return ppduDuration;
467 }
468 
469 bool
470 WifiPpdu::IsMu (void) const
471 {
473 }
474 
477 {
478  return m_modulation;
479 }
480 
481 void
482 WifiPpdu::Print (std::ostream& os) const
483 {
484  os << "preamble=" << m_preamble
485  << ", modulation=" << m_modulation
486  << ", truncatedTx=" << (m_truncatedTx ? "Y" : "N");
487  IsMu () ? (os << ", " << m_psdus) : (os << ", PSDU=" << m_psdus.at (SU_STA_ID));
488 }
489 
490 std::ostream & operator << (std::ostream &os, const WifiPpdu &ppdu)
491 {
492  ppdu.Print (os);
493  return os;
494 }
495 
496 std::ostream & operator << (std::ostream &os, const WifiConstPsduMap &psdus)
497 {
498  for (auto const& psdu : psdus)
499  {
500  os << "PSDU for STA_ID=" << psdu.first
501  << " (" << *psdu.second << ") ";
502  }
503  return os;
504 }
505 
506 } //namespace ns3
bool IsLdpcCoding(void) const
Return whether LDPC is used or not.
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3781
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:3472
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:3409
bool IsAggregation(void) const
Checks whether the PSDU contains A-MPDU.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
void SetFecCoding(bool ldpc)
Fill the FEC coding field of HT-SIG.
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:3484
#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:56
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:3535
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3682
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:3706
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:3745
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
WifiTxVector::HeMuUserInfoMap m_muUserInfos
the HE MU specific per-user information (to be removed once HE-SIG-B headers are implemented) ...
Definition: wifi-ppdu.h:140
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:3370
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
void SetBssColor(uint8_t color)
Set the BSS color.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Definition: wifi-ppdu.h:33
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:3460
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:401
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:3547
WifiTxVector GetTxVector(void) const
Get the TXVECTOR used to send the PPDU.
Definition: wifi-ppdu.cc:172
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
HeSigHeader m_heSig
the HE-SIG PHY header
Definition: wifi-ppdu.h:132
#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:3721
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3634
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:3607
uint16_t GetChannelWidth(void) const
Return the channel width (in MHz).
void SetCoding(bool ldpc)
Fill the coding field of HE-SIG-A2.
#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).
Ptr< const WifiPsdu > GetPsdu(uint8_t bssColor=64, uint16_t staId=SU_STA_ID) const
Get the payload of the PPDU.
Definition: wifi-ppdu.cc:373
VHT PHY (Clause 22)
Definition: wifi-mode.h:62
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetBssColor(uint8_t bssColor)
Fill the BSS Color field of HE-SIG-A1.
HR/DSSS PHY (Clause 18)
Definition: wifi-mode.h:50
void SetRate(uint64_t rate)
Fill the RATE field of L-SIG (in bit/s).
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
WifiModulationClass GetModulation(void) const
Get the modulation used for the PPDU.
Definition: wifi-ppdu.cc:476
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:3583
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3769
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).
bool IsLdpc(void) const
Check if LDPC FEC coding is used or not.
bool IsLdpcCoding(void) const
Return whether LDPC is used or not.
Modulation class unknown or unspecified.
Definition: wifi-mode.h:42
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...
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:3508
void SetCoding(bool ldpc)
Fill the coding field of VHT-SIG-A2.
void SetPhyHeaders(WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
Fill in the PHY headers.
Definition: wifi-ppdu.cc:67
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.
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:1313
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:3496
void Print(std::ostream &os) const
Print the PPDU contents.
Definition: wifi-ppdu.cc:482
WifiPreamble m_preamble
the PHY preamble
Definition: wifi-ppdu.h:133
HtSigHeader m_htSig
the HT-SIG PHY header
Definition: wifi-ppdu.h:130
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:3670
static WifiMode GetHeMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HE modulation class.
Definition: wifi-phy.cc:4484
HT PHY (Clause 20)
Definition: wifi-mode.h:60
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:3559
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:3658
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:3793
void SetAggregation(bool aggregation)
Fill the aggregation field of HT-SIG.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
void SetNss(uint8_t nss)
Sets the number of Nss.
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:3595
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:43
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:388
WifiPhyBand m_band
the WifiPhyBand used to transmit that PPDU
Definition: wifi-ppdu.h:137
bool IsLdpcFecCoding(void) const
Return whether LDPC is used or not.
bool IsTruncatedTx(void) const
Return true if the PPDU&#39;s transmission was aborted due to transmitter switch off. ...
Definition: wifi-ppdu.cc:395
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:392
void SetAggregation(bool aggregation)
Sets if PSDU contains A-MPDU.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:3571
uint8_t GetMcs(void) const
Return the MCS field of HT-SIG.
virtual ~WifiPpdu()
Definition: wifi-ppdu.cc:62
uint8_t m_txPowerLevel
the transmission power level (used only for TX and initializing the returned WifiTxVector) ...
Definition: wifi-ppdu.h:139
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:3397
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3733
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:3436
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:136
#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.
WifiConstPsduMap m_psdus
the PSDUs contained in this PPDU
Definition: wifi-ppdu.h:135
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:3424
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:3448
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
Definition: wifi-mode.h:38
DsssSigHeader m_dsssSig
the DSSS SIG PHY header
Definition: wifi-ppdu.h:128
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:129
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:1289
OFDM PHY (Clause 17)
Definition: wifi-mode.h:58
VhtSigHeader m_vhtSig
the VHT-SIG PHY header
Definition: wifi-ppdu.h:131
WifiPpdu(Ptr< const WifiPsdu > psdu, WifiTxVector txVector, Time ppduDuration, WifiPhyBand band)
Create a SU 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:138
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:1305
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:3382
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3646
static Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
Definition: wifi-phy.cc:2546
void SetShortGuardInterval(bool sgi)
Fill the short guard interval field of HT-SIG.
const HeMuUserInfoMap & GetHeMuUserInfoMap(void) const
Get the map HE MU user-specific transmission information indexed by STA-ID.
Definition: first.py:1
Time GetTxDuration() const
Get the total transmission duration of the PPDU.
Definition: wifi-ppdu.cc:408
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3694
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3805
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:458
bool IsMu(void) const
Return true if the PPDU is a MU PPDU.
Definition: wifi-ppdu.cc:470
WifiModulationClass m_modulation
the modulation used for the transmission of this PPDU
Definition: wifi-ppdu.h:134
#define SU_STA_ID
Definition: wifi-mode.h:30
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:3523
HE PHY (Clause 26)
Definition: wifi-mode.h:64
static WifiMode GetVhtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the VHT modulation class.
Definition: wifi-phy.cc:4441
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
Definition: wifi-mode.cc:127
DSSS PHY (Clause 15)
Definition: wifi-mode.h:48
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:3757
bool GetShortGuardIntervalDisambiguation(void) const
Return the short GI NSYM disambiguation field of VHT-SIG-A2.
static WifiMode GetHtMcs(uint8_t mcs)
Get the WifiMode object corresponding to the given MCS of the HT modulation class.
Definition: wifi-phy.cc:4332
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:3622
static Time CalculatePhyPreambleAndHeaderDuration(WifiTxVector txVector)
Definition: wifi-phy.cc:2532