|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
22 #ifndef MINSTREL_WIFI_MANAGER_H
23 #define MINSTREL_WIFI_MANAGER_H
25 #include "ns3/traced-value.h"
26 #include "ns3/wifi-remote-station-manager.h"
32 class UniformRandomVariable;
250 double rxSnr,
WifiMode txMode)
override;
254 double ctsSnr,
WifiMode ctsMode,
double rtsSnr)
override;
256 double dataSnr, uint16_t dataChannelWidth, uint8_t dataNss)
override;
Ptr< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
a unique identifier for an interface.
WifiRemoteStation * DoCreateStation(void) const override
uint32_t prob
(# packets success)/(# total packets)
uint64_t attemptHist
Aggregate of all transmission attempts.
uint32_t m_pktLen
packet length used for calculate mode TxTime
uint16_t m_maxTpRate2
second highest throughput rate in bps
uint8_t m_ewmaLevel
exponential weighted moving average
Time perfectTxTime
Perfect transmission time calculation, or frame calculation Given a bit rate and a packet length n by...
void RateInit(MinstrelWifiRemoteStation *station)
Initialize Minstrel Table.
uint32_t numRateSuccess
number of successful packets
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< RateInfo > MinstrelRate
Data structure for a Minstrel Rate table A vector of a struct RateInfo.
std::vector< std::vector< uint8_t > > SampleRate
Data structure for a Sample Rate table A vector of a vector uint8_t.
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.
void UpdateRetry(MinstrelWifiRemoteStation *station)
Update the number of retries and reset accordingly.
void UpdatePacketCounters(MinstrelWifiRemoteStation *station)
Update packet counters.
void AddCalcTxTime(WifiMode mode, Time t)
Add transmission time for the given mode to an internal list.
uint8_t numSamplesSkipped
number of samples skipped
uint32_t m_retry
total retries short + long
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
bool m_printSamples
whether samples table should be printed.
Time GetCalcTxTime(WifiMode mode) const
Estimate the TxTime of a packet with a given mode.
uint16_t FindRate(MinstrelWifiRemoteStation *station)
Find a rate to use from Minstrel Table.
bool m_initialized
for initializing tables
hold a list of per-remote-station state.
uint16_t m_txrate
current transmit rate in bps
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
bool m_isSampling
a flag to indicate we are currently sampling
static TypeId GetTypeId(void)
Get the type ID.
hold per-remote-station state for Minstrel Wifi manager.
uint16_t GetNextSample(MinstrelWifiRemoteStation *station)
Get the next sample from Sample Table.
Time m_updateStats
how frequent do we calculate the stats
MinstrelRate m_minstrelTable
minstrel table
WifiTxVector GetRtsTxVector(MinstrelWifiRemoteStation *station)
Get RTS transmit vector.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
uint32_t throughput
throughput of a rate in bps
std::ofstream m_statsFile
stats file
int m_totalPacketsCount
total number of packets as of now
bool m_sampleDeferred
a flag to indicate sample rate is on the second stage
void InitSampleTable(MinstrelWifiRemoteStation *station)
Initialize Sample Table.
uint8_t m_nModes
number of modes supported
uint32_t adjustedRetryCount
adjust the retry limit for this rate
uint32_t m_longRetry
long retries such as data packets
represent a single transmission mode
virtual ~MinstrelWifiManager()
uint16_t m_maxTpRate
the current throughput rate in bps
Implementation of Minstrel Rate Control Algorithm.
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station) override
void PrintTable(MinstrelWifiRemoteStation *station)
Print Minstrel Table.
uint32_t CountRetries(MinstrelWifiRemoteStation *station)
Get the number of retries.
SampleRate m_sampleTable
sample table
uint32_t ewmaProb
EWMA calculation ewma_prob =[prob *(100 - ewma_level) + (ewma_prob_old * ewma_level)]/100.
bool m_printStats
whether statistics table should be printed.
void UpdateStats(MinstrelWifiRemoteStation *station)
Update the Minstrel Table.
Simulation virtual time values and global simulation resolution.
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...
uint32_t numRateAttempt
how many number of attempts so far
uint32_t m_shortRetry
short retries such as control packets
int m_samplePacketsCount
how many packets we have sample so far
int m_numSamplesDeferred
number samples deferred
hold per-remote-station state.
void DoInitialize(void) override
Initialize() implementation.
void PrintSampleTable(MinstrelWifiRemoteStation *station)
Print Sample Table.
uint16_t m_sampleRate
current sample rate in bps
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_col
To keep track of the current position in the our random sample table going row by row from 1st column...
uint16_t m_maxProbRate
rate with highest probability of success in bps
uint32_t prevNumRateSuccess
Number of successful frames transmitted with previous rate.
void UpdateRate(MinstrelWifiRemoteStation *station)
Update the rate.
WifiTxVector GetDataTxVector(MinstrelWifiRemoteStation *station)
Get data transmit vector.
A struct to contain all information related to a data rate.
void CheckInit(MinstrelWifiRemoteStation *station)
Check for initializations.
uint8_t m_sampleCol
number of sample columns
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...
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
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 DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
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.
TxTime m_calcTxTime
to hold all the calculated TxTime for all modes
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
Time m_nextStatsUpdate
10 times every second
uint8_t m_lookAroundRate
the % to try other rates than our current rate
int sampleLimit
sample limit
uint32_t retryCount
retry limit
uint8_t m_index
vector index
uint32_t prevNumRateAttempt
Number of transmission attempts with previous rate.
uint64_t successHist
Aggregate of all transmission successes.
bool DoNeedRetransmission(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally) override