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  .SetGroupName ("Wifi")
59  .AddTraceSource ("PhyTxBegin",
60  "Trace source indicating a packet "
61  "has begun transmitting over the channel medium",
63  "ns3::Packet::TracedCallback")
64  .AddTraceSource ("PhyTxEnd",
65  "Trace source indicating a packet "
66  "has been completely transmitted over the channel. "
67  "NOTE: the only official WifiPhy implementation "
68  "available to this date (YansWifiPhy) never fires "
69  "this trace source.",
71  "ns3::Packet::TracedCallback")
72  .AddTraceSource ("PhyTxDrop",
73  "Trace source indicating a packet "
74  "has been dropped by the device during transmission",
76  "ns3::Packet::TracedCallback")
77  .AddTraceSource ("PhyRxBegin",
78  "Trace source indicating a packet "
79  "has begun being received from the channel medium "
80  "by the device",
82  "ns3::Packet::TracedCallback")
83  .AddTraceSource ("PhyRxEnd",
84  "Trace source indicating a packet "
85  "has been completely received from the channel medium "
86  "by the device",
88  "ns3::Packet::TracedCallback")
89  .AddTraceSource ("PhyRxDrop",
90  "Trace source indicating a packet "
91  "has been dropped by the device during reception",
93  "ns3::Packet::TracedCallback")
94  .AddTraceSource ("MonitorSnifferRx",
95  "Trace source simulating a wifi device in monitor mode "
96  "sniffing all received frames",
98  "ns3::WifiPhy::MonitorSnifferRxCallback")
99  .AddTraceSource ("MonitorSnifferTx",
100  "Trace source simulating the capability of a wifi device "
101  "in monitor mode to sniff all frames being transmitted",
103  "ns3::WifiPhy::MonitorSnifferTxCallback")
104  ;
105  return tid;
106 }
107 
109 {
110  NS_LOG_FUNCTION (this);
111  m_totalAmpduSize = 0;
113 }
114 
116 {
117  NS_LOG_FUNCTION (this);
118 }
119 
120 //return the L-SIG
121 WifiMode
123 {
124  switch (payloadMode.GetBandwidth ())
125  {
126  case 20000000:
128  case 40000000:
130  default:
132  }
133 }
134 
135 Time
137 {
138  uint8_t Ndltf, Neltf;
139 
140  //We suppose here that STBC = 0.
141  //If STBC > 0, we need a different mapping between Nss and Nltf (IEEE 802.11n-2012 standard, page 1682).
142  if (txvector.GetNss () < 3)
143  {
144  Ndltf = txvector.GetNss();
145  }
146  else
147  {
148  Ndltf = 4;
149  }
150  if (txvector.GetNess () < 3)
151  {
152  Neltf = txvector.GetNess();
153  }
154  else
155  {
156  Neltf = 4;
157  }
158 
159  switch (preamble)
160  {
161  case WIFI_PREAMBLE_HT_MF:
162  return MicroSeconds(4 + (4 * Ndltf) + (4 * Neltf));
163  case WIFI_PREAMBLE_HT_GF:
164  return MicroSeconds((4 * Ndltf) + (4 * Neltf));
165  default:
166  // no training for non HT
167  return MicroSeconds(0);
168  }
169 }
170 
171 //return L-SIG
172 Time
174 {
175  switch (preamble)
176  {
177  case WIFI_PREAMBLE_HT_MF:
178  // HT-SIG
179  return MicroSeconds(8);
180  case WIFI_PREAMBLE_HT_GF:
181  //HT-SIG
182  return MicroSeconds(8);
183  default:
184  // no HT-SIG for non HT
185  return MicroSeconds(0);
186  }
187 }
188 
189 WifiMode
191 {
192  switch (payloadMode.GetModulationClass ())
193  {
194  case WIFI_MOD_CLASS_OFDM:
195  {
196  switch (payloadMode.GetBandwidth ())
197  {
198  case 5000000:
200  case 10000000:
202  default:
203  // (Section 18.3.2 "PLCP frame format"; IEEE Std 802.11-2012)
204  // actually this is only the first part of the PlcpHeader,
205  // because the last 16 bits of the PlcpHeader are using the
206  // same mode of the payload
207  return WifiPhy::GetOfdmRate6Mbps ();
208  }
209  }
210  //Added by Ghada to support 11n
211  case WIFI_MOD_CLASS_HT:
212  { //return the HT-SIG
213  // IEEE Std 802.11n, 20.3.23
214  switch (preamble)
215  {
216  case WIFI_PREAMBLE_HT_MF:
217  switch (payloadMode.GetBandwidth ())
218  {
219  case 20000000:
221  case 40000000:
223  default:
225  }
226  case WIFI_PREAMBLE_HT_GF:
227  switch (payloadMode.GetBandwidth ())
228  {
229  case 20000000:
231  case 40000000:
233  default:
235  }
236  default:
237  return WifiPhy::GetOfdmRate6Mbps ();
238  }
239  }
242 
243  case WIFI_MOD_CLASS_DSSS:
244  if (preamble == WIFI_PREAMBLE_LONG)
245  {
246  // (Section 16.2.3 "PLCP field definitions" and Section 17.2.2.2 "Long PPDU format"; IEEE Std 802.11-2012)
247  return WifiPhy::GetDsssRate1Mbps ();
248  }
249  else // WIFI_PREAMBLE_SHORT
250  {
251  // (Section 17.2.2.3 "Short PPDU format"; IEEE Std 802.11-2012)
252  return WifiPhy::GetDsssRate2Mbps ();
253  }
254 
255  default:
256  NS_FATAL_ERROR ("unsupported modulation class");
257  return WifiMode ();
258  }
259 }
260 
261 
262 Time
264 {
265  if (preamble == WIFI_PREAMBLE_NONE)
266  {
267  return MicroSeconds(0);
268  }
269  switch (payloadMode.GetModulationClass ())
270  {
271  case WIFI_MOD_CLASS_OFDM:
272  {
273  switch (payloadMode.GetBandwidth ())
274  {
275  case 20000000:
276  default:
277  // (Section 18.3.3 "PLCP preamble (SYNC))" and Figure 18-4 "OFDM training structure"; IEEE Std 802.11-2012)
278  // also (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
279  // We return the duration of the SIGNAL field only, since the
280  // SERVICE field (which strictly speaking belongs to the PLCP
281  // header, see Section 18.3.2 and Figure 18-1) is sent using the
282  // payload mode.
283  return MicroSeconds(4);
284  case 10000000:
285  // (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
286  return MicroSeconds(8);
287  case 5000000:
288  // (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012)
289  return MicroSeconds(16);
290  }
291  }
292  //Added by Ghada to support 11n
293  case WIFI_MOD_CLASS_HT:
294  { //IEEE 802.11n Figure 20.1
295  switch (preamble)
296  {
297  case WIFI_PREAMBLE_HT_MF:
298  // L-SIG
299  return MicroSeconds(4);
300  case WIFI_PREAMBLE_HT_GF:
301  //L-SIG
302  return MicroSeconds(0);
303  default:
304  // L-SIG
305  return MicroSeconds(4);
306  }
307  }
309  return MicroSeconds(4);
310 
311  case WIFI_MOD_CLASS_DSSS:
312  if (preamble == WIFI_PREAMBLE_SHORT)
313  {
314  // (Section 17.2.2.3 "Short PPDU format" and Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
315  return MicroSeconds(24);
316  }
317  else // WIFI_PREAMBLE_LONG
318  {
319  // (Section 17.2.2.2 "Long PPDU format" and Figure 17-1 "Short PPDU format"; IEEE Std 802.11-2012)
320  return MicroSeconds(48);
321  }
322 
323  default:
324  NS_FATAL_ERROR ("unsupported modulation class");
325  return MicroSeconds(0);
326  }
327 }
328 
329 Time
331 {
332  if (preamble == WIFI_PREAMBLE_NONE)
333  {
334  return MicroSeconds(0);
335  }
336  switch (payloadMode.GetModulationClass ())
337  {
338  case WIFI_MOD_CLASS_OFDM:
339  {
340  switch (payloadMode.GetBandwidth ())
341  {
342  case 20000000:
343  default:
344  // (Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
345  // also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
346  return MicroSeconds(16);
347  case 10000000:
348  // (Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
349  // also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
350  return MicroSeconds(32);
351  case 5000000:
352  // (Section 18.3.3 "PLCP preamble (SYNC))" Figure 18-4 "OFDM training structure"
353  // also Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
354  return MicroSeconds(64);
355  }
356  }
357  case WIFI_MOD_CLASS_HT:
358  {
359  //IEEE 802.11n Figure 20.1 the training symbols before L_SIG or HT_SIG
360  return MicroSeconds(16);
361  }
363  return MicroSeconds(16);
364 
365  case WIFI_MOD_CLASS_DSSS:
366  if (preamble == WIFI_PREAMBLE_SHORT)
367  {
368  // (Section 17.2.2.3 "Short PPDU format)" Figure 17-2 "Short PPDU format"; IEEE Std 802.11-2012)
369  return MicroSeconds(72);
370  }
371  else // WIFI_PREAMBLE_LONG
372  {
373  // (Section 17.2.2.2 "Long PPDU format)" Figure 17-1 "Long PPDU format"; IEEE Std 802.11-2012)
374  return MicroSeconds(144);
375  }
376  default:
377  NS_FATAL_ERROR ("unsupported modulation class");
378  return MicroSeconds(0);
379  }
380 }
381 
382 Time
383 WifiPhy::GetPayloadDuration (uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
384 {
385  WifiMode payloadMode=txvector.GetMode();
386 
387  NS_LOG_FUNCTION (size << payloadMode);
388 
389  switch (payloadMode.GetModulationClass ())
390  {
391  case WIFI_MOD_CLASS_OFDM:
393  {
394  // (Section 18.3.2.4 "Timing related parameters" Table 18-5 "Timing-related parameters"; IEEE Std 802.11-2012
395  // corresponds to T_{SYM} in the table)
396  Time symbolDuration;
397 
398  switch (payloadMode.GetBandwidth ())
399  {
400  case 20000000:
401  default:
402  symbolDuration = MicroSeconds(4);
403  break;
404  case 10000000:
405  symbolDuration = MicroSeconds(8);
406  break;
407  case 5000000:
408  symbolDuration = MicroSeconds(16);
409  break;
410  }
411 
412  // (Section 18.3.2.3 "Modulation-dependent parameters" Table 18-4 "Modulation-dependent parameters"; IEEE Std 802.11-2012)
413  // corresponds to N_{DBPS} in the table
414  double numDataBitsPerSymbol = payloadMode.GetDataRate () * symbolDuration.GetNanoSeconds() / 1e9;
415 
416  // (Section 18.3.5.4 "Pad bits (PAD)" Equation 18-11; IEEE Std 802.11-2012)
417  uint32_t numSymbols;
418 
419  if (packetType == 1 && preamble != WIFI_PREAMBLE_NONE)
420  {
421  //First packet in an A-MPDU
422  numSymbols= ceil((16 + size * 8.0 + 6) / (numDataBitsPerSymbol));
423  if (incFlag == 1)
424  {
425  m_totalAmpduSize += size;
426  m_totalAmpduNumSymbols += numSymbols;
427  }
428  }
429  else if (packetType == 1 && preamble == WIFI_PREAMBLE_NONE)
430  {
431  //consecutive packets in an A-MPDU
432  numSymbols= ((size * 8.0) / (numDataBitsPerSymbol));
433  if (incFlag == 1)
434  {
435  m_totalAmpduSize += size;
436  m_totalAmpduNumSymbols += numSymbols;
437  }
438  }
439  else if (packetType == 2 && preamble == WIFI_PREAMBLE_NONE)
440  {
441  //last packet in an A-MPDU
442  uint32_t totalAmpduSize = m_totalAmpduSize + size;
443  numSymbols = lrint (ceil((16 + totalAmpduSize * 8.0 + 6) / (numDataBitsPerSymbol)));
444  numSymbols -= m_totalAmpduNumSymbols;
445  if (incFlag == 1)
446  {
447  m_totalAmpduSize = 0;
449  }
450  }
451  else if (packetType == 0 && preamble != WIFI_PREAMBLE_NONE)
452  {
453  //Not an A-MPDU
454  numSymbols = lrint (ceil ((16 + size * 8.0 + 6.0) / (numDataBitsPerSymbol)));
455  }
456  else
457  NS_FATAL_ERROR ("Wrong combination of preamble and packet type");
458 
459  // Add signal extension for ERP PHY
460  if (payloadMode.GetModulationClass () == WIFI_MOD_CLASS_ERP_OFDM)
461  {
462  return Time (numSymbols * symbolDuration) + MicroSeconds(6);
463  }
464  else
465  {
466  return Time (numSymbols * symbolDuration);
467  }
468  }
469  case WIFI_MOD_CLASS_HT:
470  {
471  Time symbolDuration;
472  double m_Stbc;
473  //if short GI data rate is used then symbol duration is 3.6us else symbol duration is 4us
474  //In the future has to create a stationmanager that only uses these data rates if sender and reciever support GI
475  if (payloadMode.GetUniqueName() == "OfdmRate135MbpsBW40MHzShGi" || payloadMode.GetUniqueName() == "OfdmRate65MbpsBW20MHzShGi" )
476  {
477  symbolDuration = NanoSeconds(3600);
478  }
479  else
480  {
481  switch (payloadMode.GetDataRate ()/ (txvector.GetNss()))
482  { //shortGi
483  case 7200000:
484  case 14400000:
485  case 21700000:
486  case 28900000:
487  case 43300000:
488  case 57800000:
489  case 72200000:
490  case 15000000:
491  case 30000000:
492  case 45000000:
493  case 60000000:
494  case 90000000:
495  case 120000000:
496  case 150000000:
497  symbolDuration = NanoSeconds(3600);
498  break;
499  default:
500  symbolDuration = MicroSeconds(4);
501  }
502  }
503  if (txvector.IsStbc())
504  m_Stbc=2;
505  else
506  m_Stbc=1;
507  double numDataBitsPerSymbol = payloadMode.GetDataRate () * txvector.GetNss() * symbolDuration.GetNanoSeconds() / 1e9;
508  //check tables 20-35 and 20-36 in the standard to get cases when nes =2
509  double Nes=1;
510  // IEEE Std 802.11n, section 20.3.11, equation (20-32)
511  uint32_t numSymbols;
512  if (packetType == 1 && preamble != WIFI_PREAMBLE_NONE)
513  {
514  //First packet in an A-MPDU
515  numSymbols = ceil(m_Stbc*(16 + size * 8.0 + 6*Nes) / (m_Stbc* numDataBitsPerSymbol));
516  if (incFlag == 1)
517  {
518  m_totalAmpduSize += size;
519  m_totalAmpduNumSymbols += numSymbols;
520  }
521  }
522  else if (packetType == 1 && preamble == WIFI_PREAMBLE_NONE)
523  {
524  //consecutive packets in an A-MPDU
525  numSymbols = m_Stbc* ((size * 8.0 ) / (m_Stbc* numDataBitsPerSymbol));
526  if (incFlag == 1)
527  {
528  m_totalAmpduSize += size;
529  m_totalAmpduNumSymbols += numSymbols;
530  }
531  }
532  else if (packetType == 2 && preamble == WIFI_PREAMBLE_NONE)
533  {
534  //last packet in an A-MPDU
535  uint32_t totalAmpduSize = m_totalAmpduSize+size;
536  numSymbols = lrint (m_Stbc* ceil((16 + totalAmpduSize * 8.0 + 6*Nes) / (m_Stbc* numDataBitsPerSymbol)));
537  NS_ASSERT (m_totalAmpduNumSymbols <= numSymbols);
538  numSymbols -= m_totalAmpduNumSymbols;
539  if (incFlag == 1)
540  {
541  m_totalAmpduSize = 0;
543  }
544  }
545  else if (packetType == 0 && preamble != WIFI_PREAMBLE_NONE)
546  //Not an A-MPDU
547  {
548  numSymbols = lrint (m_Stbc*ceil ((16 + size * 8.0 + 6.0*Nes) / (m_Stbc* numDataBitsPerSymbol)));
549  }
550  else
551  NS_FATAL_ERROR ("Wrong combination of preamble and packet type");
552 
553  if (frequency >= 2400 && frequency <= 2500 && ((packetType == 0 && preamble != WIFI_PREAMBLE_NONE) || (packetType == 2 && preamble == WIFI_PREAMBLE_NONE))) //at 2.4 GHz
554  {
555  return Time (numSymbols * symbolDuration) + MicroSeconds(6);
556  }
557  else //at 5 GHz
558  {
559  return Time (numSymbols * symbolDuration);
560  }
561 
562  }
563  case WIFI_MOD_CLASS_DSSS:
564  // (Section 17.2.3.6 "Long PLCP LENGTH field"; IEEE Std 802.11-2012)
565  NS_LOG_LOGIC (" size=" << size
566  << " mode=" << payloadMode
567  << " rate=" << payloadMode.GetDataRate () );
568  return MicroSeconds (lrint (ceil ((size * 8.0) / (payloadMode.GetDataRate () / 1.0e6))));
569 
570  default:
571  NS_FATAL_ERROR ("unsupported modulation class");
572  return MicroSeconds (0);
573  }
574 }
575 
576 Time
577 WifiPhy::CalculateTxDuration (uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
578 {
579  WifiMode payloadMode=txvector.GetMode();
580  Time duration = GetPlcpPreambleDuration (payloadMode, preamble)
581  + GetPlcpHeaderDuration (payloadMode, preamble)
582  + GetPlcpHtSigHeaderDuration (preamble)
583  + GetPlcpHtTrainingSymbolDuration (preamble, txvector)
584  + GetPayloadDuration (size, txvector, preamble, frequency, packetType, incFlag);
585  return duration;
586 }
587 Time
589 {
590  WifiMode payloadMode=txvector.GetMode();
591  Time duration = GetPlcpPreambleDuration (payloadMode, preamble)
592  + GetPlcpHeaderDuration (payloadMode, preamble)
593  + GetPlcpHtSigHeaderDuration (preamble)
594  + GetPlcpHtTrainingSymbolDuration (preamble, txvector);
595  return duration;
596 }
597 
598 void
600 {
601  m_phyTxBeginTrace (packet);
602 }
603 
604 void
606 {
607  m_phyTxEndTrace (packet);
608 }
609 
610 void
612 {
613  m_phyTxDropTrace (packet);
614 }
615 
616 void
618 {
619  m_phyRxBeginTrace (packet);
620 }
621 
622 void
624 {
625  m_phyRxEndTrace (packet);
626 }
627 
628 void
630 {
631  m_phyRxDropTrace (packet);
632 }
633 
634 void
635 WifiPhy::NotifyMonitorSniffRx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
636 {
637  m_phyMonitorSniffRxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, signalDbm, noiseDbm);
638 }
639 
640 void
641 WifiPhy::NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, uint8_t txPower)
642 {
643  m_phyMonitorSniffTxTrace (packet, channelFreqMhz, channelNumber, rate, isShortPreamble, txPower);
644 }
645 
646 
647 // Clause 15 rates (DSSS)
648 
649 WifiMode
651 {
652  static WifiMode mode =
653  WifiModeFactory::CreateWifiMode ("DsssRate1Mbps",
655  true,
656  22000000, 1000000,
658  2);
659  return mode;
660 }
661 
662 WifiMode
664 {
665  static WifiMode mode =
666  WifiModeFactory::CreateWifiMode ("DsssRate2Mbps",
668  true,
669  22000000, 2000000,
671  4);
672  return mode;
673 }
674 
675 
676 // Clause 18 rates (HR/DSSS)
677 
678 WifiMode
680 {
681  static WifiMode mode =
682  WifiModeFactory::CreateWifiMode ("DsssRate5_5Mbps",
684  true,
685  22000000, 5500000,
687  4);
688  return mode;
689 }
690 
691 WifiMode
693 {
694  static WifiMode mode =
695  WifiModeFactory::CreateWifiMode ("DsssRate11Mbps",
697  true,
698  22000000, 11000000,
700  4);
701  return mode;
702 }
703 
704 
705 // Clause 19.5 rates (ERP-OFDM)
706 
707 WifiMode
709 {
710  static WifiMode mode =
711  WifiModeFactory::CreateWifiMode ("ErpOfdmRate6Mbps",
713  true,
714  20000000, 6000000,
716  2);
717  return mode;
718 }
719 
720 WifiMode
722 {
723  static WifiMode mode =
724  WifiModeFactory::CreateWifiMode ("ErpOfdmRate9Mbps",
726  false,
727  20000000, 9000000,
729  2);
730  return mode;
731 }
732 
733 WifiMode
735 {
736  static WifiMode mode =
737  WifiModeFactory::CreateWifiMode ("ErpOfdmRate12Mbps",
739  true,
740  20000000, 12000000,
742  4);
743  return mode;
744 }
745 
746 WifiMode
748 {
749  static WifiMode mode =
750  WifiModeFactory::CreateWifiMode ("ErpOfdmRate18Mbps",
752  false,
753  20000000, 18000000,
755  4);
756  return mode;
757 }
758 
759 WifiMode
761 {
762  static WifiMode mode =
763  WifiModeFactory::CreateWifiMode ("ErpOfdmRate24Mbps",
765  true,
766  20000000, 24000000,
768  16);
769  return mode;
770 }
771 
772 WifiMode
774 {
775  static WifiMode mode =
776  WifiModeFactory::CreateWifiMode ("ErpOfdmRate36Mbps",
778  false,
779  20000000, 36000000,
781  16);
782  return mode;
783 }
784 
785 WifiMode
787 {
788  static WifiMode mode =
789  WifiModeFactory::CreateWifiMode ("ErpOfdmRate48Mbps",
791  false,
792  20000000, 48000000,
794  64);
795  return mode;
796 }
797 
798 WifiMode
800 {
801  static WifiMode mode =
802  WifiModeFactory::CreateWifiMode ("ErpOfdmRate54Mbps",
804  false,
805  20000000, 54000000,
807  64);
808  return mode;
809 }
810 
811 
812 // Clause 17 rates (OFDM)
813 
814 WifiMode
816 {
817  static WifiMode mode =
818  WifiModeFactory::CreateWifiMode ("OfdmRate6Mbps",
820  true,
821  20000000, 6000000,
823  2);
824  return mode;
825 }
826 
827 WifiMode
829 {
830  static WifiMode mode =
831  WifiModeFactory::CreateWifiMode ("OfdmRate9Mbps",
833  false,
834  20000000, 9000000,
836  2);
837  return mode;
838 }
839 
840 WifiMode
842 {
843  static WifiMode mode =
844  WifiModeFactory::CreateWifiMode ("OfdmRate12Mbps",
846  true,
847  20000000, 12000000,
849  4);
850  return mode;
851 }
852 
853 WifiMode
855 {
856  static WifiMode mode =
857  WifiModeFactory::CreateWifiMode ("OfdmRate18Mbps",
859  false,
860  20000000, 18000000,
862  4);
863  return mode;
864 }
865 
866 WifiMode
868 {
869  static WifiMode mode =
870  WifiModeFactory::CreateWifiMode ("OfdmRate24Mbps",
872  true,
873  20000000, 24000000,
875  16);
876  return mode;
877 }
878 
879 WifiMode
881 {
882  static WifiMode mode =
883  WifiModeFactory::CreateWifiMode ("OfdmRate36Mbps",
885  false,
886  20000000, 36000000,
888  16);
889  return mode;
890 }
891 
892 WifiMode
894 {
895  static WifiMode mode =
896  WifiModeFactory::CreateWifiMode ("OfdmRate48Mbps",
898  false,
899  20000000, 48000000,
901  64);
902  return mode;
903 }
904 
905 WifiMode
907 {
908  static WifiMode mode =
909  WifiModeFactory::CreateWifiMode ("OfdmRate54Mbps",
911  false,
912  20000000, 54000000,
914  64);
915  return mode;
916 }
917 
918 // 10 MHz channel rates
919 
920 WifiMode
922 {
923  static WifiMode mode =
924  WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW10MHz",
926  true,
927  10000000, 3000000,
929  2);
930  return mode;
931 }
932 
933 WifiMode
935 {
936  static WifiMode mode =
937  WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW10MHz",
939  false,
940  10000000, 4500000,
942  2);
943  return mode;
944 }
945 
946 WifiMode
948 {
949  static WifiMode mode =
950  WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW10MHz",
952  true,
953  10000000, 6000000,
955  4);
956  return mode;
957 }
958 
959 WifiMode
961 {
962  static WifiMode mode =
963  WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW10MHz",
965  false,
966  10000000, 9000000,
968  4);
969  return mode;
970 }
971 
972 WifiMode
974 {
975  static WifiMode mode =
976  WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW10MHz",
978  true,
979  10000000, 12000000,
981  16);
982  return mode;
983 }
984 
985 WifiMode
987 {
988  static WifiMode mode =
989  WifiModeFactory::CreateWifiMode ("OfdmRate18MbpsBW10MHz",
991  false,
992  10000000, 18000000,
994  16);
995  return mode;
996 }
997 
998 WifiMode
1000 {
1001  static WifiMode mode =
1002  WifiModeFactory::CreateWifiMode ("OfdmRate24MbpsBW10MHz",
1004  false,
1005  10000000, 24000000,
1007  64);
1008  return mode;
1009 }
1010 
1011 WifiMode
1013 {
1014  static WifiMode mode =
1015  WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW10MHz",
1017  false,
1018  10000000, 27000000,
1020  64);
1021  return mode;
1022 }
1023 
1024 // 5 MHz channel rates
1025 
1026 WifiMode
1028 {
1029  static WifiMode mode =
1030  WifiModeFactory::CreateWifiMode ("OfdmRate1_5MbpsBW5MHz",
1032  true,
1033  5000000, 1500000,
1035  2);
1036  return mode;
1037 }
1038 
1039 WifiMode
1041 {
1042  static WifiMode mode =
1043  WifiModeFactory::CreateWifiMode ("OfdmRate2_25MbpsBW5MHz",
1045  false,
1046  5000000, 2250000,
1048  2);
1049  return mode;
1050 }
1051 
1052 WifiMode
1054 {
1055  static WifiMode mode =
1056  WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW5MHz",
1058  true,
1059  5000000, 3000000,
1061  4);
1062  return mode;
1063 }
1064 
1065 WifiMode
1067 {
1068  static WifiMode mode =
1069  WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW5MHz",
1071  false,
1072  5000000, 4500000,
1074  4);
1075  return mode;
1076 }
1077 
1078 WifiMode
1080 {
1081  static WifiMode mode =
1082  WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW5MHz",
1084  true,
1085  5000000, 6000000,
1087  16);
1088  return mode;
1089 }
1090 
1091 WifiMode
1093 {
1094  static WifiMode mode =
1095  WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW5MHz",
1097  false,
1098  5000000, 9000000,
1100  16);
1101  return mode;
1102 }
1103 
1104 WifiMode
1106 {
1107  static WifiMode mode =
1108  WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW5MHz",
1110  false,
1111  5000000, 12000000,
1113  64);
1114  return mode;
1115 }
1116 
1117 WifiMode
1119 {
1120  static WifiMode mode =
1121  WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW5MHz",
1123  false,
1124  5000000, 13500000,
1126  64);
1127  return mode;
1128 }
1129 
1130 // Clause 20
1131 
1132 WifiMode
1134 {
1135  static WifiMode mode =
1136  WifiModeFactory::CreateWifiMode ("OfdmRate6_5MbpsBW20MHz",
1138  true,
1139  20000000, 6500000,
1141  2);
1142  return mode;
1143 }
1144 WifiMode
1146 {
1147  static WifiMode mode =
1148  WifiModeFactory::CreateWifiMode ("OfdmRate7_2MbpsBW20MHz",
1150  false,
1151  20000000, 7200000,
1153  2);
1154  return mode;
1155 }
1156 
1157 WifiMode
1159 {
1160  static WifiMode mode =
1161  WifiModeFactory::CreateWifiMode ("OfdmRate13MbpsBW20MHz",
1163  true,
1164  20000000, 13000000,
1166  4);
1167  return mode;
1168 }
1169 
1170 WifiMode
1172 {
1173  static WifiMode mode =
1174  WifiModeFactory::CreateWifiMode ("OfdmRate14_4MbpsBW20MHz",
1176  false,
1177  20000000, 14400000,
1179  4);
1180  return mode;
1181 }
1182 WifiMode
1184 {
1185  static WifiMode mode =
1186  WifiModeFactory::CreateWifiMode ("OfdmRate19_5MbpsBW20MHz",
1188  true,
1189  20000000, 19500000,
1191  4);
1192  return mode;
1193 }
1194 
1195 WifiMode
1197 {
1198  static WifiMode mode =
1199  WifiModeFactory::CreateWifiMode ("OfdmRate21_7MbpsBW20MHz",
1201  false,
1202  20000000, 21700000,
1204  4);
1205  return mode;
1206 }
1207 
1208 
1209 WifiMode
1211 {
1212  static WifiMode mode =
1213  WifiModeFactory::CreateWifiMode ("OfdmRate26MbpsBW20MHz",
1215  true,
1216  20000000, 26000000,
1218  16);
1219  return mode;
1220 }
1221 
1222 WifiMode
1224 {
1225  static WifiMode mode =
1226  WifiModeFactory::CreateWifiMode ("OfdmRate28_9MbpsBW20MHz",
1228  false,
1229  20000000, 28900000,
1231  16);
1232  return mode;
1233 }
1234 
1235 WifiMode
1237 {
1238  static WifiMode mode =
1239  WifiModeFactory::CreateWifiMode ("OfdmRate39MbpsBW20MHz",
1241  true,
1242  20000000, 39000000,
1244  16);
1245  return mode;
1246 }
1247 
1248 WifiMode
1250 {
1251  static WifiMode mode =
1252  WifiModeFactory::CreateWifiMode ("OfdmRate43_3MbpsBW20MHz",
1254  false,
1255  20000000, 43300000,
1257  16);
1258  return mode;
1259 }
1260 
1261 WifiMode
1263 {
1264  static WifiMode mode =
1265  WifiModeFactory::CreateWifiMode ("OfdmRate52MbpsBW20MHz",
1267  true,
1268  20000000, 52000000,
1270  64);
1271  return mode;
1272 }
1273 
1274 WifiMode
1276 {
1277  static WifiMode mode =
1278  WifiModeFactory::CreateWifiMode ("OfdmRate57_8MbpsBW20MHz",
1280  false,
1281  20000000, 57800000,
1283  64);
1284  return mode;
1285 }
1286 
1287 
1288 WifiMode
1290 {
1291  static WifiMode mode =
1292  WifiModeFactory::CreateWifiMode ("OfdmRate58_5MbpsBW20MHz",
1294  true,
1295  20000000, 58500000,
1297  64);
1298  return mode;
1299 }
1300 
1301 WifiMode
1303 {
1304  static WifiMode mode =
1305  WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHzShGi",
1307  false,
1308  20000000, 65000000,
1310  64);
1311  return mode;
1312 }
1313 
1314 WifiMode
1316 {
1317  static WifiMode mode =
1318  WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHz",
1320  true,
1321  20000000, 65000000,
1323  64);
1324  return mode;
1325 }
1326 
1327 WifiMode
1329 {
1330  static WifiMode mode =
1331  WifiModeFactory::CreateWifiMode ("OfdmRate72_2MbpsBW20MHz",
1333  false,
1334  20000000, 72200000,
1336  64);
1337  return mode;
1338 }
1339 
1340 WifiMode
1342 {
1343  static WifiMode mode =
1344  WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW40MHz",
1346  false,
1347  40000000, 13500000,
1349  2);
1350  return mode;
1351 }
1352 
1353 WifiMode
1355 {
1356  static WifiMode mode =
1357  WifiModeFactory::CreateWifiMode ("OfdmRate15MbpsBW40MHz",
1359  false,
1360  40000000, 15000000,
1362  2);
1363  return mode;
1364 }
1365 
1366 WifiMode
1368 {
1369  static WifiMode mode =
1370  WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW40MHz",
1372  false,
1373  40000000, 27000000,
1375  4);
1376  return mode;
1377 }
1378 WifiMode
1380 {
1381  static WifiMode mode =
1382  WifiModeFactory::CreateWifiMode ("OfdmRate30MbpsBW40MHz",
1384  false,
1385  40000000, 30000000,
1387  4);
1388  return mode;
1389 }
1390 
1391 WifiMode
1393 {
1394  static WifiMode mode =
1395  WifiModeFactory::CreateWifiMode ("OfdmRate40_5MbpsBW40MHz",
1397  false,
1398  40000000, 40500000,
1400  4);
1401  return mode;
1402 }
1403 WifiMode
1405 {
1406  static WifiMode mode =
1407  WifiModeFactory::CreateWifiMode ("OfdmRate45MbpsBW40MHz",
1409  false,
1410  40000000, 45000000,
1412  4);
1413  return mode;
1414 }
1415 
1416 WifiMode
1418 {
1419  static WifiMode mode =
1420  WifiModeFactory::CreateWifiMode ("OfdmRate54MbpsBW40MHz",
1422  false,
1423  40000000, 54000000,
1425  16);
1426  return mode;
1427 }
1428 
1429 WifiMode
1431 {
1432  static WifiMode mode =
1433  WifiModeFactory::CreateWifiMode ("OfdmRate60MbpsBW40MHz",
1435  false,
1436  40000000, 60000000,
1438  16);
1439  return mode;
1440 }
1441 
1442 WifiMode
1444 {
1445  static WifiMode mode =
1446  WifiModeFactory::CreateWifiMode ("OfdmRate81MbpsBW40MHz",
1448  false,
1449  40000000, 81000000,
1451  16);
1452  return mode;
1453 }
1454 WifiMode
1456 {
1457  static WifiMode mode =
1458  WifiModeFactory::CreateWifiMode ("OfdmRate90MbpsBW40MHz",
1460  false,
1461  40000000, 90000000,
1463  16);
1464  return mode;
1465 }
1466 
1467 WifiMode
1469 {
1470  static WifiMode mode =
1471  WifiModeFactory::CreateWifiMode ("OfdmRate108MbpsBW40MHz",
1473  false,
1474  40000000, 108000000,
1476  64);
1477  return mode;
1478 }
1479 WifiMode
1481 {
1482  static WifiMode mode =
1483  WifiModeFactory::CreateWifiMode ("OfdmRate120MbpsBW40MHz",
1485  false,
1486  40000000, 120000000,
1488  64);
1489  return mode;
1490 }
1491 WifiMode
1493 {
1494  static WifiMode mode =
1495  WifiModeFactory::CreateWifiMode ("OfdmRate121_5MbpsBW40MHz",
1497  false,
1498  40000000, 121500000,
1500  64);
1501  return mode;
1502 }
1503 WifiMode
1505 {
1506  static WifiMode mode =
1507  WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHzShGi",
1509  false,
1510  40000000, 135000000,
1512  64);
1513  return mode;
1514 }
1515 WifiMode
1517 {
1518  static WifiMode mode =
1519  WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHz",
1521  false,
1522  40000000, 135000000,
1524  64);
1525  return mode;
1526 }
1527 
1528 WifiMode
1530 {
1531  static WifiMode mode =
1532  WifiModeFactory::CreateWifiMode ("OfdmRate150MbpsBW40MHz",
1534  false,
1535  40000000, 150000000,
1537  64);
1538  return mode;
1539 }
1540 
1541 
1542 
1543 std::ostream& operator<< (std::ostream& os, enum WifiPhy::State state)
1544 {
1545  switch (state)
1546  {
1547  case WifiPhy::IDLE:
1548  return (os << "IDLE");
1549  case WifiPhy::CCA_BUSY:
1550  return (os << "CCA_BUSY");
1551  case WifiPhy::TX:
1552  return (os << "TX");
1553  case WifiPhy::RX:
1554  return (os << "RX");
1555  case WifiPhy::SWITCHING:
1556  return (os << "SWITCHING");
1557  case WifiPhy::SLEEP:
1558  return (os << "SLEEP");
1559  default:
1560  NS_FATAL_ERROR ("Invalid WifiPhy state");
1561  return (os << "INVALID");
1562  }
1563 }
1564 
1565 
1566 
1567 } // namespace ns3
1568 
1569 namespace {
1570 
1571 static class Constructor
1572 {
1573 public:
1575  {
1644  }
1645 } g_constructor;
1646 }
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:1092
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
Definition: wifi-phy.h:1190
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:760
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:692
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:773
#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:1210
ERP-OFDM PHY (19.5)
Definition: wifi-mode.h:52
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:828
static WifiMode GetOfdmRate7_2MbpsBW20MHz()
Return a WifiMode for OFDM at 7.2Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1145
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:986
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:1012
#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:1053
virtual ~WifiPhy()
Definition: wifi-phy.cc:115
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:650
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:641
static WifiMode GetOfdmRate81MbpsBW40MHz()
Return a WifiMode for OFDM at 81Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1443
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:747
The PHY layer has sense the medium busy through the CCA mechanism.
Definition: wifi-phy.h:141
static Time GetPlcpHtSigHeaderDuration(WifiPreamble preamble)
Definition: wifi-phy.cc:173
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:1231
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:1198
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:67
static WifiMode GetOfdmRate43_3MbpsBW20MHz()
Return a WifiMode for OFDM at 43.3Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1249
#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:1430
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1027
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:934
static WifiMode GetMFPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:122
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:906
#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:611
static WifiMode GetOfdmRate108MbpsBW40MHz()
Return a WifiMode for OFDM at 108Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1468
static WifiMode GetOfdmRate21_7MbpsBW20MHz()
Return a WifiMode for OFDM at 21.7Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1196
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:599
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:1516
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:880
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1079
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:799
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:629
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:1133
static WifiMode GetOfdmRate135MbpsBW40MHzShGi()
Return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1504
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:1229
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:890
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:1182
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:786
static WifiMode GetPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:190
uint8_t GetNess(void) const
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:973
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:1205
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:617
static WifiMode GetOfdmRate19_5MbpsBW20MHz()
Return a WifiMode for OFDM at 19.5Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1183
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:854
Time CalculateTxDuration(uint32_t size, WifiTxVector txvector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:577
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:960
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:1217
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:1105
static WifiMode GetOfdmRate52MbpsBW20MHz()
Return a WifiMode for OFDM at 52Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1262
#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:1392
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:1166
static WifiMode GetOfdmRate72_2MbpsBW20MHz()
Return a WifiMode for OFDM at 72.2Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1328
static WifiMode GetOfdmRate65MbpsBW20MHzShGi()
Return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1302
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:893
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:263
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:635
static TypeId GetTypeId(void)
Definition: wifi-phy.cc:54
static Time GetPlcpHtTrainingSymbolDuration(WifiPreamble preamble, WifiTxVector txvector)
Definition: wifi-phy.cc:136
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:1275
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:867
static WifiMode GetOfdmRate13MbpsBW20MHz()
Return a WifiMode for OFDM at 13Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1158
static WifiMode GetOfdmRate65MbpsBW20MHz()
Return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1315
static WifiMode GetOfdmRate58_5MbpsBW20MHz()
Return a WifiMode for OFDM at 58.5Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1289
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:679
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1040
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:721
void NotifyTxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyTxEnd trace.
Definition: wifi-phy.cc:605
static WifiMode GetOfdmRate15MbpsBW40MHz()
Return a WifiMode for OFDM at 15Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1354
static WifiMode GetOfdmRate121_5MbpsBW40MHz()
Return a WifiMode for OFDM at 121.5Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1492
static WifiMode GetOfdmRate28_9MbpsBW20MHz()
Return a WifiMode for OFDM at 28.9Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1223
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:346
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:708
uint8_t GetNss(void) const
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:734
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:623
static WifiMode GetOfdmRate13_5MbpsBW40MHz()
Return a WifiMode for OFDM at 13.5Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1341
static WifiMode GetOfdmRate30MbpsBW40MHz()
Return a WifiMode for OFDM at 30Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1379
static WifiMode GetOfdmRate54MbpsBW40MHz()
Return a WifiMode for OFDM at 54Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1417
OFDM PHY (Clause 17)
Definition: wifi-mode.h:54
Time CalculatePlcpDuration(WifiTxVector txvector, enum WifiPreamble preamble)
Definition: wifi-phy.cc:588
static WifiMode GetOfdmRate90MbpsBW40MHz()
Return a WifiMode for OFDM at 90Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1455
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:1232
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:882
static WifiMode GetOfdmRate45MbpsBW40MHz()
Return a WifiMode for OFDM at 45Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1404
static WifiMode GetOfdmRate120MbpsBW40MHz()
Return a WifiMode for OFDM at 120Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1480
static WifiMode GetOfdmRate39MbpsBW20MHz()
Return a WifiMode for OFDM at 39Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1236
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:663
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:947
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:999
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1118
a unique identifier for an interface.
Definition: type-id.h:57
uint64_t GetDataRate(void) const
Definition: wifi-mode.cc:79
TypeId SetParent(TypeId tid)
Definition: type-id.cc:638
Time GetPayloadDuration(uint32_t size, WifiTxVector txvector, WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
Definition: wifi-phy.cc:383
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:815
static WifiMode GetOfdmRate27MbpsBW40MHz()
Return a WifiMode for OFDM at 27Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1367
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:1066
static WifiMode GetOfdmRate14_4MbpsBW20MHz()
Return a WifiMode for OFDM at 14.4Mbps with 20MHz channel spacing.
Definition: wifi-phy.cc:1171
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:921
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
Definition: wifi-phy.h:1174
static WifiMode GetOfdmRate150MbpsBW40MHz()
Return a WifiMode for OFDM at 150Mbps with 40MHz channel spacing.
Definition: wifi-phy.cc:1529
static Time GetPlcpPreambleDuration(WifiMode payloadMode, WifiPreamble preamble)
Definition: wifi-phy.cc:330