21 #include "ns3/string.h" 24 #include "ns3/wifi-tx-vector.h" 25 #include "ns3/wifi-utils.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 dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
102 NS_LOG_FUNCTION (
this << st << ackSnr << ackMode << dataSnr << dataChannelWidth << +dataNss);
126 return WifiTxVector (
m_dataMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (
m_dataMode.
GetModulationClass (),
GetShortPreambleEnabled ()),
ConvertGuardIntervalToNanoSeconds (
m_dataMode,
GetShortGuardIntervalSupported (st),
NanoSeconds (
GetGuardInterval (st))),
GetNumberOfAntennas (), nss, 0,
GetChannelWidthForTransmission (
m_dataMode,
GetChannelWidth (st)),
GetAggregation (st));
133 return WifiTxVector (
m_ctlMode,
GetDefaultTxPowerLevel (),
GetPreambleForTransmission (
m_ctlMode.
GetModulationClass (),
GetShortPreambleEnabled ()),
ConvertGuardIntervalToNanoSeconds (
m_ctlMode,
GetShortGuardIntervalSupported (st),
NanoSeconds (
GetGuardInterval (st))), 1, 1, 0,
GetChannelWidthForTransmission (
m_ctlMode,
GetChannelWidth (st)),
GetAggregation (st));
#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.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
uint8_t GetNumberOfAntennas(void) const
Hold variables of type string.
uint8_t GetMaxNumberOfTransmitStreams(void) const
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
use constant rates for data and RTS transmissions
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
bool GetShortPreambleEnabled(void) const
Return whether the device uses short PHY preambles.
int64x64_t Min(const int64x64_t &a, const int64x64_t &b)
Minimum.
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
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
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiMode m_ctlMode
Wifi mode for RTS frames.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ConstantRateWifiManager()
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 ...
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.
Ptr< const AttributeAccessor > MakeWifiModeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
bool GetShortGuardIntervalSupported(void) const
Return whether the device has SGI support enabled.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
WifiMode m_dataMode
Wifi mode for unicast Data frames.
WifiRemoteStation * DoCreateStation(void) const override
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
uint8_t GetDefaultTxPowerLevel(void) const
virtual ~ConstantRateWifiManager()
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetMcsValue(void) const
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
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.
hold per-remote-station state.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
uint16_t GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.