802.11 PHY layer model More...
#include <wifi-phy.h>
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< WifiChannel > | GetChannel (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) |
802.11 PHY layer model
Definition at line 167 of file wifi-phy.h.
typedef Callback< void, Ptr<const Packet> > ns3::WifiPhy::RxErrorCallback |
arg1: packet received unsuccessfully arg2: snr of packet
Definition at line 207 of file wifi-phy.h.
typedef Callback< void, Ptr<Packet> > ns3::WifiPhy::RxOkCallback |
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.
Enumeration of reasons a packet was dropped. Used in trace callbacks for debugging purposes. Common for all WifiPhys.
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.
enum ns3::WifiPhy::State |
The state of the PHY layer.
Definition at line 173 of file wifi-phy.h.
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.
virtual double ns3::WifiPhy::CalculateSnr | ( | WifiMode | txMode, | |
double | ber | |||
) | const [pure virtual] |
txMode | the transmission mode | |
ber | the probability of bit error rate |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual Time ns3::WifiPhy::CalculateTxDuration | ( | uint32_t | size, | |
WifiMode | payloadMode, | |||
enum WifiPreamble | preamble | |||
) | const [pure virtual] |
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. |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
WifiMode ns3::WifiPhy::Get12mba | ( | void | ) | [static] |
Definition at line 290 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), ns3::YansWifiPhy::ConfigureHolland(), ns3::Ns2ExtWifiPhy::ConfigureHolland(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get18mba | ( | void | ) | [static] |
Definition at line 298 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), ns3::YansWifiPhy::ConfigureHolland(), ns3::Ns2ExtWifiPhy::ConfigureHolland(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get24mba | ( | void | ) | [static] |
Definition at line 306 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get36mba | ( | void | ) | [static] |
Definition at line 314 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), ns3::YansWifiPhy::ConfigureHolland(), ns3::Ns2ExtWifiPhy::ConfigureHolland(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get48mba | ( | void | ) | [static] |
Definition at line 323 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get54mba | ( | void | ) | [static] |
Definition at line 332 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), ns3::YansWifiPhy::ConfigureHolland(), ns3::Ns2ExtWifiPhy::ConfigureHolland(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get6mba | ( | void | ) | [static] |
Definition at line 274 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), ns3::InterferenceHelper::Configure80211aParameters(), ns3::YansWifiPhy::ConfigureHolland(), ns3::Ns2ExtWifiPhy::ConfigureHolland(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
WifiMode ns3::WifiPhy::Get9mba | ( | void | ) | [static] |
Definition at line 282 of file wifi-phy.cc.
References ns3::WifiModeFactory::CreateBpsk().
Referenced by ns3::YansWifiPhy::Configure80211a(), ns3::Ns2ExtWifiPhy::Configure80211a(), anonymous_namespace{wifi-phy.cc}::Constructor::Constructor(), and ns3::YansErrorRateModel::GetChunkSuccessRate().
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] |
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] |
mode | index in array of supported modes |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual uint32_t ns3::WifiPhy::GetNModes | ( | void | ) | const [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual uint32_t ns3::WifiPhy::GetNTxPower | ( | void | ) | const [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual Time ns3::WifiPhy::GetStateDuration | ( | void | ) | [pure virtual] |
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:
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] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateCcaBusy | ( | void | ) | [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateIdle | ( | void | ) | [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateRx | ( | void | ) | [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateSyncing | ( | void | ) | [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateTx | ( | void | ) | [pure virtual] |
Implemented in ns3::Ns2ExtWifiPhy, and ns3::YansWifiPhy.
virtual void ns3::WifiPhy::RegisterListener | ( | WifiPhyListener * | listener | ) | [pure virtual] |
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] |
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] |
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] |
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] |
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] |