22 #ifndef YANS_WIFI_PHY_H
23 #define YANS_WIFI_PHY_H
26 #include "ns3/callback.h"
27 #include "ns3/event-id.h"
28 #include "ns3/packet.h"
29 #include "ns3/object.h"
30 #include "ns3/traced-callback.h"
31 #include "ns3/nstime.h"
33 #include "ns3/random-variable-stream.h"
45 class YansWifiChannel;
46 class WifiPhyStateHelper;
315 virtual void SetLdpc (
bool ldpc);
321 virtual bool GetLdpc (
void)
const;
327 virtual void SetStbc (
bool stbc);
333 virtual bool GetStbc (
void)
const;
365 virtual uint8_t
GetNMcs (
void)
const;
366 virtual uint8_t
GetMcs (uint8_t mcs)
const;
417 double DbmToW (
double dbm)
const;
431 double WToDbm (
double w)
const;
uint16_t m_channelNumber
Operating channel number.
bool m_channelBonding
Flag if channel conding is used.
Ptr< Object > m_mobility
Pointer to the mobility model.
virtual bool IsStateBusy(void)
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
void Configure80211b(void)
Configure YansWifiPhy with appropriate channel frequency and supported rates for 802.11b standard.
virtual uint32_t GetFrequency(void) const
virtual WifiModeList GetMembershipSelectorModes(uint32_t selector)
The WifiPhy::GetMembershipSelectorModes() method is used (e.g., by a WifiRemoteStationManager) to det...
double DbmToW(double dbm) const
Convert from dBm to Watts.
double DbToRatio(double db) const
Convert from dB to ratio.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetErrorRateModel(Ptr< ErrorRateModel > rate)
Sets the error rate model.
virtual bool IsStateSwitching(void)
virtual bool IsStateTx(void)
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).
handles interference calculations
virtual void SetGuardInterval(bool guardInterval)
Enable or disable short/long guard interval.
virtual void SetLdpc(bool ldpc)
Enable or disable LDPC.
virtual void RegisterListener(WifiPhyListener *listener)
double m_txPowerBaseDbm
Minimum transmission power (dBm)
uint16_t GetChannelNumber() const
Return the current channel number.
void SetChannelNumber(uint16_t id)
Set the current channel number.
virtual void SendPacket(Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, WifiTxVector txvector)
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.
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)
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
virtual void SetReceiveErrorCallback(WifiPhy::RxErrorCallback callback)
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
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.
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).
bool m_ldpc
Flag if LDPC is used.
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...
receive notifications about phy events.
virtual bool GetStbc(void) const
Return whether STBC is supported.
bool m_stbc
Flag if STBC is used.
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...
double m_ccaMode1ThresholdW
Clear channel assessment (CCA) threshold in watts.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
virtual void SetStbc(bool stbc)
Enable or disable STBC.
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
double GetRxGain(void) const
Return the reception gain (dB).
double GetChannelFrequencyMhz() const
Return current center channel frequency in MHz.
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)
void SetDevice(Ptr< Object > device)
Sets the device this PHY is associated with.
double m_txPowerEndDbm
Maximum transmission power (dBm)
virtual void SetReceiveOkCallback(WifiPhy::RxOkCallback callback)
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).
802.11 PHY layer modelThis PHY implements a model of 802.11a.
double GetEdThreshold(void) const
Return the energy detection threshold (dBm).
static TypeId GetTypeId(void)
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...
virtual uint32_t GetNumberOfReceiveAntennas(void) const
uint32_t m_nTxPower
Number of available transmission power levels.
void SetRxGain(double gain)
Sets the reception gain (dB).
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
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)
virtual bool IsStateIdle(void)
void StartReceivePacket(Ptr< Packet > packet, double rxPowerDbm, WifiTxVector txVector, WifiPreamble preamble)
Starting receiving the packet (i.e.
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.
Ptr< UniformRandomVariable > m_random
Provides uniform random variables.
InterferenceHelper m_interference
Pointer to InterferenceHelper.
virtual bool GetGuardInterval(void) const
Return whether guard interval is being used.
void SetMobility(Ptr< Object > mobility)
Sets the mobility model.
an identifier for simulation events.
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.
virtual bool GetLdpc(void) const
Return if LDPC is supported.
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.
virtual void SetNumberOfReceiveAntennas(uint32_t rx)
uint32_t m_numberOfTransmitters
Number of transmitters.
double GetEdThresholdW(void) const
Return the energy detection threshold.
virtual Ptr< WifiChannel > GetChannel(void) const
Return the WifiChannel this WifiPhy is connected to.
void SetCcaMode1Threshold(double threshold)
Sets the CCA threshold (dBm).
void ConfigureHolland(void)
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
double GetRxNoiseFigure(void) const
Return the RX noise figure (dBm).
virtual double GetTxPowerEnd(void) const
Return the maximum available transmission power level (dBm).
a unique identifier for an interface.
uint32_t m_numberOfReceivers
Number of receivers.
virtual void SetChannelBonding(bool channelbonding)
Enable or disable channel bonding support.
virtual void SetFrequency(uint32_t freq)
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.
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.
virtual void SetGreenfield(bool greenfield)
Enable or disable Greenfield support.