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 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 (),
UseGreenfieldForDestination (
GetAddress (st))),
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 (),
UseGreenfieldForDestination (
GetAddress (st))),
ConvertGuardIntervalToNanoSeconds (
m_ctlMode,
GetShortGuardIntervalSupported (st),
NanoSeconds (
GetGuardInterval (st))), 1, 1, 0,
GetChannelWidthForTransmission (
m_ctlMode,
GetChannelWidth (st)),
GetAggregation (st));
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.
uint8_t GetNumberOfAntennas(void) const
Hold variables of type string.
uint8_t GetMaxNumberOfTransmitStreams(void) const
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
use constant rates for data and RTS transmissions
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble, bool useGreenfield)
Return the preamble to be used for the transmission.
Ptr< const AttributeChecker > MakeWifiModeChecker(void)
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.
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 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.
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.
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
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
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 ...
bool UseGreenfieldForDestination(Mac48Address dest) const
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 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.
uint16_t GetGuardInterval(void) const
Return the supported HE guard interval duration (in nanoseconds).
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
uint8_t GetDefaultTxPowerLevel(void) const
virtual ~ConstantRateWifiManager()
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetMcsValue(void) const
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.