Public Types | Public Member Functions | Static Public Member Functions

ns3::WifiPhy Class Reference

802.11 PHY layer model More...

#include <wifi-phy.h>

Inheritance diagram for ns3::WifiPhy:
Inheritance graph
[legend]
Collaboration diagram for ns3::WifiPhy:
Collaboration graph
[legend]

List of all members.

Public Types

enum  State {
  IDLE, CCA_BUSY, TX, RX,
  SWITCHING
}
typedef Callback< void, Ptr
< Packet >, double, WifiMode,
enum WifiPreamble > 
RxOkCallback
typedef Callback< void, Ptr
< const Packet >, double > 
RxErrorCallback

Public Member Functions

virtual double GetTxPowerStart (void) const =0
virtual double GetTxPowerEnd (void) const =0
virtual uint32_t GetNTxPower (void) const =0
virtual void SetReceiveOkCallback (RxOkCallback callback)=0
virtual void SetReceiveErrorCallback (RxErrorCallback callback)=0
virtual void SendPacket (Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel)=0
virtual void RegisterListener (WifiPhyListener *listener)=0
virtual bool IsStateIdle (void)=0
virtual bool IsStateCcaBusy (void)=0
virtual bool IsStateBusy (void)=0
virtual bool IsStateRx (void)=0
virtual bool IsStateTx (void)=0
virtual bool IsStateSwitching (void)=0
virtual Time GetStateDuration (void)=0
virtual Time GetDelayUntilIdle (void)=0
virtual Time GetLastRxStartTime (void) const =0
virtual Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const =0
virtual uint32_t GetNModes (void) const =0
virtual WifiMode GetMode (uint32_t mode) const =0
virtual double CalculateSnr (WifiMode txMode, double ber) const =0
virtual void SetChannelNumber (uint16_t id)=0
 Set channel number.
virtual uint16_t GetChannelNumber () const =0
 Return current channel number, see SetChannelNumber().
virtual void ConfigureStandard (enum WifiPhyStandard standard)=0
virtual Ptr< WifiChannelGetChannel (void) const =0
void NotifyTxBegin (Ptr< const Packet > packet)
void NotifyTxEnd (Ptr< const Packet > packet)
void NotifyTxDrop (Ptr< const Packet > packet)
void NotifyRxBegin (Ptr< const Packet > packet)
void NotifyRxEnd (Ptr< const Packet > packet)
void NotifyRxDrop (Ptr< const Packet > packet)
void NotifyPromiscSniffRx (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
void NotifyPromiscSniffTx (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::WifiPhy.
static WifiMode GetDsssRate1Mbps ()
static WifiMode GetDsssRate2Mbps ()
static WifiMode GetDsssRate5_5Mbps ()
static WifiMode GetDsssRate11Mbps ()
static WifiMode GetOfdmRate6Mbps ()
static WifiMode GetOfdmRate9Mbps ()
static WifiMode GetOfdmRate12Mbps ()
static WifiMode GetOfdmRate18Mbps ()
static WifiMode GetOfdmRate24Mbps ()
static WifiMode GetOfdmRate36Mbps ()
static WifiMode GetOfdmRate48Mbps ()
static WifiMode GetOfdmRate54Mbps ()
static WifiMode GetOfdmRate3MbpsBW10MHz ()
static WifiMode GetOfdmRate4_5MbpsBW10MHz ()
static WifiMode GetOfdmRate6MbpsBW10MHz ()
static WifiMode GetOfdmRate9MbpsBW10MHz ()
static WifiMode GetOfdmRate12MbpsBW10MHz ()
static WifiMode GetOfdmRate18MbpsBW10MHz ()
static WifiMode GetOfdmRate24MbpsBW10MHz ()
static WifiMode GetOfdmRate27MbpsBW10MHz ()
static WifiMode GetOfdmRate1_5MbpsBW5MHz ()
static WifiMode GetOfdmRate2_25MbpsBW5MHz ()
static WifiMode GetOfdmRate3MbpsBW5MHz ()
static WifiMode GetOfdmRate4_5MbpsBW5MHz ()
static WifiMode GetOfdmRate6MbpsBW5MHz ()
static WifiMode GetOfdmRate9MbpsBW5MHz ()
static WifiMode GetOfdmRate12MbpsBW5MHz ()
static WifiMode GetOfdmRate13_5MbpsBW5MHz ()

Detailed Description

802.11 PHY layer model


Member Typedef Documentation

typedef Callback<void,Ptr<const Packet>, double> ns3::WifiPhy::RxErrorCallback

arg1: packet received unsuccessfully arg2: snr of packet

typedef Callback<void,Ptr<Packet>, double, WifiMode, enum WifiPreamble> ns3::WifiPhy::RxOkCallback

arg1: packet received successfully arg2: snr of packet arg3: mode of packet arg4: type of preamble used for packet.


Member Enumeration Documentation

The state of the PHY layer.

Enumerator:
IDLE 

The PHY layer is IDLE.

CCA_BUSY 

The PHY layer has sense the medium busy through the CCA mechanism

TX 

The PHY layer is sending a packet.

RX 

The PHY layer is receiving a packet.

SWITCHING 

The PHY layer is switching to other channel.


Member Function Documentation

virtual double ns3::WifiPhy::CalculateSnr ( WifiMode  txMode,
double  ber 
) const [pure virtual]
Parameters:
txMode the transmission mode
ber the probability of bit error rate
Returns:
the minimum snr which is required to achieve the requested ber for the specified transmission mode. (W/W)

Implemented in ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::CalculateTxDuration ( uint32_t  size,
WifiMode  payloadMode,
enum WifiPreamble  preamble 
) const [pure virtual]
Parameters:
size the number of bytes in the packet to send
payloadMode the transmission mode to use for this packet
preamble the type of preamble to use for this packet.
Returns:
the total amount of time this PHY will stay busy for the transmission of these bytes.

Implemented in ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::GetDelayUntilIdle ( void   )  [pure virtual]
Returns:
the predicted delay until this PHY can become WifiPhy::IDLE.

The PHY will never become WifiPhy::IDLE _before_ the delay returned by this method but it could become really idle later.

Implemented in ns3::YansWifiPhy.

virtual WifiMode ns3::WifiPhy::GetMode ( uint32_t  mode  )  const [pure virtual]

The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager) to determine the set of transmission/reception modes that this WifiPhy(-derived class) can support - a set of WifiMode objects which we call the DeviceRateSet, and which is stored as WifiPhy::m_deviceRateSet.

It is important to note that the DeviceRateSet is a superset (not necessarily proper) of the OperationalRateSet (which is logically, if not actually, a property of the associated WifiRemoteStationManager), which itself is a superset (again, not necessarily proper) of the BSSBasicRateSet.

Parameters:
mode index in array of supported modes
Returns:
the mode whose index is specified.
See also:
WifiPhy::GetNModes()

Implemented in ns3::YansWifiPhy.

virtual uint32_t ns3::WifiPhy::GetNModes ( void   )  const [pure virtual]

The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager) to determine the set of transmission/reception modes that this WifiPhy(-derived class) can support - a set of WifiMode objects which we call the DeviceRateSet, and which is stored as WifiPhy::m_deviceRateSet.

It is important to note that the DeviceRateSet is a superset (not necessarily proper) of the OperationalRateSet (which is logically, if not actually, a property of the associated WifiRemoteStationManager), which itself is a superset (again, not necessarily proper) of the BSSBasicRateSet.

Returns:
the number of transmission modes supported by this PHY.
See also:
WifiPhy::GetMode()

Implemented in ns3::YansWifiPhy.

virtual uint32_t ns3::WifiPhy::GetNTxPower ( void   )  const [pure virtual]
Returns:
the number of tx power levels available for this PHY.

Implemented in ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::GetStateDuration ( void   )  [pure virtual]
Returns:
the amount of time since the current state has started.

Implemented in ns3::YansWifiPhy.

static TypeId ns3::WifiPhy::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::WifiPhy.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/LinkManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/LinkManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/SSManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/SSManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/Classifier/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/Classifier/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/NoiseModel/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/NoiseModel/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/PropagationModel/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/PropagationModel/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Transducer/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Transducer/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/LinkManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/LinkManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/SSManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/SSManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/Classifier/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/Classifier/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BandwidthManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BandwidthManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BurstProfileManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BurstProfileManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/NoiseModel/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/NoiseModel/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/PropagationModel/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/PropagationModel/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/ConnectionManager/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/ConnectionManager/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/NoiseModel/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/NoiseModel/$ns3::WifiPhy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/PropagationModel/$ns3::WifiNetDevice/Phy
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/PropagationModel/$ns3::WifiPhy

No Attributes defined for this type.
TraceSources defined for this type:

  • PhyTxBegin: Trace source indicating a packet has begun transmitting over the channel medium
  • PhyTxEnd: Trace source indicating a packet has been completely transmitted over the channel. NOTE: the only official WifiPhy implementation available to this date (YansWifiPhy) never fires this trace source.
  • PhyTxDrop: Trace source indicating a packet has been dropped by the device during transmission
  • PhyRxBegin: Trace source indicating a packet has begun being received from the channel medium by the device
  • PhyRxEnd: Trace source indicating a packet has been completely received from the channel medium by the device
  • PhyRxDrop: Trace source indicating a packet has been dropped by the device during reception
  • PromiscSnifferRx: Trace source simulating a wifi device in monitor mode sniffing all received frames
  • PromiscSnifferTx: Trace source simulating the capability of a wifi device in monitor mode to sniff all frames being transmitted

Reimplemented from ns3::Object.

Reimplemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateBusy ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is not WifiPhy::IDLE, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateCcaBusy ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::CCA_BUSY, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateIdle ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::IDLE, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateRx ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::RX, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateSwitching ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::SWITCHING, false otherwise.

Implemented in ns3::YansWifiPhy.

virtual bool ns3::WifiPhy::IsStateTx ( void   )  [pure virtual]
Returns:
true of the current state of the PHY layer is WifiPhy::TX, false otherwise.

Implemented in ns3::YansWifiPhy.

void ns3::WifiPhy::NotifyPromiscSniffRx ( 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 PromiscSniffer trace for a wifi packet being received. Implemented for encapsulation purposes.

Parameters:
packet the packet being received
channelFreqMhz the frequency in MHz at which the packet is received. Note that in real devices this is normally the frequency to which the receiver is tuned, and this can be different than the frequency at which the packet was originally transmitted. This is because it is possible to have the receiver tuned on a given channel and still to be able to receive packets on a nearby channel.
channelNumber the channel on which the packet is received
rate the PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header)
isShortPreamble true if short preamble is used, false otherwise
signalDbm signal power in dBm
noiseDbm noise power in dBm
void ns3::WifiPhy::NotifyPromiscSniffTx ( Ptr< const Packet packet,
uint16_t  channelFreqMhz,
uint16_t  channelNumber,
uint32_t  rate,
bool  isShortPreamble 
)

Public method used to fire a PromiscSniffer trace for a wifi packet being transmitted. Implemented for encapsulation purposes.

Parameters:
packet the packet being transmitted
channelFreqMhz the frequency in MHz at which the packet is transmitted.
channelNumber the channel on which the packet is transmitted
rate the PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header)
isShortPreamble true if short preamble is used, false otherwise
void ns3::WifiPhy::NotifyRxBegin ( Ptr< const Packet packet  ) 

Public method used to fire a PhyRxBegin trace. Implemented for encapsulation purposes.

void ns3::WifiPhy::NotifyRxDrop ( Ptr< const Packet packet  ) 

Public method used to fire a PhyRxDrop trace. Implemented for encapsulation purposes.

void ns3::WifiPhy::NotifyRxEnd ( Ptr< const Packet packet  ) 

Public method used to fire a PhyRxEnd trace. Implemented for encapsulation purposes.

void ns3::WifiPhy::NotifyTxBegin ( Ptr< const Packet packet  ) 

Public method used to fire a PhyTxBegin trace. Implemented for encapsulation purposes.

void ns3::WifiPhy::NotifyTxDrop ( Ptr< const Packet packet  ) 

Public method used to fire a PhyTxDrop trace. Implemented for encapsulation purposes.

void ns3::WifiPhy::NotifyTxEnd ( Ptr< const Packet packet  ) 

Public method used to fire a PhyTxEnd trace. Implemented for encapsulation purposes.

virtual void ns3::WifiPhy::RegisterListener ( WifiPhyListener listener  )  [pure virtual]
Parameters:
listener the new listener

Add the input listener to the list of objects to be notified of PHY-level events.

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SendPacket ( Ptr< const Packet packet,
WifiMode  mode,
enum WifiPreamble  preamble,
uint8_t  txPowerLevel 
) [pure virtual]
Parameters:
packet the packet to send
mode the transmission mode to use to send this packet
preamble the type of preamble to use to send this packet.
txPowerLevel a power level to use to send this packet. The real transmission power is calculated as txPowerMin + txPowerLevel * (txPowerMax - txPowerMin) / nTxLevels

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SetChannelNumber ( uint16_t  id  )  [pure virtual]

Set channel number.

Channel center frequency = Channel starting frequency + 5 MHz * (nch - 1)

where Starting channel frequency is standard-dependent, see SetStandard() as defined in IEEE 802.11-2007 17.3.8.3.2.

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SetReceiveErrorCallback ( RxErrorCallback  callback  )  [pure virtual]
Parameters:
callback the callback to invoke upon erroneous packet reception.

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SetReceiveOkCallback ( RxOkCallback  callback  )  [pure virtual]
Parameters:
callback the callback to invoke upon successful packet reception.

Implemented in ns3::YansWifiPhy.


The documentation for this class was generated from the following files: