22 #include "ns3/simulator.h" 26 #define Min(a,b) ((a < b) ? a : b) 58 .SetGroupName (
"Wifi")
60 .AddAttribute (
"UpdatePeriod",
61 "The interval between decisions about rate control changes",
65 .AddAttribute (
"RaiseThreshold",
"Attempt to raise the rate if we hit that threshold",
68 MakeUintegerChecker<uint32_t> ())
69 .AddAttribute (
"AddCreditThreshold",
"Add credit threshold",
72 MakeUintegerChecker<uint32_t> ())
73 .AddTraceSource (
"Rate",
74 "Traced value for rate changes (b/s)",
76 "ns3::TracedValueCallback::Uint64")
99 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
103 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
107 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HE rates");
162 double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
164 NS_LOG_FUNCTION (
this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
231 if (enough && station->
m_tx_err == 0
329 if (channelWidth > 20 && channelWidth != 22)
339 return WifiTxVector (mode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (mode.
GetModulationClass (),
GetShortPreambleEnabled (),
UseGreenfieldForDestination (
GetAddress (st))), 800, 1, 1, 0, channelWidth,
GetAggregation (station),
false);
348 if (channelWidth > 20 && channelWidth != 22)
363 rtsTxVector =
WifiTxVector (mode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (mode.
GetModulationClass (),
GetShortPreambleEnabled (),
UseGreenfieldForDestination (
GetAddress (st))), 800, 1, 1, 0, channelWidth,
GetAggregation (station),
false);
Simulation virtual time values and global simulation resolution.
bool GetVhtSupported(void) const
Return whether the device has VHT capability support enabled.
an implementation of the rate control algorithm developed by Atsushi Onoe
#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.
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
This method is a pure virtual method that must be implemented by the sub-class.
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.
uint32_t m_tx_ok
transmit OK
uint32_t m_tx_err
transmit error
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.
void UpdateMode(OnoeWifiRemoteStation *station)
Update the mode.
bool GetHeSupported(void) const
Return whether the device has HE capability support enabled.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void DoInitialize(void)
Initialize() implementation.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_tx_retr
transmit retry
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield)
Return the preamble to be used for the transmission.
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...
uint32_t m_shortRetry
short retry
static TypeId GetTypeId(void)
Get the type ID.
void UpdateRetry(OnoeWifiRemoteStation *station)
Update the number of retry (both short and long).
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
uint32_t m_longRetry
long retry
AttributeValue implementation for Time.
Hold an unsigned integer type.
bool GetHtSupported(void) const
Return whether the device has HT capability support enabled.
uint32_t m_tx_upper
transmit upper
void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold a list of per-remote-station state.
WifiModulationClass GetModulationClass() const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
bool UseGreenfieldForDestination(Mac48Address dest) const
virtual ~OnoeWifiManager()
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
static Time Now(void)
Return the current simulation virtual time.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
Time m_nextModeUpdate
next mode update
bool m_rateBlocked
whether the rate cannot be changed
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold per-remote-station state for ONOE Wifi manager.
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time m_updatePeriod
update period
uint8_t GetDefaultTxPowerLevel(void) const
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
uint32_t m_raiseThreshold
raise threshold
WifiRemoteStation * DoCreateStation(void) const
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint8_t m_txrate
transmit rate
hold per-remote-station state.
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint32_t m_addCreditThreshold
add credit threshold
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.