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, SYNCING,
  RX
}
enum  RxErrorReason { RXERROR_BAD_SIGNAL, RXERROR_ALREADY_RXING, RXERROR_IN_TX, RXERROR_LOW_SIGNAL }
typedef Callback< void, Ptr
< Packet > > 
RxOkCallback
typedef Callback< void, Ptr
< const Packet > > 
RxErrorCallback

Public Member Functions

 WifiPhy ()
virtual ~WifiPhy ()
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 IsStateCcaBusy (void)=0
virtual bool IsStateIdle (void)=0
virtual bool IsStateBusy (void)=0
virtual bool IsStateSyncing (void)=0
virtual bool IsStateRx (void)=0
virtual bool IsStateTx (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 Ptr< WifiChannelGetChannel (void) const =0

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::WifiPhy.
static const char * StateToString (enum State state)
static WifiMode Get6mba (void)
static WifiMode Get9mba (void)
static WifiMode Get12mba (void)
static WifiMode Get18mba (void)
static WifiMode Get24mba (void)
static WifiMode Get36mba (void)
static WifiMode Get48mba (void)
static WifiMode Get54mba (void)
static const char * RxErrorReasonToString (enum RxErrorReason rxErrorReason)

Detailed Description

802.11 PHY layer model

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


Member Typedef Documentation

arg1: packet received unsuccessfully arg2: snr of packet

Definition at line 207 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 202 of file wifi-phy.h.


Member Enumeration Documentation

Enumeration of reasons a packet was dropped. Used in trace callbacks for debugging purposes. Common for all WifiPhys.

Enumerator:
RXERROR_BAD_SIGNAL 

Packet dropped because received signal was not strong enough for the complete duration. Detected at end of RX period.

RXERROR_ALREADY_RXING 

Packet dropped because PHY was already in RX state on a different packet.

RXERROR_IN_TX 

Packet dropped because PHY was is TX state on a different packet.

RXERROR_LOW_SIGNAL 

Packet dropped because received signal was below PHY's detection threshold.

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

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.

SYNCING 

The PHY layer is synchronizing upon a new packet. Currently not used.

RX 

The PHY layer is receiving a packet.

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


Constructor & Destructor Documentation

ns3::WifiPhy::WifiPhy (  ) 

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

References NS_LOG_FUNCTION.

ns3::WifiPhy::~WifiPhy (  )  [virtual]

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

References NS_LOG_FUNCTION.


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::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

WifiMode ns3::WifiPhy::Get12mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get18mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get24mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get36mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get48mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get54mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get6mba ( void   )  [static]
WifiMode ns3::WifiPhy::Get9mba ( void   )  [static]
virtual Ptr<WifiChannel> ns3::WifiPhy::GetChannel ( void   )  const [pure virtual]

Implemented in ns3::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

virtual Time ns3::WifiPhy::GetLastRxStartTime ( void   )  const [pure virtual]

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

virtual WifiMode ns3::WifiPhy::GetMode ( uint32_t  mode  )  const [pure virtual]
Parameters:
mode index in array of supported modes
Returns:
the mode whose index is specified.

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

virtual uint32_t ns3::WifiPhy::GetNModes ( void   )  const [pure virtual]
Returns:
the number of transmission modes supported by this PHY.

Implemented in ns3::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

virtual double ns3::WifiPhy::GetTxPowerEnd ( void   )  const [pure virtual]

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

virtual double ns3::WifiPhy::GetTxPowerStart ( void   )  const [pure virtual]

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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]/$ns3WifiNetDevice/Phy

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

Reimplemented from ns3::Object.

Reimplemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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

References ns3::TypeId::SetParent().

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::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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

Implemented in ns3::Ns2ExtWifiPhy, and 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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

const char * ns3::WifiPhy::RxErrorReasonToString ( enum RxErrorReason  rxErrorReason  )  [static]
Returns:
the drop reason as a short reason string.

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

References NS_ASSERT, RXERROR_ALREADY_RXING, RXERROR_BAD_SIGNAL, RXERROR_IN_TX, and RXERROR_LOW_SIGNAL.

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::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

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

Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.

const char * ns3::WifiPhy::StateToString ( enum State  state  )  [static]

As long as the state enum is in the WifiPhy class, this belongs here.

Returns:
a stringified name of the state

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

References CCA_BUSY, IDLE, NS_ASSERT, RX, SYNCING, and TX.


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:27 2009 for NS-3 by  doxygen 1.6.3