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  * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 
21 #include "wifi-phy.h"
22 #include "wifi-mode.h"
23 #include "wifi-channel.h"
24 #include "wifi-preamble.h"
25 #include "ns3/simulator.h"
26 #include "ns3/packet.h"
27 #include "ns3/assert.h"
28 #include "ns3/log.h"
29 #include "ns3/double.h"
30 #include "ns3/uinteger.h"
31 #include "ns3/enum.h"
32 #include "ns3/trace-source-accessor.h"
33 #include <cmath>
34 
35 namespace ns3 {
36 
37 NS_LOG_COMPONENT_DEFINE ("WifiPhy");
38 
39 /****************************************************************
40  * This destructor is needed.
41  ****************************************************************/
42 
44 {
45 }
46 
47 /****************************************************************
48  * The actual WifiPhy class
49  ****************************************************************/
50 
52 
53 TypeId
55 {
56  static TypeId tid = TypeId ("ns3::WifiPhy")
57  .SetParent<Object> ()
58  .AddTraceSource ("PhyTxBegin",
59  "Trace source indicating a packet "
60  "has begun transmitting over the channel medium",
62  "ns3::Packet::TracedCallback")
63  .AddTraceSource ("PhyTxEnd",
64  "Trace source indicating a packet "
65  "has been completely transmitted over the channel. "
66  "NOTE: the only official WifiPhy implementation "
67  "available to this date (YansWifiPhy) never fires "
68  "this trace source.",
70  "ns3::Packet::TracedCallback")
71  .AddTraceSource ("PhyTxDrop",
72  "Trace source indicating a packet "
73  "has been dropped by the device during transmission",
75  "ns3::Packet::TracedCallback")
76  .AddTraceSource ("PhyRxBegin",
77  "Trace source indicating a packet "
78  "has begun being received from the channel medium "
79  "by the device",
81  "ns3::Packet::TracedCallback")
82  .AddTraceSource ("PhyRxEnd",
83  "Trace source indicating a packet "
84  "has been completely received from the channel medium "
85  "by the device",
87  "ns3::Packet::TracedCallback")
88  .AddTraceSource ("PhyRxDrop",
89  "Trace source indicating a packet "
90  "has been dropped by the device during reception",
92  "ns3::Packet::TracedCallback")
93  .AddTraceSource ("MonitorSnifferRx",
94  "Trace source simulating a wifi device in monitor mode "
95  "sniffing all received frames",
97  "ns3::WifiPhy::MonitorSnifferRxCallback")
98  .AddTraceSource ("MonitorSnifferTx",
99  "Trace source simulating the capability of a wifi device "
100  "in monitor mode to sniff all frames being transmitted",
102  "ns3::WifiPhy::MonitorSnifferTxCallback")
103  ;
104  return tid;
105 }
106 
108 {
109  NS_LOG_FUNCTION (this);
110  m_totalAmpduSize = 0;
112 }
113 
115 {
116  NS_LOG_FUNCTION (this);
117 }
118 
119 //return the L-SIG
120 WifiMode
122 {
123  switch (payloadMode.GetBandwidth ())
124  {
125  case 20000000:
127  case 40000000:
129  default:
131  }
132 }
133 
134 Time
136 {
137  uint8_t Ndltf, Neltf;
138 
139  //We suppose here that STBC = 0.
140  //If STBC > 0, we need a different mapping between Nss and Nltf (IEEE 802.11n-2012 standard, page 1682).
141  if (txvector.GetNss () < 3)
142  {
143  Ndltf = txvector.GetNss();
144  }
145  else
146  {
147  Ndltf = 4;
148  }
149  if (txvector.GetNess () < 3)
150  {
151  Neltf = txvector.GetNess();
152  }
153  else
154  {
155  Neltf = 4;
156  }
157 
158  switch (preamble)
159  {
160  case WIFI_PREAMBLE_HT_MF:
161  return MicroSeconds(4 + (4 * Ndltf) + (4 * Neltf));
162  case WIFI_PREAMBLE_HT_GF:
163  return MicroSeconds((4 * Ndltf) + (4 * Neltf));
164  default:
165  // no training for non HT
166  return MicroSeconds(0);
167  }
168 }
169 
170 //return L-SIG
171 Time
173 {
174  switch (preamble)
175  {
176  case WIFI_PREAMBLE_HT_MF:
177  // HT-SIG
178  return MicroSeconds(8);
179  case WIFI_PREAMBLE_HT_GF:
180  //HT-SIG
181  return MicroSeconds(8);
182  default:
183  // no HT-SIG for non HT
184  return MicroSeconds(0);
185  }
186 }
187 
188 WifiMode
190 {
191  switch (payloadMode.GetModulationClass ())
192  {
193  case WIFI_MOD_CLASS_OFDM:
194  {
195  switch (payloadMode.GetBandwidth ())
196  {
197  case 5000000:
199  case 10000000:
201  default:
202  // (Section 18.3.2 "PLCP frame format"; IEEE Std 802.11-2012)
203  // actually this is only the first part of the PlcpHeader,
204  // because the last 16 bits of the PlcpHeader are using the
205  // same mode of the payload
206  return WifiPhy::GetOfdmRate6Mbps ();
207  }
208  }
209  //Added by Ghada to support 11n
210  case WIFI_MOD_CLASS_HT:
211  { //return the HT-SIG
212  // IEEE Std 802.11n, 20.3.23
213  switch (preamble)
214  {
215  case WIFI_PREAMBLE_HT_MF:
216  switch (payloadMode.GetBandwidth ())
217  {
218  case 20000000:
220  case 40000000:
222  default:
224  }
225  case WIFI_PREAMBLE_HT_GF:
226  switch (payloadMode.GetBandwidth ())
227  {
228  case 20000000:
230  case 40000000:
232  default:
234  }
235  default:
236  return WifiPhy::GetOfdmRate6Mbps ();
237  }
238  }
241 
242  case WIFI_MOD_CLASS_DSSS:
243  if (preamble == WIFI_PREAMBLE_LONG)
244  {
245  // (Section 16.2.3 "PLCP field definitions" and Section 17.2.2.2 "Long PPDU format"; IEEE Std 802.11-2012)
246  return WifiPhy::GetDsssRate1Mbps ();
247  }
248  else // WIFI_PREAMBLE_SHORT
249  {
250  // (Section 17.2.2.3 "Short PPDU format"; IEEE Std 802.11-2012)
251  return WifiPhy::GetDsssRate2Mbps ();
252  }
253 
254  default:
255  NS_FATAL_ERROR ("unsupported modulation class");
256  return WifiMode ();
257  }
258 }
259 
260 
261 Time
263 {
264  if (preamble == WIFI_PREAMBLE_NONE)
265  {
266  return MicroSeconds(0);
267  }
268  switch (payloadMode.GetModulationClass ())
269  {
270  case WIFI_MOD_CLASS_OFDM:
271  {
272  switch (payloadMode.GetBandwidth ())
273  {
274  case 20000000:
275  default:
276  // (Section 18.3.3 "PLCP preamble (SYNC))" and Figure 18-4 "OFDM training structure"; IEEE Std 802.11-2012)
277  // also (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
278  // We return the duration of the SIGNAL field only, since the
279  // SERVICE field (which strictly speaking belongs to the PLCP
280  // header, see Section 18.3.2 and Figure 18-1) is sent using the
281  // payload mode.
282  return MicroSeconds(4);
283  case 10000000:
284  // (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
285  return MicroSeconds(8);
286  case 5000000:
287  // (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
288  return MicroSeconds(16);
289  }
290  }
291  //Added by Ghada to support 11n
292  case WIFI_MOD_CLASS_HT:
293  { //IEEE 802.11n Figure 20.1
294  switch (preamble)
295  {
296  case WIFI_PREAMBLE_HT_MF:
297  // L-SIG
298  return MicroSeconds(4);
299  case WIFI_PREAMBLE_HT_GF:
300  //L-SIG
301  return MicroSeconds(0);
302  default:
303  // L-SIG
304  return MicroSeconds(4);
305  }
306  }
308  return MicroSeconds(4);
309 
310  case WIFI_MOD_CLASS_DSSS:
311  if (preamble == WIFI_PREAMBLE_SHORT)
312  {
313  // (Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
314  return MicroSeconds(24);
315  }
316  else // WIFI_PREAMBLE_LONG
317  {
318  // (Section 17.2.2.2 "Long PPDU format" and Figure 17-1 "Short PPDU format"; IEEE Std 802.11-2012)
319  return MicroSeconds(48);
320  }
321 
322  default:
323  NS_FATAL_ERROR ("unsupported modulation class");
324  return MicroSeconds(0);
325  }
326 }
327 
328 Time
330 {
331  if (preamble == WIFI_PREAMBLE_NONE)
332  {
333  return MicroSeconds(0);
334  }
335  switch (payloadMode.GetModulationClass ())
336  {
337  case WIFI_MOD_CLASS_OFDM:
338  {
339  switch (payloadMode.GetBandwidth ())
340  {
341  case 20000000:
342  default:
343  // (Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
344  // also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
345  return MicroSeconds(16);
346  case 10000000:
347  // (Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
348  // also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
349  return MicroSeconds(32);
350  case 5000000:
351  // (Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
352  // also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
353  return MicroSeconds(64);
354  }
355  }
356  case WIFI_MOD_CLASS_HT:
357  {
358  //IEEE 802.11n Figure 20.1 the training symbols before L_SIG or HT_SIG
359  return MicroSeconds(16);
360  }
362  return MicroSeconds(16);
363 
364  case WIFI_MOD_CLASS_DSSS:
365  if (preamble == WIFI_PREAMBLE_SHORT)
366  {
367  // (Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
368  return MicroSeconds(72);
369  }
370  else // WIFI_PREAMBLE_LONG
371  {
372  // (Section 17.2.2.2 "Long PPDU format)" Figure 17-1 "Long PPDU format"; IEEE Std 802.11-2012)
373  return MicroSeconds(144);
374  }
375  default:
376  NS_FATAL_ERROR ("unsupported modulation class");
377  return MicroSeconds(0);
378  }
379 }
380 
381 Time
382 WifiPhy::GetPayloadDuration (uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
383 {
384  WifiMode payloadMode=txvector.GetMode();
385 
386  NS_LOG_FUNCTION (size << payloadMode);
387 
388  switch (payloadMode.GetModulationClass ())
389  {
390  case WIFI_MOD_CLASS_OFDM:
392  {
393  // (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012
394  // corresponds to T_{SYM} in the table)
395  Time symbolDuration;
396 
397  switch (payloadMode.GetBandwidth ())
398  {
399  case 20000000:
400  default:
401  symbolDuration = MicroSeconds(4);
402  break;
403  case 10000000:
404  symbolDuration = MicroSeconds(8);
405  break;
406  case 5000000:
407  symbolDuration = MicroSeconds(16);
408  break;
409  }
410 
411  // (Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
412  // corresponds to N_{DBPS} in the table
413  double numDataBitsPerSymbol = payloadMode.GetDataRate () * symbolDuration.GetNanoSeconds() / 1e9;
414 
415  // (Section 18.3.5.4 "Pad bits (PAD)" Equation 18-11; IEEE Std 802.11-2012)
416  uint32_t numSymbols;
417 
418  if (packetType == 1 && preamble != WIFI_PREAMBLE_NONE)
419  {
420  //First packet in an A-MPDU
421  numSymbols= ceil((16 + size * 8.0 + 6) / (numDataBitsPerSymbol));
422  if (incFlag == 1)
423  {
424  m_totalAmpduSize += size;
425  m_totalAmpduNumSymbols += numSymbols;
426  }
427  }
428  else if (packetType == 1 && preamble == WIFI_PREAMBLE_NONE)
429  {
430  //consecutive packets in an A-MPDU
431  numSymbols= ((size * 8.0) / (numDataBitsPerSymbol));
432  if (incFlag == 1)
433  {
434  m_totalAmpduSize += size;
435  m_totalAmpduNumSymbols += numSymbols;
436  }
437  }
438  else if (packetType == 2 && preamble == WIFI_PREAMBLE_NONE)
439  {
440  //last packet in an A-MPDU
441  uint32_t totalAmpduSize = m_totalAmpduSize + size;
442  numSymbols = lrint (ceil((16 + totalAmpduSize * 8.0 + 6) / (numDataBitsPerSymbol)));
443  numSymbols -= m_totalAmpduNumSymbols;
444  if (incFlag == 1)
445  {
446  m_totalAmpduSize = 0;
448  }
449  }
450  else if (packetType == 0 && preamble != WIFI_PREAMBLE_NONE)
451  {
452  //Not an A-MPDU
453  numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0) / (numDataBitsPerSymbol)));
454  }
455  else
456  NS_FATAL_ERROR ("Wrong combination of preamble and packet type");
457 
458  // Add signal extension for ERP PHY
459  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
460  {
461  return Time (numSymbols * symbolDuration) + MicroSeconds(6);
462  }
463  else
464  {
465  return Time (numSymbols * symbolDuration);
466  }
467  }
468  case WIFI_MOD_CLASS_HT:
469  {
470  Time symbolDuration;
471  double m_Stbc;
472  //if short GI data rate is used then symbol duration is 3.6us else symbol duration is 4us
473  //In the future has to create a stationmanager that only uses these data rates if sender and reciever support GI
474  if (payloadMode.GetUniqueName() == "OfdmRate135MbpsBW40MHzShGi" || payloadMode.GetUniqueName() == "OfdmRate65MbpsBW20MHzShGi" )
475  {
476  symbolDuration = NanoSeconds(3600);
477  }
478  else
479  {
480  switch (payloadMode.GetDataRate ()/ (txvector.GetNss()))
481  { //shortGi
482  case 7200000:
483  case 14400000:
484  case 21700000:
485  case 28900000:
486  case 43300000:
487  case 57800000:
488  case 72200000:
489  case 15000000:
490  case 30000000:
491  case 45000000:
492  case 60000000:
493  case 90000000:
494  case 120000000:
495  case 150000000:
496  symbolDuration = NanoSeconds(3600);
497  break;
498  default:
499  symbolDuration = MicroSeconds(4);
500  }
501  }
502  if (txvector.IsStbc())
503  m_Stbc=2;
504  else
505  m_Stbc=1;
506  double numDataBitsPerSymbol = payloadMode.GetDataRate () * txvector.GetNss() * symbolDuration.GetNanoSeconds() / 1e9;
507  //check tables 20-35 and 20-36 in the standard to get cases when nes =2
508  double Nes=1;
509  // IEEE Std 802.11n, section 20.3.11, equation (20-32)
510  uint32_t numSymbols;
511  if (packetType == 1 && preamble != WIFI_PREAMBLE_NONE)
512  {
513  //First packet in an A-MPDU
514  numSymbols = ceil(m_Stbc*(16 + size * 8.0 + 6*Nes) / (m_Stbc* numDataBitsPerSymbol));
515  if (incFlag == 1)
516  {
517  m_totalAmpduSize += size;
518  m_totalAmpduNumSymbols += numSymbols;
519  }
520  }
521  else if (packetType == 1 && preamble == WIFI_PREAMBLE_NONE)
522  {
523  //consecutive packets in an A-MPDU
524  numSymbols = m_Stbc* ((size * 8.0 ) / (m_Stbc* numDataBitsPerSymbol));
525  if (incFlag == 1)
526  {
527  m_totalAmpduSize += size;
528  m_totalAmpduNumSymbols += numSymbols;
529  }
530  }
531  else if (packetType == 2 && preamble == WIFI_PREAMBLE_NONE)
532  {
533  //last packet in an A-MPDU
534  uint32_t totalAmpduSize = m_totalAmpduSize+size;
535  numSymbols = lrint (m_Stbc* ceil((16 + totalAmpduSize * 8.0 + 6*Nes) / (m_Stbc* numDataBitsPerSymbol)));
536  NS_ASSERT (m_totalAmpduNumSymbols <= numSymbols);
537  numSymbols -= m_totalAmpduNumSymbols;
538  if (incFlag == 1)
539  {
540  m_totalAmpduSize = 0;
542  }
543  }
544  else if (packetType == 0 && preamble != WIFI_PREAMBLE_NONE)
545  //Not an A-MPDU
546  {
547  numSymbols = lrint (m_Stbc*ceil ((16 + size * 8.0 + 6.0*Nes) / (m_Stbc* numDataBitsPerSymbol)));
548  }
549  else
550  NS_FATAL_ERROR ("Wrong combination of preamble and packet type");
551 
552  if (frequency >= 2400 && frequency <= 2500 && ((packetType == 0 && preamble != WIFI_PREAMBLE_NONE) || (packetType == 2 && preamble == WIFI_PREAMBLE_NONE))) //at 2.4 GHz
553  {
554  return Time (numSymbols * symbolDuration) + MicroSeconds(6);
555  }
556  else //at 5 GHz
557  {
558  return Time (numSymbols * symbolDuration);
559  }
560 
561  }
562  case WIFI_MOD_CLASS_DSSS:
563  // (Section 17.2.3.6 "Long PLCP LENGTH field"; IEEE Std 802.11-2012)
564  NS_LOG_LOGIC (" size=" << size
565  << " mode=" << payloadMode
566  << " rate=" << payloadMode.GetDataRate () );
567  return MicroSeconds (lrint (ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6))));
568 
569  default:
570  NS_FATAL_ERROR ("unsupported modulation class");
571  return MicroSeconds (0);
572  }
573 }
574 
575 Time
576 WifiPhy::CalculateTxDuration (uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
577 {
578  WifiMode payloadMode=txvector.GetMode();
579  Time duration = GetPlcpPreambleDuration (payloadMode, preamble)
580  + GetPlcpHeaderDuration (payloadMode, preamble)
581  + GetPlcpHtSigHeaderDuration (payloadMode, preamble)
582  + GetPlcpHtTrainingSymbolDuration (preamble, txvector)
583  + GetPayloadDuration (size, txvector, preamble, frequency, packetType, incFlag);
584  return duration;
585 }
586 
587 void
589 {
590  m_phyTxBeginTrace (packet);
591 }
592 
593 void
595 {
596  m_phyTxEndTrace (packet);
597 }
598 
599 void
601 {
602  m_phyTxDropTrace (packet);
603 }
604 
605 void
607 {
608  m_phyRxBeginTrace (packet);
609 }
610 
611 void
613 {
614  m_phyRxEndTrace (packet);
615 }
616 
617 void
619 {
620  m_phyRxDropTrace (packet);
621 }
622 
623 void
624 WifiPhy::NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
625 {
626  m_phyMonitorSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
627 }
628 
629 void
630 WifiPhy::NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, uint8_t txPower)
631 {
632  m_phyMonitorSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, txPower);
633 }
634 
635 
636 // Clause 15 rates (DSSS)
637 
638 WifiMode
640 {
641  static WifiMode mode =
642  WifiModeFactory::CreateWifiMode ("DsssRate1Mbps",
644  true,
645  22000000, 1000000,
647  2);
648  return mode;
649 }
650 
651 WifiMode
653 {
654  static WifiMode mode =
655  WifiModeFactory::CreateWifiMode ("DsssRate2Mbps",
657  true,
658  22000000, 2000000,
660  4);
661  return mode;
662 }
663 
664 
665 // Clause 18 rates (HR/DSSS)
666 
667 WifiMode
669 {
670  static WifiMode mode =
671  WifiModeFactory::CreateWifiMode ("DsssRate5_5Mbps",
673  true,
674  22000000, 5500000,
676  4);
677  return mode;
678 }
679 
680 WifiMode
682 {
683  static WifiMode mode =
684  WifiModeFactory::CreateWifiMode ("DsssRate11Mbps",
686  true,
687  22000000, 11000000,
689  4);
690  return mode;
691 }
692 
693 
694 // Clause 19.5 rates (ERP-OFDM)
695 
696 WifiMode
698 {
699  static WifiMode mode =
700  WifiModeFactory::CreateWifiMode ("ErpOfdmRate6Mbps",
702  true,
703  20000000, 6000000,
705  2);
706  return mode;
707 }
708 
709 WifiMode
711 {
712  static WifiMode mode =
713  WifiModeFactory::CreateWifiMode ("ErpOfdmRate9Mbps",
715  false,
716  20000000, 9000000,
718  2);
719  return mode;
720 }
721 
722 WifiMode
724 {
725  static WifiMode mode =
726  WifiModeFactory::CreateWifiMode ("ErpOfdmRate12Mbps",
728  true,
729  20000000, 12000000,
731  4);
732  return mode;
733 }
734 
735 WifiMode
737 {
738  static WifiMode mode =
739  WifiModeFactory::CreateWifiMode ("ErpOfdmRate18Mbps",
741  false,
742  20000000, 18000000,
744  4);
745  return mode;
746 }
747 
748 WifiMode
750 {
751  static WifiMode mode =
752  WifiModeFactory::CreateWifiMode ("ErpOfdmRate24Mbps",
754  true,
755  20000000, 24000000,
757  16);
758  return mode;
759 }
760 
761 WifiMode
763 {
764  static WifiMode mode =
765  WifiModeFactory::CreateWifiMode ("ErpOfdmRate36Mbps",
767  false,
768  20000000, 36000000,
770  16);
771  return mode;
772 }
773 
774 WifiMode
776 {
777  static WifiMode mode =
778  WifiModeFactory::CreateWifiMode ("ErpOfdmRate48Mbps",
780  false,
781  20000000, 48000000,
783  64);
784  return mode;
785 }
786 
787 WifiMode
789 {
790  static WifiMode mode =
791  WifiModeFactory::CreateWifiMode ("ErpOfdmRate54Mbps",
793  false,
794  20000000, 54000000,
796  64);
797  return mode;
798 }
799 
800 
801 // Clause 17 rates (OFDM)
802 
803 WifiMode
805 {
806  static WifiMode mode =
807  WifiModeFactory::CreateWifiMode ("OfdmRate6Mbps",
809  true,
810  20000000, 6000000,
812  2);
813  return mode;
814 }
815 
816 WifiMode
818 {
819  static WifiMode mode =
820  WifiModeFactory::CreateWifiMode ("OfdmRate9Mbps",
822  false,
823  20000000, 9000000,
825  2);
826  return mode;
827 }
828 
829 WifiMode
831 {
832  static WifiMode mode =
833  WifiModeFactory::CreateWifiMode ("OfdmRate12Mbps",
835  true,
836  20000000, 12000000,
838  4);
839  return mode;
840 }
841 
842 WifiMode
844 {
845  static WifiMode mode =
846  WifiModeFactory::CreateWifiMode ("OfdmRate18Mbps",
848  false,
849  20000000, 18000000,
851  4);
852  return mode;
853 }
854 
855 WifiMode
857 {
858  static WifiMode mode =
859  WifiModeFactory::CreateWifiMode ("OfdmRate24Mbps",
861  true,
862  20000000, 24000000,
864  16);
865  return mode;
866 }
867 
868 WifiMode
870 {
871  static WifiMode mode =
872  WifiModeFactory::CreateWifiMode ("OfdmRate36Mbps",
874  false,
875  20000000, 36000000,
877  16);
878  return mode;
879 }
880 
881 WifiMode
883 {
884  static WifiMode mode =
885  WifiModeFactory::CreateWifiMode ("OfdmRate48Mbps",
887  false,
888  20000000, 48000000,
890  64);
891  return mode;
892 }
893 
894 WifiMode
896 {
897  static WifiMode mode =
898  WifiModeFactory::CreateWifiMode ("OfdmRate54Mbps",
900  false,
901  20000000, 54000000,
903  64);
904  return mode;
905 }
906 
907 // 10 MHz channel rates
908 
909 WifiMode
911 {
912  static WifiMode mode =
913  WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW10MHz",
915  true,
916  10000000, 3000000,
918  2);
919  return mode;
920 }
921 
922 WifiMode
924 {
925  static WifiMode mode =
926  WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW10MHz",
928  false,
929  10000000, 4500000,
931  2);
932  return mode;
933 }
934 
935 WifiMode
937 {
938  static WifiMode mode =
939  WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW10MHz",
941  true,
942  10000000, 6000000,
944  4);
945  return mode;
946 }
947 
948 WifiMode
950 {
951  static WifiMode mode =
952  WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW10MHz",
954  false,
955  10000000, 9000000,
957  4);
958  return mode;
959 }
960 
961 WifiMode
963 {
964  static WifiMode mode =
965  WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW10MHz",
967  true,
968  10000000, 12000000,
970  16);
971  return mode;
972 }
973 
974 WifiMode
976 {
977  static WifiMode mode =
978  WifiModeFactory::CreateWifiMode ("OfdmRate18MbpsBW10MHz",
980  false,
981  10000000, 18000000,
983  16);
984  return mode;
985 }
986 
987 WifiMode
989 {
990  static WifiMode mode =
991  WifiModeFactory::CreateWifiMode ("OfdmRate24MbpsBW10MHz",
993  false,
994  10000000, 24000000,
996  64);
997  return mode;
998 }
999 
1000 WifiMode
1002 {
1003  static WifiMode mode =
1004  WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW10MHz",
1006  false,
1007  10000000, 27000000,
1009  64);
1010  return mode;
1011 }
1012 
1013 // 5 MHz channel rates
1014 
1015 WifiMode
1017 {
1018  static WifiMode mode =
1019  WifiModeFactory::CreateWifiMode ("OfdmRate1_5MbpsBW5MHz",
1021  true,
1022  5000000, 1500000,
1024  2);
1025  return mode;
1026 }
1027 
1028 WifiMode
1030 {
1031  static WifiMode mode =
1032  WifiModeFactory::CreateWifiMode ("OfdmRate2_25MbpsBW5MHz",
1034  false,
1035  5000000, 2250000,
1037  2);
1038  return mode;
1039 }
1040 
1041 WifiMode
1043 {
1044  static WifiMode mode =
1045  WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW5MHz",
1047  true,
1048  5000000, 3000000,
1050  4);
1051  return mode;
1052 }
1053 
1054 WifiMode
1056 {
1057  static WifiMode mode =
1058  WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW5MHz",
1060  false,
1061  5000000, 4500000,
1063  4);
1064  return mode;
1065 }
1066 
1067 WifiMode
1069 {
1070  static WifiMode mode =
1071  WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW5MHz",
1073  true,
1074  5000000, 6000000,
1076  16);
1077  return mode;
1078 }
1079 
1080 WifiMode
1082 {
1083  static WifiMode mode =
1084  WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW5MHz",
1086  false,
1087  5000000, 9000000,
1089  16);
1090  return mode;
1091 }
1092 
1093 WifiMode
1095 {
1096  static WifiMode mode =
1097  WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW5MHz",
1099  false,
1100  5000000, 12000000,
1102  64);
1103  return mode;
1104 }
1105 
1106 WifiMode
1108 {
1109  static WifiMode mode =
1110  WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW5MHz",
1112  false,
1113  5000000, 13500000,
1115  64);
1116  return mode;
1117 }
1118 
1119 // Clause 20
1120 
1121 WifiMode
1123 {
1124  static WifiMode mode =
1125  WifiModeFactory::CreateWifiMode ("OfdmRate6_5MbpsBW20MHz",
1127  true,
1128  20000000, 6500000,
1130  2);
1131  return mode;
1132 }
1133 WifiMode
1135 {
1136  static WifiMode mode =
1137  WifiModeFactory::CreateWifiMode ("OfdmRate7_2MbpsBW20MHz",
1139  false,
1140  20000000, 7200000,
1142  2);
1143  return mode;
1144 }
1145 
1146 WifiMode
1148 {
1149  static WifiMode mode =
1150  WifiModeFactory::CreateWifiMode ("OfdmRate13MbpsBW20MHz",
1152  true,
1153  20000000, 13000000,
1155  4);
1156  return mode;
1157 }
1158 
1159 WifiMode
1161 {
1162  static WifiMode mode =
1163  WifiModeFactory::CreateWifiMode ("OfdmRate14_4MbpsBW20MHz",
1165  false,
1166  20000000, 14400000,
1168  4);
1169  return mode;
1170 }
1171 WifiMode
1173 {
1174  static WifiMode mode =
1175  WifiModeFactory::CreateWifiMode ("OfdmRate19_5MbpsBW20MHz",
1177  true,
1178  20000000, 19500000,
1180  4);
1181  return mode;
1182 }
1183 
1184 WifiMode
1186 {
1187  static WifiMode mode =
1188  WifiModeFactory::CreateWifiMode ("OfdmRate21_7MbpsBW20MHz",
1190  false,
1191  20000000, 21700000,
1193  4);
1194  return mode;
1195 }
1196 
1197 
1198 WifiMode
1200 {
1201  static WifiMode mode =
1202  WifiModeFactory::CreateWifiMode ("OfdmRate26MbpsBW20MHz",
1204  true,
1205  20000000, 26000000,
1207  16);
1208  return mode;
1209 }
1210 
1211 WifiMode
1213 {
1214  static WifiMode mode =
1215  WifiModeFactory::CreateWifiMode ("OfdmRate28_9MbpsBW20MHz",
1217  false,
1218  20000000, 28900000,
1220  16);
1221  return mode;
1222 }
1223 
1224 WifiMode
1226 {
1227  static WifiMode mode =
1228  WifiModeFactory::CreateWifiMode ("OfdmRate39MbpsBW20MHz",
1230  true,
1231  20000000, 39000000,
1233  16);
1234  return mode;
1235 }
1236 
1237 WifiMode
1239 {
1240  static WifiMode mode =
1241  WifiModeFactory::CreateWifiMode ("OfdmRate43_3MbpsBW20MHz",
1243  false,
1244  20000000, 43300000,
1246  16);
1247  return mode;
1248 }
1249 
1250 WifiMode
1252 {
1253  static WifiMode mode =
1254  WifiModeFactory::CreateWifiMode ("OfdmRate52MbpsBW20MHz",
1256  true,
1257  20000000, 52000000,
1259  64);
1260  return mode;
1261 }
1262 
1263 WifiMode
1265 {
1266  static WifiMode mode =
1267  WifiModeFactory::CreateWifiMode ("OfdmRate57_8MbpsBW20MHz",
1269  false,
1270  20000000, 57800000,
1272  64);
1273  return mode;
1274 }
1275 
1276 
1277 WifiMode
1279 {
1280  static WifiMode mode =
1281  WifiModeFactory::CreateWifiMode ("OfdmRate58_5MbpsBW20MHz",
1283  true,
1284  20000000, 58500000,
1286  64);
1287  return mode;
1288 }
1289 
1290 WifiMode
1292 {
1293  static WifiMode mode =
1294  WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHzShGi",
1296  false,
1297  20000000, 65000000,
1299  64);
1300  return mode;
1301 }
1302 
1303 WifiMode
1305 {
1306  static WifiMode mode =
1307  WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHz",
1309  true,
1310  20000000, 65000000,
1312  64);
1313  return mode;
1314 }
1315 
1316 WifiMode
1318 {
1319  static WifiMode mode =
1320  WifiModeFactory::CreateWifiMode ("OfdmRate72_2MbpsBW20MHz",
1322  false,
1323  20000000, 72200000,
1325  64);
1326  return mode;
1327 }
1328 
1329 WifiMode
1331 {
1332  static WifiMode mode =
1333  WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW40MHz",
1335  false,
1336  40000000, 13500000,
1338  2);
1339  return mode;
1340 }
1341 
1342 WifiMode
1344 {
1345  static WifiMode mode =
1346  WifiModeFactory::CreateWifiMode ("OfdmRate15MbpsBW40MHz",
1348  false,
1349  40000000, 15000000,
1351  2);
1352  return mode;
1353 }
1354 
1355 WifiMode
1357 {
1358  static WifiMode mode =
1359  WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW40MHz",
1361  false,
1362  40000000, 27000000,
1364  4);
1365  return mode;
1366 }
1367 WifiMode
1369 {
1370  static WifiMode mode =
1371  WifiModeFactory::CreateWifiMode ("OfdmRate30MbpsBW40MHz",
1373  false,
1374  40000000, 30000000,
1376  4);
1377  return mode;
1378 }
1379 
1380 WifiMode
1382 {
1383  static WifiMode mode =
1384  WifiModeFactory::CreateWifiMode ("OfdmRate40_5MbpsBW40MHz",
1386  false,
1387  40000000, 40500000,
1389  4);
1390  return mode;
1391 }
1392 WifiMode
1394 {
1395  static WifiMode mode =
1396  WifiModeFactory::CreateWifiMode ("OfdmRate45MbpsBW40MHz",
1398  false,
1399  40000000, 45000000,
1401  4);
1402  return mode;
1403 }
1404 
1405 WifiMode
1407 {
1408  static WifiMode mode =
1409  WifiModeFactory::CreateWifiMode ("OfdmRate54MbpsBW40MHz",
1411  false,
1412  40000000, 54000000,
1414  16);
1415  return mode;
1416 }
1417 
1418 WifiMode
1420 {
1421  static WifiMode mode =
1422  WifiModeFactory::CreateWifiMode ("OfdmRate60MbpsBW40MHz",
1424  false,
1425  40000000, 60000000,
1427  16);
1428  return mode;
1429 }
1430 
1431 WifiMode
1433 {
1434  static WifiMode mode =
1435  WifiModeFactory::CreateWifiMode ("OfdmRate81MbpsBW40MHz",
1437  false,
1438  40000000, 81000000,
1440  16);
1441  return mode;
1442 }
1443 WifiMode
1445 {
1446  static WifiMode mode =
1447  WifiModeFactory::CreateWifiMode ("OfdmRate90MbpsBW40MHz",
1449  false,
1450  40000000, 90000000,
1452  16);
1453  return mode;
1454 }
1455 
1456 WifiMode
1458 {
1459  static WifiMode mode =
1460  WifiModeFactory::CreateWifiMode ("OfdmRate108MbpsBW40MHz",
1462  false,
1463  40000000, 108000000,
1465  64);
1466  return mode;
1467 }
1468 WifiMode
1470 {
1471  static WifiMode mode =
1472  WifiModeFactory::CreateWifiMode ("OfdmRate120MbpsBW40MHz",
1474  false,
1475  40000000, 120000000,
1477  64);
1478  return mode;
1479 }
1480 WifiMode
1482 {
1483  static WifiMode mode =
1484  WifiModeFactory::CreateWifiMode ("OfdmRate121_5MbpsBW40MHz",
1486  false,
1487  40000000, 121500000,
1489  64);
1490  return mode;
1491 }
1492 WifiMode
1494 {
1495  static WifiMode mode =
1496  WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHzShGi",
1498  false,
1499  40000000, 135000000,
1501  64);
1502  return mode;
1503 }
1504 WifiMode
1506 {
1507  static WifiMode mode =
1508  WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHz",
1510  false,
1511  40000000, 135000000,
1513  64);
1514  return mode;
1515 }
1516 
1517 WifiMode
1519 {
1520  static WifiMode mode =
1521  WifiModeFactory::CreateWifiMode ("OfdmRate150MbpsBW40MHz",
1523  false,
1524  40000000, 150000000,
1526  64);
1527  return mode;
1528 }
1529 
1530 
1531 
1532 std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state)
1533 {
1534  switch (state)
1535  {
1536  case WifiPhy::IDLE:
1537  return (os << "IDLE");
1538  case WifiPhy::CCA_BUSY:
1539  return (os << "CCA_BUSY");
1540  case WifiPhy::TX:
1541  return (os << "TX");
1542  case WifiPhy::RX:
1543  return (os << "RX");
1544  case WifiPhy::SWITCHING:
1545  return (os << "SWITCHING");
1546  case WifiPhy::SLEEP:
1547  return (os << "SLEEP");
1548  default:
1549  NS_FATAL_ERROR ("Invalid WifiPhy state");
1550  return (os << "INVALID");
1551  }
1552 }
1553 
1554 
1555 
1556 } // namespace ns3
1557 
1558 namespace {
1559 
1560 static class Constructor
1561 {
1562 public:
1564  {
1633  }
1634 } g_constructor;
1635 }
static class anonymous_namespace{wifi-phy.cc}::Constructor g_constructor
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1081
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1184
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:749
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:681
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
Definition: wifi-phy.cc:762
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
static WifiMode GetOfdmRate26MbpsBW20MHz()
Return a WifiMode for OFDM at 26Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1199
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:52
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:817
static WifiMode GetOfdmRate7_2MbpsBW20MHz()
Return a WifiMode for OFDM at 7.2Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1134
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:975
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:1001
#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:1042
virtual ~WifiPhy()
Definition: wifi-phy.cc:114
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:639
void NotifyMonitorSniffTx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, uint8_t txPower)
Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
Definition: wifi-phy.cc:630
static WifiMode GetOfdmRate81MbpsBW40MHz()
Return a WifiMode for OFDM at 81Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1432
802.11 PHY layer model
Definition: wifi-phy.h:126
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:736
The PHY layer has sense the medium busy through the CCA mechanism.
Definition: wifi-phy.h:141
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:1225
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:830
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
Definition: wifi-phy.h:1192
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:115
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:61
static WifiMode GetOfdmRate43_3MbpsBW20MHz()
Return a WifiMode for OFDM at 43.3Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1238
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
static WifiMode GetOfdmRate60MbpsBW40MHz()
Return a WifiMode for OFDM at 60Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1419
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1016
The PHY layer is sleeping.
Definition: wifi-phy.h:157
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:923
static WifiMode GetMFPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:121
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:895
#define NS_FATAL_ERROR(msg)
Fatal error handling.
Definition: fatal-error.h:100
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:600
static WifiMode GetOfdmRate108MbpsBW40MHz()
Return a WifiMode for OFDM at 108Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1457
static WifiMode GetOfdmRate21_7MbpsBW20MHz()
Return a WifiMode for OFDM at 21.7Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1185
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:588
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:93
static WifiMode GetOfdmRate135MbpsBW40MHz()
Return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1505
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:869
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1068
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:788
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:618
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:29
static WifiMode GetOfdmRate6_5MbpsBW20MHz()
Return a WifiMode for OFDM at 6.5Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1122
static WifiMode GetOfdmRate135MbpsBW40MHzShGi()
Return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1493
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, bool, uint8_t > m_phyMonitorSniffTxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being transmitted...
Definition: wifi-phy.h:1223
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:883
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:1176
The PHY layer is IDLE.
Definition: wifi-phy.h:137
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:775
static WifiMode GetPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:189
uint8_t GetNess(void) const
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:962
HT PHY (Clause 20)
Definition: wifi-mode.h:56
std::string GetUniqueName(void) const
Definition: wifi-mode.cc:97
The PHY layer is receiving a packet.
Definition: wifi-phy.h:149
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
Definition: wifi-phy.h:1199
virtual ~WifiPhyListener()
Definition: wifi-phy.cc:43
static WifiMode CreateWifiMode(std::string uniqueName, enum WifiModulationClass modClass, bool isMandatory, uint32_t bandwidth, uint32_t dataRate, enum WifiCodeRate codingRate, uint8_t constellationSize)
Definition: wifi-mode.cc:141
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:606
static WifiMode GetOfdmRate19_5MbpsBW20MHz()
Return a WifiMode for OFDM at 19.5Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1172
The PHY layer is sending a packet.
Definition: wifi-phy.h:145
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:843
Time CalculateTxDuration(uint32_t size, WifiTxVector txvector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:576
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:949
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, bool, double, double > m_phyMonitorSniffRxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being received...
Definition: wifi-phy.h:1211
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:1094
static WifiMode GetOfdmRate52MbpsBW20MHz()
Return a WifiMode for OFDM at 52Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1251
#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:153
static WifiMode GetOfdmRate40_5MbpsBW40MHz()
Return a WifiMode for OFDM at 40.5Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1381
uint32_t GetBandwidth(void) const
Definition: wifi-mode.cc:67
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Definition: wifi-phy.h:1160
static WifiMode GetOfdmRate72_2MbpsBW20MHz()
Return a WifiMode for OFDM at 72.2Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1317
static WifiMode GetOfdmRate65MbpsBW20MHzShGi()
Return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1291
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:882
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition: angles.cc:42
static Time GetPlcpHeaderDuration(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:262
static Time GetPlcpHtSigHeaderDuration(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:172
void NotifyMonitorSniffRx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
Public method used to fire a MonitorSniffer trace for a wifi packet being received.
Definition: wifi-phy.cc:624
static TypeId GetTypeId(void)
Definition: wifi-phy.cc:54
static Time GetPlcpHtTrainingSymbolDuration(WifiPreamble preamble, WifiTxVector txvector)
Definition: wifi-phy.cc:135
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static WifiMode GetOfdmRate57_8MbpsBW20MHz()
Return a WifiMode for OFDM at 57.8Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1264
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:856
static WifiMode GetOfdmRate13MbpsBW20MHz()
Return a WifiMode for OFDM at 13Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1147
static WifiMode GetOfdmRate65MbpsBW20MHz()
Return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1304
static WifiMode GetOfdmRate58_5MbpsBW20MHz()
Return a WifiMode for OFDM at 58.5Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1278
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:668
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1029
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:710
void NotifyTxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:594
static WifiMode GetOfdmRate15MbpsBW40MHz()
Return a WifiMode for OFDM at 15Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1343
static WifiMode GetOfdmRate121_5MbpsBW40MHz()
Return a WifiMode for OFDM at 121.5Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1481
static WifiMode GetOfdmRate28_9MbpsBW20MHz()
Return a WifiMode for OFDM at 28.9Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1212
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:339
No explicit coding (e.g., DSSS rates)
Definition: wifi-mode.h:70
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:697
uint8_t GetNss(void) const
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:723
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:612
static WifiMode GetOfdmRate13_5MbpsBW40MHz()
Return a WifiMode for OFDM at 13.5Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1330
static WifiMode GetOfdmRate30MbpsBW40MHz()
Return a WifiMode for OFDM at 30Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1368
static WifiMode GetOfdmRate54MbpsBW40MHz()
Return a WifiMode for OFDM at 54Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1406
OFDM PHY (Clause 17)
Definition: wifi-mode.h:54
static WifiMode GetOfdmRate90MbpsBW40MHz()
Return a WifiMode for OFDM at 90Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1444
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:1226
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:875
static WifiMode GetOfdmRate45MbpsBW40MHz()
Return a WifiMode for OFDM at 45Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1393
static WifiMode GetOfdmRate120MbpsBW40MHz()
Return a WifiMode for OFDM at 120Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1469
static WifiMode GetOfdmRate39MbpsBW20MHz()
Return a WifiMode for OFDM at 39Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1225
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:652
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:936
WifiMode GetMode(void) const
State
The state of the PHY layer.
Definition: wifi-phy.h:132
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:988
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1107
a unique identifier for an interface.
Definition: type-id.h:51
uint64_t GetDataRate(void) const
Definition: wifi-mode.cc:79
TypeId SetParent(TypeId tid)
Definition: type-id.cc:631
Time GetPayloadDuration(uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:382
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:804
static WifiMode GetOfdmRate27MbpsBW40MHz()
Return a WifiMode for OFDM at 27Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1356
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
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:1055
static WifiMode GetOfdmRate14_4MbpsBW20MHz()
Return a WifiMode for OFDM at 14.4Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1160
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:910
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1168
static WifiMode GetOfdmRate150MbpsBW40MHz()
Return a WifiMode for OFDM at 150Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1518
static Time GetPlcpPreambleDuration(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:329