29 #include "ns3/simulator.h"
30 #include "ns3/packet.h"
31 #include "ns3/assert.h"
33 #include "ns3/double.h"
34 #include "ns3/uinteger.h"
36 #include "ns3/pointer.h"
37 #include "ns3/net-device.h"
38 #include "ns3/trace-source-accessor.h"
39 #include "ns3/boolean.h"
55 .SetGroupName (
"Wifi")
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.",
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.",
70 MakeDoubleChecker<double> ())
71 .AddAttribute (
"TxGain",
72 "Transmission gain (dB).",
76 MakeDoubleChecker<double> ())
77 .AddAttribute (
"RxGain",
78 "Reception gain (dB).",
82 MakeDoubleChecker<double> ())
83 .AddAttribute (
"TxPowerLevels",
84 "Number of transmission power levels available between "
85 "TxPowerStart and TxPowerEnd included.",
88 MakeUintegerChecker<uint32_t> ())
89 .AddAttribute (
"TxPowerEnd",
90 "Maximum available transmission level (dbm).",
94 MakeDoubleChecker<double> ())
95 .AddAttribute (
"TxPowerStart",
96 "Minimum available transmission level (dbm).",
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)\".",
111 MakeDoubleChecker<double> ())
112 .AddAttribute (
"State",
113 "The state of the PHY layer.",
116 MakePointerChecker<WifiPhyStateHelper> ())
117 .AddAttribute (
"ChannelSwitchDelay",
118 "Delay between two short frames transmitted on different frequencies.",
122 .AddAttribute (
"ChannelNumber",
123 "Channel center frequency = Channel starting frequency + 5 MHz * nch.",
127 MakeUintegerChecker<uint16_t> ())
128 .AddAttribute (
"Frequency",
129 "The operating frequency.",
133 MakeUintegerChecker<uint32_t> ())
134 .AddAttribute (
"Transmitters",
135 "The number of transmitters.",
139 MakeUintegerChecker<uint32_t> ())
140 .AddAttribute (
"Receivers",
141 "The number of receivers.",
145 MakeUintegerChecker<uint32_t> ())
146 .AddAttribute (
"ShortGuardEnabled",
147 "Whether or not short guard interval is enabled.",
152 .AddAttribute (
"LdpcEnabled",
153 "Whether or not LDPC is enabled.",
158 .AddAttribute (
"STBCEnabled",
159 "Whether or not STBC is enabled.",
164 .AddAttribute (
"GreenfieldEnabled",
165 "Whether or not Greenfield is enabled.",
170 .AddAttribute (
"ChannelWidth",
171 "Whether 5MHz, 10MHz, 20MHz, 22MHz, 40MHz, 80 MHz or 160 MHz.",
175 MakeUintegerChecker<uint32_t> ())
181 : m_initialized (false),
185 m_channelStartingFrequency (0),
187 m_plcpSuccess (false)
190 m_random = CreateObject<UniformRandomVariable> ();
191 m_state = CreateObject<WifiPhyStateHelper> ();
434 NS_LOG_DEBUG (
"drop packet because of channel switching while reception");
440 NS_LOG_DEBUG (
"channel switching postponed until end of current transmission");
448 NS_LOG_DEBUG (
"channel switching ignored in sleep mode");
497 NS_LOG_DEBUG (
"setting sleep mode postponed until end of current transmission");
501 NS_LOG_DEBUG (
"setting sleep mode postponed until end of current reception");
505 NS_LOG_DEBUG (
"setting sleep mode postponed until end of channel switching");
534 NS_LOG_DEBUG (
"not in sleep mode, there is nothing to resume");
541 m_state->SwitchFromSleep (delayUntilCcaEnd);
555 m_state->SetReceiveOkCallback (callback);
561 m_state->SetReceiveErrorCallback (callback);
576 double rxPowerW =
DbmToW (rxPowerDbm);
590 NS_LOG_DEBUG (
"drop packet because of channel switching");
609 NS_LOG_DEBUG (
"drop packet because already in Rx (power=" <<
620 NS_LOG_DEBUG (
"drop packet because already in Tx (power=" <<
636 NS_LOG_DEBUG (
"drop packet because no preamble has been received");
642 NS_LOG_DEBUG (
"Drop MPDU because no plcp has been received");
670 NS_LOG_DEBUG (
"sync to signal (power=" << rxPowerW <<
"W)");
672 m_state->SwitchToRx (rxDuration);
681 packet, txVector, preamble, aMpdu, event);
686 packet, preamble, aMpdu, event);
690 NS_LOG_DEBUG (
"drop packet because signal power too Small (" <<
713 if (!delayUntilCcaEnd.
IsZero ())
715 m_state->SwitchMaybeToCcaBusy (delayUntilCcaEnd);
746 NS_LOG_DEBUG (
"drop packet because it was sent using an unsupported mode (" << txMode <<
")");
753 NS_LOG_DEBUG (
"drop packet because plcp preamble/header reception failed");
788 uint32_t dataRate500KbpsUnits;
820 for (uint32_t i = 0; i <
GetNModes (); i++)
832 for (uint32_t i = 0; i <
GetNMcs (); i++)
1018 m_state->RegisterListener (listener);
1024 m_state->UnregisterListener (listener);
1030 return m_state->IsStateCcaBusy ();
1036 return m_state->IsStateIdle ();
1042 return m_state->IsStateBusy ();
1060 return m_state->IsStateSwitching ();
1066 return m_state->IsStateSleep ();
1072 return m_state->GetStateDuration ();
1078 return m_state->GetDelayUntilIdle ();
1084 return m_state->GetLastRxStartTime ();
1090 double ratio = std::pow (10.0, dB / 10.0);
1097 double mW = std::pow (10.0, dBm / 10.0);
1104 return 10.0 * std::log10 (w * 1000.0);
1110 return 10.0 * std::log10 (ratio);
1150 NS_LOG_DEBUG (
"mode=" << (event->GetPayloadMode ().GetDataRate (event->GetTxVector ().GetChannelWidth (),
event->GetTxVector ().IsShortGuardInterval (), 1)) <<
1151 ", snr(dB)=" <<
RatioToDb (snrPer.snr) <<
", per=" << snrPer.per <<
", size=" << packet->
GetSize ());
1156 uint32_t dataRate500KbpsUnits;
1159 dataRate500KbpsUnits = 128 +
event->GetPayloadMode ().GetMcsValue ();
1163 dataRate500KbpsUnits =
event->GetPayloadMode ().GetDataRate (event->GetTxVector ().GetChannelWidth (),
event->GetTxVector ().IsShortGuardInterval (), 1) * event->GetTxVector ().GetNss () / 500000;
1169 m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetTxVector (),
event->GetPreambleType ());
1175 m_state->SwitchFromRxEndError (packet, snrPer.snr);
1180 m_state->SwitchFromRxEndError (packet, snrPer.snr);
1284 NS_ASSERT_MSG (channelwidth == 5 || channelwidth == 10 || channelwidth == 20 || channelwidth == 22 || channelwidth == 40 || channelwidth == 80 || channelwidth == 160,
"wrong channel width value");
1337 return supportedmodes;
ERP-OFDM PHY (Clause 19, Section 19.5)
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
uint16_t m_channelNumber
Operating channel number.
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.
virtual bool IsStateBusy(void)
Simulation virtual time values and global simulation resolution.
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
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.
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 GetVhtMcs8()
Return MCS 8 from VHT MCS values.
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.
HT OFDM PHY for the 5 GHz band (clause 20)
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 GetVhtMcs0()
Return MCS 0 from VHT MCS values.
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
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).
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
The PHY layer has sense the medium busy through the CCA mechanism.
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
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
void StartReceivePacket(Ptr< Packet > packet, WifiTxVector txVector, WifiPreamble preamble, struct mpduInfo aMpdu, Ptr< InterferenceHelper::Event > event)
Starting receiving the payload of a packet (i.e.
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...
Time GetEnergyDuration(double energyW)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void RegisterListener(WifiPhyListener *listener)
bool IsShortGuardInterval(void) const
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.
void SetChannelNumber(uint16_t id)
Set the current channel number.
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
HT OFDM PHY for the 2.4 GHz band (clause 20)
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble, uint8_t packetType, uint32_t mpduReferenceNumber)
Ptr< MobilityModel > m_mobility
Pointer to the mobility model.
virtual bool IsStateSleep(void)
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
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.
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...
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.
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
virtual Time GetStateDuration(void)
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
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.
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).
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.
void SetMobility(Ptr< MobilityModel > mobility)
assign a mobility model to this device
virtual void SetChannelWidth(uint32_t channelwidth)
Set channel width.
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.
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.
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 GetHtMcs2()
Return MCS 2 from HT MCS values.
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...
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
AttributeValue implementation for Time.
Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector, enum WifiPreamble preamble)
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
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.
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...
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
The PHY layer is receiving a packet.
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 ...
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
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.
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.
The PHY layer is switching to other channel.
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 bool IsStateCcaBusy(void)
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
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.
double m_txPowerEndDbm
Maximum transmission power (dBm)
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
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.
void EraseEvents(void)
Erase all events.
802.11 PHY layer modelThis PHY implements a model of 802.11a.
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
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 GetHtMcs5()
Return MCS 5 from HT MCS values.
virtual uint32_t GetNumberOfReceiveAntennas(void) const
uint64_t GetDataRate(uint32_t channelWidth, bool isShortGuardInterval, uint8_t nss) const
uint32_t m_nTxPower
Number of available transmission power levels.
void StartReceivePreambleAndHeader(Ptr< Packet > packet, double rxPowerDbm, WifiTxVector txVector, WifiPreamble preamble, struct mpduInfo aMpdu, Time rxDuration)
Starting receiving the plcp of a packet (i.e.
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
void SetRxGain(double gain)
Sets the reception gain (dB).
WifiModeList m_deviceMcsSet
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, uint8_t packetType, uint8_t incFlag)
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.
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...
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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.
Ptr< NetDevice > m_device
Pointer to the device.
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 NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
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 GetHtMcs6()
Return MCS 6 from HT MCS values.
void EndReceive(Ptr< Packet > packet, enum WifiPreamble preamble, struct mpduInfo aMpdu, Ptr< InterferenceHelper::Event > event)
The last bit of the packet has arrived.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t m_channelWidth
Channel width.
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
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
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.
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.
uint32_t m_numberOfTransmitters
Number of transmitters.
virtual bool IsMcsSupported(WifiMode mcs)
double GetEdThresholdW(void) const
Return the energy detection threshold.
virtual Ptr< WifiChannel > GetChannel(void) const
Return the WifiChannel this WifiPhy is connected to.
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
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)
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'...
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.
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.
bool m_initialized
Flag for runtime initialization.
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
uint8_t GetNoOfMpdus(void) const
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
virtual void SetFrequency(uint32_t freq)
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz 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< WifiPhyStateHelper > m_state
Pointer to WifiPhyStateHelper.
Ptr< MobilityModel > GetMobility(void)
Return the mobility model this PHY is associated with.
virtual void SetGreenfield(bool greenfield)
Enable or disable Greenfield support.