23 #ifndef YANS_WIFI_PHY_H 
   24 #define YANS_WIFI_PHY_H 
   27 #include "ns3/callback.h" 
   28 #include "ns3/event-id.h" 
   29 #include "ns3/packet.h" 
   30 #include "ns3/object.h" 
   31 #include "ns3/traced-callback.h" 
   32 #include "ns3/nstime.h" 
   34 #include "ns3/random-variable-stream.h" 
   35 #include "ns3/mobility-model.h" 
   47 class YansWifiChannel;
 
   48 class WifiPhyStateHelper;
 
  358   virtual void SetLdpc (
bool ldpc);
 
  364   virtual bool GetLdpc (
void) 
const;
 
  370   virtual void SetStbc (
bool stbc);
 
  376   virtual bool GetStbc (
void) 
const;
 
  409   virtual uint8_t 
GetNMcs (
void) 
const;
 
  465   double DbmToW (
double dbm) 
const;
 
  481   double WToDbm (
double w) 
const;
 
uint16_t m_channelNumber
Operating channel number. 
virtual bool IsStateBusy(void)
Simulation virtual time values and global simulation resolution. 
uint16_t GetChannelNumber(void) const 
Return the current channel number. 
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 bool IsModeSupported(WifiMode mode) const 
Check if the given WifiMode is supported by the PHY. 
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. 
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. 
virtual void RegisterListener(WifiPhyListener *listener)
double m_txPowerBaseDbm
Minimum transmission power (dBm) 
void SetChannelNumber(uint16_t id)
Set the current channel number. 
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)
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. 
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. 
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). 
std::vector< uint32_t > m_bssMembershipSelectorSet
void SetMobility(Ptr< MobilityModel > mobility)
assign a mobility model to this device 
virtual void SetChannelWidth(uint32_t channelwidth)
Set channel width. 
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. 
receive notifications about phy events. 
virtual bool GetStbc(void) const 
Return whether STBC is supported. 
bool m_stbc
Flag if STBC is used. 
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)
Destructor implementation. 
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...
virtual WifiMode GetMcs(uint8_t mcs) const 
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
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)
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). 
Every class exported by the ns3 library is enclosed in the ns3 namespace. 
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 GetNumberOfReceiveAntennas(void) 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. 
void SetRxGain(double gain)
Sets the reception gain (dB). 
WifiModeList m_deviceMcsSet
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...
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 
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. 
Ptr< UniformRandomVariable > m_random
Provides uniform random variables. 
Ptr< NetDevice > m_device
Pointer to the device. 
InterferenceHelper m_interference
Pointer to InterferenceHelper. 
virtual bool GetGuardInterval(void) const 
Return whether guard interval is being used. 
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. 
void EndReceive(Ptr< Packet > packet, enum WifiPreamble preamble, struct mpduInfo aMpdu, Ptr< InterferenceHelper::Event > event)
The last bit of the packet has arrived. 
uint32_t m_channelWidth
Channel width. 
virtual bool GetLdpc(void) const 
Return if LDPC is supported. 
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. 
virtual void SetNumberOfReceiveAntennas(uint32_t rx)
void SetDevice(Ptr< NetDevice > device)
Sets the device this PHY is associated with. 
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. 
void SetCcaMode1Threshold(double threshold)
Sets the CCA threshold (dBm). 
void ConfigureHolland(void)
Ptr< NetDevice > GetDevice(void) const 
Return the device this PHY is associated with. 
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 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. 
bool m_initialized
Flag for runtime initialization. 
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< 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.