21 #include "ns3/string.h"
24 #include "ns3/wifi-phy.h"
25 #include "ns3/wifi-tx-vector.h"
26 #include "ns3/wifi-utils.h"
28 #define Min(a,b) ((a < b) ? a : b)
39 static TypeId tid =
TypeId (
"ns3::ConstantRateWifiManager")
41 .SetGroupName (
"Wifi")
43 .AddAttribute (
"DataMode",
"The transmission mode to use for every data packet transmission",
47 .AddAttribute (
"ControlMode",
"The transmission mode to use for every RTS packet transmission.",
94 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
101 double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
103 NS_LOG_FUNCTION (
this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
127 return WifiTxVector (
m_dataMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (
m_dataMode.
GetModulationClass (),
GetShortPreambleEnabled ()),
ConvertGuardIntervalToNanoSeconds (
m_dataMode,
GetShortGuardIntervalSupported (st),
NanoSeconds (
GetGuardInterval (st))),
GetNumberOfAntennas (), nss, 0,
GetChannelWidthForTransmission (
m_dataMode,
GetPhy ()->
GetChannelWidth (),
GetChannelWidth (st)),
GetAggregation (st));
134 return WifiTxVector (
m_ctlMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (
m_ctlMode.
GetModulationClass (),
GetShortPreambleEnabled ()),
ConvertGuardIntervalToNanoSeconds (
m_ctlMode,
GetShortGuardIntervalSupported (st),
NanoSeconds (
GetGuardInterval (st))), 1, 1, 0,
GetChannelWidthForTransmission (
m_ctlMode,
GetPhy ()->
GetChannelWidth (),
GetChannelWidth (st)),
GetAggregation (st));
use constant rates for data and RTS transmissions
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
WifiMode m_ctlMode
Wifi mode for RTS frames.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
virtual ~ConstantRateWifiManager()
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
ConstantRateWifiManager()
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override
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) override
This method is a pure virtual method that must be implemented by the sub-class.
static TypeId GetTypeId(void)
Get the type ID.
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiMode m_dataMode
Wifi mode for unicast Data frames.
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiRemoteStation * DoCreateStation(void) const override
Hold variables of type string.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
represent a single transmission mode
uint8_t GetMcsValue(void) const
WifiModulationClass GetModulationClass() const
hold a list of per-remote-station state.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
uint8_t GetMaxNumberOfTransmitStreams(void) const
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
Ptr< WifiPhy > GetPhy(void) const
Return the WifiPhy.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
uint8_t GetDefaultTxPowerLevel(void) const
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
uint8_t GetNumberOfAntennas(void) const
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint16_t GetChannelWidthForTransmission(WifiMode mode, uint16_t maxAllowedChannelWidth)
Return the channel width that is allowed based on the selected mode and the given maximum channel wid...
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
hold per-remote-station state.