A Discrete-Event Network Simulator
API
wifi-phy.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  * Sébastien Deronne <sebastien.deronne@gmail.com>
20  */
21 
22 #include "wifi-phy.h"
23 #include "wifi-mode.h"
24 #include "wifi-channel.h"
25 #include "wifi-preamble.h"
26 #include "ns3/simulator.h"
27 #include "ns3/packet.h"
28 #include "ns3/assert.h"
29 #include "ns3/log.h"
30 #include "ns3/double.h"
31 #include "ns3/uinteger.h"
32 #include "ns3/enum.h"
33 #include "ns3/trace-source-accessor.h"
34 #include <cmath>
35 
36 namespace ns3 {
37 
38 NS_LOG_COMPONENT_DEFINE ("WifiPhy");
39 
40 /****************************************************************
41  * This destructor is needed.
42  ****************************************************************/
43 
45 {
46 }
47 
48 /****************************************************************
49  * The actual WifiPhy class
50  ****************************************************************/
51 
53 
54 TypeId
56 {
57  static TypeId tid = TypeId ("ns3::WifiPhy")
58  .SetParent<Object> ()
59  .SetGroupName ("Wifi")
60  .AddTraceSource ("PhyTxBegin",
61  "Trace source indicating a packet "
62  "has begun transmitting over the channel medium",
64  "ns3::Packet::TracedCallback")
65  .AddTraceSource ("PhyTxEnd",
66  "Trace source indicating a packet "
67  "has been completely transmitted over the channel. "
68  "NOTE: the only official WifiPhy implementation "
69  "available to this date (YansWifiPhy) never fires "
70  "this trace source.",
72  "ns3::Packet::TracedCallback")
73  .AddTraceSource ("PhyTxDrop",
74  "Trace source indicating a packet "
75  "has been dropped by the device during transmission",
77  "ns3::Packet::TracedCallback")
78  .AddTraceSource ("PhyRxBegin",
79  "Trace source indicating a packet "
80  "has begun being received from the channel medium "
81  "by the device",
83  "ns3::Packet::TracedCallback")
84  .AddTraceSource ("PhyRxEnd",
85  "Trace source indicating a packet "
86  "has been completely received from the channel medium "
87  "by the device",
89  "ns3::Packet::TracedCallback")
90  .AddTraceSource ("PhyRxDrop",
91  "Trace source indicating a packet "
92  "has been dropped by the device during reception",
94  "ns3::Packet::TracedCallback")
95  .AddTraceSource ("MonitorSnifferRx",
96  "Trace source simulating a wifi device in monitor mode "
97  "sniffing all received frames",
99  "ns3::WifiPhy::MonitorSnifferRxTracedCallback")
100  .AddTraceSource ("MonitorSnifferTx",
101  "Trace source simulating the capability of a wifi device "
102  "in monitor mode to sniff all frames being transmitted",
104  "ns3::WifiPhy::MonitorSnifferTxTracedCallback")
105  ;
106  return tid;
107 }
108 
110 {
111  NS_LOG_FUNCTION (this);
112  m_totalAmpduSize = 0;
114 }
115 
117 {
118  NS_LOG_FUNCTION (this);
119 }
120 
121 WifiMode
123 {
124  return WifiPhy::GetHtMcs0 ();
125 }
126 
127 WifiMode
129 {
130  return WifiPhy::GetVhtMcs0 ();
131 }
132 
133 Time
135 {
136  uint8_t Ndltf, Neltf;
137  //We suppose here that STBC = 0.
138  //If STBC > 0, we need a different mapping between Nss and Nltf (IEEE 802.11n-2012 standard, page 1682).
139  if (txVector.GetNss () < 3)
140  {
141  Ndltf = txVector.GetNss ();
142  }
143  else if (txVector.GetNss () < 5)
144  {
145  Ndltf = 4;
146  }
147  else if (txVector.GetNss () < 7)
148  {
149  Ndltf = 6;
150  }
151  else
152  {
153  Ndltf = 8;
154  }
155 
156  if (txVector.GetNess () < 3)
157  {
158  Neltf = txVector.GetNess ();
159  }
160  else
161  {
162  Neltf = 4;
163  }
164 
165  switch (preamble)
166  {
167  case WIFI_PREAMBLE_HT_MF:
168  return MicroSeconds (4 + (4 * Ndltf) + (4 * Neltf));
169  case WIFI_PREAMBLE_HT_GF:
170  return MicroSeconds ((4 * Ndltf) + (4 * Neltf));
171  case WIFI_PREAMBLE_VHT:
172  return MicroSeconds (4 + (4 * Ndltf));
173  default:
174  //no training for non HT
175  return MicroSeconds (0);
176  }
177 }
178 
179 Time
181 {
182  switch (preamble)
183  {
184  case WIFI_PREAMBLE_HT_MF:
185  case WIFI_PREAMBLE_HT_GF:
186  //HT-SIG
187  return MicroSeconds (8);
188  default:
189  //no HT-SIG for non HT
190  return MicroSeconds (0);
191  }
192 }
193 
194 Time
196 {
197  switch (preamble)
198  {
199  case WIFI_PREAMBLE_VHT:
200  //VHT-SIG-A1
201  return MicroSeconds (4);
202  default:
203  // no VHT-SIG-A1 for non VHT
204  return MicroSeconds (0);
205  }
206 }
207 
208 Time
210 {
211  switch (preamble)
212  {
213  case WIFI_PREAMBLE_VHT:
214  //VHT-SIG-A2
215  return MicroSeconds (4);
216  default:
217  // no VHT-SIG-A2 for non VHT
218  return MicroSeconds (0);
219  }
220 }
221 
222 Time
224 {
225  switch (preamble)
226  {
227  case WIFI_PREAMBLE_VHT:
228  //VHT-SIG-B
229  return MicroSeconds (4);
230  default:
231  // no VHT-SIG-B for non VHT
232  return MicroSeconds (0);
233  }
234 }
235 
236 WifiMode
238 {
239  switch (payloadMode.GetModulationClass ())
240  {
241  case WIFI_MOD_CLASS_OFDM:
242  case WIFI_MOD_CLASS_HT:
243  case WIFI_MOD_CLASS_VHT:
244  switch (txVector.GetChannelWidth ())
245  {
246  case 5000000:
248  case 10000000:
250  case 20000000:
251  case 40000000:
252  case 80000000:
253  case 160000000:
254  default:
255  //(Section 18.3.2 "PLCP frame format"; IEEE Std 802.11-2012)
256  //actually this is only the first part of the PlcpHeader,
257  //because the last 16 bits of the PlcpHeader are using the
258  //same mode of the payload
259  return WifiPhy::GetOfdmRate6Mbps ();
260  }
263  case WIFI_MOD_CLASS_DSSS:
265  if (preamble == WIFI_PREAMBLE_LONG)
266  {
267  //(Section 16.2.3 "PLCP field definitions" and Section 17.2.2.2 "Long PPDU format"; IEEE Std 802.11-2012)
268  return WifiPhy::GetDsssRate1Mbps ();
269  }
270  else //WIFI_PREAMBLE_SHORT
271  {
272  //(Section 17.2.2.3 "Short PPDU format"; IEEE Std 802.11-2012)
273  return WifiPhy::GetDsssRate2Mbps ();
274  }
275  default:
276  NS_FATAL_ERROR ("unsupported modulation class");
277  return WifiMode ();
278  }
279 }
280 
281 Time
283 {
284  if (preamble == WIFI_PREAMBLE_NONE)
285  {
286  return MicroSeconds (0);
287  }
288  switch (txVector.GetMode ().GetModulationClass ())
289  {
290  case WIFI_MOD_CLASS_OFDM:
291  {
292  switch (txVector.GetChannelWidth ())
293  {
294  case 20000000:
295  default:
296  //(Section 18.3.3 "PLCP preamble (SYNC))" and Figure 18-4 "OFDM training structure"; IEEE Std 802.11-2012)
297  //also (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
298  //We return the duration of the SIGNAL field only, since the
299  //SERVICE field (which strictly speaking belongs to the PLCP
300  //header, see Section 18.3.2 and Figure 18-1) is sent using the
301  //payload mode.
302  return MicroSeconds (4);
303  case 10000000:
304  //(Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
305  return MicroSeconds (8);
306  case 5000000:
307  //(Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
308  return MicroSeconds (16);
309  }
310  }
311  case WIFI_MOD_CLASS_HT:
312  {
313  //L-SIG
314  //IEEE 802.11n Figure 20.1
315  switch (preamble)
316  {
317  case WIFI_PREAMBLE_HT_MF:
318  default:
319  return MicroSeconds (4);
320  case WIFI_PREAMBLE_HT_GF:
321  return MicroSeconds (0);
322  }
323  }
324  case WIFI_MOD_CLASS_VHT:
326  return MicroSeconds (4);
327  case WIFI_MOD_CLASS_DSSS:
329  if (preamble == WIFI_PREAMBLE_SHORT)
330  {
331  //(Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
332  return MicroSeconds (24);
333  }
334  else //WIFI_PREAMBLE_LONG
335  {
336  //(Section 17.2.2.2 "Long PPDU format" and Figure 17-1 "Short PPDU format"; IEEE Std 802.11-2012)
337  return MicroSeconds (48);
338  }
339  default:
340  NS_FATAL_ERROR ("unsupported modulation class");
341  return MicroSeconds (0);
342  }
343 }
344 
345 Time
347 {
348  if (preamble == WIFI_PREAMBLE_NONE)
349  {
350  return MicroSeconds (0);
351  }
352  switch (txVector.GetMode ().GetModulationClass ())
353  {
354  case WIFI_MOD_CLASS_OFDM:
355  {
356  switch (txVector.GetChannelWidth ())
357  {
358  case 20000000:
359  default:
360  //(Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
361  //also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
362  return MicroSeconds (16);
363  case 10000000:
364  //(Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
365  //also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
366  return MicroSeconds (32);
367  case 5000000:
368  //(Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
369  //also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
370  return MicroSeconds (64);
371  }
372  }
373  case WIFI_MOD_CLASS_VHT:
374  case WIFI_MOD_CLASS_HT:
375  //IEEE 802.11n Figure 20.1 the training symbols before L_SIG or HT_SIG
376  return MicroSeconds (16);
378  return MicroSeconds (16);
379  case WIFI_MOD_CLASS_DSSS:
381  if (preamble == WIFI_PREAMBLE_SHORT)
382  {
383  //(Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
384  return MicroSeconds (72);
385  }
386  else //WIFI_PREAMBLE_LONG
387  {
388  //(Section 17.2.2.2 "Long PPDU format)" Figure 17-1 "Long PPDU format"; IEEE Std 802.11-2012)
389  return MicroSeconds (144);
390  }
391  default:
392  NS_FATAL_ERROR ("unsupported modulation class");
393  return MicroSeconds (0);
394  }
395 }
396 
397 Time
398 WifiPhy::GetPayloadDuration (uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
399 {
400  WifiMode payloadMode = txVector.GetMode ();
401  NS_LOG_FUNCTION (size << payloadMode);
402 
403  switch (payloadMode.GetModulationClass ())
404  {
405  case WIFI_MOD_CLASS_OFDM:
407  {
408  //(Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012
409  //corresponds to T_{SYM} in the table)
410  Time symbolDuration;
411 
412  switch (txVector.GetChannelWidth ())
413  {
414  case 20000000:
415  default:
416  symbolDuration = MicroSeconds (4);
417  break;
418  case 10000000:
419  symbolDuration = MicroSeconds (8);
420  break;
421  case 5000000:
422  symbolDuration = MicroSeconds (16);
423  break;
424  }
425 
426  //(Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
427  //corresponds to N_{DBPS} in the table
428  double numDataBitsPerSymbol = payloadMode.GetDataRate (txVector.GetChannelWidth (), 0, 1) * symbolDuration.GetNanoSeconds () / 1e9;
429  //(Section 18.3.5.4 "Pad bits (PAD)" Equation 18-11; IEEE Std 802.11-2012)
430  uint32_t numSymbols;
431 
432  if (packetType == 1 && preamble != WIFI_PREAMBLE_NONE)
433  {
434  //First packet in an A-MPDU
435  numSymbols = ceil ((16 + size * 8.0 + 6) / numDataBitsPerSymbol);
436  if (incFlag == 1)
437  {
438  m_totalAmpduSize += size;
439  m_totalAmpduNumSymbols += numSymbols;
440  }
441  }
442  else if (packetType == 1 && preamble == WIFI_PREAMBLE_NONE)
443  {
444  //consecutive packets in an A-MPDU
445  numSymbols = ((size * 8.0) / numDataBitsPerSymbol);
446  if (incFlag == 1)
447  {
448  m_totalAmpduSize += size;
449  m_totalAmpduNumSymbols += numSymbols;
450  }
451  }
452  else if (packetType == 2 && preamble == WIFI_PREAMBLE_NONE)
453  {
454  //last packet in an A-MPDU
455  uint32_t totalAmpduSize = m_totalAmpduSize + size;
456  numSymbols = lrint (ceil ((16 + totalAmpduSize * 8.0 + 6) / numDataBitsPerSymbol));
457  numSymbols -= m_totalAmpduNumSymbols;
458  if (incFlag == 1)
459  {
460  m_totalAmpduSize = 0;
462  }
463  }
464  else if (packetType == 0 && preamble != WIFI_PREAMBLE_NONE)
465  {
466  //Not an A-MPDU
467  numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0) / numDataBitsPerSymbol));
468  }
469  else
470  {
471  NS_FATAL_ERROR ("Wrong combination of preamble and packet type");
472  }
473 
474  //Add signal extension for ERP PHY
475  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
476  {
477  return Time (numSymbols * symbolDuration) + MicroSeconds (6);
478  }
479  else
480  {
481  return Time (numSymbols * symbolDuration);
482  }
483  }
484  case WIFI_MOD_CLASS_HT:
485  case WIFI_MOD_CLASS_VHT:
486  {
487  Time symbolDuration;
488  double m_Stbc;
489  //if short GI data rate is used then symbol duration is 3.6us else symbol duration is 4us
490  //In the future has to create a stationmanager that only uses these data rates if sender and reciever support GI
491  if (txVector.IsShortGuardInterval ())
492  {
493  symbolDuration = NanoSeconds (3600);
494  }
495  else
496  {
497  symbolDuration = MicroSeconds (4);
498  }
499 
500  if (txVector.IsStbc ())
501  {
502  m_Stbc = 2;
503  }
504  else
505  {
506  m_Stbc = 1;
507  }
508 
509  //check tables 20-35 and 20-36 in the .11n standard to get cases when nes = 2
510  //check tables 22-30 to 22-61 in the .11ac standard to get cases when nes > 1
511  double Nes;
512  if (txVector.GetChannelWidth () == 160
513  && (payloadMode.GetUniqueName () == "VhtMcs7" || payloadMode.GetUniqueName () == "VhtMcs8" || payloadMode.GetUniqueName () == "VhtMcs9"))
514  {
515  Nes = 2;
516  }
517  else
518  {
519  Nes = 1;
520  }
521 
522  //IEEE Std 802.11n, section 20.3.11, equation (20-32)
523  uint32_t numSymbols;
524  double numDataBitsPerSymbol = payloadMode.GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1) * txVector.GetNss () * symbolDuration.GetNanoSeconds () / 1e9;
525 
526  if (packetType == 1 && preamble != WIFI_PREAMBLE_NONE)
527  {
528  //First packet in an A-MPDU
529  numSymbols = ceil (m_Stbc * (16 + size * 8.0 + 6 * Nes) / (m_Stbc * numDataBitsPerSymbol));
530  if (incFlag == 1)
531  {
532  m_totalAmpduSize += size;
533  m_totalAmpduNumSymbols += numSymbols;
534  }
535  }
536  else if (packetType == 1 && preamble == WIFI_PREAMBLE_NONE)
537  {
538  //consecutive packets in an A-MPDU
539  numSymbols = m_Stbc * ((size * 8.0 ) / (m_Stbc * numDataBitsPerSymbol));
540  if (incFlag == 1)
541  {
542  m_totalAmpduSize += size;
543  m_totalAmpduNumSymbols += numSymbols;
544  }
545  }
546  else if (packetType == 2 && preamble == WIFI_PREAMBLE_NONE)
547  {
548  //last packet in an A-MPDU
549  uint32_t totalAmpduSize = m_totalAmpduSize + size;
550  numSymbols = lrint (m_Stbc * ceil ((16 + totalAmpduSize * 8.0 + 6 * Nes) / (m_Stbc * numDataBitsPerSymbol)));
551  NS_ASSERT (m_totalAmpduNumSymbols <= numSymbols);
552  numSymbols -= m_totalAmpduNumSymbols;
553  if (incFlag == 1)
554  {
555  m_totalAmpduSize = 0;
557  }
558  }
559  else if (packetType == 0 && preamble != WIFI_PREAMBLE_NONE)
560  {
561  //Not an A-MPDU
562  numSymbols = lrint (m_Stbc * ceil ((16 + size * 8.0 + 6.0 * Nes) / (m_Stbc * numDataBitsPerSymbol)));
563  }
564  else
565  {
566  NS_FATAL_ERROR ("Wrong combination of preamble and packet type");
567  }
568 
569  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_HT && frequency >= 2400 && frequency <= 2500 && ((packetType == 0 && preamble != WIFI_PREAMBLE_NONE) || (packetType == 2 && preamble == WIFI_PREAMBLE_NONE))) //at 2.4 GHz
570  {
571  return Time (numSymbols * symbolDuration) + MicroSeconds (6);
572  }
573  else //at 5 GHz
574  {
575  return Time (numSymbols * symbolDuration);
576  }
577  }
578  case WIFI_MOD_CLASS_DSSS:
580  //(Section 17.2.3.6 "Long PLCP LENGTH field"; IEEE Std 802.11-2012)
581  NS_LOG_LOGIC (" size=" << size
582  << " mode=" << payloadMode
583  << " rate=" << payloadMode.GetDataRate (22, 0, 1));
584  return MicroSeconds (lrint (ceil ((size * 8.0) / (payloadMode.GetDataRate (22, 0, 1) / 1.0e6))));
585  default:
586  NS_FATAL_ERROR ("unsupported modulation class");
587  return MicroSeconds (0);
588  }
589 }
590 
591 Time
593 {
594  Time duration = GetPlcpPreambleDuration (txVector, preamble)
595  + GetPlcpHeaderDuration (txVector, preamble)
596  + GetPlcpHtSigHeaderDuration (preamble)
597  + GetPlcpVhtSigA1Duration (preamble)
598  + GetPlcpVhtSigA2Duration (preamble)
599  + GetPlcpHtTrainingSymbolDuration (preamble, txVector)
600  + GetPlcpVhtSigBDuration (preamble);
601  return duration;
602 }
603 
604 Time
605 WifiPhy::CalculateTxDuration (uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
606 {
607  Time duration = CalculatePlcpPreambleAndHeaderDuration (txVector, preamble)
608  + GetPayloadDuration (size, txVector, preamble, frequency, packetType, incFlag);
609  return duration;
610 }
611 
612 void
614 {
615  m_phyTxBeginTrace (packet);
616 }
617 
618 void
620 {
621  m_phyTxEndTrace (packet);
622 }
623 
624 void
626 {
627  m_phyTxDropTrace (packet);
628 }
629 
630 void
632 {
633  m_phyRxBeginTrace (packet);
634 }
635 
636 void
638 {
639  m_phyRxEndTrace (packet);
640 }
641 
642 void
644 {
645  m_phyRxDropTrace (packet);
646 }
647 
648 void
649 WifiPhy::NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
650 {
651  m_phyMonitorSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, preamble, txVector, aMpdu, signalNoise);
652 }
653 
654 void
655 WifiPhy::NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
656 {
657  m_phyMonitorSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, preamble, txVector, aMpdu);
658 }
659 
660 
661 // Clause 15 rates (DSSS)
662 
663 WifiMode
665 {
666  static WifiMode mode =
667  WifiModeFactory::CreateWifiMode ("DsssRate1Mbps",
669  true,
671  2);
672  return mode;
673 }
674 
675 WifiMode
677 {
678  static WifiMode mode =
679  WifiModeFactory::CreateWifiMode ("DsssRate2Mbps",
681  true,
683  4);
684  return mode;
685 }
686 
687 
688 // Clause 18 rates (HR/DSSS)
689 
690 WifiMode
692 {
693  static WifiMode mode =
694  WifiModeFactory::CreateWifiMode ("DsssRate5_5Mbps",
696  true,
698  16);
699  return mode;
700 }
701 
702 WifiMode
704 {
705  static WifiMode mode =
706  WifiModeFactory::CreateWifiMode ("DsssRate11Mbps",
708  true,
710  256);
711  return mode;
712 }
713 
714 
715 // Clause 19.5 rates (ERP-OFDM)
716 
717 WifiMode
719 {
720  static WifiMode mode =
721  WifiModeFactory::CreateWifiMode ("ErpOfdmRate6Mbps",
723  true,
725  2);
726  return mode;
727 }
728 
729 WifiMode
731 {
732  static WifiMode mode =
733  WifiModeFactory::CreateWifiMode ("ErpOfdmRate9Mbps",
735  false,
737  2);
738  return mode;
739 }
740 
741 WifiMode
743 {
744  static WifiMode mode =
745  WifiModeFactory::CreateWifiMode ("ErpOfdmRate12Mbps",
747  true,
749  4);
750  return mode;
751 }
752 
753 WifiMode
755 {
756  static WifiMode mode =
757  WifiModeFactory::CreateWifiMode ("ErpOfdmRate18Mbps",
759  false,
761  4);
762  return mode;
763 }
764 
765 WifiMode
767 {
768  static WifiMode mode =
769  WifiModeFactory::CreateWifiMode ("ErpOfdmRate24Mbps",
771  true,
773  16);
774  return mode;
775 }
776 
777 WifiMode
779 {
780  static WifiMode mode =
781  WifiModeFactory::CreateWifiMode ("ErpOfdmRate36Mbps",
783  false,
785  16);
786  return mode;
787 }
788 
789 WifiMode
791 {
792  static WifiMode mode =
793  WifiModeFactory::CreateWifiMode ("ErpOfdmRate48Mbps",
795  false,
797  64);
798  return mode;
799 }
800 
801 WifiMode
803 {
804  static WifiMode mode =
805  WifiModeFactory::CreateWifiMode ("ErpOfdmRate54Mbps",
807  false,
809  64);
810  return mode;
811 }
812 
813 
814 // Clause 17 rates (OFDM)
815 
816 WifiMode
818 {
819  static WifiMode mode =
820  WifiModeFactory::CreateWifiMode ("OfdmRate6Mbps",
822  true,
824  2);
825  return mode;
826 }
827 
828 WifiMode
830 {
831  static WifiMode mode =
832  WifiModeFactory::CreateWifiMode ("OfdmRate9Mbps",
834  false,
836  2);
837  return mode;
838 }
839 
840 WifiMode
842 {
843  static WifiMode mode =
844  WifiModeFactory::CreateWifiMode ("OfdmRate12Mbps",
846  true,
848  4);
849  return mode;
850 }
851 
852 WifiMode
854 {
855  static WifiMode mode =
856  WifiModeFactory::CreateWifiMode ("OfdmRate18Mbps",
858  false,
860  4);
861  return mode;
862 }
863 
864 WifiMode
866 {
867  static WifiMode mode =
868  WifiModeFactory::CreateWifiMode ("OfdmRate24Mbps",
870  true,
872  16);
873  return mode;
874 }
875 
876 WifiMode
878 {
879  static WifiMode mode =
880  WifiModeFactory::CreateWifiMode ("OfdmRate36Mbps",
882  false,
884  16);
885  return mode;
886 }
887 
888 WifiMode
890 {
891  static WifiMode mode =
892  WifiModeFactory::CreateWifiMode ("OfdmRate48Mbps",
894  false,
896  64);
897  return mode;
898 }
899 
900 WifiMode
902 {
903  static WifiMode mode =
904  WifiModeFactory::CreateWifiMode ("OfdmRate54Mbps",
906  false,
908  64);
909  return mode;
910 }
911 
912 
913 // 10 MHz channel rates
914 
915 WifiMode
917 {
918  static WifiMode mode =
919  WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW10MHz",
921  true,
923  2);
924  return mode;
925 }
926 
927 WifiMode
929 {
930  static WifiMode mode =
931  WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW10MHz",
933  false,
935  2);
936  return mode;
937 }
938 
939 WifiMode
941 {
942  static WifiMode mode =
943  WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW10MHz",
945  true,
947  4);
948  return mode;
949 }
950 
951 WifiMode
953 {
954  static WifiMode mode =
955  WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW10MHz",
957  false,
959  4);
960  return mode;
961 }
962 
963 WifiMode
965 {
966  static WifiMode mode =
967  WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW10MHz",
969  true,
971  16);
972  return mode;
973 }
974 
975 WifiMode
977 {
978  static WifiMode mode =
979  WifiModeFactory::CreateWifiMode ("OfdmRate18MbpsBW10MHz",
981  false,
983  16);
984  return mode;
985 }
986 
987 WifiMode
989 {
990  static WifiMode mode =
991  WifiModeFactory::CreateWifiMode ("OfdmRate24MbpsBW10MHz",
993  false,
995  64);
996  return mode;
997 }
998 
999 WifiMode
1001 {
1002  static WifiMode mode =
1003  WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW10MHz",
1005  false,
1007  64);
1008  return mode;
1009 }
1010 
1011 
1012 // 5 MHz channel rates
1013 
1014 WifiMode
1016 {
1017  static WifiMode mode =
1018  WifiModeFactory::CreateWifiMode ("OfdmRate1_5MbpsBW5MHz",
1020  true,
1022  2);
1023  return mode;
1024 }
1025 
1026 WifiMode
1028 {
1029  static WifiMode mode =
1030  WifiModeFactory::CreateWifiMode ("OfdmRate2_25MbpsBW5MHz",
1032  false,
1034  2);
1035  return mode;
1036 }
1037 
1038 WifiMode
1040 {
1041  static WifiMode mode =
1042  WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW5MHz",
1044  true,
1046  4);
1047  return mode;
1048 }
1049 
1050 WifiMode
1052 {
1053  static WifiMode mode =
1054  WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW5MHz",
1056  false,
1058  4);
1059  return mode;
1060 }
1061 
1062 WifiMode
1064 {
1065  static WifiMode mode =
1066  WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW5MHz",
1068  true,
1070  16);
1071  return mode;
1072 }
1073 
1074 WifiMode
1076 {
1077  static WifiMode mode =
1078  WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW5MHz",
1080  false,
1082  16);
1083  return mode;
1084 }
1085 
1086 WifiMode
1088 {
1089  static WifiMode mode =
1090  WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW5MHz",
1092  false,
1094  64);
1095  return mode;
1096 }
1097 
1098 WifiMode
1100 {
1101  static WifiMode mode =
1102  WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW5MHz",
1104  false,
1106  64);
1107  return mode;
1108 }
1109 
1110 
1111 // Clause 20
1112 
1113 WifiMode
1115 {
1116  static WifiMode mcs =
1118  return mcs;
1119 }
1120 
1121 WifiMode
1123 {
1124  static WifiMode mcs =
1126  return mcs;
1127 }
1128 
1129 WifiMode
1131 {
1132  static WifiMode mcs =
1134  return mcs;
1135 }
1136 
1137 WifiMode
1139 {
1140  static WifiMode mcs =
1142  return mcs;
1143 }
1144 
1145 WifiMode
1147 {
1148  static WifiMode mcs =
1150  return mcs;
1151 }
1152 
1153 WifiMode
1155 {
1156  static WifiMode mcs =
1158  return mcs;
1159 }
1160 
1161 WifiMode
1163 {
1164  static WifiMode mcs =
1166  return mcs;
1167 }
1168 
1169 WifiMode
1171 {
1172  static WifiMode mcs =
1174  return mcs;
1175 }
1176 
1177 WifiMode
1179 {
1180  static WifiMode mcs =
1182  return mcs;
1183 }
1184 
1185 WifiMode
1187 {
1188  static WifiMode mcs =
1190  return mcs;
1191 }
1192 
1193 WifiMode
1195 {
1196  static WifiMode mcs =
1198  return mcs;
1199 }
1200 
1201 WifiMode
1203 {
1204  static WifiMode mcs =
1206  return mcs;
1207 }
1208 
1209 WifiMode
1211 {
1212  static WifiMode mcs =
1214  return mcs;
1215 }
1216 
1217 WifiMode
1219 {
1220  static WifiMode mcs =
1222  return mcs;
1223 }
1224 
1225 WifiMode
1227 {
1228  static WifiMode mcs =
1230  return mcs;
1231 }
1232 
1233 WifiMode
1235 {
1236  static WifiMode mcs =
1238  return mcs;
1239 }
1240 
1241 WifiMode
1243 {
1244  static WifiMode mcs =
1246  return mcs;
1247 }
1248 
1249 WifiMode
1251 {
1252  static WifiMode mcs =
1254  return mcs;
1255 }
1256 
1257 WifiMode
1259 {
1260  static WifiMode mcs =
1262  return mcs;
1263 }
1264 
1265 WifiMode
1267 {
1268  static WifiMode mcs =
1270  return mcs;
1271 }
1272 
1273 WifiMode
1275 {
1276  static WifiMode mcs =
1278  return mcs;
1279 }
1280 
1281 WifiMode
1283 {
1284  static WifiMode mcs =
1286  return mcs;
1287 }
1288 
1289 WifiMode
1291 {
1292  static WifiMode mcs =
1294  return mcs;
1295 }
1296 
1297 WifiMode
1299 {
1300  static WifiMode mcs =
1302  return mcs;
1303 }
1304 
1305 WifiMode
1307 {
1308  static WifiMode mcs =
1310  return mcs;
1311 }
1312 
1313 WifiMode
1315 {
1316  static WifiMode mcs =
1318  return mcs;
1319 }
1320 
1321 WifiMode
1323 {
1324  static WifiMode mcs =
1326  return mcs;
1327 }
1328 
1329 WifiMode
1331 {
1332  static WifiMode mcs =
1334  return mcs;
1335 }
1336 
1337 WifiMode
1339 {
1340  static WifiMode mcs =
1342  return mcs;
1343 }
1344 
1345 WifiMode
1347 {
1348  static WifiMode mcs =
1350  return mcs;
1351 }
1352 
1353 WifiMode
1355 {
1356  static WifiMode mcs =
1358  return mcs;
1359 }
1360 
1361 WifiMode
1363 {
1364  static WifiMode mcs =
1366  return mcs;
1367 }
1368 
1369 
1370 // Clause 22
1371 
1372 WifiMode
1374 {
1375  static WifiMode mcs =
1377  return mcs;
1378 }
1379 
1380 WifiMode
1382 {
1383  static WifiMode mcs =
1385  return mcs;
1386 }
1387 
1388 WifiMode
1390 {
1391  static WifiMode mcs =
1393  return mcs;
1394 }
1395 
1396 WifiMode
1398 {
1399  static WifiMode mcs =
1401  return mcs;
1402 }
1403 
1404 WifiMode
1406 {
1407  static WifiMode mcs =
1409  return mcs;
1410 }
1411 
1412 WifiMode
1414 {
1415  static WifiMode mcs =
1417  return mcs;
1418 }
1419 
1420 WifiMode
1422 {
1423  static WifiMode mcs =
1425  return mcs;
1426 }
1427 
1428 WifiMode
1430 {
1431  static WifiMode mcs =
1433  return mcs;
1434 }
1435 
1436 WifiMode
1438 {
1439  static WifiMode mcs =
1441  return mcs;
1442 }
1443 
1444 WifiMode
1446 {
1447  static WifiMode mcs =
1449  return mcs;
1450 }
1451 
1452 std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state)
1453 {
1454  switch (state)
1455  {
1456  case WifiPhy::IDLE:
1457  return (os << "IDLE");
1458  case WifiPhy::CCA_BUSY:
1459  return (os << "CCA_BUSY");
1460  case WifiPhy::TX:
1461  return (os << "TX");
1462  case WifiPhy::RX:
1463  return (os << "RX");
1464  case WifiPhy::SWITCHING:
1465  return (os << "SWITCHING");
1466  case WifiPhy::SLEEP:
1467  return (os << "SLEEP");
1468  default:
1469  NS_FATAL_ERROR ("Invalid WifiPhy state");
1470  return (os << "INVALID");
1471  }
1472 }
1473 
1474 } //namespace ns3
1475 
1476 namespace {
1477 
1478 static class Constructor
1479 {
1480 public:
1482  {
1561  }
1562 } g_constructor;
1563 
1564 }
static class anonymous_namespace{wifi-phy.cc}::Constructor g_constructor
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:1421
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1075
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1263
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:766
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:703
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:778
void NotifyMonitorSniffTx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
Definition: wifi-phy.cc:655
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:1437
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:56
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:829
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:976
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:1000
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1039
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:1373
virtual ~WifiPhy()
Definition: wifi-phy.cc:116
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:664
802.11 PHY layer model
Definition: wifi-phy.h:138
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:754
The PHY layer has sense the medium busy through the CCA mechanism.
Definition: wifi-phy.h:153
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Definition: wifi-phy.cc:1170
static WifiMode GetHtPlcpHeaderMode(WifiMode payloadMode)
Definition: wifi-phy.cc:122
Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:398
static Time GetPlcpHtSigHeaderDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:180
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
Definition: wifi-phy.cc:1413
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:1290
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:1226
uint32_t m_totalAmpduNumSymbols
Number of symbols previously transmitted for the MPDUs in an A-MPDU, used for the computation of the ...
Definition: wifi-phy.h:1312
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:841
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1271
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:375
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
Definition: wifi-phy.cc:1362
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:1282
#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
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:1354
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:1194
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:1322
bool IsShortGuardInterval(void) const
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1015
The PHY layer is sleeping.
Definition: wifi-phy.h:169
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
Definition: wifi-phy.cc:1250
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:1306
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:928
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:901
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:145
void(* Time)(Time oldValue, Time newValue)
TracedValue callback signature for Time.
Definition: nstime.h:719
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:625
VHT PHY (Clause 22)
Definition: wifi-mode.h:62
HR/DSSS PHY (Clause 18)
Definition: wifi-mode.h:50
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:1178
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:1258
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:613
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:1405
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:1330
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:877
static WifiMode CreateWifiMcs(std::string uniqueName, uint8_t mcsValue, enum WifiModulationClass modClass)
Definition: wifi-mode.cc:441
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:1429
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1063
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:1397
void NotifyMonitorSniffRx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
Public method used to fire a MonitorSniffer trace for a wifi packet being received.
Definition: wifi-phy.cc:649
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
static WifiMode GetVhtPlcpHeaderMode(WifiMode payloadMode)
Definition: wifi-phy.cc:128
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
Definition: wifi-phy.cc:1242
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:802
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:1346
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:1202
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:643
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo, struct signalNoiseDbm > m_phyMonitorSniffRxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being received...
Definition: wifi-phy.h:1294
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
Definition: wifi-phy.cc:1130
Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector, enum WifiPreamble preamble)
Definition: wifi-phy.cc:592
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:919
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
The trace source fired when the phy layer drops a packet as it tries to transmit it.
Definition: wifi-phy.h:1255
static WifiMode GetPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble, WifiTxVector txVector)
Definition: wifi-phy.cc:237
The PHY layer is IDLE.
Definition: wifi-phy.h:149
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Definition: wifi-phy.cc:1210
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:790
uint8_t GetNess(void) const
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:964
uint32_t GetChannelWidth(void) const
HT PHY (Clause 20)
Definition: wifi-mode.h:60
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:338
The PHY layer is receiving a packet.
Definition: wifi-phy.h:161
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
Definition: wifi-phy.h:1278
virtual ~WifiPhyListener()
Definition: wifi-phy.cc:44
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:631
The PHY layer is sending a packet.
Definition: wifi-phy.h:157
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:853
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:952
bool IsStbc(void) const
Check if STBC is used or not.
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1087
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:252
The PHY layer is switching to other channel.
Definition: wifi-phy.h:165
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Definition: wifi-phy.h:1239
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
Definition: wifi-phy.cc:1381
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:889
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:1114
static TypeId GetTypeId(void)
Definition: wifi-phy.cc:55
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo > m_phyMonitorSniffTxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being transmitted...
Definition: wifi-phy.h:1310
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:865
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
Definition: wifi-phy.cc:1218
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
Definition: wifi-phy.cc:1274
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:1154
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
Definition: wifi-mode.cc:100
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
Definition: wifi-phy.cc:1389
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:691
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:605
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1027
static Time GetPlcpVhtSigA1Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:195
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:730
void NotifyTxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:619
static WifiMode CreateWifiMode(std::string uniqueName, enum WifiModulationClass modClass, bool isMandatory, enum WifiCodeRate codingRate, uint16_t constellationSize)
Definition: wifi-mode.cc:403
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:353
No explicit coding (e.g., DSSS rates)
Definition: wifi-mode.h:75
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:718
uint8_t GetNss(void) const
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:742
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:637
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:1266
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:1162
OFDM PHY (Clause 17)
Definition: wifi-mode.h:58
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:1338
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:1186
static Time GetPlcpHeaderDuration(WifiTxVector txVector, WifiPreamble preamble)
Definition: wifi-phy.cc:282
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
Definition: wifi-phy.cc:1146
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:1314
uint32_t m_totalAmpduSize
Total size of the previously transmitted MPDUs in an A-MPDU, used for the computation of the number o...
Definition: wifi-phy.h:1313
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:911
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:1122
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:1298
A base class which provides memory management and object aggregation.
Definition: object.h:87
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
Definition: wifi-phy.cc:676
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:1445
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:940
WifiMode GetMode(void) const
State
The state of the PHY layer.
Definition: wifi-phy.h:144
static Time GetPlcpHtTrainingSymbolDuration(WifiPreamble preamble, WifiTxVector txVector)
Definition: wifi-phy.cc:134
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:988
static Time GetPlcpVhtSigBDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:223
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1099
a unique identifier for an interface.
Definition: type-id.h:58
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
Definition: wifi-phy.cc:1234
static Time GetPlcpPreambleDuration(WifiTxVector txVector, WifiPreamble preamble)
Definition: wifi-phy.cc:346
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:826
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:1138
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:817
DSSS PHY (Clause 15)
Definition: wifi-mode.h:48
static Time GetPlcpVhtSigA2Duration(WifiPreamble preamble)
Definition: wifi-phy.cc:209
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1051
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:916
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1247