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")
111 for (uint8_t i = 0; i < nModes; i++)
124 for (uint8_t i = 0; i < nModes; i++)
137 " channel width " << j <<
139 " GI " << guardInterval);
147 uint16_t guardInterval;
160 " channel width " << j <<
162 " GI " << guardInterval);
180 NS_LOG_DEBUG (
"Checking " << i->second.GetMode ().GetUniqueName () <<
181 " nss " << +i->second.GetNss () <<
182 " GI " << i->second.GetGuardInterval () <<
183 " width " << i->second.GetChannelWidth ());
185 " nss " << +txVector.
GetNss () <<
188 if (txVector.
GetMode () == i->second.GetMode ()
189 && txVector.
GetNss () == i->second.GetNss ()
203 m_thresholds.push_back (std::make_pair (snr, txVector));
239 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
243 station->m_lastSnrObserved = rtsSnr;
248 double ackSnr,
WifiMode ackMode,
double dataSnr)
254 NS_LOG_WARN (
"DataSnr reported to be zero; not saving this report.");
257 station->m_lastSnrObserved = dataSnr;
263 NS_LOG_FUNCTION (
this << st << +nSuccessfulMpdus << +nFailedMpdus << rxSnr << dataSnr);
267 NS_LOG_WARN (
"DataSnr reported to be zero; not saving this report.");
301 uint64_t bestRate = 0;
302 uint8_t selectedNss = 1;
303 uint16_t guardInterval;
311 selectedNss = station->
m_nss;
315 " nss " << +selectedNss);
354 " data rate " << dataRate <<
355 " threshold " << threshold <<
" last snr observed " <<
358 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
361 " data rate " << dataRate <<
362 " threshold " << threshold <<
363 " last snr observed " <<
397 " data rate " << dataRate <<
398 " threshold " << threshold <<
" last snr observed " <<
401 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
404 " data rate " << dataRate <<
405 " threshold " << threshold <<
406 " last snr observed " <<
436 " data rate " << dataRate <<
437 " threshold " << threshold <<
" last snr observed " <<
440 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
443 " data rate " << dataRate <<
444 " threshold " << threshold <<
445 " last snr observed " <<
463 txVector.
SetNss (selectedNss);
468 " threshold " << threshold <<
469 " last snr observed " <<
471 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
474 " data rate " << dataRate <<
475 " threshold " << threshold <<
476 " last snr observed " <<
486 station->
m_nss = selectedNss;
488 NS_LOG_DEBUG (
"Found maxMode: " << maxMode <<
" channelWidth: " << channelWidth);
502 return WifiTxVector (maxMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (maxMode,
GetAddress (station)), guardInterval,
GetNumberOfAntennas (), selectedNss, 0,
GetChannelWidthForTransmission (maxMode, channelWidth),
GetAggregation (station),
false);
513 double maxThreshold = 0.0;
527 if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
529 maxThreshold = threshold;
533 return WifiTxVector (maxMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (maxMode,
GetAddress (station)), 800,
GetNumberOfAntennas (), nss, 0,
GetChannelWidthForMode (maxMode),
GetAggregation (station),
false);
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
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
To avoid using the cache before a valid value has been cached.
WifiMode GetMcs(uint8_t mcs) const
The WifiPhy::GetMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of tr...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void DoReportFinalRtsFailed(WifiRemoteStation *station)
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.
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.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
uint16_t GetGuardInterval(void) const
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
hold per-remote-station state for Ideal Wifi manager.
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
void DoInitialize(void)
Initialize() implementation.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
uint16_t GetChannelWidth(void) const
uint8_t GetNMcs(void) const
The WifiPhy::GetNMcs() method is used (e.g., by a WifiRemoteStationManager) to determine the set of t...
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
static TypeId GetTypeId(void)
Get the type ID.
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
double m_ber
The maximum Bit Error Rate acceptable at any transmission mode.
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
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.
WifiMode GetMode(void) const
Thresholds m_thresholds
List of WifiTxVector and the minimum SNR pair.
double m_lastSnrObserved
SNR of most recently reported packet sent to the remote station.
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.
WifiModulationClass GetModulationClass() const
std::string GetUniqueName(void) const
WifiMode GetDefaultMode(void) const
Return the default transmission mode.
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.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint16_t GetChannelWidthForMode(WifiMode mode) const
Convenience function for selecting a channel width for legacy mode.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
bool HasHeSupported(void) const
Return whether the device has HE capability support enabled.
int64_t GetNanoSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
WifiRemoteStation * DoCreateStation(void) const
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
double m_lastSnrCached
SNR most recently used to select a rate.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
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)
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
bool GetHeSupported(const WifiRemoteStation *station) const
Return whether the given station is HE capable.
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
bool GetHtSupported(Mac48Address address) const
Return whether the station supports HT or not.
#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.
uint8_t m_nss
Number of spacial streams.
uint8_t GetDefaultTxPowerLevel(void) const
bool IsLowLatency(void) const
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.
virtual ~IdealWifiManager()
uint16_t GetChannelWidth(void) const
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
bool GetShortGuardInterval(Mac48Address address) const
Return whether the station supports HT/VHT short guard interval.
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...
static uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY's default ...
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
double GetSnrThreshold(WifiTxVector txVector) const
Return the minimum SNR needed to successfully transmit data with this WifiTxVector at the specified B...
uint8_t GetMcsValue(void) const
uint8_t GetMaxSupportedTxSpatialStreams(void) const
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.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
void AddSnrThreshold(WifiTxVector txVector, double snr)
Adds a pair of WifiTxVector and the minimum SNR for that given vector to the list.
uint8_t GetNss(void) const
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
Time GetGuardInterval(void) const