23 #include "ns3/assert.h"
24 #include "ns3/double.h"
27 #define Min(a,b) ((a < b) ? a : b)
49 .SetGroupName (
"Wifi")
51 .AddAttribute (
"BerThreshold",
52 "The maximum Bit Error Rate acceptable at any transmission mode",
55 MakeDoubleChecker<double> ())
72 for (uint32_t i = 0; i < nModes; i++)
86 if (mode == i->second)
128 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
136 double ackSnr,
WifiMode ackMode,
double dataSnr)
159 double maxThreshold = 0.0;
165 if (threshold > maxThreshold
166 && threshold < station->m_lastSnr)
168 maxThreshold = threshold;
173 if (channelWidth > 20 && channelWidth != 22)
188 double maxThreshold = 0.0;
194 if (threshold > maxThreshold
195 && threshold < station->m_lastSnr)
197 maxThreshold = threshold;
202 if (channelWidth > 20 && channelWidth != 22)
virtual void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
virtual bool IsLowLatency(void) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
double GetSnrThreshold(WifiMode mode) const
Return the minimum SNR needed to successfully transmit data with this mode at the specified BER...
virtual uint32_t GetNModes(void) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
virtual double CalculateSnr(WifiMode txMode, double ber) const =0
virtual void DoReportRtsOk(WifiRemoteStation *station, double ctsSnr, WifiMode ctsMode, double rtsSnr)
This method is a pure virtual method that must be implemented by the sub-class.
hold per-remote-station state for Ideal Wifi manager.
virtual void SetupPhy(Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
virtual void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
static TypeId GetTypeId(void)
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
Thresholds m_thresholds
List of WifiMode and the minimum SNR pair.
hold a list of per-remote-station state.
virtual void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr)
This method is a pure virtual method that must be implemented by the sub-class.
virtual WifiRemoteStation * DoCreateStation(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual WifiMode GetMode(uint32_t mode) const =0
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, uint32_t size)
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
uint8_t GetDefaultTxPowerLevel(void) const
uint32_t GetNBasicModes(void) const
Return the number of basic modes we support.
uint32_t GetLongRetryCount(const WifiRemoteStation *station) const
Return the long retry limit of the given station.
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
Ideal rate control algorithmThis class implements an 'ideal' rate control algorithm similar to RBAR i...
uint32_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
virtual ~IdealWifiManager()
virtual void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
double m_lastSnr
SNR of last packet sent to the remote station.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void AddModeSnrThreshold(WifiMode mode, double snr)
Adds a pair of WifiMode and the minimum SNR for that given mode to the list.
a unique identifier for an interface.
virtual void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
hold per-remote-station state.