53 .SetGroupName (
"Wifi")
55 .AddAttribute (
"BerThreshold",
56 "The maximum Bit Error Rate acceptable at any transmission mode",
59 MakeDoubleChecker<double> ())
60 .AddTraceSource (
"Rate",
61 "Traced value for rate changes (b/s)",
63 "ns3::TracedValueCallback::Uint64")
109 for (uint32_t i = 0; i < nModes; i++)
122 for (uint32_t i = 0; i < nModes; i++)
135 " channel width " << (uint16_t) j <<
136 " nss " << (uint16_t) nss <<
137 " GI " << guardInterval);
145 uint16_t guardInterval;
157 " channel width " << (uint16_t) j <<
158 " nss " << (uint16_t) i <<
159 " GI " << guardInterval);
177 NS_LOG_DEBUG (
"Checking " << i->second.GetMode ().GetUniqueName () <<
178 " nss " << (uint16_t) i->second.GetNss () <<
179 " GI " << i->second.GetGuardInterval () <<
180 " width " << (uint16_t) i->second.GetChannelWidth ());
182 " nss " << (uint16_t) txVector.
GetNss () <<
185 if (txVector.
GetMode () == i->second.GetMode ()
186 && txVector.
GetNss () == i->second.GetNss ()
200 m_thresholds.push_back (std::make_pair (snr, txVector));
234 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
238 station->m_lastSnrObserved = rtsSnr;
243 double ackSnr,
WifiMode ackMode,
double dataSnr)
249 NS_LOG_WARN (
"DataSnr reported to be zero; not saving this report.");
252 station->m_lastSnrObserved = dataSnr;
258 NS_LOG_FUNCTION (
this << st << (uint16_t)nSuccessfulMpdus << (uint16_t)nFailedMpdus << rxSnr << dataSnr);
262 NS_LOG_WARN (
"DataSnr reported to be zero; not saving this report.");
290 uint64_t bestRate = 0;
291 uint8_t selectedNss = 1;
292 uint16_t guardInterval;
300 selectedNss = station->
m_nss;
304 " nss " << (uint16_t) selectedNss);
336 " nss " << (uint16_t) nss <<
" width " <<
343 " data rate " << dataRate <<
344 " threshold " << threshold <<
" last snr observed " <<
347 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
350 " data rate " << dataRate <<
351 " threshold " << threshold <<
352 " last snr observed " <<
379 " nss " << (uint16_t) nss <<
" width " <<
386 " data rate " << dataRate <<
387 " threshold " << threshold <<
" last snr observed " <<
390 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
393 " data rate " << dataRate <<
394 " threshold " << threshold <<
395 " last snr observed " <<
418 " nss " << (uint16_t) nss <<
" width " <<
425 " data rate " << dataRate <<
426 " threshold " << threshold <<
" last snr observed " <<
429 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
432 " data rate " << dataRate <<
433 " threshold " << threshold <<
434 " last snr observed " <<
452 txVector.
SetNss (selectedNss);
457 " threshold " << threshold <<
458 " last snr observed " <<
460 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
463 " data rate " << dataRate <<
464 " threshold " << threshold <<
465 " last snr observed " <<
475 station->
m_nss = selectedNss;
477 NS_LOG_DEBUG (
"Found maxMode: " << maxMode <<
" channelWidth: " << (uint16_t) channelWidth);
491 return WifiTxVector (maxMode,
GetDefaultTxPowerLevel (),
GetLongRetryCount (station),
GetPreambleForTransmission (maxMode,
GetAddress (station)), guardInterval,
GetNumberOfAntennas (), selectedNss, 0, channelWidth,
GetAggregation (station),
false);
502 double maxThreshold = 0.0;
516 if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
518 maxThreshold = threshold;
522 return WifiTxVector (maxMode,
GetDefaultTxPowerLevel (),
GetShortRetryCount (station),
GetPreambleForTransmission (maxMode,
GetAddress (station)), 800,
GetNumberOfAntennas (), nss, 0,
GetChannelWidthForMode (maxMode),
GetAggregation (station),
false);
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.
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
uint16_t GetGuardInterval(void) const
bool IsLowLatency(void) const
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
static const double CACHE_INITIAL_VALUE
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint8_t GetChannelWidthForMode(WifiMode mode) const
Convenience function for selecting a channel width for legacy mode.
uint8_t GetMaxNumberOfTransmitStreams(void)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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.
bool GetShortGuardInterval(void) const
Return whether short guard interval is supported.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint32_t i) const
Return the WifiMode supported by the specified station at the specified index.
hold per-remote-station state for Ideal Wifi manager.
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.
void DoInitialize(void)
Initialize() implementation.
WifiMode GetSupported(const WifiRemoteStation *station, uint32_t i) const
Return whether mode associated with the specified station at the specified index. ...
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
uint8_t GetChannelWidth(void) const
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
double GetSnrThreshold(WifiTxVector txVector) const
Return the minimum SNR needed to successfully transmit data with this WifiTxVector at the specified B...
static TypeId GetTypeId(void)
Get the type ID.
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
void DoReportAmpduTxStatus(WifiRemoteStation *station, uint8_t nSuccessfulMpdus, uint8_t nFailedMpdus, double rxSnr, double dataSnr)
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
uint8_t GetNumberOfAntennas(void)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
uint64_t GetDataRate(uint8_t channelWidth, uint16_t guardInterval, uint8_t nss) const
WifiMode GetBasicMode(uint32_t i) const
Return a basic mode from the set of basic modes.
uint8_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
bool GetHeSupported(const WifiRemoteStation *station) const
Return whether the given station is HE capable.
Time GetGuardInterval(void) const
uint8_t GetMcsValue(void) const
std::string GetUniqueName(void) const
Thresholds m_thresholds
List of WifiTxVector and the minimum SNR pair.
double m_nss
SNR most recently used to select a rate.
double m_lastSnrObserved
SNR of most recently reported packet sent to the remote station.
uint8_t GetNumberOfSupportedStreams(const WifiRemoteStation *station) const
Return the number of supported streams the station has.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
uint32_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
virtual void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
hold a list of per-remote-station state.
void SetNss(uint8_t nss)
Sets the number of Nss refer to IEEE 802.11n Table 20-28 for explanation and range.
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.
WifiRemoteStation * DoCreateStation(void) const
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
TracedValue< uint64_t > m_currentRate
Trace rate changes.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static bool IsValidTxVector(WifiTxVector txVector)
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
bool GetShortGuardInterval(const WifiRemoteStation *station) const
Return whether the given station supports HT/VHT short guard interval.
double m_lastSnrCached
SNR most recently used to select a rate.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
uint8_t GetChannelWidth(void) const
uint8_t GetDefaultTxPowerLevel(void) const
bool HasHeSupported(void) const
Return whether the device has HE capability support enabled.
uint8_t GetNss(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.
uint32_t GetNMcsSupported(const WifiRemoteStation *station) const
Return the number of MCS supported by the given station.
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ideal rate control algorithmThis class implements an 'ideal' rate control algorithm similar to RBAR i...
WifiMode m_lastMode
Mode most recently used to the remote station.
void SetChannelWidth(uint8_t channelWidth)
Sets the selected channelWidth (in MHz)
uint32_t GetShortRetryCount(const WifiRemoteStation *station) const
Return the short retry limit of the given station.
virtual ~IdealWifiManager()
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
WifiModulationClass GetModulationClass() const
void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
WifiMode GetMode(void) const
This class can be used to hold variables of floating point type such as 'double' or 'float'...
a unique identifier for an interface.
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.
bool GetHtSupported(const WifiRemoteStation *station) const
Return whether the given station is HT capable.
void AddSnrThreshold(WifiTxVector txVector, double snr)
Adds a pair of WifiTxVector and the minimum SNR for that given vector to the list.
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
WifiMode GetMode(uint32_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...