22 #ifndef MINSTREL_WIFI_MANAGER_H 23 #define MINSTREL_WIFI_MANAGER_H 25 #include "ns3/traced-value.h" 32 class UniformRandomVariable;
268 double ctsSnr,
WifiMode ctsMode,
double rtsSnr);
270 double ackSnr,
WifiMode ackMode,
double dataSnr);
void CheckInit(MinstrelWifiRemoteStation *station)
check for initializations
void PrintTable(MinstrelWifiRemoteStation *station)
printing Minstrel Table
uint16_t m_maxProbRate
rate with highest prob of success
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station)
void SetupMac(const Ptr< WifiMac > mac)
Set up MAC associated with this device since it is the object that knows the full set of timing param...
Simulation virtual time values and global simulation resolution.
bool m_printStats
whether statistics table should be printed.
uint8_t m_lookAroundRate
the % to try other rates than our current rate
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
uint8_t m_index
vector index
Time perfectTxTime
Perfect transmission time calculation, or frame calculation Given a bit rate and a packet length n by...
Implementation of Minstrel Rate Control AlgorithmMinstrel is a rate control algorithm implemented in ...
uint16_t m_maxTpRate
the current throughput rate
uint16_t m_txrate
current transmit rate
uint16_t m_maxTpRate2
second highest throughput rate
uint32_t numRateSuccess
number of successful pkts
void DoReportFinalDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
uint8_t numSamplesSkipped
number of samples skipped
hold per-remote-station state for Minstrel Wifi manager.
Time m_updateStats
how frequent do we calculate the stats (1/10 seconds)
void UpdateStats(MinstrelWifiRemoteStation *station)
updating the Minstrel Table every 1/10 seconds
uint16_t m_sampleRate
current sample rate
MinstrelRate m_minstrelTable
minstrel table
std::ofstream m_statsFile
stats file
bool m_sampleDeferred
a flag to indicate sample rate is on the second stage
std::vector< std::vector< uint8_t > > SampleRate
Data structure for a Sample Rate table A vector of a vector uint8_t.
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
std::vector< RateInfo > MinstrelRate
Data structure for a Minstrel Rate table A vector of a struct RateInfo.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint32_t retryCount
retry limit
uint8_t m_nModes
number of modes supported
uint32_t m_pktLen
packet length used for calculate mode TxTime
void SetHeSupported(bool enable)
Enable or disable HE capability support.
uint32_t adjustedRetryCount
adjust the retry limit for this rate
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.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode)
This method is a pure virtual method that must be implemented by the sub-class.
A struct to contain all information related to a data rate.
void SetupPhy(const Ptr< WifiPhy > phy)
Set up PHY associated with this device since it is the object that knows the full set of transmit rat...
bool m_isSampling
a flag to indicate we are currently sampling
int m_numSamplesDeferred
number samles deferred
void SetHtSupported(bool enable)
Enable or disable HT capability support.
SampleRate m_sampleTable
sample table
uint8_t m_col
To keep track of the current position in the our random sample table going row by row from 1st column...
uint32_t prevNumRateSuccess
Number of successful frames transmitted with previous rate.
bool IsLowLatency(void) const
uint16_t GetNextSample(MinstrelWifiRemoteStation *station)
getting the next sample from Sample Table
void PrintSampleTable(MinstrelWifiRemoteStation *station)
printing Sample Table
uint32_t prevNumRateAttempt
Number of transmission attempts with previous rate.
int sampleLimit
sample limit
uint64_t attemptHist
Aggregate of all transmission attempts.
uint64_t successHist
Aggregate of all transmission successes.
void AddCalcTxTime(WifiMode mode, Time t)
Add transmission time for the given mode to an internal list.
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.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station)
uint32_t m_longRetry
long retries such as data packets
uint16_t FindRate(MinstrelWifiRemoteStation *station)
find a rate to use from Minstrel Table
bool m_initialized
for initializing tables
uint32_t ewmaProb
EWMA calculation ewma_prob =[prob *(100 - ewma_level) + (ewma_prob_old * ewma_level)]/100.
uint32_t numRateAttempt
how many number of attempts so far
TxTime m_calcTxTime
to hold all the calculated TxTime for all modes
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void UpdateRate(MinstrelWifiRemoteStation *station)
updating the rate
WifiTxVector GetDataTxVector(MinstrelWifiRemoteStation *station)
Get data transmit vector.
bool DoNeedRetransmission(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
uint32_t throughput
throughput of a rate
uint32_t m_retry
total retries short + long
int m_totalPacketsCount
total number of packets as of now
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
void UpdateRetry(MinstrelWifiRemoteStation *station)
update the number of retries and reset accordingly
int m_samplePacketsCount
how many packets we have sample so far
static TypeId GetTypeId(void)
Get the type ID.
void InitSampleTable(MinstrelWifiRemoteStation *station)
initialize Sample Table
void DoReportRtsFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector GetRtsTxVector(MinstrelWifiRemoteStation *station)
Get RTS transmit vector.
void SetVhtSupported(bool enable)
Enable or disable VHT capability support.
uint32_t CountRetries(MinstrelWifiRemoteStation *station)
Count retries.
void DoReportDataFailed(WifiRemoteStation *station)
This method is a pure virtual method that must be implemented by the sub-class.
std::map< WifiMode, Time > TxTime
typedef for a vector of a pair of Time, WifiMode.
bool m_printSamples
whether samples table should be printed.
virtual ~MinstrelWifiManager()
uint32_t m_shortRetry
short retries such as control packts
WifiRemoteStation * DoCreateStation(void) const
uint8_t m_sampleCol
number of sample columns
Time GetCalcTxTime(WifiMode mode) const
for estimating the TxTime of a packet with a given mode
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.
a unique identifier for an interface.
uint8_t m_ewmaLevel
exponential weighted moving average
Time CalculateTimeUnicastPacket(Time dataTransmissionTime, uint32_t shortRetries, uint32_t longRetries)
Estimate the time to transmit the given packet with the given number of retries.
void RateInit(MinstrelWifiRemoteStation *station)
initialize Minstrel Table
hold per-remote-station state.
uint32_t prob
(# pkts success )/(# total pkts)
void UpdatePacketCounters(MinstrelWifiRemoteStation *station)
Update packet counters.
Time m_nextStatsUpdate
10 times every second