23 #include "ns3/uinteger.h"
25 #define Min(a,b) ((a < b) ? a : b)
52 .SetGroupName (
"Wifi")
54 .AddAttribute (
"ProbeThreshold",
55 "The number of consecutive transmissions failure to activate the RTS probe.",
58 MakeUintegerChecker<uint32_t> ())
59 .AddAttribute (
"FailureThreshold",
60 "The number of consecutive transmissions failure to decrease the rate.",
63 MakeUintegerChecker<uint32_t> ())
64 .AddAttribute (
"SuccessThreshold",
65 "The minimum number of sucessfull transmissions to try a new rate.",
68 MakeUintegerChecker<uint32_t> ())
69 .AddAttribute (
"Timeout",
70 "The 'timer' in the CARA algorithm",
73 MakeUintegerChecker<uint32_t> ())
74 .AddTraceSource (
"Rate",
75 "Traced value for rate changes (b/s)",
77 "ns3::TracedValueCallback::Uint64")
141 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
148 double ackSnr,
WifiMode ackMode,
double dataSnr)
187 if (channelWidth > 20 && channelWidth != 22)
198 return WifiTxVector (mode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (mode,
GetAddress (station)), 800, 1, 1, 0, channelWidth,
GetAggregation (station),
false);
209 if (channelWidth > 20 && channelWidth != 22)
224 rtsTxVector =
WifiTxVector (mode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (mode,
GetAddress (station)), 800, 1, 1, 0, channelWidth,
GetAggregation (station),
false);
249 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HT rates");
259 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support VHT rates");
269 NS_FATAL_ERROR (
"WifiRemoteStationManager selected does not support HE rates");
#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...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
bool GetUseNonErpProtection(void) const
Return whether the device supports protection of non-ERP stations.
WifiRemoteStation * DoCreateStation(void) const
bool IsLowLatency(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint32_t m_timerTimeout
timer threshold
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
virtual ~CaraWifiManager()
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
void SetHeSupported(bool enable)
Enable or disable HE capability support.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint32_t m_probeThreshold
probe threshold
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
uint32_t m_failureThreshold
failure threshold
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.
static TypeId GetTypeId(void)
Get the type ID.
Hold an unsigned integer type.
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
void SetHtSupported(bool enable)
Enable or disable HT capability support.
uint8_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
uint32_t m_failed
failed count
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
hold a list of per-remote-station state.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
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.
WifiMode GetSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether mode associated with the specified station at the specified index. ...
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
uint8_t GetDefaultTxPowerLevel(void) const
WifiMode GetNonErpSupported(const WifiRemoteStation *station, uint8_t i) const
Return whether non-ERP mode associated with the specified station at the specified index...
uint32_t m_success
success count
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
uint32_t m_successThreshold
success threshold
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
uint8_t GetNSupported(const WifiRemoteStation *station) const
Return the number of modes supported by the given station.
hold per-remote-station state for CARA Wifi manager.
uint32_t m_timer
timer count
implement the CARA rate control algorithmImplement the CARA algorithm from: J.
void DoReportFinalRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool DoNeedRts(WifiRemoteStation *station, Ptr< const Packet > packet, bool normally)
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
hold per-remote-station state.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)