802.11 PHY layer modelThis 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). More...
#include <yans-wifi-phy.h>
Public Member Functions | |
YansWifiPhy () | |
virtual | ~YansWifiPhy () |
int64_t | AssignStreams (int64_t stream) |
virtual double | CalculateSnr (WifiMode txMode, double ber) const |
virtual void | ConfigureStandard (enum WifiPhyStandard standard) |
double | GetCcaMode1Threshold (void) const |
virtual Ptr< WifiChannel > | GetChannel (void) const |
double | GetChannelFrequencyMhz () const |
Return current center channel frequency in MHz, see SetChannelNumber() | |
uint16_t | GetChannelNumber () const |
Return current channel number, see SetChannelNumber() | |
virtual Time | GetDelayUntilIdle (void) |
Ptr< Object > | GetDevice (void) const |
double | GetEdThreshold (void) const |
Ptr< ErrorRateModel > | GetErrorRateModel (void) const |
virtual Time | GetLastRxStartTime (void) const |
Ptr< Object > | GetMobility (void) |
virtual WifiMode | GetMode (uint32_t mode) const |
virtual uint32_t | GetNModes (void) const |
virtual uint32_t | GetNTxPower (void) const |
double | GetRxGain (void) const |
double | GetRxNoiseFigure (void) const |
virtual Time | GetStateDuration (void) |
double | GetTxGain (void) const |
virtual double | GetTxPowerEnd (void) const |
virtual double | GetTxPowerStart (void) const |
virtual bool | IsStateBusy (void) |
virtual bool | IsStateCcaBusy (void) |
virtual bool | IsStateIdle (void) |
virtual bool | IsStateRx (void) |
virtual bool | IsStateSwitching (void) |
virtual bool | IsStateTx (void) |
virtual void | RegisterListener (WifiPhyListener *listener) |
virtual void | SendPacket (Ptr< const Packet > packet, WifiMode mode, enum WifiPreamble preamble, uint8_t txPowerLevel) |
void | SetCcaMode1Threshold (double threshold) |
void | SetChannel (Ptr< YansWifiChannel > channel) |
void | SetChannelNumber (uint16_t id) |
Set channel number. | |
void | SetDevice (Ptr< Object > device) |
void | SetEdThreshold (double threshold) |
void | SetErrorRateModel (Ptr< ErrorRateModel > rate) |
void | SetMobility (Ptr< Object > mobility) |
void | SetNTxPower (uint32_t n) |
virtual void | SetReceiveErrorCallback (WifiPhy::RxErrorCallback callback) |
virtual void | SetReceiveOkCallback (WifiPhy::RxOkCallback callback) |
void | SetRxGain (double gain) |
void | SetRxNoiseFigure (double noiseFigureDb) |
void | SetTxGain (double gain) |
void | SetTxPowerEnd (double end) |
void | SetTxPowerStart (double start) |
void | StartReceivePacket (Ptr< Packet > packet, double rxPowerDbm, WifiMode mode, WifiPreamble preamble) |
![]() | |
WifiPhy () | |
virtual | ~WifiPhy () |
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) |
![]() | |
Object () | |
virtual | ~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 | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~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) |
Private Member Functions | |
YansWifiPhy (const YansWifiPhy &o) | |
void | Configure80211_10Mhz (void) |
void | Configure80211_5Mhz () |
void | Configure80211a (void) |
void | Configure80211b (void) |
void | Configure80211g (void) |
void | Configure80211p_CCH (void) |
void | Configure80211p_SCH (void) |
void | ConfigureHolland (void) |
double | DbmToW (double dbm) const |
double | DbToRatio (double db) const |
virtual void | DoDispose (void) |
void | EndReceive (Ptr< Packet > packet, Ptr< InterferenceHelper::Event > event) |
double | GetEdThresholdW (void) const |
double | GetPowerDbm (uint8_t power) const |
double | RatioToDb (double ratio) const |
double | WToDbm (double w) const |
Private Attributes | |
double | m_ccaMode1ThresholdW |
Ptr< YansWifiChannel > | m_channel |
uint16_t | m_channelNumber |
double | m_channelStartingFrequency |
Standard-dependent center frequency of 0-th channel, MHz. | |
Time | m_channelSwitchDelay |
Ptr< Object > | m_device |
WifiModeList | m_deviceRateSet |
double | m_edThresholdW |
EventId | m_endRxEvent |
InterferenceHelper | m_interference |
Ptr< Object > | m_mobility |
uint32_t | m_nTxPower |
Ptr< UniformRandomVariable > | m_random |
Provides uniform random variables. | |
double | m_rxGainDb |
Ptr< WifiPhyStateHelper > | m_state |
double | m_txGainDb |
double | m_txPowerBaseDbm |
double | m_txPowerEndDbm |
Additional Inherited Members | |
![]() | |
typedef Callback< void, Ptr < const Packet >, double > | RxErrorCallback |
typedef Callback< void, Ptr < Packet >, double, WifiMode, enum WifiPreamble > | RxOkCallback |
enum | State { IDLE, CCA_BUSY, TX, RX, SWITCHING } |
![]() | |
Object (const Object &o) | |
virtual void | DoDispose (void) |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
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::YansWifiChannel class.
Definition at line 63 of file yans-wifi-phy.h.
ns3::YansWifiPhy::YansWifiPhy | ( | ) |
Definition at line 127 of file yans-wifi-phy.cc.
References m_random, m_state, and NS_LOG_FUNCTION.
|
virtual |
Definition at line 137 of file yans-wifi-phy.cc.
References NS_LOG_FUNCTION.
|
private |
|
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.
stream | first stream index to use |
Implements ns3::WifiPhy.
Definition at line 801 of file yans-wifi-phy.cc.
References m_random, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
|
virtual |
txMode | the transmission mode |
ber | the probability of bit error rate |
Implements ns3::WifiPhy.
Definition at line 309 of file yans-wifi-phy.cc.
References ns3::ErrorRateModel::CalculateSnr(), ns3::InterferenceHelper::GetErrorRateModel(), and m_interference.
|
private |
Definition at line 589 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetOfdmRate12MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate18MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate24MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate27MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate3MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate4_5MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate6MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate9MbpsBW10MHz(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 605 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetOfdmRate12MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate13_5MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate1_5MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate2_25MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate3MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate4_5MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate6MbpsBW5MHz(), ns3::WifiPhy::GetOfdmRate9MbpsBW5MHz(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 540 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetOfdmRate12Mbps(), ns3::WifiPhy::GetOfdmRate18Mbps(), ns3::WifiPhy::GetOfdmRate24Mbps(), ns3::WifiPhy::GetOfdmRate36Mbps(), ns3::WifiPhy::GetOfdmRate48Mbps(), ns3::WifiPhy::GetOfdmRate54Mbps(), ns3::WifiPhy::GetOfdmRate6Mbps(), ns3::WifiPhy::GetOfdmRate9Mbps(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 557 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetDsssRate11Mbps(), ns3::WifiPhy::GetDsssRate1Mbps(), ns3::WifiPhy::GetDsssRate2Mbps(), ns3::WifiPhy::GetDsssRate5_5Mbps(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 569 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetDsssRate11Mbps(), ns3::WifiPhy::GetDsssRate1Mbps(), ns3::WifiPhy::GetDsssRate2Mbps(), ns3::WifiPhy::GetDsssRate5_5Mbps(), ns3::WifiPhy::GetErpOfdmRate12Mbps(), ns3::WifiPhy::GetErpOfdmRate18Mbps(), ns3::WifiPhy::GetErpOfdmRate24Mbps(), ns3::WifiPhy::GetErpOfdmRate36Mbps(), ns3::WifiPhy::GetErpOfdmRate48Mbps(), ns3::WifiPhy::GetErpOfdmRate54Mbps(), ns3::WifiPhy::GetErpOfdmRate6Mbps(), ns3::WifiPhy::GetErpOfdmRate9Mbps(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 633 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetOfdmRate12MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate18MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate24MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate27MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate3MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate4_5MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate6MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate9MbpsBW10MHz(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 649 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetOfdmRate12MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate18MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate24MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate27MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate3MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate4_5MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate6MbpsBW10MHz(), ns3::WifiPhy::GetOfdmRate9MbpsBW10MHz(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
private |
Definition at line 621 of file yans-wifi-phy.cc.
References ns3::WifiPhy::GetOfdmRate12Mbps(), ns3::WifiPhy::GetOfdmRate18Mbps(), ns3::WifiPhy::GetOfdmRate36Mbps(), ns3::WifiPhy::GetOfdmRate54Mbps(), ns3::WifiPhy::GetOfdmRate6Mbps(), m_channelStartingFrequency, m_deviceRateSet, and NS_LOG_FUNCTION.
Referenced by ConfigureStandard().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 154 of file yans-wifi-phy.cc.
References Configure80211_10Mhz(), Configure80211_5Mhz(), Configure80211a(), Configure80211b(), Configure80211g(), Configure80211p_CCH(), Configure80211p_SCH(), ConfigureHolland(), NS_ASSERT, NS_LOG_FUNCTION, ns3::WIFI_PHY_STANDARD_80211_10MHZ, ns3::WIFI_PHY_STANDARD_80211_5MHZ, ns3::WIFI_PHY_STANDARD_80211a, ns3::WIFI_PHY_STANDARD_80211b, ns3::WIFI_PHY_STANDARD_80211g, ns3::WIFI_PHY_STANDARD_80211p_CCH, ns3::WIFI_PHY_STANDARD_80211p_SCH, and ns3::WIFI_PHY_STANDARD_holland.
|
private |
Definition at line 727 of file yans-wifi-phy.cc.
Referenced by SetCcaMode1Threshold(), SetEdThreshold(), and StartReceivePacket().
|
private |
Definition at line 720 of file yans-wifi-phy.cc.
Referenced by SetRxNoiseFigure().
|
privatevirtual |
Definition at line 143 of file yans-wifi-phy.cc.
References m_channel, m_device, m_deviceRateSet, m_mobility, m_state, and NS_LOG_FUNCTION.
|
private |
Definition at line 770 of file yans-wifi-phy.cc.
References ns3::InterferenceHelper::CalculateSnrPer(), GetChannelFrequencyMhz(), GetChannelNumber(), GetRxNoiseFigure(), ns3::Packet::GetSize(), ns3::UniformRandomVariable::GetValue(), IsStateRx(), m_interference, m_random, m_state, ns3::WifiPhy::NotifyMonitorSniffRx(), ns3::WifiPhy::NotifyRxDrop(), ns3::InterferenceHelper::NotifyRxEnd(), ns3::WifiPhy::NotifyRxEnd(), ns3::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, RatioToDb(), ns3::WifiPhyStateHelper::SwitchFromRxEndError(), ns3::WifiPhyStateHelper::SwitchFromRxEndOk(), and ns3::WIFI_PREAMBLE_SHORT.
Referenced by StartReceivePacket().
double ns3::YansWifiPhy::GetCcaMode1Threshold | ( | void | ) | const |
Definition at line 287 of file yans-wifi-phy.cc.
References m_ccaMode1ThresholdW, and WToDbm().
Referenced by GetTypeId().
|
virtual |
double ns3::YansWifiPhy::GetChannelFrequencyMhz | ( | ) | const |
Return current center channel frequency in MHz, see SetChannelNumber()
Definition at line 382 of file yans-wifi-phy.cc.
References GetChannelNumber(), and m_channelStartingFrequency.
Referenced by EndReceive(), and SendPacket().
|
virtual |
Return current channel number, see SetChannelNumber()
Implements ns3::WifiPhy.
Definition at line 376 of file yans-wifi-phy.cc.
References m_channelNumber.
Referenced by EndReceive(), GetChannelFrequencyMhz(), ns3::MeshWifiInterfaceMac::GetFrequencyChannel(), GetTypeId(), ns3::YansWifiChannel::Send(), and SendPacket().
|
virtual |
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 708 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::GetDelayUntilIdle(), and m_state.
Referenced by SetChannelNumber().
Definition at line 298 of file yans-wifi-phy.cc.
References m_device.
double ns3::YansWifiPhy::GetEdThreshold | ( | void | ) | const |
Definition at line 281 of file yans-wifi-phy.cc.
References m_edThresholdW, and WToDbm().
Referenced by GetTypeId().
|
private |
Definition at line 746 of file yans-wifi-phy.cc.
References m_edThresholdW.
Ptr< ErrorRateModel > ns3::YansWifiPhy::GetErrorRateModel | ( | void | ) | const |
Definition at line 293 of file yans-wifi-phy.cc.
References ns3::InterferenceHelper::GetErrorRateModel(), and m_interference.
|
virtual |
Implements ns3::WifiPhy.
Definition at line 714 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::GetLastRxStartTime(), and m_state.
Definition at line 303 of file yans-wifi-phy.cc.
References m_mobility.
Referenced by ns3::YansWifiChannel::Send().
|
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.
mode | index in array of supported modes |
Implements ns3::WifiPhy.
Definition at line 529 of file yans-wifi-phy.cc.
References m_deviceRateSet.
|
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.
Implements ns3::WifiPhy.
Definition at line 524 of file yans-wifi-phy.cc.
References m_deviceRateSet.
|
virtual |
Implements ns3::WifiPhy.
Definition at line 534 of file yans-wifi-phy.cc.
References m_nTxPower.
|
private |
Definition at line 752 of file yans-wifi-phy.cc.
References m_nTxPower, m_txPowerBaseDbm, m_txPowerEndDbm, NS_ASSERT, and NS_ASSERT_MSG.
Referenced by SendPacket().
double ns3::YansWifiPhy::GetRxGain | ( | void | ) | const |
Definition at line 275 of file yans-wifi-phy.cc.
References m_rxGainDb.
Referenced by GetTypeId().
double ns3::YansWifiPhy::GetRxNoiseFigure | ( | void | ) | const |
Definition at line 255 of file yans-wifi-phy.cc.
References ns3::InterferenceHelper::GetNoiseFigure(), m_interference, and RatioToDb().
Referenced by EndReceive(), and GetTypeId().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 703 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::GetStateDuration(), and m_state.
double ns3::YansWifiPhy::GetTxGain | ( | void | ) | const |
Definition at line 270 of file yans-wifi-phy.cc.
References m_txGainDb.
Referenced by GetTypeId().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 265 of file yans-wifi-phy.cc.
References m_txPowerEndDbm.
Referenced by GetTypeId().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 260 of file yans-wifi-phy.cc.
References m_txPowerBaseDbm.
Referenced by GetTypeId().
|
static |
This method returns the TypeId associated to ns3::YansWifiPhy.
This object is accessible through the following paths with Config::Set and Config::Connect:
Attributes defined for this type:
No TraceSources defined for this type.
TraceSources defined in parent class ns3::WifiPhy:
Reimplemented from ns3::WifiPhy.
Definition at line 46 of file yans-wifi-phy.cc.
References GetCcaMode1Threshold(), GetChannelNumber(), GetEdThreshold(), GetRxGain(), GetRxNoiseFigure(), GetTxGain(), GetTxPowerEnd(), GetTxPowerStart(), m_channelSwitchDelay, m_nTxPower, m_state, ns3::MicroSeconds(), SetCcaMode1Threshold(), SetChannelNumber(), SetEdThreshold(), ns3::TypeId::SetParent(), SetRxGain(), SetRxNoiseFigure(), SetTxGain(), SetTxPowerEnd(), and SetTxPowerStart().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 682 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::IsStateBusy(), and m_state.
|
virtual |
Implements ns3::WifiPhy.
Definition at line 671 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::IsStateCcaBusy(), and m_state.
|
virtual |
Implements ns3::WifiPhy.
Definition at line 677 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::IsStateIdle(), and m_state.
|
virtual |
Implements ns3::WifiPhy.
Definition at line 687 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::IsStateRx(), and m_state.
Referenced by EndReceive().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 697 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::IsStateSwitching(), and m_state.
Referenced by SetChannelNumber().
|
virtual |
Implements ns3::WifiPhy.
Definition at line 692 of file yans-wifi-phy.cc.
References ns3::WifiPhyStateHelper::IsStateTx(), and m_state.
|
private |
Definition at line 740 of file yans-wifi-phy.cc.
Referenced by EndReceive(), and GetRxNoiseFigure().
|
virtual |
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 665 of file yans-wifi-phy.cc.
References m_state, and ns3::WifiPhyStateHelper::RegisterListener().
|
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 |
Implements ns3::WifiPhy.
Definition at line 498 of file yans-wifi-phy.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::EventId::Cancel(), GetChannelFrequencyMhz(), GetChannelNumber(), ns3::WifiMode::GetDataRate(), GetPowerDbm(), ns3::Packet::GetSize(), ns3::WifiPhyStateHelper::IsStateRx(), ns3::WifiPhyStateHelper::IsStateSwitching(), ns3::WifiPhyStateHelper::IsStateTx(), m_channel, m_endRxEvent, m_interference, m_state, m_txGainDb, ns3::WifiPhy::NotifyMonitorSniffTx(), ns3::InterferenceHelper::NotifyRxEnd(), ns3::WifiPhy::NotifyTxBegin(), NS_ASSERT, NS_LOG_FUNCTION, ns3::YansWifiChannel::Send(), ns3::WifiPhyStateHelper::SwitchToTx(), and ns3::WIFI_PREAMBLE_SHORT.
void ns3::YansWifiPhy::SetCcaMode1Threshold | ( | double | threshold | ) |
Definition at line 233 of file yans-wifi-phy.cc.
References DbmToW(), m_ccaMode1ThresholdW, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::YansWifiPhy::SetChannel | ( | Ptr< YansWifiChannel > | channel | ) |
Definition at line 320 of file yans-wifi-phy.cc.
References ns3::YansWifiChannel::Add(), and m_channel.
Referenced by ns3::YansWifiPhyHelper::Create().
|
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.
YansWifiPhy can switch among different channels. Basically, YansWifiPhy has a private attribute m_channelNumber that identifies the channel the PHY operates on. Channel switching cannot interrupt an ongoing transmission. When PHY is in TX state, the channel switching is postponed until the end of the current transmission. When the PHY is in RX state, the channel switching causes the drop of the synchronized packet.
Implements ns3::WifiPhy.
Definition at line 327 of file yans-wifi-phy.cc.
References ns3::EventId::Cancel(), ns3::WifiPhy::CCA_BUSY, ns3::InterferenceHelper::EraseEvents(), GetDelayUntilIdle(), ns3::WifiPhyStateHelper::GetState(), ns3::WifiPhy::IDLE, IsStateSwitching(), m_channelNumber, m_channelSwitchDelay, m_endRxEvent, m_interference, m_state, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, ns3::WifiPhy::RX, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiPhyStateHelper::SwitchToChannelSwitching(), and ns3::WifiPhy::TX.
Referenced by GetTypeId(), and ns3::MeshWifiInterfaceMac::SwitchFrequencyChannel().
Definition at line 244 of file yans-wifi-phy.cc.
References m_device.
Referenced by ns3::YansWifiPhyHelper::Create().
void ns3::YansWifiPhy::SetEdThreshold | ( | double | threshold | ) |
Definition at line 227 of file yans-wifi-phy.cc.
References DbmToW(), m_edThresholdW, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::YansWifiPhy::SetErrorRateModel | ( | Ptr< ErrorRateModel > | rate | ) |
Definition at line 239 of file yans-wifi-phy.cc.
References m_interference, and ns3::InterferenceHelper::SetErrorRateModel().
Referenced by ns3::YansWifiPhyHelper::Create().
Definition at line 249 of file yans-wifi-phy.cc.
References m_mobility.
Referenced by ns3::YansWifiPhyHelper::Create().
void ns3::YansWifiPhy::SetNTxPower | ( | uint32_t | n | ) |
Definition at line 209 of file yans-wifi-phy.cc.
References m_nTxPower, and NS_LOG_FUNCTION.
|
virtual |
callback | the callback to invoke upon erroneous packet reception. |
Implements ns3::WifiPhy.
Definition at line 393 of file yans-wifi-phy.cc.
References m_state, and ns3::WifiPhyStateHelper::SetReceiveErrorCallback().
|
virtual |
callback | the callback to invoke upon successful packet reception. |
Implements ns3::WifiPhy.
Definition at line 388 of file yans-wifi-phy.cc.
References m_state, and ns3::WifiPhyStateHelper::SetReceiveOkCallback().
void ns3::YansWifiPhy::SetRxGain | ( | double | gain | ) |
Definition at line 221 of file yans-wifi-phy.cc.
References m_rxGainDb, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::YansWifiPhy::SetRxNoiseFigure | ( | double | noiseFigureDb | ) |
Definition at line 191 of file yans-wifi-phy.cc.
References DbToRatio(), m_interference, NS_LOG_FUNCTION, and ns3::InterferenceHelper::SetNoiseFigure().
Referenced by GetTypeId().
void ns3::YansWifiPhy::SetTxGain | ( | double | gain | ) |
Definition at line 215 of file yans-wifi-phy.cc.
References m_txGainDb, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::YansWifiPhy::SetTxPowerEnd | ( | double | end | ) |
Definition at line 203 of file yans-wifi-phy.cc.
References m_txPowerEndDbm, and NS_LOG_FUNCTION.
Referenced by GetTypeId().
void ns3::YansWifiPhy::SetTxPowerStart | ( | double | start | ) |
Definition at line 197 of file yans-wifi-phy.cc.
References m_txPowerBaseDbm, NS_LOG_FUNCTION, and visualizer.core::start().
Referenced by GetTypeId().
void ns3::YansWifiPhy::StartReceivePacket | ( | Ptr< Packet > | packet, |
double | rxPowerDbm, | ||
WifiMode | mode, | ||
WifiPreamble | preamble | ||
) |
Definition at line 398 of file yans-wifi-phy.cc.
References ns3::InterferenceHelper::Add(), ns3::WifiPhy::CalculateTxDuration(), ns3::WifiPhy::CCA_BUSY, DbmToW(), EndReceive(), ns3::WifiPhyStateHelper::GetDelayUntilIdle(), ns3::InterferenceHelper::GetEnergyDuration(), ns3::Packet::GetSize(), ns3::WifiPhyStateHelper::GetState(), ns3::WifiPhy::IDLE, ns3::EventId::IsExpired(), ns3::Time::IsZero(), m_ccaMode1ThresholdW, m_edThresholdW, m_endRxEvent, m_interference, m_rxGainDb, m_state, ns3::WifiPhy::NotifyRxBegin(), ns3::WifiPhy::NotifyRxDrop(), ns3::InterferenceHelper::NotifyRxStart(), ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::WifiPhy::RX, ns3::Simulator::Schedule(), ns3::WifiPhy::SWITCHING, ns3::WifiPhyStateHelper::SwitchMaybeToCcaBusy(), ns3::WifiPhyStateHelper::SwitchToRx(), and ns3::WifiPhy::TX.
|
private |
Definition at line 734 of file yans-wifi-phy.cc.
Referenced by GetCcaMode1Threshold(), and GetEdThreshold().
|
private |
Definition at line 175 of file yans-wifi-phy.h.
Referenced by GetCcaMode1Threshold(), SetCcaMode1Threshold(), and StartReceivePacket().
|
private |
Definition at line 182 of file yans-wifi-phy.h.
Referenced by DoDispose(), GetChannel(), SendPacket(), and SetChannel().
|
private |
Definition at line 183 of file yans-wifi-phy.h.
Referenced by GetChannelNumber(), and SetChannelNumber().
|
private |
Standard-dependent center frequency of 0-th channel, MHz.
Definition at line 229 of file yans-wifi-phy.h.
Referenced by Configure80211_10Mhz(), Configure80211_5Mhz(), Configure80211a(), Configure80211b(), Configure80211g(), Configure80211p_CCH(), Configure80211p_SCH(), ConfigureHolland(), and GetChannelFrequencyMhz().
|
private |
Definition at line 232 of file yans-wifi-phy.h.
Referenced by GetTypeId(), and SetChannelNumber().
Definition at line 184 of file yans-wifi-phy.h.
Referenced by DoDispose(), GetDevice(), and SetDevice().
|
private |
This vector holds the set of transmission modes that this WifiPhy(-derived class) can support. In conversation we call this the DeviceRateSet (not a term you'll find in the standard), and it is a superset of standard-defined parameters such as the OperationalRateSet, and the BSSBasicRateSet (which, themselves, have a superset/subset relationship).
Mandatory rates relevant to this WifiPhy can be found by iterating over this vector looking for WifiMode objects for which WifiMode::IsMandatory() is true.
A quick note is appropriate here (well, here is as good a place as any I can find)...
In the standard there is no text that explicitly precludes production of a device that does not support some rates that are mandatory (according to the standard) for PHYs that the device happens to fully or partially support.
This approach is taken by some devices which choose to only support, for example, 6 and 9 Mbps ERP-OFDM rates for cost and power consumption reasons (i.e., these devices don't need to be designed for and waste current on the increased linearity requirement of higher-order constellations when 6 and 9 Mbps more than meet their data requirements). The wording of the standard allows such devices to have an OperationalRateSet which includes 6 and 9 Mbps ERP-OFDM rates, despite 12 and 24 Mbps being "mandatory" rates for the ERP-OFDM PHY.
Now this doesn't actually have any impact on code, yet. It is, however, something that we need to keep in mind for the future. Basically, the key point is that we can't be making assumptions like "the Operational Rate Set will contain all the mandatory rates".
Definition at line 223 of file yans-wifi-phy.h.
Referenced by Configure80211_10Mhz(), Configure80211_5Mhz(), Configure80211a(), Configure80211b(), Configure80211g(), Configure80211p_CCH(), Configure80211p_SCH(), ConfigureHolland(), DoDispose(), GetMode(), and GetNModes().
|
private |
Definition at line 174 of file yans-wifi-phy.h.
Referenced by GetEdThreshold(), GetEdThresholdW(), SetEdThreshold(), and StartReceivePacket().
|
private |
Definition at line 225 of file yans-wifi-phy.h.
Referenced by SendPacket(), SetChannelNumber(), and StartReceivePacket().
|
private |
Definition at line 231 of file yans-wifi-phy.h.
Referenced by CalculateSnr(), EndReceive(), GetErrorRateModel(), GetRxNoiseFigure(), SendPacket(), SetChannelNumber(), SetErrorRateModel(), SetRxNoiseFigure(), and StartReceivePacket().
Definition at line 185 of file yans-wifi-phy.h.
Referenced by DoDispose(), GetMobility(), and SetMobility().
|
private |
Definition at line 180 of file yans-wifi-phy.h.
Referenced by GetNTxPower(), GetPowerDbm(), GetTypeId(), and SetNTxPower().
|
private |
Provides uniform random variables.
Definition at line 227 of file yans-wifi-phy.h.
Referenced by AssignStreams(), EndReceive(), and YansWifiPhy().
|
private |
Definition at line 177 of file yans-wifi-phy.h.
Referenced by GetRxGain(), SetRxGain(), and StartReceivePacket().
|
private |
Definition at line 230 of file yans-wifi-phy.h.
Referenced by DoDispose(), EndReceive(), GetDelayUntilIdle(), GetLastRxStartTime(), GetStateDuration(), GetTypeId(), IsStateBusy(), IsStateCcaBusy(), IsStateIdle(), IsStateRx(), IsStateSwitching(), IsStateTx(), RegisterListener(), SendPacket(), SetChannelNumber(), SetReceiveErrorCallback(), SetReceiveOkCallback(), StartReceivePacket(), and YansWifiPhy().
|
private |
Definition at line 176 of file yans-wifi-phy.h.
Referenced by GetTxGain(), SendPacket(), and SetTxGain().
|
private |
Definition at line 178 of file yans-wifi-phy.h.
Referenced by GetPowerDbm(), GetTxPowerStart(), and SetTxPowerStart().
|
private |
Definition at line 179 of file yans-wifi-phy.h.
Referenced by GetPowerDbm(), GetTxPowerEnd(), and SetTxPowerEnd().