28 #include "ns3/simulator.h"
29 #include "ns3/packet.h"
30 #include "ns3/assert.h"
32 #include "ns3/double.h"
33 #include "ns3/uinteger.h"
35 #include "ns3/pointer.h"
36 #include "ns3/net-device.h"
37 #include "ns3/trace-source-accessor.h"
38 #include "ns3/boolean.h"
53 .AddConstructor<YansWifiPhy> ()
54 .AddAttribute (
"EnergyDetectionThreshold",
55 "The energy of a received signal should be higher than "
56 "this threshold (dbm) to allow the PHY layer to detect the signal.",
60 MakeDoubleChecker<double> ())
61 .AddAttribute (
"CcaMode1Threshold",
62 "The energy of a received signal should be higher than "
63 "this threshold (dbm) to allow the PHY layer to declare CCA BUSY state",
67 MakeDoubleChecker<double> ())
68 .AddAttribute (
"TxGain",
69 "Transmission gain (dB).",
73 MakeDoubleChecker<double> ())
74 .AddAttribute (
"RxGain",
75 "Reception gain (dB).",
79 MakeDoubleChecker<double> ())
80 .AddAttribute (
"TxPowerLevels",
81 "Number of transmission power levels available between "
82 "TxPowerStart and TxPowerEnd included.",
85 MakeUintegerChecker<uint32_t> ())
86 .AddAttribute (
"TxPowerEnd",
87 "Maximum available transmission level (dbm).",
91 MakeDoubleChecker<double> ())
92 .AddAttribute (
"TxPowerStart",
93 "Minimum available transmission level (dbm).",
97 MakeDoubleChecker<double> ())
98 .AddAttribute (
"RxNoiseFigure",
99 "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver."
100 " According to Wikipedia (http://en.wikipedia.org/wiki/Noise_figure), this is "
101 "\"the difference in decibels (dB) between"
102 " the noise output of the actual receiver to the noise output of an "
103 " ideal receiver with the same overall gain and bandwidth when the receivers "
104 " are connected to sources at the standard noise temperature T0 (usually 290 K)\"."
109 MakeDoubleChecker<double> ())
110 .AddAttribute (
"State",
"The state of the PHY layer",
113 MakePointerChecker<WifiPhyStateHelper> ())
114 .AddAttribute (
"ChannelSwitchDelay",
115 "Delay between two short frames transmitted on different frequencies.",
119 .AddAttribute (
"ChannelNumber",
120 "Channel center frequency = Channel starting frequency + 5 MHz * nch",
124 MakeUintegerChecker<uint16_t> ())
125 .AddAttribute (
"Frequency",
"The operating frequency.",
129 MakeUintegerChecker<uint32_t> ())
130 .AddAttribute (
"Transmitters",
"The number of transmitters.",
134 MakeUintegerChecker<uint32_t> ())
135 .AddAttribute (
"Receivers",
"The number of receivers.",
139 MakeUintegerChecker<uint32_t> ())
140 .AddAttribute (
"ShortGuardEnabled",
"Whether or not short guard interval is enabled.",
145 .AddAttribute (
"LdpcEnabled",
"Whether or not LDPC is enabled.",
150 .AddAttribute (
"STBCEnabled",
"Whether or not STBC is enabled.",
155 .AddAttribute (
"GreenfieldEnabled",
"Whether or not STBC is enabled.",
160 .AddAttribute (
"ChannelBonding",
"Whether 20MHz or 40MHz.",
172 : m_initialized (false),
175 m_channelStartingFrequency (0),
179 m_random = CreateObject<UniformRandomVariable> ();
180 m_state = CreateObject<WifiPhyStateHelper> ();
398 NS_LOG_DEBUG (
"drop packet because of channel switching while reception");
403 NS_LOG_DEBUG (
"channel switching postponed until end of current transmission");
411 NS_LOG_DEBUG (
"channel switching ignored in sleep mode");
460 NS_LOG_DEBUG (
"setting sleep mode postponed until end of current transmission");
464 NS_LOG_DEBUG (
"setting sleep mode postponed until end of current reception");
468 NS_LOG_DEBUG (
"setting sleep mode postponed until end of channel switching");
496 NS_LOG_DEBUG (
"not in sleep mode, there is nothing to resume");
501 m_state->SwitchFromSleep (delayUntilCcaEnd);
509 m_state->SetReceiveOkCallback (callback);
514 m_state->SetReceiveErrorCallback (callback);
521 uint8_t packetType,
Time rxDuration)
526 double rxPowerW =
DbmToW (rxPowerDbm);
541 NS_LOG_DEBUG (
"drop packet because of channel switching");
559 NS_LOG_DEBUG (
"drop packet because already in Rx (power=" <<
570 NS_LOG_DEBUG (
"drop packet because already in Tx (power=" <<
609 NS_LOG_DEBUG (
"drop packet because no preamble has been received");
613 NS_LOG_DEBUG (
"sync to signal (power=" << rxPowerW <<
"W)");
615 m_state->SwitchToRx (rxDuration);
625 NS_LOG_DEBUG (
"drop packet because it was sent using an unsupported mode (" << txMode <<
")");
632 NS_LOG_DEBUG (
"drop packet because signal power too Small (" <<
653 if (!delayUntilCcaEnd.
IsZero ())
655 m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd);
685 uint32_t dataRate500KbpsUnits;
713 for (uint32_t i = 0; i <
GetNModes (); i++)
725 for (uint32_t i = 0; i <
GetNMcs (); i++)
836 m_state->RegisterListener (listener);
842 m_state->UnregisterListener (listener);
848 return m_state->IsStateCcaBusy ();
854 return m_state->IsStateIdle ();
859 return m_state->IsStateBusy ();
874 return m_state->IsStateSwitching ();
879 return m_state->IsStateSleep ();
885 return m_state->GetStateDuration ();
890 return m_state->GetDelayUntilIdle ();
896 return m_state->GetLastRxStartTime ();
902 double ratio = std::pow (10.0, dB / 10.0);
909 double mW = std::pow (10.0, dBm / 10.0);
916 return 10.0 * std::log10 (w * 1000.0);
922 return 10.0 * std::log10 (ratio);
960 NS_LOG_DEBUG (
"mode=" << (event->GetPayloadMode ().GetDataRate ()) <<
961 ", snr=" << snrPer.snr <<
", per=" << snrPer.per <<
", size=" << packet->
GetSize ());
965 uint32_t dataRate500KbpsUnits;
968 dataRate500KbpsUnits = 128 +
WifiModeToMcs (event->GetPayloadMode ());
972 dataRate500KbpsUnits =
event->GetPayloadMode ().GetDataRate () *
event->GetTxVector().GetNss()/ 500000;
975 double signalDbm =
RatioToDb (event->GetRxPowerW ()) + 30;
978 m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (),
event->GetPreambleType ());
984 m_state->SwitchFromRxEndError (packet, snrPer.snr);
1108 for (uint8_t i=0; i <8; i++)
1141 return supportedmodes;
ERP-OFDM PHY (Clause 19, Section 19.5)
uint16_t m_channelNumber
Operating channel number.
bool m_channelBonding
Flag if channel bonding is used.
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
Ptr< Object > m_mobility
Pointer to the mobility model.
virtual bool IsStateBusy(void)
Simulation virtual time values and global simulation resolution.
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
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.
#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
virtual bool IsModeSupported(WifiMode mode) const
Check if the given WifiMode is supported by the PHY.
static WifiMode GetOfdmRate26MbpsBW20MHz()
Return a WifiMode for OFDM at 26Mbps with 20MHz channel spacing.
AttributeValue implementation for Boolean.
virtual WifiModeList GetMembershipSelectorModes(uint32_t selector)
The WifiPhy::GetMembershipSelectorModes() method is used (e.g., by a WifiRemoteStationManager) to det...
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.
double DbToRatio(double db) const
Convert from dB to ratio.
static WifiMode GetOfdmRate7_2MbpsBW20MHz()
Return a WifiMode for OFDM at 7.2Mbps with 20MHz channel spacing.
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
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.
void SetErrorRateModel(Ptr< ErrorRateModel > rate)
Sets the error rate model.
virtual bool IsStateSwitching(void)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual bool IsStateTx(void)
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
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.
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.
static WifiMode GetOfdmRate81MbpsBW40MHz()
Return a WifiMode for OFDM at 81Mbps with 40MHz channel spacing.
void SetTxGain(double gain)
Sets the transmission gain (dB).
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
The PHY layer has sense the medium busy through the CCA mechanism.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void SetGuardInterval(bool guardInterval)
Enable or disable short/long guard interval.
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
enum WifiModulationClass GetModulationClass() const
virtual void SetLdpc(bool ldpc)
Enable or disable LDPC.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
static WifiMode GetOfdmRate43_3MbpsBW20MHz()
Return a WifiMode for OFDM at 43.3Mbps with 20MHz channel spacing.
Time GetEnergyDuration(double energyW)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void RegisterListener(WifiPhyListener *listener)
static WifiMode GetOfdmRate60MbpsBW40MHz()
Return a WifiMode for OFDM at 60Mbps with 40MHz channel spacing.
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
The PHY layer is sleeping.
double m_txPowerBaseDbm
Minimum transmission power (dBm)
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
virtual bool IsMcsSupported(WifiMode mode)
void SetChannelNumber(uint16_t id)
Set the current channel number.
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
static WifiMode GetOfdmRate108MbpsBW40MHz()
Return a WifiMode for OFDM at 108Mbps with 40MHz channel spacing.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
virtual bool IsStateSleep(void)
static WifiMode GetOfdmRate21_7MbpsBW20MHz()
Return a WifiMode for OFDM at 21.7Mbps with 20MHz channel spacing.
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Ptr< Object > GetDevice(void) const
Return the device this PHY is associated with.
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)
void Configure80211a(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11a standard.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
void Configure80211g(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11g standard.
static WifiMode GetOfdmRate135MbpsBW40MHz()
Return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing.
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
virtual Time GetStateDuration(void)
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).
virtual bool GetChannelBonding(void) const
Return whether channel bonding 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.
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
virtual void SetReceiveErrorCallback(WifiPhy::RxErrorCallback callback)
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
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...
static WifiMode GetOfdmRate6_5MbpsBW20MHz()
Return a WifiMode for OFDM at 6.5Mbps with 20MHz channel spacing.
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.
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 SetEdThreshold(double threshold)
Sets the energy detection threshold (dBm).
static WifiMode GetOfdmRate135MbpsBW40MHzShGi()
Return a WifiMode for OFDM at 135Mbps with 40MHz channel spacing.
bool m_ldpc
Flag if LDPC is used.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual uint8_t GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
AttributeValue implementation for Time.
receive notifications about phy events.
virtual bool GetStbc(void) const
Return whether STBC is supported.
bool m_stbc
Flag if STBC is used.
Hold an unsigned integer type.
Ptr< Object > m_device
Pointer to the device.
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.
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.
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
std::string GetUniqueName(void) const
The PHY layer is receiving a packet.
double GetRxGain(void) const
Return the reception gain (dB).
Ptr< InterferenceHelper::Event > Add(uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble, Time duration, double rxPower, WifiTxVector txvector)
Add the packet-related signal to interference helper.
The aim of the AmpduTag is to provide means for a MAC to specify that a packet includes A-MPDU since ...
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
static WifiMode GetOfdmRate19_5MbpsBW20MHz()
Return a WifiMode for OFDM at 19.5Mbps with 20MHz channel spacing.
The PHY layer is sending a packet.
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
double GetChannelFrequencyMhz() const
Return current center channel frequency in MHz.
Time CalculateTxDuration(uint32_t size, WifiTxVector txvector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
static WifiMode GetOfdmRate52MbpsBW20MHz()
Return a WifiMode for OFDM at 52Mbps with 20MHz channel spacing.
The PHY layer is switching to other channel.
double WToDbm(double w) const
Convert from Watts to dBm.
static WifiMode GetOfdmRate40_5MbpsBW40MHz()
Return a WifiMode for OFDM at 40.5Mbps with 40MHz channel spacing.
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 bool IsStateCcaBusy(void)
static WifiMode GetOfdmRate72_2MbpsBW20MHz()
Return a WifiMode for OFDM at 72.2Mbps with 20MHz channel spacing.
static WifiMode GetOfdmRate65MbpsBW20MHzShGi()
Return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing.
void SetDevice(Ptr< Object > device)
Sets the device this PHY is associated with.
struct InterferenceHelper::SnrPer CalculateSnrPer(Ptr< InterferenceHelper::Event > event)
Calculate the SNIR at the start of the packet and accumulate all SNIR changes in the snir vector...
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.
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.
double m_txPowerEndDbm
Maximum transmission power (dBm)
virtual void SetReceiveOkCallback(WifiPhy::RxOkCallback callback)
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.
static WifiMode GetOfdmRate57_8MbpsBW20MHz()
Return a WifiMode for OFDM at 57.8Mbps with 20MHz channel spacing.
void EraseEvents(void)
Erase all events.
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
double GetEdThreshold(void) const
Return the energy detection threshold (dBm).
static TypeId GetTypeId(void)
static WifiMode GetOfdmRate13MbpsBW20MHz()
Return a WifiMode for OFDM at 13Mbps with 20MHz channel spacing.
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
virtual uint32_t GetNumberOfTransmitAntennas(void) const
virtual uint32_t WifiModeToMcs(WifiMode mode)
For a given WifiMode finds the corresponding MCS value and returns it as defined in the IEEE 802...
static WifiMode GetOfdmRate65MbpsBW20MHz()
Return a WifiMode for OFDM at 65Mbps with 20MHz channel spacing.
virtual uint32_t GetNumberOfReceiveAntennas(void) const
static WifiMode GetOfdmRate58_5MbpsBW20MHz()
Return a WifiMode for OFDM at 58.5Mbps with 20MHz channel spacing.
uint32_t m_nTxPower
Number of available transmission power levels.
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txvector, enum WifiPreamble preamble, uint8_t packetType)
void SetRxGain(double gain)
Sets the reception gain (dB).
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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...
static Time Now(void)
Return the current simulation virtual time.
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
virtual WifiMode McsToWifiMode(uint8_t mcs)
For a given MCS finds the corresponding WifiMode and returns it as defined in the IEEE 802...
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)
static WifiMode GetOfdmRate15MbpsBW40MHz()
Return a WifiMode for OFDM at 15Mbps with 40MHz channel spacing.
static WifiMode GetOfdmRate121_5MbpsBW40MHz()
Return a WifiMode for OFDM at 121.5Mbps with 40MHz channel spacing.
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...
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static WifiMode GetOfdmRate28_9MbpsBW20MHz()
Return a WifiMode for OFDM at 28.9Mbps with 20MHz channel spacing.
virtual bool IsStateIdle(void)
virtual Time GetLastRxStartTime(void) const
Return the start time of the last received packet.
virtual double CalculateSnr(WifiMode txMode, double ber) const
virtual bool GetGreenfield(void) const
Return whether Greenfield is supported.
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
uint8_t GetNss(void) const
InterferenceHelper m_interference
Pointer to InterferenceHelper.
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
virtual bool GetGuardInterval(void) const
Return whether guard interval is being used.
void StartReceivePacket(Ptr< Packet > packet, double rxPowerDbm, WifiTxVector txVector, WifiPreamble preamble, uint8_t packetType, Time rxDuration)
Starting receiving the packet (i.e.
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
void SetMobility(Ptr< Object > mobility)
Sets the mobility model.
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 GetOfdmRate13_5MbpsBW40MHz()
Return a WifiMode for OFDM at 13.5Mbps with 40MHz channel spacing.
static WifiMode GetOfdmRate30MbpsBW40MHz()
Return a WifiMode for OFDM at 30Mbps with 40MHz channel spacing.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
static WifiMode GetOfdmRate54MbpsBW40MHz()
Return a WifiMode for OFDM at 54Mbps with 40MHz channel spacing.
virtual bool GetLdpc(void) const
Return if LDPC is supported.
void Cancel(void)
This method is syntactic sugar for the ns3::Simulator::Cancel method.
uint16_t m_mpdusNum
carries the number of expected mpdus that are part of an A-MPDU
std::vector< uint8_t > m_deviceMcsSet
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.
void EndReceive(Ptr< Packet > packet, Ptr< InterferenceHelper::Event > event)
The last bit of the packet has arrived.
static WifiMode GetOfdmRate90MbpsBW40MHz()
Return a WifiMode for OFDM at 90Mbps with 40MHz channel spacing.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
virtual void SetNumberOfReceiveAntennas(uint32_t rx)
static WifiMode GetOfdmRate45MbpsBW40MHz()
Return a WifiMode for OFDM at 45Mbps with 40MHz channel spacing.
uint32_t m_numberOfTransmitters
Number of transmitters.
static WifiMode GetOfdmRate120MbpsBW40MHz()
Return a WifiMode for OFDM at 120Mbps with 40MHz channel spacing.
double GetEdThresholdW(void) const
Return the energy detection threshold.
static WifiMode GetOfdmRate39MbpsBW20MHz()
Return a WifiMode for OFDM at 39Mbps with 20MHz channel spacing.
virtual Ptr< WifiChannel > GetChannel(void) const
Return the WifiChannel this WifiPhy is connected to.
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
void SetCcaMode1Threshold(double threshold)
Sets the CCA threshold (dBm).
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
WifiMode GetMode(void) const
void ConfigureHolland(void)
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'...
double GetRxNoiseFigure(void) const
Return the RX noise figure (dBm).
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
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.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
uint32_t m_numberOfReceivers
Number of receivers.
virtual void ResumeFromSleep(void)
Resume from sleep mode.
uint64_t GetDataRate(void) const
virtual void SetChannelBonding(bool channelbonding)
Enable or disable channel bonding support.
TypeId SetParent(TypeId tid)
bool m_initialized
Flag for runtime initialization.
uint8_t GetNoOfMpdus(void) const
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
static WifiMode GetOfdmRate27MbpsBW40MHz()
Return a WifiMode for OFDM at 27Mbps with 40MHz channel spacing.
virtual void SetFrequency(uint32_t freq)
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
static WifiMode GetOfdmRate14_4MbpsBW20MHz()
Return a WifiMode for OFDM at 14.4Mbps with 20MHz channel spacing.
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.
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.
Ptr< ErrorRateModel > GetErrorRateModel(void) const
Return the error rate model this PHY is using.
Ptr< Object > GetMobility(void)
Return the mobility model this PHY is associated with.
Ptr< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
static WifiMode GetOfdmRate150MbpsBW40MHz()
Return a WifiMode for OFDM at 150Mbps with 40MHz channel spacing.
virtual void SetGreenfield(bool greenfield)
Enable or disable Greenfield support.