A Discrete-Event Network Simulator
API
yans-wifi-phy.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2005,2006 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  * Ghada Badawy <gbadawy@gmail.com>
20  * Sébastien Deronne <sebastien.deronne@gmail.com>
21  */
22 
23 #include "yans-wifi-phy.h"
24 #include "yans-wifi-channel.h"
25 #include "wifi-mode.h"
26 #include "wifi-preamble.h"
27 #include "wifi-phy-state-helper.h"
28 #include "error-rate-model.h"
29 #include "ns3/simulator.h"
30 #include "ns3/packet.h"
31 #include "ns3/assert.h"
32 #include "ns3/log.h"
33 #include "ns3/double.h"
34 #include "ns3/uinteger.h"
35 #include "ns3/enum.h"
36 #include "ns3/pointer.h"
37 #include "ns3/net-device.h"
38 #include "ns3/trace-source-accessor.h"
39 #include "ns3/boolean.h"
40 #include "ns3/node.h"
41 #include "ampdu-tag.h"
42 #include <cmath>
43 
44 namespace ns3 {
45 
46 NS_LOG_COMPONENT_DEFINE ("YansWifiPhy");
47 
48 NS_OBJECT_ENSURE_REGISTERED (YansWifiPhy);
49 
50 TypeId
52 {
53  static TypeId tid = TypeId ("ns3::YansWifiPhy")
54  .SetParent<WifiPhy> ()
55  .SetGroupName ("Wifi")
56  .AddConstructor<YansWifiPhy> ()
57  .AddAttribute ("EnergyDetectionThreshold",
58  "The energy of a received signal should be higher than "
59  "this threshold (dbm) to allow the PHY layer to detect the signal.",
60  DoubleValue (-96.0),
63  MakeDoubleChecker<double> ())
64  .AddAttribute ("CcaMode1Threshold",
65  "The energy of a received signal should be higher than "
66  "this threshold (dbm) to allow the PHY layer to declare CCA BUSY state.",
67  DoubleValue (-99.0),
70  MakeDoubleChecker<double> ())
71  .AddAttribute ("TxGain",
72  "Transmission gain (dB).",
73  DoubleValue (1.0),
76  MakeDoubleChecker<double> ())
77  .AddAttribute ("RxGain",
78  "Reception gain (dB).",
79  DoubleValue (1.0),
82  MakeDoubleChecker<double> ())
83  .AddAttribute ("TxPowerLevels",
84  "Number of transmission power levels available between "
85  "TxPowerStart and TxPowerEnd included.",
86  UintegerValue (1),
88  MakeUintegerChecker<uint32_t> ())
89  .AddAttribute ("TxPowerEnd",
90  "Maximum available transmission level (dbm).",
91  DoubleValue (16.0206),
94  MakeDoubleChecker<double> ())
95  .AddAttribute ("TxPowerStart",
96  "Minimum available transmission level (dbm).",
97  DoubleValue (16.0206),
100  MakeDoubleChecker<double> ())
101  .AddAttribute ("RxNoiseFigure",
102  "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
103  " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
104  "\"the difference in decibels (dB) between"
105  " the noise output of the actual receiver to the noise output of an "
106  " ideal receiver with the same overall gain and bandwidth when the receivers "
107  " are connected to sources at the standard noise temperature T0 (usually 290 K)\".",
108  DoubleValue (7),
111  MakeDoubleChecker<double> ())
112  .AddAttribute ("State",
113  "The state of the PHY layer.",
114  PointerValue (),
116  MakePointerChecker<WifiPhyStateHelper> ())
117  .AddAttribute ("ChannelSwitchDelay",
118  "Delay between two short frames transmitted on different frequencies.",
119  TimeValue (MicroSeconds (250)),
121  MakeTimeChecker ())
122  .AddAttribute ("ChannelNumber",
123  "Channel center frequency = Channel starting frequency + 5 MHz * nch.",
124  UintegerValue (1),
127  MakeUintegerChecker<uint16_t> ())
128  .AddAttribute ("Frequency",
129  "The operating frequency.",
130  UintegerValue (2407),
133  MakeUintegerChecker<uint32_t> ())
134  .AddAttribute ("TxAntennas",
135  "The number of supported Tx antennas.",
136  UintegerValue (1),
139  MakeUintegerChecker<uint32_t> ())
140  .AddAttribute ("RxAntennas",
141  "The number of supported Rx antennas.",
142  UintegerValue (1),
145  MakeUintegerChecker<uint32_t> ())
146  .AddAttribute ("ShortGuardEnabled",
147  "Whether or not short guard interval is enabled."
148  "This parameter is only valuable for 802.11n/ac STAs and APs.",
149  BooleanValue (false),
153  .AddAttribute ("LdpcEnabled",
154  "Whether or not LDPC is enabled.",
155  BooleanValue (false),
159  .AddAttribute ("STBCEnabled",
160  "Whether or not STBC is enabled.",
161  BooleanValue (false),
165  .AddAttribute ("GreenfieldEnabled",
166  "Whether or not Greenfield is enabled."
167  "This parameter is only valuable for 802.11n STAs and APs.",
168  BooleanValue (false),
172  .AddAttribute ("ShortPlcpPreambleSupported",
173  "Whether or not short PLCP preamble is supported."
174  "This parameter is only valuable for 802.11b STAs and APs."
175  "Note: 802.11g APs and STAs always support short PLCP preamble.",
176  BooleanValue (false),
180  .AddAttribute ("ChannelWidth",
181  "Whether 5MHz, 10MHz, 20MHz, 22MHz, 40MHz, 80 MHz or 160 MHz.",
182  UintegerValue (20),
185  MakeUintegerChecker<uint32_t> ())
186  ;
187  return tid;
188 }
189 
191  : m_initialized (false),
192  m_channelNumber (1),
193  m_endRxEvent (),
194  m_endPlcpRxEvent (),
195  m_channelStartingFrequency (0),
196  m_mpdusNum (0),
197  m_plcpSuccess (false),
198  m_txMpduReferenceNumber (0xffffffff),
199  m_rxMpduReferenceNumber (0xffffffff)
200 {
201  NS_LOG_FUNCTION (this);
202  m_random = CreateObject<UniformRandomVariable> ();
203  m_state = CreateObject<WifiPhyStateHelper> ();
204 }
205 
207 {
208  NS_LOG_FUNCTION (this);
209 }
210 
211 void
213 {
214  NS_LOG_FUNCTION (this);
215  m_channel = 0;
216  m_deviceRateSet.clear ();
217  m_deviceMcsSet.clear ();
218  m_device = 0;
219  m_mobility = 0;
220  m_state = 0;
221 }
222 
223 void
225 {
226  NS_LOG_FUNCTION (this);
227  m_initialized = true;
228 }
229 
230 void
232 {
233  NS_LOG_FUNCTION (this << standard);
234  switch (standard)
235  {
237  Configure80211a ();
238  break;
240  Configure80211b ();
241  break;
243  Configure80211g ();
244  break;
247  break;
250  break;
252  ConfigureHolland ();
253  break;
256  Configure80211n ();
257  break;
260  Configure80211n ();
261  break;
263  Configure80211ac ();
264  break;
265  default:
266  NS_ASSERT (false);
267  break;
268  }
269 }
270 
271 void
272 YansWifiPhy::SetRxNoiseFigure (double noiseFigureDb)
273 {
274  NS_LOG_FUNCTION (this << noiseFigureDb);
275  m_interference.SetNoiseFigure (DbToRatio (noiseFigureDb));
276 }
277 
278 void
280 {
281  NS_LOG_FUNCTION (this << start);
283 }
284 
285 void
287 {
288  NS_LOG_FUNCTION (this << end);
289  m_txPowerEndDbm = end;
290 }
291 
292 void
294 {
295  NS_LOG_FUNCTION (this << n);
296  m_nTxPower = n;
297 }
298 
299 void
301 {
302  NS_LOG_FUNCTION (this << gain);
303  m_txGainDb = gain;
304 }
305 
306 void
308 {
309  NS_LOG_FUNCTION (this << gain);
310  m_rxGainDb = gain;
311 }
312 
313 void
314 YansWifiPhy::SetEdThreshold (double threshold)
315 {
316  NS_LOG_FUNCTION (this << threshold);
317  m_edThresholdW = DbmToW (threshold);
318 }
319 
320 void
322 {
323  NS_LOG_FUNCTION (this << threshold);
324  m_ccaMode1ThresholdW = DbmToW (threshold);
325 }
326 
327 void
329 {
331 }
332 
333 void
335 {
336  m_device = device;
337 }
338 
339 void
341 {
343 }
344 
345 double
347 {
349 }
350 
351 double
353 {
354  return m_txPowerBaseDbm;
355 }
356 
357 double
359 {
360  return m_txPowerEndDbm;
361 }
362 
363 double
365 {
366  return m_txGainDb;
367 }
368 
369 double
371 {
372  return m_rxGainDb;
373 }
374 
375 double
377 {
378  return WToDbm (m_edThresholdW);
379 }
380 
381 double
383 {
384  return WToDbm (m_ccaMode1ThresholdW);
385 }
386 
389 {
391 }
392 
395 {
396  return m_device;
397 }
398 
401 {
402  if (m_mobility != 0)
403  {
404  return m_mobility;
405  }
406  else
407  {
408  return m_device->GetNode ()->GetObject<MobilityModel> ();
409  }
410 }
411 
412 double
413 YansWifiPhy::CalculateSnr (WifiTxVector txVector, double ber) const
414 {
415  return m_interference.GetErrorRateModel ()->CalculateSnr (txVector, ber);
416 }
417 
420 {
421  return m_channel;
422 }
423 
424 void
426 {
427  m_channel = channel;
428  m_channel->Add (this);
429 }
430 
431 void
433 {
434  if (!m_initialized)
435  {
436  //this is not channel switch, this is initialization
437  NS_LOG_DEBUG ("start at channel " << nch);
438  m_channelNumber = nch;
439  return;
440  }
441 
443  switch (m_state->GetState ())
444  {
445  case YansWifiPhy::RX:
446  NS_LOG_DEBUG ("drop packet because of channel switching while reception");
448  m_endRxEvent.Cancel ();
449  goto switchChannel;
450  break;
451  case YansWifiPhy::TX:
452  NS_LOG_DEBUG ("channel switching postponed until end of current transmission");
454  break;
456  case YansWifiPhy::IDLE:
457  goto switchChannel;
458  break;
459  case YansWifiPhy::SLEEP:
460  NS_LOG_DEBUG ("channel switching ignored in sleep mode");
461  break;
462  default:
463  NS_ASSERT (false);
464  break;
465  }
466 
467  return;
468 
469 switchChannel:
470 
471  NS_LOG_DEBUG ("switching channel " << m_channelNumber << " -> " << nch);
472  m_state->SwitchToChannelSwitching (m_channelSwitchDelay);
474  /*
475  * Needed here to be able to correctly sensed the medium for the first
476  * time after the switching. The actual switching is not performed until
477  * after m_channelSwitchDelay. Packets received during the switching
478  * state are added to the event list and are employed later to figure
479  * out the state of the medium after the switching.
480  */
481  m_channelNumber = nch;
482 }
483 
484 uint16_t
486 {
487  return m_channelNumber;
488 }
489 
490 Time
492 {
493  return m_channelSwitchDelay;
494 }
495 
496 double
498 {
500 }
501 
502 void
504 {
505  NS_LOG_FUNCTION (this);
506  switch (m_state->GetState ())
507  {
508  case YansWifiPhy::TX:
509  NS_LOG_DEBUG ("setting sleep mode postponed until end of current transmission");
511  break;
512  case YansWifiPhy::RX:
513  NS_LOG_DEBUG ("setting sleep mode postponed until end of current reception");
515  break;
517  NS_LOG_DEBUG ("setting sleep mode postponed until end of channel switching");
519  break;
521  case YansWifiPhy::IDLE:
522  NS_LOG_DEBUG ("setting sleep mode");
523  m_state->SwitchToSleep ();
524  break;
525  case YansWifiPhy::SLEEP:
526  NS_LOG_DEBUG ("already in sleep mode");
527  break;
528  default:
529  NS_ASSERT (false);
530  break;
531  }
532 }
533 
534 void
536 {
537  NS_LOG_FUNCTION (this);
538  switch (m_state->GetState ())
539  {
540  case YansWifiPhy::TX:
541  case YansWifiPhy::RX:
542  case YansWifiPhy::IDLE:
545  {
546  NS_LOG_DEBUG ("not in sleep mode, there is nothing to resume");
547  break;
548  }
549  case YansWifiPhy::SLEEP:
550  {
551  NS_LOG_DEBUG ("resuming from sleep mode");
553  m_state->SwitchFromSleep (delayUntilCcaEnd);
554  break;
555  }
556  default:
557  {
558  NS_ASSERT (false);
559  break;
560  }
561  }
562 }
563 
564 void
566 {
567  m_state->SetReceiveOkCallback (callback);
568 }
569 
570 void
572 {
573  m_state->SetReceiveErrorCallback (callback);
574 }
575 
576 void
578  double rxPowerDbm,
579  WifiTxVector txVector,
580  enum WifiPreamble preamble,
581  enum mpduType mpdutype,
582  Time rxDuration)
583 {
584  //This function should be later split to check separately whether plcp preamble and plcp header can be successfully received.
585  //Note: plcp preamble reception is not yet modeled.
586  NS_LOG_FUNCTION (this << packet << rxPowerDbm << txVector.GetMode () << preamble << (uint32_t)mpdutype);
587  AmpduTag ampduTag;
588  rxPowerDbm += m_rxGainDb;
589  double rxPowerW = DbmToW (rxPowerDbm);
590  Time endRx = Simulator::Now () + rxDuration;
591  Time preambleAndHeaderDuration = CalculatePlcpPreambleAndHeaderDuration (txVector, preamble);
592 
594  event = m_interference.Add (packet->GetSize (),
595  txVector,
596  preamble,
597  rxDuration,
598  rxPowerW);
599 
600  switch (m_state->GetState ())
601  {
603  NS_LOG_DEBUG ("drop packet because of channel switching");
604  NotifyRxDrop (packet);
605  m_plcpSuccess = false;
606  /*
607  * Packets received on the upcoming channel are added to the event list
608  * during the switching state. This way the medium can be correctly sensed
609  * when the device listens to the channel for the first time after the
610  * switching e.g. after channel switching, the channel may be sensed as
611  * busy due to other devices' tramissions started before the end of
612  * the switching.
613  */
614  if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ())
615  {
616  //that packet will be noise _after_ the completion of the
617  //channel switching.
618  goto maybeCcaBusy;
619  }
620  break;
621  case YansWifiPhy::RX:
622  NS_LOG_DEBUG ("drop packet because already in Rx (power=" <<
623  rxPowerW << "W)");
624  NotifyRxDrop (packet);
625  if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ())
626  {
627  //that packet will be noise _after_ the reception of the
628  //currently-received packet.
629  goto maybeCcaBusy;
630  }
631  break;
632  case YansWifiPhy::TX:
633  NS_LOG_DEBUG ("drop packet because already in Tx (power=" <<
634  rxPowerW << "W)");
635  NotifyRxDrop (packet);
636  if (endRx > Simulator::Now () + m_state->GetDelayUntilIdle ())
637  {
638  //that packet will be noise _after_ the transmission of the
639  //currently-transmitted packet.
640  goto maybeCcaBusy;
641  }
642  break;
644  case YansWifiPhy::IDLE:
645  if (rxPowerW > m_edThresholdW) //checked here, no need to check in the payload reception (current implementation assumes constant rx power over the packet duration)
646  {
647  if (preamble == WIFI_PREAMBLE_NONE && m_mpdusNum == 0)
648  {
649  NS_LOG_DEBUG ("drop packet because no preamble has been received");
650  NotifyRxDrop (packet);
651  goto maybeCcaBusy;
652  }
653  else if (preamble == WIFI_PREAMBLE_NONE && m_plcpSuccess == false) //A-MPDU reception fails
654  {
655  NS_LOG_DEBUG ("Drop MPDU because no plcp has been received");
656  NotifyRxDrop (packet);
657  goto maybeCcaBusy;
658  }
659  else if (preamble != WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum == 0)
660  {
661  //received the first MPDU in an MPDU
662  m_mpdusNum = ampduTag.GetNoOfMpdus () - 1;
664  }
665  else if (preamble == WIFI_PREAMBLE_NONE && packet->PeekPacketTag (ampduTag) && m_mpdusNum > 0)
666  {
667  //received the other MPDUs that are part of the A-MPDU
668  if (ampduTag.GetNoOfMpdus () < m_mpdusNum)
669  {
670  NS_LOG_DEBUG ("Missing MPDU from the A-MPDU " << m_mpdusNum - ampduTag.GetNoOfMpdus ());
671  m_mpdusNum = ampduTag.GetNoOfMpdus ();
672  }
673  else
674  {
675  m_mpdusNum--;
676  }
677  }
678  else if (preamble != WIFI_PREAMBLE_NONE && m_mpdusNum > 0 )
679  {
680  NS_LOG_DEBUG ("Didn't receive the last MPDUs from an A-MPDU " << m_mpdusNum);
681  m_mpdusNum = 0;
682  }
683 
684  NS_LOG_DEBUG ("sync to signal (power=" << rxPowerW << "W)");
685  //sync to signal
686  m_state->SwitchToRx (rxDuration);
688  NotifyRxBegin (packet);
690 
691  if (preamble != WIFI_PREAMBLE_NONE)
692  {
694  m_endPlcpRxEvent = Simulator::Schedule (preambleAndHeaderDuration, &YansWifiPhy::StartReceivePacket, this,
695  packet, txVector, preamble, mpdutype, event);
696  }
697 
700  packet, preamble, mpdutype, event);
701  }
702  else
703  {
704  NS_LOG_DEBUG ("drop packet because signal power too Small (" <<
705  rxPowerW << "<" << m_edThresholdW << ")");
706  NotifyRxDrop (packet);
707  m_plcpSuccess = false;
708  goto maybeCcaBusy;
709  }
710  break;
711  case YansWifiPhy::SLEEP:
712  NS_LOG_DEBUG ("drop packet because in sleep mode");
713  NotifyRxDrop (packet);
714  m_plcpSuccess = false;
715  break;
716  }
717 
718  return;
719 
720 maybeCcaBusy:
721  //We are here because we have received the first bit of a packet and we are
722  //not going to be able to synchronize on it
723  //In this model, CCA becomes busy when the aggregation of all signals as
724  //tracked by the InterferenceHelper class is higher than the CcaBusyThreshold
725 
727  if (!delayUntilCcaEnd.IsZero ())
728  {
729  m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd);
730  }
731 }
732 
733 void
735  WifiTxVector txVector,
736  enum WifiPreamble preamble,
737  enum mpduType mpdutype,
739 {
740  NS_LOG_FUNCTION (this << packet << txVector.GetMode () << preamble << (uint32_t)mpdutype);
741  NS_ASSERT (IsStateRx ());
743  AmpduTag ampduTag;
744  WifiMode txMode = txVector.GetMode ();
745 
746  struct InterferenceHelper::SnrPer snrPer;
747  snrPer = m_interference.CalculatePlcpHeaderSnrPer (event);
748 
749  NS_LOG_DEBUG ("snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per);
750 
751  if (m_random->GetValue () > snrPer.per) //plcp reception succeeded
752  {
753  if (IsModeSupported (txMode) || IsMcsSupported (txMode))
754  {
755  NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled
756  m_plcpSuccess = true;
757  }
758  else //mode is not allowed
759  {
760  NS_LOG_DEBUG ("drop packet because it was sent using an unsupported mode (" << txMode << ")");
761  NotifyRxDrop (packet);
762  m_plcpSuccess = false;
763  }
764  }
765  else //plcp reception failed
766  {
767  NS_LOG_DEBUG ("drop packet because plcp preamble/header reception failed");
768  NotifyRxDrop (packet);
769  m_plcpSuccess = false;
770  }
771 }
772 
773 void
775 {
776  SendPacket (packet, txVector, preamble, NORMAL_MPDU);
777 }
778 
779 void
781 {
782  NS_LOG_FUNCTION (this << packet << txVector.GetMode ()
783  << txVector.GetMode ().GetDataRate (txVector)
784  << preamble << (uint32_t)txVector.GetTxPowerLevel () << (uint32_t)mpdutype);
785  /* Transmission can happen if:
786  * - we are syncing on a packet. It is the responsability of the
787  * MAC layer to avoid doing this but the PHY does nothing to
788  * prevent it.
789  * - we are idle
790  */
791  NS_ASSERT (!m_state->IsStateTx () && !m_state->IsStateSwitching ());
792 
793  if (m_state->IsStateSleep ())
794  {
795  NS_LOG_DEBUG ("Dropping packet because in sleep mode");
796  NotifyTxDrop (packet);
797  return;
798  }
799 
800  Time txDuration = CalculateTxDuration (packet->GetSize (), txVector, preamble, GetFrequency (), mpdutype, 1);
801  NS_ASSERT (txDuration > NanoSeconds (0));
802 
803  if (m_state->IsStateRx ())
804  {
806  m_endRxEvent.Cancel ();
808  }
809  NotifyTxBegin (packet);
810  uint32_t dataRate500KbpsUnits;
812  {
813  dataRate500KbpsUnits = 128 + txVector.GetMode ().GetMcsValue ();
814  }
815  else
816  {
817  dataRate500KbpsUnits = txVector.GetMode ().GetDataRate (txVector.GetChannelWidth (), txVector.IsShortGuardInterval (), 1) * txVector.GetNss () / 500000;
818  }
819  if (mpdutype == MPDU_IN_AGGREGATE && preamble != WIFI_PREAMBLE_NONE)
820  {
821  //send the first MPDU in an MPDU
823  }
824  struct mpduInfo aMpdu;
825  aMpdu.type = mpdutype;
827  NotifyMonitorSniffTx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, preamble, txVector, aMpdu);
828  m_state->SwitchToTx (txDuration, packet, GetPowerDbm (txVector.GetTxPowerLevel ()), txVector, preamble);
829  m_channel->Send (this, packet, GetPowerDbm (txVector.GetTxPowerLevel ()) + m_txGainDb, txVector, preamble, mpdutype, txDuration);
830 }
831 
832 uint32_t
834 {
835  return m_deviceRateSet.size ();
836 }
837 
838 WifiMode
839 YansWifiPhy::GetMode (uint32_t mode) const
840 {
841  return m_deviceRateSet[mode];
842 }
843 
844 bool
846 {
847  for (uint32_t i = 0; i < GetNModes (); i++)
848  {
849  if (mode == GetMode (i))
850  {
851  return true;
852  }
853  }
854  return false;
855 }
856 bool
858 {
859  for (uint32_t i = 0; i < GetNMcs (); i++)
860  {
861  if (mcs == GetMcs (i))
862  {
863  return true;
864  }
865  }
866  return false;
867 }
868 
869 uint32_t
871 {
872  return m_nTxPower;
873 }
874 
875 void
877 {
878  NS_LOG_FUNCTION (this);
879  m_channelStartingFrequency = 5e3; //5.000 GHz
880  SetChannelWidth (20); //20 MHz
881 
890 }
891 
892 void
894 {
895  NS_LOG_FUNCTION (this);
896  m_channelStartingFrequency = 2407; //2.407 GHz
897  SetChannelWidth (22); //22 MHz
898 
903 }
904 
905 void
907 {
908  NS_LOG_FUNCTION (this);
909  Configure80211b ();
910  SetChannelWidth (20); //20 MHz
911 
920 }
921 
922 void
924 {
925  NS_LOG_FUNCTION (this);
926  m_channelStartingFrequency = 5e3; //5.000 GHz, suppose 802.11a
927  SetChannelWidth (10); //10 MHz
928 
937 }
938 
939 void
941 {
942  NS_LOG_FUNCTION (this);
943  m_channelStartingFrequency = 5e3; //5.000 GHz, suppose 802.11a
944  SetChannelWidth (5); //5 MHz
945 
954 }
955 
956 void
958 {
959  NS_LOG_FUNCTION (this);
960  m_channelStartingFrequency = 5e3; //5.000 GHz
961  SetChannelWidth (20); //20 MHz
962 
968 }
969 
970 void
972 {
973  NS_LOG_FUNCTION (this);
974 
975  bool htFound = false;
976  for (std::vector<uint32_t>::size_type i = 0; i < m_bssMembershipSelectorSet.size (); i++)
977  {
979  {
980  htFound = true;
981  break;
982  }
983  }
984  if (htFound)
985  {
986  // erase all HtMcs modes from deviceMcsSet
987  size_t index = m_deviceMcsSet.size () - 1;
988  for (std::vector<WifiMode>::reverse_iterator rit = m_deviceMcsSet.rbegin (); rit != m_deviceMcsSet.rend(); ++rit, --index)
989  {
990  if (m_deviceMcsSet[index].GetModulationClass ()== WIFI_MOD_CLASS_HT)
991  {
992  m_deviceMcsSet.erase (m_deviceMcsSet.begin () + index);
993  }
994  }
995  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs0 ());
996  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs1 ());
997  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs2 ());
998  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs3 ());
999  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs4 ());
1000  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs5 ());
1001  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs6 ());
1002  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs7 ());
1003  if (GetSupportedTxSpatialStreams () > 1)
1004  {
1005  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs8 ());
1006  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs9 ());
1007  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs10 ());
1008  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs11 ());
1009  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs12 ());
1010  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs13 ());
1011  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs14 ());
1012  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs15 ());
1013  }
1014  if (GetSupportedTxSpatialStreams () > 2)
1015  {
1016  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs16 ());
1017  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs17 ());
1018  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs18 ());
1019  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs19 ());
1020  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs20 ());
1021  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs21 ());
1022  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs22 ());
1023  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs23 ());
1024  }
1025  if (GetSupportedTxSpatialStreams () > 3)
1026  {
1027  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs24 ());
1028  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs25 ());
1029  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs26 ());
1030  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs27 ());
1031  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs28 ());
1032  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs29 ());
1033  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs30 ());
1034  m_deviceMcsSet.push_back (WifiPhy::GetHtMcs31 ());
1035  }
1036  }
1037 }
1038 
1039 void
1041 {
1042  NS_LOG_FUNCTION (this);
1043  if (m_channelStartingFrequency >= 2400 && m_channelStartingFrequency <= 2500) //at 2.4 GHz
1044  {
1045  Configure80211b ();
1046  Configure80211g ();
1047  }
1048  if (m_channelStartingFrequency >= 5000 && m_channelStartingFrequency <= 6000) //at 5 GHz
1049  {
1050  Configure80211a ();
1051  }
1052  SetChannelWidth (20); //20 MHz
1053  m_bssMembershipSelectorSet.push_back (HT_PHY);
1055 }
1056 
1057 void
1059 {
1060  NS_LOG_FUNCTION (this);
1061  m_channelStartingFrequency = 5e3; //5.000 GHz
1062  Configure80211n ();
1063  SetChannelWidth (80); //80 MHz
1064 
1065  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs0 ());
1066  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs1 ());
1067  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs2 ());
1068  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs3 ());
1069  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs4 ());
1070  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs5 ());
1071  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs6 ());
1072  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs7 ());
1073  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs8 ());
1074  m_deviceMcsSet.push_back (WifiPhy::GetVhtMcs9 ());
1075 
1076  m_bssMembershipSelectorSet.push_back (VHT_PHY);
1077 }
1078 
1079 void
1081 {
1082  m_state->RegisterListener (listener);
1083 }
1084 
1085 void
1087 {
1088  m_state->UnregisterListener (listener);
1089 }
1090 
1091 bool
1093 {
1094  return m_state->IsStateCcaBusy ();
1095 }
1096 
1097 bool
1099 {
1100  return m_state->IsStateIdle ();
1101 }
1102 
1103 bool
1105 {
1106  return m_state->IsStateBusy ();
1107 }
1108 
1109 bool
1111 {
1112  return m_state->IsStateRx ();
1113 }
1114 
1115 bool
1117 {
1118  return m_state->IsStateTx ();
1119 }
1120 
1121 bool
1123 {
1124  return m_state->IsStateSwitching ();
1125 }
1126 
1127 bool
1129 {
1130  return m_state->IsStateSleep ();
1131 }
1132 
1133 Time
1135 {
1136  return m_state->GetStateDuration ();
1137 }
1138 
1139 Time
1141 {
1142  return m_state->GetDelayUntilIdle ();
1143 }
1144 
1145 Time
1147 {
1148  return m_state->GetLastRxStartTime ();
1149 }
1150 
1151 double
1152 YansWifiPhy::DbToRatio (double dB) const
1153 {
1154  double ratio = std::pow (10.0, dB / 10.0);
1155  return ratio;
1156 }
1157 
1158 double
1159 YansWifiPhy::DbmToW (double dBm) const
1160 {
1161  double mW = std::pow (10.0, dBm / 10.0);
1162  return mW / 1000.0;
1163 }
1164 
1165 double
1166 YansWifiPhy::WToDbm (double w) const
1167 {
1168  return 10.0 * std::log10 (w * 1000.0);
1169 }
1170 
1171 double
1172 YansWifiPhy::RatioToDb (double ratio) const
1173 {
1174  return 10.0 * std::log10 (ratio);
1175 }
1176 
1177 double
1179 {
1180  return m_edThresholdW;
1181 }
1182 
1183 double
1184 YansWifiPhy::GetPowerDbm (uint8_t power) const
1185 {
1187  NS_ASSERT (m_nTxPower > 0);
1188  double dbm;
1189  if (m_nTxPower > 1)
1190  {
1191  dbm = m_txPowerBaseDbm + power * (m_txPowerEndDbm - m_txPowerBaseDbm) / (m_nTxPower - 1);
1192  }
1193  else
1194  {
1195  NS_ASSERT_MSG (m_txPowerBaseDbm == m_txPowerEndDbm, "cannot have TxPowerEnd != TxPowerStart with TxPowerLevels == 1");
1196  dbm = m_txPowerBaseDbm;
1197  }
1198  return dbm;
1199 }
1200 
1201 void
1203 {
1204  NS_LOG_FUNCTION (this << packet << event);
1205  NS_ASSERT (IsStateRx ());
1206  NS_ASSERT (event->GetEndTime () == Simulator::Now ());
1207 
1208  struct InterferenceHelper::SnrPer snrPer;
1209  snrPer = m_interference.CalculatePlcpPayloadSnrPer (event);
1211 
1212  if (m_plcpSuccess == true)
1213  {
1214  NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate (event->GetTxVector ())) <<
1215  ", snr(dB)=" << RatioToDb (snrPer.snr) << ", per=" << snrPer.per << ", size=" << packet->GetSize ());
1216 
1217  if (m_random->GetValue () > snrPer.per)
1218  {
1219  NotifyRxEnd (packet);
1220  uint32_t dataRate500KbpsUnits;
1221  if ((event->GetPayloadMode ().GetModulationClass () == WIFI_MOD_CLASS_HT) || (event->GetPayloadMode ().GetModulationClass () == WIFI_MOD_CLASS_VHT))
1222  {
1223  dataRate500KbpsUnits = 128 + event->GetPayloadMode ().GetMcsValue ();
1224  }
1225  else
1226  {
1227  dataRate500KbpsUnits = event->GetPayloadMode ().GetDataRate (event->GetTxVector ().GetChannelWidth (), event->GetTxVector ().IsShortGuardInterval (), 1) * event->GetTxVector ().GetNss () / 500000;
1228  }
1229  struct signalNoiseDbm signalNoise;
1230  signalNoise.signal = RatioToDb (event->GetRxPowerW ()) + 30;
1231  signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
1232  struct mpduInfo aMpdu;
1233  aMpdu.type = mpdutype;
1235  NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, event->GetPreambleType (), event->GetTxVector (), aMpdu, signalNoise);
1236  m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetTxVector (), event->GetPreambleType ());
1237  }
1238  else
1239  {
1240  /* failure. */
1241  NotifyRxDrop (packet);
1242  bool isEndOfFrame = ((mpdutype == NORMAL_MPDU && preamble != WIFI_PREAMBLE_NONE) || (mpdutype == LAST_MPDU_IN_AGGREGATE && preamble == WIFI_PREAMBLE_NONE));
1243  m_state->SwitchFromRxEndError (packet, snrPer.snr, isEndOfFrame);
1244  }
1245  }
1246  else
1247  {
1248  bool isEndOfFrame = ((mpdutype == NORMAL_MPDU && preamble != WIFI_PREAMBLE_NONE) || (mpdutype == LAST_MPDU_IN_AGGREGATE && preamble == WIFI_PREAMBLE_NONE));
1249  m_state->SwitchFromRxEndError (packet, snrPer.snr, isEndOfFrame);
1250  }
1251 
1252  if (preamble == WIFI_PREAMBLE_NONE && mpdutype == LAST_MPDU_IN_AGGREGATE)
1253  {
1254  m_plcpSuccess = false;
1255  }
1256 }
1257 
1258 int64_t
1260 {
1261  NS_LOG_FUNCTION (this << stream);
1262  m_random->SetStream (stream);
1263  return 1;
1264 }
1265 
1266 void
1268 {
1270 }
1271 
1272 void
1274 {
1277 }
1278 
1279 void
1281 {
1282  m_numberOfReceivers = rx;
1283 }
1284 
1285 void
1287 {
1288  m_ldpc = Ldpc;
1289 }
1290 
1291 void
1293 {
1294  m_stbc = stbc;
1295 }
1296 
1297 void
1299 {
1300  m_greenfield = greenfield;
1301 }
1302 
1303 bool
1305 {
1306  return m_guardInterval;
1307 }
1308 
1309 void
1310 YansWifiPhy::SetGuardInterval (bool guardInterval)
1311 {
1312  m_guardInterval = guardInterval;
1313 }
1314 
1315 uint32_t
1317 {
1319 }
1320 
1321 uint32_t
1323 {
1324  return m_numberOfTransmitters;
1325 }
1326 
1327 uint32_t
1329 {
1330  return m_numberOfReceivers;
1331 }
1332 
1333 bool
1335 {
1336  return m_ldpc;
1337 }
1338 
1339 bool
1341 {
1342  return m_stbc;
1343 }
1344 
1345 bool
1347 {
1348  return m_greenfield;
1349 }
1350 
1351 bool
1353 {
1354  return m_shortPreamble;
1355 }
1356 
1357 void
1359 {
1360  m_shortPreamble = enable;
1361 }
1362 
1363 void
1364 YansWifiPhy::SetChannelWidth (uint32_t channelwidth)
1365 {
1366  NS_ASSERT_MSG (channelwidth == 5 || channelwidth == 10 || channelwidth == 20 || channelwidth == 22 || channelwidth == 40 || channelwidth == 80 || channelwidth == 160, "wrong channel width value");
1367  m_channelWidth = channelwidth;
1368  AddSupportedChannelWidth (channelwidth);
1369 }
1370 
1371 uint32_t
1373 {
1374  return m_channelWidth;
1375 }
1376 
1377 uint8_t
1379 {
1380  return (static_cast<uint8_t> (GetNumberOfReceiveAntennas ()));
1381 }
1382 
1383 uint8_t
1385 {
1386  return (static_cast<uint8_t> (GetNumberOfTransmitAntennas ()));
1387 }
1388 
1389 void
1391 {
1392  NS_LOG_FUNCTION (this << width);
1393  for (std::vector<uint32_t>::size_type i = 0; i != m_supportedChannelWidthSet.size (); i++)
1394  {
1395  if (m_supportedChannelWidthSet[i] == width)
1396  {
1397  return;
1398  }
1399  }
1400  m_supportedChannelWidthSet.push_back (width);
1401 }
1402 
1403 std::vector<uint32_t>
1405 {
1407 }
1408 
1409 uint32_t
1411 {
1412  return m_bssMembershipSelectorSet.size ();
1413 }
1414 
1415 uint32_t
1416 YansWifiPhy::GetBssMembershipSelector (uint32_t selector) const
1417 {
1418  return m_bssMembershipSelectorSet[selector];
1419 }
1420 
1423 {
1424  uint32_t id = GetBssMembershipSelector (selector);
1425  WifiModeList supportedmodes;
1426  if (id == HT_PHY || id == VHT_PHY)
1427  {
1428  //mandatory MCS 0 to 7
1429  supportedmodes.push_back (WifiPhy::GetHtMcs0 ());
1430  supportedmodes.push_back (WifiPhy::GetHtMcs1 ());
1431  supportedmodes.push_back (WifiPhy::GetHtMcs2 ());
1432  supportedmodes.push_back (WifiPhy::GetHtMcs3 ());
1433  supportedmodes.push_back (WifiPhy::GetHtMcs4 ());
1434  supportedmodes.push_back (WifiPhy::GetHtMcs5 ());
1435  supportedmodes.push_back (WifiPhy::GetHtMcs6 ());
1436  supportedmodes.push_back (WifiPhy::GetHtMcs7 ());
1437  }
1438  if (id == VHT_PHY)
1439  {
1440  //mandatory MCS 0 to 9
1441  supportedmodes.push_back (WifiPhy::GetVhtMcs0 ());
1442  supportedmodes.push_back (WifiPhy::GetVhtMcs1 ());
1443  supportedmodes.push_back (WifiPhy::GetVhtMcs2 ());
1444  supportedmodes.push_back (WifiPhy::GetVhtMcs3 ());
1445  supportedmodes.push_back (WifiPhy::GetVhtMcs4 ());
1446  supportedmodes.push_back (WifiPhy::GetVhtMcs5 ());
1447  supportedmodes.push_back (WifiPhy::GetVhtMcs6 ());
1448  supportedmodes.push_back (WifiPhy::GetVhtMcs7 ());
1449  supportedmodes.push_back (WifiPhy::GetVhtMcs8 ());
1450  supportedmodes.push_back (WifiPhy::GetVhtMcs9 ());
1451  }
1452  return supportedmodes;
1453 }
1454 
1455 uint8_t
1457 {
1458  return m_deviceMcsSet.size ();
1459 }
1460 
1461 WifiMode
1462 YansWifiPhy::GetMcs (uint8_t mcs) const
1463 {
1464  return m_deviceMcsSet[mcs];
1465 }
1466 
1467 } //namespace ns3
ERP-OFDM PHY (Clause 19, Section 19.5)
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
Definition: wifi-phy.cc:1531
uint16_t m_channelNumber
Operating channel number.
tuple channel
Definition: third.py:85
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1185
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
Definition: wifi-phy.cc:876
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Definition: wifi-phy.cc:813
virtual double CalculateSnr(WifiTxVector txVector, double ber) const
virtual uint8_t GetSupportedTxSpatialStreams(void) const
virtual bool IsStateBusy(void)
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:888
void NotifyMonitorSniffTx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
Definition: wifi-phy.cc:765
A struct for both SNR and PER.
uint16_t GetChannelNumber(void) const
Return the current channel number.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
void Configure80211b(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream.
virtual uint32_t GetFrequency(void) const
std::vector< uint32_t > m_supportedChannelWidthSet
Supported channel width.
virtual bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
Definition: wifi-phy.cc:1547
AttributeValue implementation for Boolean.
Definition: boolean.h:34
EventId m_endPlcpRxEvent
virtual WifiModeList GetMembershipSelectorModes(uint32_t selector)
The WifiPhy::GetMembershipSelectorModes() method is used (e.g., by a WifiRemoteStationManager) to det...
virtual std::vector< uint32_t > GetSupportedChannelWidthSet(void) const
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model.
double DbmToW(double dbm) const
Convert from dBm to Watts.
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
Definition: wifi-phy.cc:939
double DbToRatio(double db) const
Convert from dB to ratio.
HT OFDM PHY for the 5 GHz band (clause 20)
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1086
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:1110
void SetErrorRateModel(Ptr< ErrorRateModel > rate)
Sets the error rate model.
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble)
virtual bool IsStateSwitching(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:44
virtual bool IsStateTx(void)
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1149
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
Definition: wifi-phy.cc:1483
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
Definition: wifi-phy.cc:774
void Configure80211n(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11n standard.
Ptr< YansWifiChannel > m_channel
YansWifiChannel that this YansWifiPhy is connected to.
void SetTxGain(double gain)
Sets the transmission gain (dB).
enum mpduType type
Definition: wifi-phy.h:63
802.11 PHY layer model
Definition: wifi-phy.h:151
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
Definition: wifi-phy.cc:864
The PHY layer has sense the medium busy through the CCA mechanism.
Definition: wifi-phy.h:166
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Definition: wifi-phy.cc:1280
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: boolean.h:81
bool IsZero(void) const
Definition: nstime.h:274
def start()
Definition: core.py:1482
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
Definition: wifi-phy.cc:1523
virtual void SetGuardInterval(bool guardInterval)
Enable or disable short/long guard interval.
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
Definition: wifi-phy.cc:1400
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
Definition: wifi-phy.cc:1336
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
Definition: wifi-phy.cc:951
enum WifiModulationClass GetModulationClass() const
Definition: wifi-mode.cc:386
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
Definition: wifi-phy.cc:1472
virtual void SetLdpc(bool ldpc)
Enable or disable LDPC.
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
Definition: wifi-phy.cc:1392
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
Definition: wifi-phy.cc:1464
Time GetEnergyDuration(double energyW)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
virtual void RegisterListener(WifiPhyListener *listener)
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
Definition: wifi-phy.cc:1304
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
Definition: wifi-phy.cc:1432
bool IsShortGuardInterval(void) const
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1125
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
Definition: packet.h:786
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
The PHY layer is sleeping.
Definition: wifi-phy.h:182
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
Definition: wifi-phy.cc:1360
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
Definition: wifi-phy.cc:1416
double m_txPowerBaseDbm
Minimum transmission power (dBm)
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1038
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
Definition: wifi-phy.cc:1011
void SetChannelNumber(uint16_t id)
Set the current channel number.
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
Definition: wifi-phy.cc:735
HT OFDM PHY for the 2.4 GHz band (clause 20)
VHT PHY (Clause 22)
Definition: wifi-mode.h:64
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
Definition: wifi-phy.cc:1288
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
Definition: wifi-phy.cc:1368
virtual bool IsStateSleep(void)
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Definition: wifi-phy.cc:723
double m_edThresholdW
Energy detection threshold in watts.
void Configure80211_5Mhz()
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11a standard with 5MHz channel spacing.
virtual Time GetDelayUntilIdle(void)
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
Definition: wifi-phy.cc:1515
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
Definition: wifi-phy.cc:1440
uint32_t m_rxMpduReferenceNumber
A-MPDU reference number to identify all received subframes belonging to the same received A-MPDU...
void Configure80211a(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
void Configure80211ac(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11ac standard.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Definition: wifi-mode.h:99
void Configure80211g(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
Definition: wifi-phy.cc:987
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
Definition: wifi-phy.cc:1539
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1173
virtual Time GetStateDuration(void)
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
Definition: wifi-phy.cc:1507
void NotifyMonitorSniffRx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
Public method used to fire a MonitorSniffer trace for a wifi packet being received.
Definition: wifi-phy.cc:759
virtual uint32_t GetNBssMembershipSelectors(void) const
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
double m_rxGainDb
Reception gain (dB)
uint8_t GetTxPowerLevel(void) const
double GetTxGain(void) const
Return the transmission gain (dB).
bool m_shortPreamble
Flag if short PLCP preamble is supported.
std::vector< uint32_t > m_bssMembershipSelectorSet
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:446
void SetMobility(Ptr< MobilityModel > mobility)
assign a mobility model to this device
virtual void SetChannelWidth(uint32_t channelwidth)
Set channel width.
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
Definition: wifi-phy.cc:1352
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
Definition: wifi-phy.cc:912
virtual void SetReceiveErrorCallback(WifiPhy::RxErrorCallback callback)
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
Definition: wifi-phy.cc:1456
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
Definition: wifi-phy.cc:1312
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
Definition: wifi-phy.cc:753
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:30
Keep track of the current position and velocity of an object.
void SetErrorRateModel(Ptr< ErrorRateModel > rate)
Set the error rate model for this interference helper.
virtual uint32_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual bool IsStateRx(void)
virtual uint8_t GetNMcs(void) const
virtual double GetTxPowerStart(void) const
Return the minimum available transmission power level (dBm).
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
bool PeekPacketTag(Tag &tag) const
Search a matching tag and call Tag::Deserialize if it is found.
Definition: packet.cc:846
virtual WifiMode GetMode(uint32_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
double m_channelStartingFrequency
Standard-dependent center frequency of 0-th channel in MHz.
void StartReceivePacket(Ptr< Packet > packet, WifiTxVector txVector, WifiPreamble preamble, enum mpduType mpdutype, Ptr< InterferenceHelper::Event > event)
Starting receiving the payload of a packet (i.e.
void SetEdThreshold(double threshold)
Sets the energy detection threshold (dBm).
The MPDU is not part of an A-MPDU.
Definition: wifi-phy.h:48
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
Definition: wifi-phy.cc:1240
bool m_ldpc
Flag if LDPC is used.
tuple mobility
Definition: third.py:101
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: pointer.h:220
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
Definition: simulator.h:1216
AttributeValue implementation for Time.
Definition: nstime.h:957
Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector, enum WifiPreamble preamble)
Definition: wifi-phy.cc:696
uint32_t mpduRefNumber
Definition: wifi-phy.h:64
#define VHT_PHY
Definition: yans-wifi-phy.h:44
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:919
receive notifications about phy events.
Definition: wifi-phy.h:70
virtual bool GetStbc(void) const
Return whether STBC is supported.
bool m_stbc
Flag if STBC is used.
Hold an unsigned integer type.
Definition: uinteger.h:44
The PHY layer is IDLE.
Definition: wifi-phy.h:162
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
Definition: wifi-phy.cc:1320
WifiModeList m_deviceRateSet
This vector holds the set of transmission modes that this WifiPhy(-derived class) can support...
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
Definition: wifi-phy.cc:900
double m_ccaMode1ThresholdW
Clear channel assessment (CCA) threshold in watts.
virtual void DoDispose(void)
Destructor implementation.
virtual void SetStbc(bool stbc)
Enable or disable STBC.
#define HT_PHY
Definition: yans-wifi-phy.h:45
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1074
uint32_t GetChannelWidth(void) const
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
HT PHY (Clause 20)
Definition: wifi-mode.h:62
struct InterferenceHelper::SnrPer CalculatePlcpHeaderSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the plcp header and accumulate all SNIR changes in the snir vector...
virtual WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
uint8_t GetMcsValue(void) const
Definition: wifi-mode.cc:364
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency)
Definition: wifi-phy.cc:717
The PHY layer is receiving a packet.
Definition: wifi-phy.h:174
double GetRxGain(void) const
Return the reception gain (dB).
The aim of the AmpduTag is to provide means for a MAC to specify that a packet includes A-MPDU since ...
Definition: ampdu-tag.h:36
uint32_t m_txMpduReferenceNumber
A-MPDU reference number to identify all transmitted subframes belonging to the same received A-MPDU...
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
Definition: wifi-phy.cc:741
The PHY layer is sending a packet.
Definition: wifi-phy.h:170
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
Definition: wifi-phy.cc:963
double GetChannelFrequencyMhz() const
Return current center channel frequency in MHz.
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1062
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1197
The PHY layer is switching to other channel.
Definition: wifi-phy.h:178
double WToDbm(double w) const
Convert from Watts to dBm.
void SetChannel(Ptr< YansWifiChannel > channel)
Set the YansWifiChannel this YansWifiPhy is to be connected to.
void SetNTxPower(uint32_t n)
Sets the number of transmission power levels available between the minimum level and the maximum leve...
virtual void SetShortPlcpPreambleSupported(bool preamble)
Enable or disable short PLCP preamble.
virtual bool IsStateCcaBusy(void)
virtual void AddSupportedChannelWidth(uint32_t width)
The MPDU is part of an A-MPDU, but is not the last aggregate.
Definition: wifi-phy.h:50
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
Definition: wifi-phy.cc:1491
virtual ~YansWifiPhy()
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
Definition: wifi-phy.cc:999
double m_txPowerEndDbm
Maximum transmission power (dBm)
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
Definition: wifi-phy.cc:1224
virtual void SetReceiveOkCallback(WifiPhy::RxOkCallback callback)
struct InterferenceHelper::SnrPer CalculatePlcpPayloadSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the plcp payload and accumulate all SNIR changes in the snir vecto...
virtual void UnregisterListener(WifiPhyListener *listener)
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
double GetCcaMode1Threshold(void) const
Return the CCA threshold (dBm).
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void NotifyRxStart()
Notify that RX has started.
Hold objects of type Ptr.
Definition: pointer.h:36
VHT OFDM PHY (clause 22)
void EraseEvents(void)
Erase all events.
802.11 PHY layer modelThis PHY implements a model of 802.11a.
Definition: yans-wifi-phy.h:66
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Definition: wifi-phy.cc:975
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Definition: boolean.cc:121
Ptr< InterferenceHelper::Event > Add(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, Time duration, double rxPower)
Add the packet-related signal to interference helper.
double GetEdThreshold(void) const
Return the energy detection threshold (dBm).
static TypeId GetTypeId(void)
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
virtual uint32_t GetNumberOfTransmitAntennas(void) const
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
Definition: wifi-phy.cc:1328
virtual bool GetShortPlcpPreambleSupported(void) const
Return whether short PLCP preamble is supported.
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
Definition: wifi-phy.cc:1384
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
Definition: wifi-phy.cc:1264
virtual uint32_t GetNumberOfReceiveAntennas(void) const
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
Definition: wifi-mode.cc:109
uint32_t m_nTxPower
Number of available transmission power levels.
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
Definition: wifi-phy.cc:1499
void SetRxGain(double gain)
Sets the reception gain (dB).
WifiModeList m_deviceMcsSet
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Definition: wifi-phy.cc:801
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1137
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: nstime.h:958
virtual void SetSleepMode(void)
Put in sleep mode.
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
Definition: wifi-mode.h:225
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:223
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
Definition: wifi-phy.cc:840
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
double RatioToDb(double ratio) const
Convert from ratio to dB.
virtual void SetNumberOfTransmitAntennas(uint32_t tx)
virtual void DoInitialize(void)
Initialize() implementation.
Time GetChannelSwitchDelay(void) const
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:90
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: double.h:42
virtual bool IsStateIdle(void)
virtual Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
virtual bool GetGreenfield(void) const
Return whether Greenfield is supported.
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Definition: wifi-phy.cc:828
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
Ptr< NetDevice > m_device
Pointer to the device.
void StartReceivePreambleAndHeader(Ptr< Packet > packet, double rxPowerDbm, WifiTxVector txVector, WifiPreamble preamble, enum mpduType mpdutype, Time rxDuration)
Starting receiving the plcp of a packet (i.e.
uint8_t GetNss(void) const
InterferenceHelper m_interference
Pointer to InterferenceHelper.
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
Definition: wifi-phy.cc:852
virtual bool GetGuardInterval(void) const
Return whether guard interval is being used.
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
Definition: wifi-phy.cc:747
void NotifyRxEnd()
Notify that RX has ended.
void SetNoiseFigure(double value)
Set the noise figure.
Time m_channelSwitchDelay
Time required to switch between channel.
virtual void ConfigureStandard(enum WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
Definition: wifi-phy.cc:1376
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
Definition: wifi-phy.cc:1272
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
uint32_t m_channelWidth
Channel width.
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
Definition: wifi-phy.cc:1448
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
Definition: wifi-phy.cc:1296
void ConfigureHtDeviceMcsSet(void)
Configure the device Mcs set with the appropriate HtMcs modes for the number of available transmit sp...
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
Definition: wifi-phy.cc:1256
virtual bool GetLdpc(void) const
Return if LDPC is supported.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
Definition: event-id.cc:53
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
Definition: wifi-phy.cc:1424
uint16_t m_mpdusNum
carries the number of expected mpdus that are part of an A-MPDU
double m_txGainDb
Transmission gain (dB)
bool m_greenfield
Flag if GreenField format is supported.
double GetPowerDbm(uint8_t power) const
Get the power of the given power level in dBm.
bool m_guardInterval
Flag if short guard interval is used.
virtual uint32_t GetChannelWidth(void) const
Return channel width.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:911
virtual void SetNumberOfReceiveAntennas(uint32_t rx)
void SetDevice(Ptr< NetDevice > device)
Sets the device this PHY is associated with.
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
Definition: wifi-phy.cc:1232
uint32_t m_numberOfTransmitters
Number of transmitters.
virtual bool IsMcsSupported(WifiMode mcs)
double GetEdThresholdW(void) const
Return the energy detection threshold.
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
Definition: wifi-phy.cc:1408
virtual Ptr< WifiChannel > GetChannel(void) const
Return the WifiChannel this WifiPhy is connected to.
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
Definition: wifi-phy.cc:786
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
Definition: wifi-phy.cc:1555
void SetCcaMode1Threshold(double threshold)
Sets the CCA threshold (dBm).
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1050
WifiMode GetMode(void) const
void ConfigureHolland(void)
Ptr< NetDevice > GetDevice(void) const
Return the device this PHY is associated with.
double GetNoiseFigure(void) const
Return the noise figure.
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Definition: double.h:41
virtual uint8_t GetSupportedRxSpatialStreams(void) const
double GetRxNoiseFigure(void) const
Return the RX noise figure (dBm).
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1098
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1209
virtual double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
bool IsExpired(void) const
This method is syntactic sugar for the ns3::Simulator::IsExpired method.
Definition: event-id.cc:59
void EndReceive(Ptr< Packet > packet, enum WifiPreamble preamble, enum mpduType mpdutype, Ptr< InterferenceHelper::Event > event)
The last bit of the packet has arrived.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Definition: uinteger.h:45
a unique identifier for an interface.
Definition: type-id.h:58
uint32_t m_numberOfReceivers
Number of receivers.
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
Definition: wifi-phy.cc:1344
virtual void ResumeFromSleep(void)
Resume from sleep mode.
bool m_plcpSuccess
Flag if the PLCP of the packet or the first MPDU in an A-MPDU has been received.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:826
bool m_initialized
Flag for runtime initialization.
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
Definition: wifi-phy.cc:1248
uint8_t GetNoOfMpdus(void) const
Definition: ampdu-tag.cc:95
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
Definition: wifi-phy.cc:927
virtual void SetFrequency(uint32_t freq)
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
Definition: wifi-phy.cc:1161
void Configure80211_10Mhz(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11a standard with 10MHz channel spacing.
virtual uint32_t GetNTxPower(void) const
Return the number of available transmission power levels.
mpduType
This enumeration defines the type of an MPDU.
Definition: wifi-phy.h:45
void SetRxNoiseFigure(double noiseFigureDb)
Sets the RX loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
Definition: wifi-phy.cc:1026
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model this PHY is using.
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
The MPDU is the last aggregate in an A-MPDU.
Definition: wifi-phy.h:52
Ptr< MobilityModel > GetMobility(void)
Return the mobility model this PHY is associated with.
virtual void SetGreenfield(bool greenfield)
Enable or disable Greenfield support.