A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ns3::WifiPhy Class Referenceabstract

802.11 PHY layer model More...

#include <wifi-phy.h>

+ Inheritance diagram for ns3::WifiPhy:

Public Types

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

Public Member Functions

virtual int64_t AssignStreams (int64_t stream)=0
 
virtual double CalculateSnr (WifiMode txMode, double ber) const =0
 
virtual void ConfigureStandard (enum WifiPhyStandard standard)=0
 
virtual Ptr< WifiChannelGetChannel (void) const =0
 
virtual uint16_t GetChannelNumber () const =0
 Return current channel number, see SetChannelNumber()
 
virtual Time GetDelayUntilIdle (void)=0
 
virtual Time GetLastRxStartTime (void) const =0
 
virtual WifiMode GetMode (uint32_t mode) const =0
 
virtual uint32_t GetNModes (void) const =0
 
virtual uint32_t GetNTxPower (void) const =0
 
virtual Time GetStateDuration (void)=0
 
virtual double GetTxPowerEnd (void) const =0
 
virtual double GetTxPowerStart (void) const =0
 
virtual bool IsStateBusy (void)=0
 
virtual bool IsStateCcaBusy (void)=0
 
virtual bool IsStateIdle (void)=0
 
virtual bool IsStateRx (void)=0
 
virtual bool IsStateSensing (void)=0
 
virtual bool IsStateSwitching (void)=0
 
virtual bool IsStateTx (void)=0
 
void NotifyMonitorSniffRx (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm)
 
void NotifyMonitorSniffTx (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, bool isShortPreamble)
 
void NotifyRxBegin (Ptr< const Packet > packet)
 
void NotifyRxDrop (Ptr< const Packet > packet)
 
void NotifyRxEnd (Ptr< const Packet > packet)
 
void NotifyTxBegin (Ptr< const Packet > packet)
 
void NotifyTxDrop (Ptr< const Packet > packet)
 
void NotifyTxEnd (Ptr< const Packet > packet)
 
virtual void RegisterListener (WifiPhyListener *listener)=0
 
virtual void SendPacket (Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel)=0
 
virtual void SetChannelNumber (uint16_t id)=0
 Set channel number. More...
 
virtual void SetHandoffEndedCallback (HandoffEndedCallback callback)=0
 
virtual void SetReceiveErrorCallback (RxErrorCallback callback)=0
 
virtual void SetReceiveOkCallback (RxOkCallback callback)=0
 
virtual void SetSenseEndedCallback (SnsEndedCallback callback)=0
 
virtual void StartSensing (Time duration)=0
 Start sensing on current channel. More...
 
- Public Member Functions inherited from ns3::Object
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
 
uint32_t GetReferenceCount (void) const
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 
void Ref (void) const
 
void Unref (void) const
 
- Public Member Functions inherited from ns3::ObjectBase
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble)
 
static WifiMode GetDsssRate11Mbps ()
 
static WifiMode GetDsssRate1Mbps ()
 
static WifiMode GetDsssRate2Mbps ()
 
static WifiMode GetDsssRate5_5Mbps ()
 
static WifiMode GetErpOfdmRate12Mbps ()
 
static WifiMode GetErpOfdmRate18Mbps ()
 
static WifiMode GetErpOfdmRate24Mbps ()
 
static WifiMode GetErpOfdmRate36Mbps ()
 
static WifiMode GetErpOfdmRate48Mbps ()
 
static WifiMode GetErpOfdmRate54Mbps ()
 
static WifiMode GetErpOfdmRate6Mbps ()
 
static WifiMode GetErpOfdmRate9Mbps ()
 
static WifiMode GetOfdmRate12Mbps ()
 
static WifiMode GetOfdmRate12MbpsBW10MHz ()
 
static WifiMode GetOfdmRate12MbpsBW5MHz ()
 
static WifiMode GetOfdmRate13_5MbpsBW5MHz ()
 
static WifiMode GetOfdmRate18Mbps ()
 
static WifiMode GetOfdmRate18MbpsBW10MHz ()
 
static WifiMode GetOfdmRate1_5MbpsBW5MHz ()
 
static WifiMode GetOfdmRate24Mbps ()
 
static WifiMode GetOfdmRate24MbpsBW10MHz ()
 
static WifiMode GetOfdmRate27MbpsBW10MHz ()
 
static WifiMode GetOfdmRate2_25MbpsBW5MHz ()
 
static WifiMode GetOfdmRate36Mbps ()
 
static WifiMode GetOfdmRate3MbpsBW10MHz ()
 
static WifiMode GetOfdmRate3MbpsBW5MHz ()
 
static WifiMode GetOfdmRate48Mbps ()
 
static WifiMode GetOfdmRate4_5MbpsBW10MHz ()
 
static WifiMode GetOfdmRate4_5MbpsBW5MHz ()
 
static WifiMode GetOfdmRate54Mbps ()
 
static WifiMode GetOfdmRate6Mbps ()
 
static WifiMode GetOfdmRate6MbpsBW10MHz ()
 
static WifiMode GetOfdmRate6MbpsBW5MHz ()
 
static WifiMode GetOfdmRate9Mbps ()
 
static WifiMode GetOfdmRate9MbpsBW10MHz ()
 
static WifiMode GetOfdmRate9MbpsBW5MHz ()
 
static uint32_t GetPayloadDurationMicroSeconds (uint32_t size, WifiMode payloadMode)
 
static uint32_t GetPlcpHeaderDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble)
 
static WifiMode GetPlcpHeaderMode (WifiMode payloadMode, WifiPreamble preamble)
 
static uint32_t GetPlcpPreambleDurationMicroSeconds (WifiMode payloadMode, WifiPreamble preamble)
 
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 

Private Attributes

TracedCallback< Ptr< const
Packet >, uint16_t, uint16_t,
uint32_t, bool, double, double > 
m_phyMonitorSniffRxTrace
 
TracedCallback< Ptr< const
Packet >, uint16_t, uint16_t,
uint32_t, bool > 
m_phyMonitorSniffTxTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyRxBeginTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyRxDropTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyRxEndTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxBeginTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxDropTrace
 
TracedCallback< Ptr< const
Packet > > 
m_phyTxEndTrace
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 
virtual void DoInitialize (void)
 
virtual void NotifyNewAggregate (void)
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 

Detailed Description

802.11 PHY layer model

Config Paths

ns3::WifiPhy is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::WifiNetDevice/Phy

No Attributes are defined for this type.

TraceSources

  • 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
  • MonitorSnifferRx: Trace source simulating a wifi device in monitor mode sniffing all received frames
  • MonitorSnifferTx: Trace source simulating the capability of a wifi device in monitor mode to sniff all frames being transmitted

Definition at line 121 of file wifi-phy.h.

Member Typedef Documentation

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

arg1: packet received unsuccessfully arg2: snr of packet

Definition at line 166 of file wifi-phy.h.

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

Definition at line 161 of file wifi-phy.h.

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.

SENSING 

The PHY layer is sensing the channel.

Definition at line 127 of file wifi-phy.h.

Member Function Documentation

virtual int64_t ns3::WifiPhy::AssignStreams ( int64_t  stream)
pure virtual

Assign a fixed random variable stream number to the random variables used by this model. Return the number of streams (possibly zero) that have been assigned.

Parameters
streamfirst stream index to use
Returns
the number of stream indices assigned by this model

Implemented in ns3::YansWifiPhy.

virtual double ns3::WifiPhy::CalculateSnr ( WifiMode  txMode,
double  ber 
) const
pure virtual
Parameters
txModethe transmission mode
berthe 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.

Time ns3::WifiPhy::CalculateTxDuration ( uint32_t  size,
WifiMode  payloadMode,
enum WifiPreamble  preamble 
)
static
Parameters
sizethe number of bytes in the packet to send
payloadModethe transmission mode to use for this packet
preamblethe 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.

Definition at line 294 of file wifi-phy.cc.

References GetPayloadDurationMicroSeconds(), GetPlcpHeaderDurationMicroSeconds(), GetPlcpPreambleDurationMicroSeconds(), and ns3::MicroSeconds().

Referenced by ns3::MacLow::CalculateTransmissionTime(), ns3::TxDurationTest::CheckTxDuration(), ns3::MacLow::NotifyNav(), and ns3::YansWifiPhy::SendPacket().

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.

WifiMode ns3::WifiPhy::GetDsssRate1Mbps ( )
static
WifiMode ns3::WifiPhy::GetDsssRate5_5Mbps ( )
static

Clause 18 rates (HR/DSSS)

Definition at line 387 of file wifi-phy.cc.

References ns3::WifiModeFactory::CreateWifiMode(), ns3::WIFI_CODE_RATE_UNDEFINED, and ns3::WIFI_MOD_CLASS_DSSS.

Referenced by ns3::TxDurationTest::DoRun().

WifiMode ns3::WifiPhy::GetErpOfdmRate6Mbps ( )
static

Clause 19.5 rates (ERP-OFDM)

Definition at line 417 of file wifi-phy.cc.

References ns3::WifiModeFactory::CreateWifiMode(), ns3::WIFI_CODE_RATE_1_2, and ns3::WIFI_MOD_CLASS_ERP_OFDM.

Referenced by GetPlcpHeaderMode().

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
modeindex in array of supported modes
Returns
the mode whose index is specified.
See Also
WifiPhy::GetNModes()

Implemented in ns3::YansWifiPhy.

Referenced by ns3::AdhocWifiMac::Enqueue(), ns3::MeshWifiInterfaceMac::ForwardDown(), ns3::WifiRemoteStationManager::GetControlAnswerMode(), ns3::MeshWifiInterfaceMac::GetSupportedRates(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), and ns3::MeshWifiInterfaceMac::Receive().

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.

Referenced by ns3::AdhocWifiMac::Enqueue(), ns3::MeshWifiInterfaceMac::ForwardDown(), ns3::WifiRemoteStationManager::GetControlAnswerMode(), ns3::MeshWifiInterfaceMac::GetSupportedRates(), ns3::StaWifiMac::Receive(), ns3::ApWifiMac::Receive(), and ns3::MeshWifiInterfaceMac::Receive().

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.

WifiMode ns3::WifiPhy::GetOfdmRate6Mbps ( )
static

Clause 17 rates (OFDM)

Definition at line 525 of file wifi-phy.cc.

References ns3::WifiModeFactory::CreateWifiMode(), ns3::WIFI_CODE_RATE_1_2, and ns3::WIFI_MOD_CLASS_OFDM.

Referenced by GetPlcpHeaderMode().

uint32_t ns3::WifiPhy::GetPayloadDurationMicroSeconds ( uint32_t  size,
WifiMode  payloadMode 
)
static
Parameters
sizethe number of bytes in the packet to send
payloadModethe WifiMode use for the transmission of the payload
Returns
the duration of the payload in microseconds

Definition at line 235 of file wifi-phy.cc.

References ns3::WifiMode::GetBandwidth(), ns3::WifiMode::GetDataRate(), ns3::WifiMode::GetModulationClass(), NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, and ns3::WIFI_MOD_CLASS_OFDM.

Referenced by CalculateTxDuration(), and ns3::TxDurationTest::CheckPayloadDuration().

uint32_t ns3::WifiPhy::GetPlcpHeaderDurationMicroSeconds ( WifiMode  payloadMode,
WifiPreamble  preamble 
)
static
Parameters
payloadModethe WifiMode use for the transmission of the payload
preamblethe type of preamble
Returns
the duration of the PLCP header in microseconds

Definition at line 141 of file wifi-phy.cc.

References ns3::WifiMode::GetBandwidth(), ns3::WifiMode::GetModulationClass(), NS_FATAL_ERROR, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, and ns3::WIFI_MOD_CLASS_OFDM.

Referenced by CalculateTxDuration().

WifiMode ns3::WifiPhy::GetPlcpHeaderMode ( WifiMode  payloadMode,
WifiPreamble  preamble 
)
static
Parameters
payloadModethe WifiMode use for the transmission of the payload
preamblethe type of preamble
Returns
the WifiMode used for the transmission of the PLCP header

Definition at line 98 of file wifi-phy.cc.

References ns3::WifiMode::GetBandwidth(), GetDsssRate1Mbps(), GetErpOfdmRate6Mbps(), ns3::WifiMode::GetModulationClass(), GetOfdmRate6Mbps(), NS_FATAL_ERROR, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, and ns3::WIFI_MOD_CLASS_OFDM.

uint32_t ns3::WifiPhy::GetPlcpPreambleDurationMicroSeconds ( WifiMode  payloadMode,
WifiPreamble  preamble 
)
static
Parameters
payloadModethe WifiMode use for the transmission of the payload
preamblethe type of preamble
Returns
the duration of the PLCP preamble in microseconds

Definition at line 189 of file wifi-phy.cc.

References ns3::WifiMode::GetBandwidth(), ns3::WifiMode::GetModulationClass(), NS_FATAL_ERROR, ns3::WIFI_MOD_CLASS_DSSS, ns3::WIFI_MOD_CLASS_ERP_OFDM, and ns3::WIFI_MOD_CLASS_OFDM.

Referenced by CalculateTxDuration().

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

Implemented 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::IsStateSensing ( void  )
pure virtual
Returns
true if the current of the PHY layer is WifiPhy::SENSING, 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.

Referenced by ns3::MacLow::StartTransmission().

void ns3::WifiPhy::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. Implemented for encapsulation purposes.

Parameters
packetthe packet being received
channelFreqMhzthe 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.
channelNumberthe channel on which the packet is received
ratethe PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header)
isShortPreambletrue if short preamble is used, false otherwise
signalDbmsignal power in dBm
noiseDbmnoise power in dBm

Definition at line 340 of file wifi-phy.cc.

References m_phyMonitorSniffRxTrace.

void ns3::WifiPhy::NotifyMonitorSniffTx ( Ptr< const Packet packet,
uint16_t  channelFreqMhz,
uint16_t  channelNumber,
uint32_t  rate,
bool  isShortPreamble 
)

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

Parameters
packetthe packet being transmitted
channelFreqMhzthe frequency in MHz at which the packet is transmitted.
channelNumberthe channel on which the packet is transmitted
ratethe PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header)
isShortPreambletrue if short preamble is used, false otherwise

Definition at line 346 of file wifi-phy.cc.

References m_phyMonitorSniffTxTrace.

Referenced by ns3::YansWifiPhy::SendPacket().

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

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

Definition at line 322 of file wifi-phy.cc.

References m_phyRxBeginTrace.

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

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

Definition at line 334 of file wifi-phy.cc.

References m_phyRxDropTrace.

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

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

Definition at line 328 of file wifi-phy.cc.

References m_phyRxEndTrace.

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

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

Definition at line 304 of file wifi-phy.cc.

References m_phyTxBeginTrace.

Referenced by ns3::YansWifiPhy::SendPacket().

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

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

Definition at line 316 of file wifi-phy.cc.

References m_phyTxDropTrace.

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

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

Definition at line 310 of file wifi-phy.cc.

References m_phyTxEndTrace.

virtual void ns3::WifiPhy::RegisterListener ( WifiPhyListener listener)
pure virtual
Parameters
listenerthe 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
packetthe packet to send
modethe transmission mode to use to send this packet
preamblethe type of preamble to use to send this packet.
txPowerLevela 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.

Referenced by ns3::SpectrumManager::SenseEnded(), and ns3::SpectrumManager::SetRepository().

virtual void ns3::WifiPhy::SetHandoffEndedCallback ( HandoffEndedCallback  callback)
pure virtual
Parameters
callbackthe callback to invoke when sensing is ended

Implemented in ns3::YansWifiPhy.

Referenced by ns3::SpectrumManager::SpectrumManager().

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

Implemented in ns3::YansWifiPhy.

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

Implemented in ns3::YansWifiPhy.

virtual void ns3::WifiPhy::SetSenseEndedCallback ( SnsEndedCallback  callback)
pure virtual
Parameters
callbackthe callback to invoke when sensing is ended

Implemented in ns3::YansWifiPhy.

Referenced by ns3::SpectrumManager::SpectrumManager().

virtual void ns3::WifiPhy::StartSensing ( Time  duration)
pure virtual

Start sensing on current channel.

Parameters
durationTime to sense

Implemented in ns3::YansWifiPhy.

Referenced by ns3::SpectrumManager::HandoffEnded(), ns3::SpectrumManager::SenseEnded(), ns3::SpectrumManager::Start(), and ns3::SpectrumManager::TransmitEnded().

Member Data Documentation

TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool, double, double> ns3::WifiPhy::m_phyMonitorSniffRxTrace
private

A trace source that emulates a wifi device in monitor mode sniffing a packet being received.

As a reference with the real world, firing this trace corresponds in the madwifi driver to calling the function ieee80211_input_monitor()

See Also
class CallBackTraceSource

Definition at line 554 of file wifi-phy.h.

Referenced by NotifyMonitorSniffRx().

TracedCallback<Ptr<const Packet>, uint16_t, uint16_t, uint32_t, bool> ns3::WifiPhy::m_phyMonitorSniffTxTrace
private

A trace source that emulates a wifi device in monitor mode sniffing a packet being transmitted.

As a reference with the real world, firing this trace corresponds in the madwifi driver to calling the function ieee80211_input_monitor()

See Also
class CallBackTraceSource

Definition at line 566 of file wifi-phy.h.

Referenced by NotifyMonitorSniffTx().

TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyRxBeginTrace
private

The trace source fired when a packet begins the reception process from the medium.

See Also
class CallBackTraceSource

Definition at line 527 of file wifi-phy.h.

Referenced by NotifyRxBegin().

TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyRxDropTrace
private

The trace source fired when the phy layer drops a packet it has received.

See Also
class CallBackTraceSource

Definition at line 542 of file wifi-phy.h.

Referenced by NotifyRxDrop().

TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyRxEndTrace
private

The trace source fired when a packet ends the reception process from the medium.

See Also
class CallBackTraceSource

Definition at line 535 of file wifi-phy.h.

Referenced by NotifyRxEnd().

TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyTxBeginTrace
private

The trace source fired when a packet begins the transmission process on the medium.

See Also
class CallBackTraceSource

Definition at line 503 of file wifi-phy.h.

Referenced by NotifyTxBegin().

TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyTxDropTrace
private

The trace source fired when the phy layer drops a packet as it tries to transmit it.

See Also
class CallBackTraceSource

Definition at line 519 of file wifi-phy.h.

Referenced by NotifyTxDrop().

TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyTxEndTrace
private

The trace source fired when a packet ends the transmission process on the medium.

See Also
class CallBackTraceSource

Definition at line 511 of file wifi-phy.h.

Referenced by NotifyTxEnd().


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