26 #include "ns3/callback.h"
27 #include "ns3/packet.h"
28 #include "ns3/object.h"
29 #include "ns3/nstime.h"
34 #include "ns3/traced-callback.h"
428 virtual uint32_t
GetNModes (
void)
const = 0;
513 virtual uint8_t
GetNMcs (
void)
const = 0;
1099 uint16_t channelNumber, uint32_t rate,
WifiPreamble preamble,
1126 uint16_t channelNumber, uint32_t rate,
WifiPreamble preamble,
1145 uint16_t channelNumber, uint32_t rate,
WifiPreamble preamble,
1146 WifiTxVector txVector,
struct mpduInfo aMpdu);
1165 uint16_t channelNumber, uint32_t rate,
WifiPreamble preamble,
1166 WifiTxVector txVector,
struct mpduInfo aMpdu);
1213 virtual void SetLdpc (
bool ldpc) = 0;
1217 virtual bool GetLdpc (
void)
const = 0;
1221 virtual void SetStbc (
bool stbc) = 0;
1225 virtual bool GetStbc (
void)
const = 0;
static WifiMode GetVhtMcs6()
Return MCS 6 from VHT MCS values.
static WifiMode GetOfdmRate9MbpsBW5MHz()
Return a WifiMode for OFDM at 9Mbps with 5MHz channel spacing.
TracedCallback< Ptr< const Packet > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
static WifiMode GetErpOfdmRate24Mbps()
Return a WifiMode for ERP-OFDM at 24Mbps.
static WifiMode GetDsssRate11Mbps()
Return a WifiMode for DSSS at 11Mbps.
virtual uint32_t GetFrequency(void) const =0
virtual uint32_t GetNumberOfTransmitAntennas(void) const =0
virtual Ptr< WifiChannel > GetChannel(void) const =0
Return the WifiChannel this WifiPhy is connected to.
Simulation virtual time values and global simulation resolution.
Callback< void, Ptr< const Packet >, double, bool > RxErrorCallback
arg1: packet received unsuccessfully arg2: snr of packet arg3: PHY-RXEND flag
void(* MonitorSnifferTxCallback)(const Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
TracedCallback signature for monitor mode transmit events.
static WifiMode GetErpOfdmRate36Mbps()
Return a WifiMode for ERP-OFDM at 36Mbps.
void NotifyMonitorSniffTx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu)
Public method used to fire a MonitorSniffer trace for a wifi packet being transmitted.
static WifiMode GetVhtMcs8()
Return MCS 8 from VHT MCS values.
virtual void ConfigureStandard(enum WifiPhyStandard standard)=0
Configure the PHY-level parameters for different Wi-Fi standard.
static WifiMode GetOfdmRate9Mbps()
Return a WifiMode for OFDM at 9Mbps.
static WifiMode GetOfdmRate18MbpsBW10MHz()
Return a WifiMode for OFDM at 18Mbps with 10MHz channel spacing.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static WifiMode GetOfdmRate27MbpsBW10MHz()
Return a WifiMode for OFDM at 27Mbps with 10MHz channel spacing.
virtual void NotifyTxStart(Time duration, double txPowerDbm)=0
static WifiMode GetOfdmRate3MbpsBW5MHz()
Return a WifiMode for OFDM at 3Mbps with 5MHz channel spacing.
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
virtual void NotifyWakeup(void)=0
Notify listeners that we woke up.
static WifiMode GetDsssRate1Mbps()
Return a WifiMode for DSSS at 1Mbps.
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
static WifiMode GetErpOfdmRate18Mbps()
Return a WifiMode for ERP-OFDM at 18Mbps.
The PHY layer has sense the medium busy through the CCA mechanism.
static WifiMode GetHtMcs7()
Return MCS 7 from HT MCS values.
static WifiMode GetHtPlcpHeaderMode(WifiMode payloadMode)
Forward calls to a chain of Callback.
static Time GetPlcpHtSigHeaderDuration(WifiPreamble preamble)
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
static WifiMode GetHtMcs22()
Return MCS 22 from HT MCS values.
static WifiMode GetHtMcs14()
Return MCS 14 from HT MCS values.
uint32_t m_totalAmpduNumSymbols
Number of symbols previously transmitted for the MPDUs in an A-MPDU, used for the computation of the ...
static WifiMode GetOfdmRate12Mbps()
Return a WifiMode for OFDM at 12Mbps.
TracedCallback< Ptr< const Packet > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
virtual uint8_t GetNMcs(void) const =0
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
static WifiMode GetHtMcs31()
Return MCS 31 from HT MCS values.
static WifiMode GetHtMcs21()
Return MCS 21 from HT MCS values.
static WifiMode GetHtMcs30()
Return MCS 30 from HT MCS values.
virtual double CalculateSnr(WifiMode txMode, double ber) const =0
static WifiMode GetHtMcs10()
Return MCS 10 from HT MCS values.
static WifiMode GetHtMcs26()
Return MCS 26 from HT MCS values.
static WifiMode GetOfdmRate1_5MbpsBW5MHz()
Return a WifiMode for OFDM at 1.5Mbps with 5MHz channel spacing.
Callback< void, Ptr< Packet >, double, WifiTxVector, enum WifiPreamble > RxOkCallback
arg1: packet received successfully arg2: snr of packet arg3: TXVECTOR of packet arg4: type of preambl...
The PHY layer is sleeping.
static WifiMode GetHtMcs17()
Return MCS 17 from HT MCS values.
static WifiMode GetHtMcs24()
Return MCS 24 from HT MCS values.
static WifiMode GetOfdmRate4_5MbpsBW10MHz()
Return a WifiMode for OFDM at 4.5Mbps with 10MHz channel spacing.
static WifiMode GetOfdmRate54Mbps()
Return a WifiMode for OFDM at 54Mbps.
virtual void SetLdpc(bool ldpc)=0
virtual void SetNumberOfReceiveAntennas(uint32_t rx)=0
virtual bool GetLdpc(void) const =0
void NotifyTxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyTxDrop trace.
static WifiMode GetHtMcs8()
Return MCS 8 from HT MCS values.
static WifiMode GetHtMcs18()
Return MCS 18 from HT MCS values.
void NotifyTxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyTxBegin trace.
Time CalculateTxDuration(uint32_t size, WifiTxVector txVector, enum WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag)
static WifiMode GetVhtMcs4()
Return MCS 4 from VHT MCS values.
static WifiMode GetHtMcs27()
Return MCS 27 from HT MCS values.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
static WifiMode GetOfdmRate36Mbps()
Return a WifiMode for OFDM at 36Mbps.
static WifiMode GetVhtMcs7()
Return MCS 7 from VHT MCS values.
static WifiMode GetOfdmRate6MbpsBW5MHz()
Return a WifiMode for OFDM at 6Mbps with 5MHz channel spacing.
virtual bool IsStateCcaBusy(void)=0
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
virtual void RegisterListener(WifiPhyListener *listener)=0
void NotifyMonitorSniffRx(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
Public method used to fire a MonitorSniffer trace for a wifi packet being received.
virtual void NotifySwitchingStart(Time duration)=0
virtual WifiMode GetMcs(uint8_t mcs) const =0
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
virtual void ResumeFromSleep(void)=0
Resume from sleep mode.
static WifiMode GetVhtPlcpHeaderMode(WifiMode payloadMode)
virtual bool IsStateIdle(void)=0
static WifiMode GetHtMcs16()
Return MCS 16 from HT MCS values.
static WifiMode GetErpOfdmRate54Mbps()
Return a WifiMode for ERP-OFDM at 54Mbps.
static WifiMode GetHtMcs29()
Return MCS 29 from HT MCS values.
static WifiMode GetHtMcs11()
Return MCS 11 from HT MCS values.
void NotifyRxDrop(Ptr< const Packet > packet)
Public method used to fire a PhyRxDrop trace.
virtual bool IsStateSleep(void)=0
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
virtual uint32_t GetChannelWidth(void) const =0
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
virtual bool GetStbc(void) const =0
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo, struct signalNoiseDbm > m_phyMonitorSniffRxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being received...
virtual void NotifyRxEndOk(void)=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
The MPDU is not part of an A-MPDU.
static WifiMode GetHtMcs2()
Return MCS 2 from HT MCS values.
virtual void SetFrequency(uint32_t freq)=0
virtual void SetReceiveErrorCallback(RxErrorCallback callback)=0
Time CalculatePlcpPreambleAndHeaderDuration(WifiTxVector txVector, enum WifiPreamble preamble)
receive notifications about phy events.
TracedCallback< Ptr< const Packet > > m_phyTxDropTrace
The trace source fired when the phy layer drops a packet as it tries to transmit it.
static WifiMode GetPlcpHeaderMode(WifiMode payloadMode, WifiPreamble preamble, WifiTxVector txVector)
virtual void SetGuardInterval(bool guardInterval)=0
static WifiMode GetHtMcs12()
Return MCS 12 from HT MCS values.
static WifiMode GetErpOfdmRate48Mbps()
Return a WifiMode for ERP-OFDM at 48Mbps.
virtual Time GetDelayUntilIdle(void)=0
static WifiMode GetOfdmRate12MbpsBW10MHz()
Return a WifiMode for OFDM at 12Mbps with 10MHz channel spacing.
The PHY layer is receiving a packet.
TracedCallback< Ptr< const Packet > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
virtual bool IsModeSupported(WifiMode mode) const =0
Check if the given WifiMode is supported by the PHY.
virtual bool GetGuardInterval(void) const =0
virtual ~WifiPhyListener()
virtual void SetNumberOfTransmitAntennas(uint32_t tx)=0
void NotifyRxBegin(Ptr< const Packet > packet)
Public method used to fire a PhyRxBegin trace.
The PHY layer is sending a packet.
static WifiMode GetOfdmRate18Mbps()
Return a WifiMode for OFDM at 18Mbps.
static WifiMode GetOfdmRate9MbpsBW10MHz()
Return a WifiMode for OFDM at 9Mbps with 10MHz channel spacing.
static WifiMode GetOfdmRate12MbpsBW5MHz()
Return a WifiMode for OFDM at 12Mbps with 5MHz channel spacing.
virtual uint32_t GetNBssMembershipSelectors(void) const =0
The WifiPhy::NBssMembershipSelectors() method is used (e.g., by a WifiRemoteStationManager) to determ...
The PHY layer is switching to other channel.
TracedCallback< Ptr< const Packet > > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
virtual bool IsStateSwitching(void)=0
The MPDU is part of an A-MPDU, but is not the last aggregate.
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
virtual bool IsStateBusy(void)=0
static WifiMode GetOfdmRate48Mbps()
Return a WifiMode for OFDM at 48Mbps.
virtual void NotifySleep(void)=0
Notify listeners that we went to sleep.
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
virtual Time GetChannelSwitchDelay(void) const =0
static TypeId GetTypeId(void)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void UnregisterListener(WifiPhyListener *listener)=0
TracedCallback< Ptr< const Packet >, uint16_t, uint16_t, uint32_t, WifiPreamble, WifiTxVector, struct mpduInfo > m_phyMonitorSniffTxTrace
A trace source that emulates a wifi device in monitor mode sniffing a packet being transmitted...
static WifiMode GetOfdmRate24Mbps()
Return a WifiMode for OFDM at 24Mbps.
virtual uint32_t GetBssMembershipSelector(uint32_t selector) const =0
The WifiPhy::BssMembershipSelector() method is used (e.g., by a WifiRemoteStationManager) to determin...
virtual bool IsStateRx(void)=0
virtual void SetGreenfield(bool greenfield)=0
virtual Time GetStateDuration(void)=0
static WifiMode GetHtMcs13()
Return MCS 13 from HT MCS values.
virtual uint16_t GetChannelNumber(void) const =0
Return current channel number.
static WifiMode GetHtMcs20()
Return MCS 20 from HT MCS values.
static WifiMode GetHtMcs5()
Return MCS 5 from HT MCS values.
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
static WifiMode GetVhtMcs2()
Return MCS 2 from VHT MCS values.
static WifiMode GetDsssRate5_5Mbps()
Return a WifiMode for DSSS at 5.5Mbps.
virtual void SetStbc(bool stbc)=0
static WifiMode GetOfdmRate2_25MbpsBW5MHz()
Return a WifiMode for OFDM at 2.25Mbps with 5MHz channel spacing.
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes...
static Time GetPlcpVhtSigA1Duration(WifiPreamble preamble)
static WifiMode GetErpOfdmRate9Mbps()
Return a WifiMode for ERP-OFDM at 9Mbps.
virtual void SetShortPlcpPreamble(bool shortPreamble)=0
void NotifyTxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyTxEnd trace.
virtual void SetChannelNumber(uint16_t id)=0
Set channel number.
virtual bool IsStateTx(void)=0
virtual void NotifyRxStart(Time duration)=0
virtual void NotifyRxEndError(void)=0
We have received the last bit of a packet for which NotifyRxStart was invoked first and...
virtual double GetTxPowerEnd(void) const =0
Return the maximum available transmission power level (dBm).
Time GetPayloadDuration(uint32_t size, WifiTxVector txVector, WifiPreamble preamble, double frequency, enum mpduType mpdutype, uint8_t incFlag)
virtual bool GetShortPlcpPreamble(void) const =0
static WifiMode GetErpOfdmRate6Mbps()
Return a WifiMode for ERP-OFDM at 6Mbps.
virtual double GetTxPowerStart(void) const =0
Return the minimum available transmission power level (dBm).
static WifiMode GetErpOfdmRate12Mbps()
Return a WifiMode for ERP-OFDM at 12Mbps.
void NotifyRxEnd(Ptr< const Packet > packet)
Public method used to fire a PhyRxEnd trace.
static WifiMode GetHtMcs19()
Return MCS 19 from HT MCS values.
static WifiMode GetHtMcs6()
Return MCS 6 from HT MCS values.
virtual uint32_t GetNTxPower(void) const =0
void(* MonitorSnifferRxCallback)(Ptr< const Packet > packet, uint16_t channelFreqMhz, uint16_t channelNumber, uint32_t rate, WifiPreamble preamble, WifiTxVector txVector, struct mpduInfo aMpdu, struct signalNoiseDbm signalNoise)
TracedCallback signature for monitor mode receive events.
static WifiMode GetHtMcs28()
Return MCS 28 from HT MCS values.
static WifiMode GetHtMcs9()
Return MCS 9 from HT MCS values.
virtual void SetSleepMode(void)=0
Put in sleep mode.
virtual void SetReceiveOkCallback(RxOkCallback callback)=0
static Time GetPlcpHeaderDuration(WifiTxVector txVector, WifiPreamble preamble)
static WifiMode GetHtMcs4()
Return MCS 4 from HT MCS values.
static WifiMode GetHtMcs25()
Return MCS 25 from HT MCS values.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...
uint32_t m_totalAmpduSize
Total size of the previously transmitted MPDUs in an A-MPDU, used for the computation of the number o...
static WifiMode GetHtMcs1()
Return MCS 1 from HT MCS values.
static WifiMode GetHtMcs23()
Return MCS 23 from HT MCS values.
virtual void SendPacket(Ptr< const Packet > packet, WifiTxVector txVector, enum WifiPreamble preamble, enum mpduType mpdutype)=0
A base class which provides memory management and object aggregation.
static WifiMode GetDsssRate2Mbps()
Return a WifiMode for DSSS at 2Mbps.
static WifiMode GetVhtMcs9()
Return MCS 9 from VHT MCS values.
static WifiMode GetOfdmRate6MbpsBW10MHz()
Return a WifiMode for OFDM at 6Mbps with 10MHz channel spacing.
virtual void SetChannelWidth(uint32_t channelwidth)=0
State
The state of the PHY layer.
static Time GetPlcpHtTrainingSymbolDuration(WifiPreamble preamble, WifiTxVector txVector)
static WifiMode GetOfdmRate24MbpsBW10MHz()
Return a WifiMode for OFDM at 24Mbps with 10MHz channel spacing.
static Time GetPlcpVhtSigBDuration(WifiPreamble preamble)
virtual WifiModeList GetMembershipSelectorModes(uint32_t selector)=0
The WifiPhy::GetMembershipSelectorModes() method is used (e.g., by a WifiRemoteStationManager) to det...
static WifiMode GetOfdmRate13_5MbpsBW5MHz()
Return a WifiMode for OFDM at 13.5Mbps with 5MHz channel spacing.
virtual Time GetLastRxStartTime(void) const =0
Return the start time of the last received packet.
a unique identifier for an interface.
static WifiMode GetHtMcs15()
Return MCS 15 from HT MCS values.
static Time GetPlcpPreambleDuration(WifiTxVector txVector, WifiPreamble preamble)
static WifiMode GetHtMcs3()
Return MCS 3 from HT MCS values.
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6Mbps.
virtual bool GetGreenfield(void) const =0
static Time GetPlcpVhtSigA2Duration(WifiPreamble preamble)
virtual uint32_t GetNumberOfReceiveAntennas(void) const =0
static WifiMode GetOfdmRate4_5MbpsBW5MHz()
Return a WifiMode for OFDM at 4.5Mbps with 5MHz channel spacing.
mpduType
This enumeration defines the type of an MPDU.
static WifiMode GetOfdmRate3MbpsBW10MHz()
Return a WifiMode for OFDM at 3Mbps with 10MHz channel spacing.
TracedCallback< Ptr< const Packet > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
virtual void NotifyMaybeCcaBusyStart(Time duration)=0
The MPDU is the last aggregate in an A-MPDU.