|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
26 #ifndef MINSTREL_HT_WIFI_MANAGER_H
27 #define MINSTREL_HT_WIFI_MANAGER_H
29 #include "ns3/wifi-remote-station-manager.h"
31 #include "ns3/wifi-mpdu-type.h"
38 typedef std::map<WifiMode, Time>
TxTime;
69 return (os <<
"INVALID");
250 double rxSnr,
WifiMode txMode)
override;
254 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
override;
256 double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
override;
262 double rxSnr,
double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
override;
454 double CalculateEwmsd (
double oldEwmsd,
double currentProb,
double ewmaProb,
double weight);
535 uint16_t
GetIndex (uint8_t groupId, uint8_t rateId);
545 uint8_t
GetHtGroupId (uint8_t txstreams, uint16_t gi, uint16_t chWidth);
555 uint8_t
GetVhtGroupId (uint8_t txstreams, uint16_t gi, uint16_t chWidth);
565 uint8_t
GetHeGroupId (uint8_t txstreams, uint16_t gi, uint16_t chWidth);
a unique identifier for an interface.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint32_t CountRetries(MinstrelHtWifiRemoteStation *station)
Count retries.
static const uint8_t MAX_HT_STREAM_GROUPS
Maximal number of groups per stream in HT (2 possible channel widths and 2 possible GI configurations...
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes.
uint16_t gi
guard interval duration (nanoseconds)
uint16_t m_maxTpRate
The max throughput rate of this group in bps.
TxTime ratesTxTimeTable
rates transmit time table
Data structure to contain the information that defines a group.
double prob
Current probability within last time interval.
WifiModeList GetVhtDeviceMcsList(void) const
Returns a list of only the VHT MCS supported by the device.
uint16_t FindRate(MinstrelHtWifiRemoteStation *station)
Find a rate to use from Minstrel Table.
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.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint8_t MAX_VHT_WIDTH
Maximal channel width in MHz.
uint8_t GetVhtGroupId(uint8_t txstreams, uint16_t gi, uint16_t chWidth)
Returns the groupId of a VHT MCS with the given number of streams, GI and channel width used.
static const uint8_t MAX_HE_STREAM_GROUPS
Maximal number of groups per stream in HE (4 possible channel widths and 3 possible GI configurations...
void PrintTable(MinstrelHtWifiRemoteStation *station)
Printing Minstrel Table.
uint8_t m_index
Sample table index.
uint16_t chWidth
channel width (MHz)
double throughput
Throughput of this rate (in packets per second).
uint8_t m_lookAroundRate
The % to try other rates than our current rate.
uint32_t prevNumRateAttempt
Number of transmission attempts with previous rate.
uint8_t m_nSampleCol
Number of sample columns.
hold a list of per-remote-station state.
uint16_t m_maxProbRate
The highest success probability rate of this group in bps.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
static const uint8_t MAX_HT_SUPPORTED_STREAMS
Constants for maximum values.
uint8_t m_col
MCS rates are divided into groups based on the number of streams and flags that they use.
void PrintSampleTable(MinstrelHtWifiRemoteStation *station)
Printing Sample Table.
bool IsValidMcs(Ptr< WifiPhy > phy, uint8_t streams, uint16_t chWidth, WifiMode mode)
Check the validity of a combination of number of streams, chWidth and mode.
static const uint8_t MAX_HE_GROUP_RATES
Number of rates (or MCS) per HE group.
uint32_t numRateSuccess
Number of successful frames transmitted so far.
uint16_t GetIndex(uint8_t groupId, uint8_t rateId)
Returns the global index corresponding to the groupId and rateId.
std::map< WifiMode, Time > TxTime
Data structure to save transmission time calculations per rate.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
uint32_t retryCount
Retry limit.
static const uint8_t MAX_HE_SUPPORTED_STREAMS
Maximal number of streams supported by the HE PHY layer.
static const uint8_t MAX_VHT_GROUP_RATES
Number of rates (or MCS) per VHT group.
void SetupMac(const Ptr< WifiMac > mac) override
Set up MAC associated with this device since it is the object that knows the full set of timing param...
uint8_t mcsIndex
The index in the operationalMcsSet of the WifiRemoteStationManager.
uint64_t successHist
Aggregate of all transmission successes.
Time CalculateTimeUnicastPacket(Time dataTransmissionTime, uint32_t shortRetries, uint32_t longRetries)
Estimate the time to transmit the given packet with the given number of retries.
static const uint8_t MAX_VHT_STREAM_GROUPS
Maximal number of groups per stream in VHT (4 possible channel widths and 2 possible GI configuration...
void InitSampleTable(MinstrelHtWifiRemoteStation *station)
Initialize Sample Table.
uint8_t GetHeGroupId(uint8_t txstreams, uint16_t gi, uint16_t chWidth)
Returns the groupId of an HE MCS with the given number of streams, GI and channel width used.
void CalculateRetransmits(MinstrelHtWifiRemoteStation *station, uint16_t index)
Calculate the number of retransmissions to set for the index rate.
static const uint8_t MAX_VHT_SUPPORTED_STREAMS
Maximal number of streams supported by the VHT PHY layer.
represent a single transmission mode
uint8_t GetRateId(uint16_t index)
Return the rateId inside a group, from the global index.
uint16_t GetLowestIndex(MinstrelHtWifiRemoteStation *station)
Returns the lowest global index of the rates supported by the station.
static const uint8_t MAX_HE_WIDTH
Maximal channel width in MHz.
void UpdateRetry(MinstrelHtWifiRemoteStation *station)
Update the number of retries and reset accordingly.
double ewmsdProb
Exponential weighted moving standard deviation of probability.
void UpdatePacketCounters(MinstrelHtWifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus)
Update the number of sample count variables.
double CalculateThroughput(MinstrelHtWifiRemoteStation *station, uint8_t groupId, uint8_t rateId, double ewmaProb)
Return the average throughput of the MCS defined by groupId and rateId.
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.
uint8_t m_numRates
Number of rates per group Minstrel should consider.
void SetNextSample(MinstrelHtWifiRemoteStation *station)
Set the next sample from Sample Table.
double ewmaProb
Exponential weighted moving average of probability.
uint32_t prevNumRateSuccess
Number of successful frames transmitted with previous rate.
void AddMpduTxTime(uint8_t groupId, WifiMode mode, Time t)
Save a TxTime to the vector of groups.
Time CalculateMpduTxDuration(Ptr< WifiPhy > phy, uint8_t streams, uint16_t gi, uint16_t chWidth, WifiMode mode, MpduType mpduType)
Estimates the TxTime of a frame with a given mode and group (stream, guard interval and channel width...
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
uint32_t m_frameLength
Frame length used for calculate modes TxTime in bytes.
void StatsDump(MinstrelHtWifiRemoteStation *station, uint8_t groupId, std::ofstream &of)
Print group statistics.
Simulation virtual time values and global simulation resolution.
uint64_t attemptHist
Aggregate of all transmission attempts.
MinstrelHtWifiRemoteStation structure.
virtual ~MinstrelHtWifiManager()
MinstrelHtRate m_ratesTable
Information about rates of this group.
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
uint32_t numSamplesSkipped
Number of times this rate statistics were not updated because no attempts have been made.
uint16_t GetNextSample(MinstrelHtWifiRemoteStation *station)
Getting the next sample from Sample Table.
uint32_t adjustedRetryCount
Adjust the retry limit for this rate.
void SetBestProbabilityRate(MinstrelHtWifiRemoteStation *station, uint16_t index)
Set index rate as maxProbRate if it is better than current value.
bool DoNeedRetransmission(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally) override
uint16_t m_maxTpRate2
The second max throughput rate of this group in bps.
void SetupPhy(const Ptr< WifiPhy > phy) override
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
WifiModeList GetHtDeviceMcsList(void) const
Returns a list of only the HT MCS supported by the device.
std::vector< struct GroupInfo > McsGroupData
Data structure for a table of groups.
std::vector< MinstrelHtRateInfo > MinstrelHtRate
Data structure for a Minstrel Rate table.
uint8_t m_numGroups
Number of groups Minstrel should consider.
hold per-remote-station state.
static const uint8_t MAX_HT_GROUP_RATES
Number of rates (or MCS) per HT group.
bool supported
If the rate is supported.
uint8_t GetHtGroupId(uint8_t txstreams, uint16_t gi, uint16_t chWidth)
Returns the groupId of an HT MCS with the given number of streams, GI and channel width used.
uint32_t numRateAttempt
Number of transmission attempts so far.
A struct to contain information of a group.
void RateInit(MinstrelHtWifiRemoteStation *station)
Initialize Minstrel Table.
std::vector< McsGroup > MinstrelMcsGroups
Data structure for a table of group definitions.
Implementation of Minstrel-HT Rate Control Algorithm.
void UpdateRate(MinstrelHtWifiRemoteStation *station)
Update rate.
void DoInitialize(void) override
Initialize() implementation.
bool isSupported
flag whether group is supported
void SetBestStationThRates(MinstrelHtWifiRemoteStation *station, uint16_t index)
Set index rate as maxTpRate or maxTp2Rate if is better than current values.
A struct to contain all statistics information related to a data rate.
bool m_printStats
If statistics table should be printed.
static TypeId GetTypeId(void)
Get the type ID.
Time GetFirstMpduTxTime(uint8_t groupId, WifiMode mode) const
Obtain the TxTime saved in the group information.
Ptr< MinstrelWifiManager > m_legacyManager
Pointer to an instance of MinstrelWifiManager.
void DoReportAmpduTxStatus(WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss) override
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
void(* RateChangeTracedCallback)(const uint64_t rate, const Mac48Address remoteAddress)
TracedCallback signature for rate change events.
uint8_t m_ewmaLevel
Exponential weighted moving average level (or coefficient).
bool m_useLatestAmendmentOnly
Flag if only the latest supported amendment by both peers should be used.
static const uint8_t MAX_HT_WIDTH
Maximal channel width in MHz.
bool m_supported
If the rates of this group are supported by the station.
double CalculateEwmsd(double oldEwmsd, double currentProb, double ewmaProb, double weight)
Perform EWMSD (Exponentially Weighted Moving Standard Deviation) calculation.
Time m_updateStats
How frequent do we calculate the stats.
uint8_t GetGroupId(uint16_t index)
Return the groupId from the global index.
Time GetMpduTxTime(uint8_t groupId, WifiMode mode) const
Obtain the TxTime saved in the group information.
void AddFirstMpduTxTime(uint8_t groupId, WifiMode mode, Time t)
Save a TxTime to the vector of groups.
uint8_t streams
number of spatial streams
std::ostream & operator<<(std::ostream &os, const Angles &a)
WifiModeList GetHeDeviceMcsList() const
Returns a list of only the HE MCS supported by the device.
Time m_legacyUpdateStats
How frequent do we calculate the stats for legacy MinstrelWifiManager.
void UpdateStats(MinstrelHtWifiRemoteStation *station)
Update the Minstrel Table.
McsGroupType
Available MCS group types.
Time perfectTxTime
Perfect transmission time calculation, or frame calculation.
void CheckInit(MinstrelHtWifiRemoteStation *station)
Check for initializations.
TxTime ratesFirstMpduTxTimeTable
rates MPDU transmit time table
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
MinstrelMcsGroups m_minstrelGroups
Global array for groups information.
McsGroupType type
identifies the group,
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
MpduType
The type of an MPDU.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
bool retryUpdated
If number of retries was updated already.
WifiRemoteStation * DoCreateStation(void) const override