21 #include "ns3/string.h" 27 #define Min(a,b) ((a < b) ? a : b) 38 static TypeId tid =
TypeId (
"ns3::ConstantRateWifiManager")
40 .SetGroupName (
"Wifi")
42 .AddAttribute (
"DataMode",
"The transmission mode to use for every data packet transmission",
46 .AddAttribute (
"ControlMode",
"The transmission mode to use for every RTS packet transmission.",
93 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
100 double ackSnr,
WifiMode ackMode,
double dataSnr)
121 return WifiTxVector (
m_dataMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (
m_dataMode,
GetAddress (st)),
ConvertGuardIntervalToNanoSeconds (
m_dataMode,
GetShortGuardInterval (st),
NanoSeconds (
GetGuardInterval (st))),
GetNumberOfAntennas (),
Min (
GetMaxNumberOfTransmitStreams (),
GetNumberOfSupportedStreams (st)), 0,
GetChannelWidthForTransmission (
m_dataMode,
GetChannelWidth (st)),
GetAggregation (st),
false);
128 return WifiTxVector (
m_ctlMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (
m_ctlMode,
GetAddress (st)),
ConvertGuardIntervalToNanoSeconds (
m_ctlMode,
GetShortGuardInterval (st),
NanoSeconds (
GetGuardInterval (st))), 1, 1, 0,
GetChannelWidthForTransmission (
m_ctlMode,
GetChannelWidth (st)),
GetAggregation (st),
false);
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
#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.
Hold variables of type string.
uint8_t GetMaxNumberOfTransmitStreams(void)
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, bool htShortGuardInterval, Time heGuardInterval)
Convert the guard interval to nanoseconds based on the wifimode.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint16_t GetGuardInterval(const WifiRemoteStation *station) const
Return the HE guard interval duration supported by the station.
use constant rates for data and RTS transmissions
WifiRemoteStation * DoCreateStation(void) const
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
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.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
uint8_t GetNumberOfAntennas(void)
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
WifiPreamble GetPreambleForTransmission(WifiMode mode, Mac48Address dest)
Return the preamble to be used for the transmission.
bool IsLowLatency(void) const
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.
WifiMode m_ctlMode
Wifi mode for RTS frames.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ConstantRateWifiManager()
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.
Mac48Address GetAddress(const WifiRemoteStation *station) const
Return the address of the station.
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
WifiMode m_dataMode
Wifi mode for unicast DATA frames.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
uint8_t GetDefaultTxPowerLevel(void) const
virtual ~ConstantRateWifiManager()
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
void DoReportFinalDataFailed(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.
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 ...
static TypeId GetTypeId(void)
Get the type ID.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
hold per-remote-station state.
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.