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.");
297 uint64_t bestRate = 0;
298 uint8_t selectedNss = 1;
299 uint16_t guardInterval;
307 selectedNss = station->
m_nss;
311 " nss " << +selectedNss);
350 " data rate " << dataRate <<
351 " threshold " << threshold <<
" last snr observed " <<
354 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
357 " data rate " << dataRate <<
358 " threshold " << threshold <<
359 " last snr observed " <<
393 " data rate " << dataRate <<
394 " threshold " << threshold <<
" last snr observed " <<
397 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
400 " data rate " << dataRate <<
401 " threshold " << threshold <<
402 " last snr observed " <<
432 " data rate " << dataRate <<
433 " threshold " << threshold <<
" last snr observed " <<
436 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
439 " data rate " << dataRate <<
440 " threshold " << threshold <<
441 " last snr observed " <<
459 txVector.
SetNss (selectedNss);
464 " threshold " << threshold <<
465 " last snr observed " <<
467 if (dataRate > bestRate && threshold < station->m_lastSnrObserved)
470 " data rate " << dataRate <<
471 " threshold " << threshold <<
472 " last snr observed " <<
482 station->
m_nss = selectedNss;
484 NS_LOG_DEBUG (
"Found maxMode: " << maxMode <<
" channelWidth: " << +channelWidth);
498 return WifiTxVector (maxMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (maxMode,
GetAddress (station)), guardInterval,
GetNumberOfAntennas (), selectedNss, 0,
GetChannelWidthForTransmission (maxMode, channelWidth),
GetAggregation (station),
false);
509 double maxThreshold = 0.0;
523 if (threshold > maxThreshold && threshold < station->m_lastSnrObserved)
525 maxThreshold = threshold;
529 return WifiTxVector (maxMode,
GetDefaultTxPowerLevel (),
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.
bool GetVhtSupported(Mac48Address address) const
Return whether the station supports VHT or not.
uint16_t GetGuardInterval(void) const
bool GetShortGuardInterval(Mac48Address address) const
Return whether the station supports HT/VHT short guard interval.
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
To avoid using the cache before a valid value has been cached.
#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...
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.
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.
bool IsValid(void) const
The standard disallows certain combinations of WifiMode, number of spatial streams, and channel widths.
uint8_t GetNBasicModes(void) const
Return the number of basic modes we support.
static uint8_t GetChannelWidthForTransmission(WifiMode mode, uint8_t maxSupportedChannelWidth)
Return the channel width that corresponds to the selected mode (instead of letting the PHY's default ...
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
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
WifiMode GetMode(uint8_t mode) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
uint8_t GetMcsValue(void) const
std::string GetUniqueName(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.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the 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.
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.
bool HasVhtSupported(void) const
Return whether the device has VHT capability support enabled.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
double m_lastSnrCached
SNR most recently used to select a rate.
uint8_t GetMaxSupportedTxSpatialStreams(void) const
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
bool HasHtSupported(void) const
Return whether the device has HT capability support enabled.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
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
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.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint8_t m_nss
Number of spacial streams.
Ideal rate control algorithmThis class implements an 'ideal' rate control algorithm similar to RBAR i...
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
WifiMode m_lastMode
Mode most recently used to the remote station.
void SetChannelWidth(uint8_t channelWidth)
Sets the selected channelWidth (in MHz)
virtual ~IdealWifiManager()
bool GetHtSupported(Mac48Address address) const
Return whether the station supports HT or not.
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'...
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
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.
uint8_t GetNModes(void) const
The WifiPhy::GetNModes() and WifiPhy::GetMode() methods are used (e.g., by a WifiRemoteStationManager...
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.