#include <wifi-phy.h>
Public Types | |
enum | State { SYNC, TX, CCA_BUSY, IDLE } |
typedef Callback< void, Ptr < Packet >, double, WifiMode, enum WifiPreamble > | SyncOkCallback |
typedef Callback< void, Ptr < const Packet >, double > | SyncErrorCallback |
Public Member Functions | |
virtual uint32_t | GetNTxPower (void) const =0 |
virtual void | SetReceiveOkCallback (SyncOkCallback callback)=0 |
virtual void | SetReceiveErrorCallback (SyncErrorCallback 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 | IsStateSync (void)=0 |
virtual bool | IsStateTx (void)=0 |
virtual Time | GetStateDuration (void)=0 |
virtual Time | GetDelayUntilIdle (void)=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 |
void | NotifyTxBegin (Ptr< const Packet > packet) |
void | NotifyTxEnd (Ptr< const Packet > packet) |
void | NotifyTxDrop (Ptr< const Packet > packet) |
void | NotifyRxBegin (Ptr< const Packet > packet) |
void | NotifyRxEnd (Ptr< const Packet > packet) |
void | NotifyRxDrop (Ptr< const Packet > packet) |
void | NotifyPromiscSniffRx (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble, double signalDbm, double noiseDbm) |
void | NotifyPromiscSniffTx (Ptr< const Packet > packet, uint16_t channelFreqMhz, uint32_t rate, bool isShortPreamble) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::WifiPhy. | |
Private Attributes | |
TracedCallback< Ptr< const Packet > > | m_phyTxBeginTrace |
TracedCallback< Ptr< const Packet > > | m_phyTxEndTrace |
TracedCallback< Ptr< const Packet > > | m_phyTxDropTrace |
TracedCallback< Ptr< const Packet > > | m_phyRxBeginTrace |
TracedCallback< Ptr< const Packet > > | m_phyRxEndTrace |
TracedCallback< Ptr< const Packet > > | m_phyRxDropTrace |
TracedCallback< Ptr< const Packet >, uint16_t, uint32_t, bool, double, double > | m_phyPromiscSniffRxTrace |
TracedCallback< Ptr< const Packet >, uint16_t, uint32_t, bool > | m_phyPromiscSniffTxTrace |
typedef Callback<void,Ptr<const Packet>, double> ns3::WifiPhy::SyncErrorCallback |
arg1: packet received unsuccessfully arg2: snr of packet
typedef Callback<void,Ptr<Packet>, double, WifiMode, enum WifiPreamble> ns3::WifiPhy::SyncOkCallback |
arg1: packet received successfully arg2: snr of packet arg3: mode of packet arg4: type of preamble used for packet.
enum ns3::WifiPhy::State |
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::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::YansWifiPhy.
virtual Time ns3::WifiPhy::GetDelayUntilIdle | ( | void | ) | [pure virtual] |
Implemented in ns3::YansWifiPhy.
virtual WifiMode ns3::WifiPhy::GetMode | ( | uint32_t | mode | ) | const [pure virtual] |
mode | index in array of supported modes |
Implemented in ns3::YansWifiPhy.
virtual uint32_t ns3::WifiPhy::GetNModes | ( | void | ) | const [pure virtual] |
virtual uint32_t ns3::WifiPhy::GetNTxPower | ( | void | ) | const [pure virtual] |
virtual Time ns3::WifiPhy::GetStateDuration | ( | void | ) | [pure virtual] |
static 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:
Reimplemented from ns3::Object.
Reimplemented in ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateBusy | ( | void | ) | [pure virtual] |
Implemented in ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateCcaBusy | ( | void | ) | [pure virtual] |
Implemented in ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateIdle | ( | void | ) | [pure virtual] |
Implemented in ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateSync | ( | void | ) | [pure virtual] |
Implemented in ns3::YansWifiPhy.
virtual bool ns3::WifiPhy::IsStateTx | ( | void | ) | [pure virtual] |
Implemented in ns3::YansWifiPhy.
void ns3::WifiPhy::NotifyPromiscSniffRx | ( | Ptr< const Packet > | packet, | |
uint16_t | channelFreqMhz, | |||
uint32_t | rate, | |||
bool | isShortPreamble, | |||
double | signalDbm, | |||
double | noiseDbm | |||
) |
Public method used to fire a PromiscSniffer trace for a wifi packet being received. Implemented for encapsulation purposes.
packet | the packet being received | |
channelFreqMhz | the 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. | |
rate | the PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header) | |
isShortPreamble | true if short preamble is used, false otherwise | |
signalDbm | signal power in dBm | |
noiseDbm | noise power in dBm |
void ns3::WifiPhy::NotifyPromiscSniffTx | ( | Ptr< const Packet > | packet, | |
uint16_t | channelFreqMhz, | |||
uint32_t | rate, | |||
bool | isShortPreamble | |||
) |
Public method used to fire a PromiscSniffer trace for a wifi packet being transmitted. Implemented for encapsulation purposes.
packet | the packet being received | |
channelFreqMhz | the 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. | |
rate | the PHY data rate in units of 500kbps (i.e., the same units used both for the radiotap and for the prism header) | |
isShortPreamble | true if short preamble is used, false otherwise |
Public method used to fire a PhyRxBegin trace. Implemented for encapsulation purposes.
Public method used to fire a PhyRxDrop trace. Implemented for encapsulation purposes.
Public method used to fire a PhyRxEnd trace. Implemented for encapsulation purposes.
Public method used to fire a PhyTxBegin trace. Implemented for encapsulation purposes.
Public method used to fire a PhyTxDrop trace. Implemented for encapsulation purposes.
Public method used to fire a PhyTxEnd trace. Implemented for encapsulation purposes.
virtual void ns3::WifiPhy::RegisterListener | ( | WifiPhyListener * | listener | ) | [pure virtual] |
listener | the new listener |
Implemented in ns3::YansWifiPhy.
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::YansWifiPhy.
virtual void ns3::WifiPhy::SetReceiveErrorCallback | ( | SyncErrorCallback | callback | ) | [pure virtual] |
callback | the callback to invoke upon erronous packet reception. |
Implemented in ns3::YansWifiPhy.
virtual void ns3::WifiPhy::SetReceiveOkCallback | ( | SyncOkCallback | callback | ) | [pure virtual] |
callback | the callback to invoke upon successful packet reception. |
Implemented in ns3::YansWifiPhy.
TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool, double, double> ns3::WifiPhy::m_phyPromiscSniffRxTrace [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()
TracedCallback<Ptr<const Packet>, uint16_t, uint32_t, bool> ns3::WifiPhy::m_phyPromiscSniffTxTrace [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()
TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyRxBeginTrace [private] |
The trace source fired when a packet begins the reception process from the medium.
TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyRxDropTrace [private] |
The trace source fired when the phy layer drops a packet it has received.
TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyRxEndTrace [private] |
The trace source fired when a packet ends the reception process from the medium.
TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyTxBeginTrace [private] |
The trace source fired when a packet begins the transmission process on the medium.
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.
TracedCallback<Ptr<const Packet> > ns3::WifiPhy::m_phyTxEndTrace [private] |
The trace source fired when a packet ends the transmission process on the medium.