ns3::Ns2ExtWifiPhy Class Reference

802.11 PHY layer model More...

#include <ns2ext-wifi-phy.h>

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

List of all members.

Public Member Functions

 Ns2ExtWifiPhy ()
virtual ~Ns2ExtWifiPhy ()
void SetChannel (Ptr< Ns2ExtWifiChannel > channel)
void StartReceivePacket (Ptr< Packet > packet, double rxPowerDbm, WifiMode mode, WifiPreamble preamble)
void SetStandard (enum WifiPhyStandard standard)
void SetRxNoise (double ratio)
double GetRxNoise (void) const
void SetUseConstantNoiseFloor (bool value)
bool GetUseConstantNoiseFloor () const
void SetConstantNoiseFloor (double dbm)
double GetConstantNoiseFloor () const
void SetTxPowerStart (double start)
void SetTxPowerEnd (double end)
void SetNTxPower (uint32_t n)
void SetTxGain (double gain)
void SetRxGain (double gain)
void SetDevice (Ptr< Object > device)
void SetMobility (Ptr< Object > mobility)
double GetTxGain (void) const
double GetRxGain (void) const
Ptr< ObjectGetDevice (void) const
Ptr< ObjectGetMobility (void)
void SetCarrierSenseThreshold (double dbm)
double GetCarrierSenseThreshold () const
virtual double GetTxPowerStart (void) const
virtual double GetTxPowerEnd (void) const
virtual uint32_t GetNTxPower (void) const
virtual void SetReceiveOkCallback (WifiPhy::RxOkCallback callback)
virtual void SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback)
virtual void SendPacket (Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel)
virtual void RegisterListener (WifiPhyListener *listener)
virtual bool IsStateCcaBusy (void)
virtual bool IsStateIdle (void)
virtual bool IsStateBusy (void)
virtual bool IsStateSyncing (void)
virtual bool IsStateRx (void)
virtual bool IsStateTx (void)
virtual Time GetStateDuration (void)
virtual Time GetDelayUntilIdle (void)
virtual Time GetLastRxStartTime (void) const
virtual Time CalculateTxDuration (uint32_t size, WifiMode payloadMode, enum WifiPreamble preamble) const
virtual uint32_t GetNModes (void) const
virtual WifiMode GetMode (uint32_t mode) const
virtual double CalculateSnr (WifiMode txMode, double ber) const
virtual Ptr< WifiChannelGetChannel (void) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::Ns2ExtWifiPhy.

Private Types

typedef std::vector< WifiModeModes

Private Member Functions

 Ns2ExtWifiPhy (const Ns2ExtWifiPhy &o)
virtual void DoDispose (void)
void Configure80211a (void)
void ConfigureHolland (void)
double DbmToW (double dbm) const
double DbToRatio (double db) const
double WToDbm (double w) const
double RatioToDb (double ratio) const
double GetPowerDbm (uint8_t power) const
void EndReceivePacket (Ptr< Packet > packet, Ptr< InterferenceHelper::Event > event)

Private Attributes

double m_txGainDb
double m_rxGainDb
double m_txPowerBaseDbm
double m_txPowerEndDbm
uint32_t m_nTxPower
double m_carrierSenseThresholdW
double m_sinrReceive
Ptr< Ns2ExtWifiChannelm_channel
Ptr< Objectm_device
Ptr< Objectm_mobility
Modes m_modes
EventId m_endRxEvent
WifiPhyStandard m_standard
Ptr< Ns2ExtWifiPhyStateHelperm_state
InterferenceHelper m_interference

Detailed Description

802.11 PHY layer model

This PHY implements a model of 802.11a. The model implemented here is based on the model described in "Yet Another Network Simulator", (http://cutebugs.net/files/wns2-yans.pdf).

This PHY model depends on a channel loss and delay model as provided by the ns3::PropagationLossModel and ns3::PropagationDelayModel classes, both of which are members of the ns3::Ns2ExtWifiChannel class.

Definition at line 63 of file ns2ext-wifi-phy.h.


Member Typedef Documentation

typedef std::vector<WifiMode> ns3::Ns2ExtWifiPhy::Modes [private]

Definition at line 135 of file ns2ext-wifi-phy.h.


Constructor & Destructor Documentation

ns3::Ns2ExtWifiPhy::Ns2ExtWifiPhy (  ) 

Definition at line 125 of file ns2ext-wifi-phy.cc.

References m_state, and NS_LOG_FUNCTION.

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

Definition at line 132 of file ns2ext-wifi-phy.cc.

References NS_LOG_FUNCTION.

ns3::Ns2ExtWifiPhy::Ns2ExtWifiPhy ( const Ns2ExtWifiPhy o  )  [private]

Member Function Documentation

double ns3::Ns2ExtWifiPhy::CalculateSnr ( WifiMode  txMode,
double  ber 
) const [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)

Implements ns3::WifiPhy.

Definition at line 287 of file ns2ext-wifi-phy.cc.

References m_sinrReceive.

Time ns3::Ns2ExtWifiPhy::CalculateTxDuration ( uint32_t  size,
WifiMode  payloadMode,
enum WifiPreamble  preamble 
) const [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.

Implements ns3::WifiPhy.

Definition at line 538 of file ns2ext-wifi-phy.cc.

References ns3::InterferenceHelper::CalculateTxDuration(), and m_interference.

Referenced by SendPacket(), and StartReceivePacket().

void ns3::Ns2ExtWifiPhy::Configure80211a ( void   )  [private]
void ns3::Ns2ExtWifiPhy::ConfigureHolland ( void   )  [private]
double ns3::Ns2ExtWifiPhy::DbmToW ( double  dbm  )  const [private]
double ns3::Ns2ExtWifiPhy::DbToRatio ( double  db  )  const [private]

Definition at line 544 of file ns2ext-wifi-phy.cc.

Referenced by SetRxNoise().

void ns3::Ns2ExtWifiPhy::DoDispose ( void   )  [private, virtual]

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.

Reimplemented from ns3::Object.

Definition at line 138 of file ns2ext-wifi-phy.cc.

References m_channel, m_device, m_modes, and NS_LOG_FUNCTION.

void ns3::Ns2ExtWifiPhy::EndReceivePacket ( Ptr< Packet packet,
Ptr< InterferenceHelper::Event event 
) [private]
double ns3::Ns2ExtWifiPhy::GetCarrierSenseThreshold (  )  const
Returns:
carrier-sense threshold in dBm.

Definition at line 281 of file ns2ext-wifi-phy.cc.

References m_carrierSenseThresholdW, and WToDbm().

Referenced by GetTypeId().

Ptr< WifiChannel > ns3::Ns2ExtWifiPhy::GetChannel ( void   )  const [virtual]

Implements ns3::WifiPhy.

Definition at line 293 of file ns2ext-wifi-phy.cc.

References m_channel.

double ns3::Ns2ExtWifiPhy::GetConstantNoiseFloor ( void   )  const
Time ns3::Ns2ExtWifiPhy::GetDelayUntilIdle ( void   )  [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.

Implements ns3::WifiPhy.

Definition at line 526 of file ns2ext-wifi-phy.cc.

References m_state.

Ptr< Object > ns3::Ns2ExtWifiPhy::GetDevice ( void   )  const

Definition at line 264 of file ns2ext-wifi-phy.cc.

References m_device.

Time ns3::Ns2ExtWifiPhy::GetLastRxStartTime ( void   )  const [virtual]

Implements ns3::WifiPhy.

Definition at line 532 of file ns2ext-wifi-phy.cc.

References m_state.

Ptr< Object > ns3::Ns2ExtWifiPhy::GetMobility ( void   ) 

Definition at line 269 of file ns2ext-wifi-phy.cc.

References m_mobility.

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

Implements ns3::WifiPhy.

Definition at line 445 of file ns2ext-wifi-phy.cc.

References m_modes.

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

Implements ns3::WifiPhy.

Definition at line 440 of file ns2ext-wifi-phy.cc.

References m_modes.

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

Implements ns3::WifiPhy.

Definition at line 450 of file ns2ext-wifi-phy.cc.

References m_nTxPower.

double ns3::Ns2ExtWifiPhy::GetPowerDbm ( uint8_t  power  )  const [private]

Definition at line 570 of file ns2ext-wifi-phy.cc.

References m_nTxPower, m_txPowerBaseDbm, m_txPowerEndDbm, and NS_ASSERT.

Referenced by SendPacket().

double ns3::Ns2ExtWifiPhy::GetRxGain ( void   )  const

Definition at line 258 of file ns2ext-wifi-phy.cc.

References m_rxGainDb.

Referenced by GetTypeId().

double ns3::Ns2ExtWifiPhy::GetRxNoise ( void   )  const

Definition at line 172 of file ns2ext-wifi-phy.cc.

References ns3::InterferenceHelper::GetRxNoiseRatio(), m_interference, and RatioToDb().

Referenced by GetTypeId().

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

Implements ns3::WifiPhy.

Definition at line 521 of file ns2ext-wifi-phy.cc.

References m_state.

double ns3::Ns2ExtWifiPhy::GetTxGain ( void   )  const

Definition at line 253 of file ns2ext-wifi-phy.cc.

References m_txGainDb.

Referenced by GetTypeId().

double ns3::Ns2ExtWifiPhy::GetTxPowerEnd ( void   )  const [virtual]

Implements ns3::WifiPhy.

Definition at line 248 of file ns2ext-wifi-phy.cc.

References m_txPowerEndDbm.

Referenced by GetTypeId().

double ns3::Ns2ExtWifiPhy::GetTxPowerStart ( void   )  const [virtual]

Implements ns3::WifiPhy.

Definition at line 243 of file ns2ext-wifi-phy.cc.

References m_txPowerBaseDbm.

Referenced by GetTypeId().

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

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

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

  • /NodeList/[i]/DeviceList/[i]/$ns3WifiNetDevice/Phy/$ns3Ns2ExtWifiPhy

Attributes defined for this type:

  • TxGain: Transmission gain (dB).
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • RxGain: Reception gain (dB).
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • TxPowerLevels: Number of transmission power levels available between TxPowerBase and TxPowerEnd included.
  • TxPowerEnd: Maximum available transmission level (dbm).
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 20
    • Flags: construct write read
  • TxPowerStart: Minimum available transmission level (dbm).
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 20
    • Flags: construct write read
  • RxNoise: Ratio of energy lost by receiver (dB).
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 7
    • Flags: construct write read
  • UseConstantNoiseFloor: If false calculate noise floor, if true use ConstantNoiseFloor as noise floor.
    • Set with class: BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: construct write read
  • ConstantNoiseFloor: Override receiver noise energy calculation with a constant noise floor (dBm).
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: -101
    • Flags: construct write read
  • CarrierSenseThreshold: Carrier-sense threshold in dBm.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: -94
    • Flags: construct write read
  • SINRReceive: Signal-and-Noise-Interference ratio (in dB) required to receive a packet. TODO: This should depend on the datarate.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 4
    • Flags: construct write read
  • Standard: The standard chosen configures a set of transmission modes and some PHY-specific constants.
    • Set with class: ns3::EnumValue
    • Underlying type: 802.11a|holland
    • Initial value: 802.11a
    • Flags: construct write
  • State: The state of the PHY layer

No TraceSources defined for this type.

Reimplemented from ns3::WifiPhy.

Definition at line 47 of file ns2ext-wifi-phy.cc.

References ns3::TypeId::AddAttribute(), GetCarrierSenseThreshold(), GetConstantNoiseFloor(), GetRxGain(), GetRxNoise(), GetTxGain(), GetTxPowerEnd(), GetTxPowerStart(), GetUseConstantNoiseFloor(), m_nTxPower, m_sinrReceive, m_state, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), SetCarrierSenseThreshold(), SetConstantNoiseFloor(), ns3::TypeId::SetParent(), SetRxGain(), SetRxNoise(), SetStandard(), SetTxGain(), SetTxPowerEnd(), SetTxPowerStart(), SetUseConstantNoiseFloor(), ns3::WIFI_PHY_STANDARD_80211a, and ns3::WIFI_PHY_STANDARD_holland.

bool ns3::Ns2ExtWifiPhy::GetUseConstantNoiseFloor (  )  const

Definition at line 184 of file ns2ext-wifi-phy.cc.

References ns3::InterferenceHelper::GetUseConstantNoiseFloor(), and m_interference.

Referenced by GetTypeId().

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

Implements ns3::WifiPhy.

Definition at line 500 of file ns2ext-wifi-phy.cc.

References m_state.

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

Implements ns3::WifiPhy.

Definition at line 489 of file ns2ext-wifi-phy.cc.

References m_state.

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

Implements ns3::WifiPhy.

Definition at line 495 of file ns2ext-wifi-phy.cc.

References m_state.

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

Implements ns3::WifiPhy.

Definition at line 510 of file ns2ext-wifi-phy.cc.

References m_state.

Referenced by EndReceivePacket().

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

Implements ns3::WifiPhy.

Definition at line 505 of file ns2ext-wifi-phy.cc.

References m_state.

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

Implements ns3::WifiPhy.

Definition at line 515 of file ns2ext-wifi-phy.cc.

References m_state.

double ns3::Ns2ExtWifiPhy::RatioToDb ( double  ratio  )  const [private]

Definition at line 564 of file ns2ext-wifi-phy.cc.

Referenced by GetRxNoise().

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

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

Implements ns3::WifiPhy.

Definition at line 483 of file ns2ext-wifi-phy.cc.

References m_state.

void ns3::Ns2ExtWifiPhy::SendPacket ( Ptr< const Packet packet,
WifiMode  mode,
enum WifiPreamble  preamble,
uint8_t  txPowerLevel 
) [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

Implements ns3::WifiPhy.

Definition at line 414 of file ns2ext-wifi-phy.cc.

References CalculateTxDuration(), ns3::EventId::Cancel(), GetPowerDbm(), m_channel, m_endRxEvent, m_state, m_txGainDb, NS_ASSERT, and NS_LOG_FUNCTION.

void ns3::Ns2ExtWifiPhy::SetCarrierSenseThreshold ( double  dbm  ) 

Set carrier sense threshold in dBm for ns-2 compatiblity mode.

Parameters:
dbm in dBm (e.g. -94 dBm)

Definition at line 275 of file ns2ext-wifi-phy.cc.

References DbmToW(), m_carrierSenseThresholdW, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::Ns2ExtWifiPhy::SetChannel ( Ptr< Ns2ExtWifiChannel channel  ) 

Definition at line 298 of file ns2ext-wifi-phy.cc.

References m_channel.

void ns3::Ns2ExtWifiPhy::SetConstantNoiseFloor ( double  dbm  ) 
void ns3::Ns2ExtWifiPhy::SetDevice ( Ptr< Object device  ) 

Definition at line 232 of file ns2ext-wifi-phy.cc.

References m_device.

void ns3::Ns2ExtWifiPhy::SetMobility ( Ptr< Object mobility  ) 

Definition at line 237 of file ns2ext-wifi-phy.cc.

References m_mobility.

void ns3::Ns2ExtWifiPhy::SetNTxPower ( uint32_t  n  ) 

Definition at line 214 of file ns2ext-wifi-phy.cc.

References m_nTxPower, and NS_LOG_FUNCTION.

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

Implements ns3::WifiPhy.

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

References m_state.

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

Implements ns3::WifiPhy.

Definition at line 305 of file ns2ext-wifi-phy.cc.

References m_state.

void ns3::Ns2ExtWifiPhy::SetRxGain ( double  gain  ) 

Definition at line 226 of file ns2ext-wifi-phy.cc.

References m_rxGainDb, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::Ns2ExtWifiPhy::SetRxNoise ( double  ratio  ) 
void ns3::Ns2ExtWifiPhy::SetStandard ( enum WifiPhyStandard  standard  ) 
void ns3::Ns2ExtWifiPhy::SetTxGain ( double  gain  ) 

Definition at line 220 of file ns2ext-wifi-phy.cc.

References m_txGainDb, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::Ns2ExtWifiPhy::SetTxPowerEnd ( double  end  ) 

Definition at line 208 of file ns2ext-wifi-phy.cc.

References m_txPowerEndDbm, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::Ns2ExtWifiPhy::SetTxPowerStart ( double  start  ) 

Definition at line 202 of file ns2ext-wifi-phy.cc.

References m_txPowerBaseDbm, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::Ns2ExtWifiPhy::SetUseConstantNoiseFloor ( bool  value  ) 
void ns3::Ns2ExtWifiPhy::StartReceivePacket ( Ptr< Packet packet,
double  rxPowerDbm,
WifiMode  mode,
WifiPreamble  preamble 
)
double ns3::Ns2ExtWifiPhy::WToDbm ( double  w  )  const [private]

Member Data Documentation

Definition at line 158 of file ns2ext-wifi-phy.h.

Referenced by DoDispose(), GetChannel(), SendPacket(), and SetChannel().

Definition at line 159 of file ns2ext-wifi-phy.h.

Referenced by DoDispose(), GetDevice(), and SetDevice().

Definition at line 162 of file ns2ext-wifi-phy.h.

Referenced by SendPacket(), and StartReceivePacket().

Definition at line 160 of file ns2ext-wifi-phy.h.

Referenced by GetMobility(), and SetMobility().

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

Referenced by Configure80211a(), ConfigureHolland(), DoDispose(), GetMode(), and GetNModes().

uint32_t ns3::Ns2ExtWifiPhy::m_nTxPower [private]

Definition at line 154 of file ns2ext-wifi-phy.h.

Referenced by GetNTxPower(), GetPowerDbm(), GetTypeId(), and SetNTxPower().

Definition at line 151 of file ns2ext-wifi-phy.h.

Referenced by GetRxGain(), SetRxGain(), and StartReceivePacket().

Definition at line 156 of file ns2ext-wifi-phy.h.

Referenced by CalculateSnr(), EndReceivePacket(), and GetTypeId().

Definition at line 163 of file ns2ext-wifi-phy.h.

Referenced by SetStandard().

Definition at line 150 of file ns2ext-wifi-phy.h.

Referenced by GetTxGain(), SendPacket(), and SetTxGain().

Definition at line 152 of file ns2ext-wifi-phy.h.

Referenced by GetPowerDbm(), GetTxPowerStart(), and SetTxPowerStart().

Definition at line 153 of file ns2ext-wifi-phy.h.

Referenced by GetPowerDbm(), GetTxPowerEnd(), and SetTxPowerEnd().


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