27#include "ns3/ht-configuration.h"
29#include "ns3/packet.h"
30#include "ns3/random-variable-stream.h"
31#include "ns3/simulator.h"
32#include "ns3/wifi-mac.h"
33#include "ns3/wifi-net-device.h"
34#include "ns3/wifi-phy.h"
35#include "ns3/wifi-psdu.h"
40#define Min(a, b) ((a < b) ? a : b)
41#define Max(a, b) ((a > b) ? a : b)
57 .maxWidth =
MHz_u{40},
67 .maxWidth =
MHz_u{160},
77 .maxWidth =
MHz_u{160},
110 TypeId(
"ns3::MinstrelHtWifiManager")
113 .SetGroupName(
"Wifi")
114 .AddAttribute(
"UpdateStatistics",
115 "The interval between updating statistics table",
119 .AddAttribute(
"LegacyUpdateStatistics",
120 "The interval between updating statistics table (for legacy Minstrel)",
124 .AddAttribute(
"LookAroundRate",
125 "The percentage to try other rates (for legacy Minstrel)",
129 .AddAttribute(
"EWMA",
134 .AddAttribute(
"SampleColumn",
135 "The number of columns used for sampling",
139 .AddAttribute(
"PacketLength",
140 "The packet length used for calculating mode TxTime (bytes)",
144 .AddAttribute(
"UseLatestAmendmentOnly",
145 "Use only the latest amendment when it is supported by both peers",
149 .AddAttribute(
"PrintStats",
150 "Control the printing of the statistics table",
154 .AddTraceSource(
"Rate",
155 "Traced value for rate changes (b/s)",
157 "ns3::TracedValueCallback::Uint64");
221 for (uint8_t streams = 1; streams <=
standardInfos.maxStreams; ++streams)
242 && (
GetPhy()->GetMaxSupportedTxSpatialStreams() >=
275 NS_LOG_DEBUG(
"Initialized group " << groupId <<
": (" << +streams <<
","
408 m_minstrelGroups[groupId].ratesFirstMpduTxTimeTable.insert(std::make_pair(mode,
t));
441 station->m_totalPacketsCount = 0;
442 station->m_samplePacketsCount = 0;
445 station->m_sampleDeferred =
false;
449 station->m_initialized =
false;
460 station->m_ampduPacketCount = 0;
569 <<
"\tlongRetry \t" <<
station->m_longRetry);
579 station->m_groupsTable[groupId]
607 <<
", attempt = " <<
station->m_minstrelTable[
station->m_txrate].numRateAttempt
608 <<
", success = " <<
station->m_minstrelTable[
station->m_txrate].numRateSuccess
609 <<
" (before update).");
618 <<
", attempt = " <<
station->m_minstrelTable[
station->m_txrate].numRateAttempt
619 <<
", success = " <<
station->m_minstrelTable[
station->m_txrate].numRateSuccess
620 <<
" (after update).");
636 "DoReportDataOk m_txrate = "
638 <<
", attempt = " <<
station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateAttempt
639 <<
", success = " <<
station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateSuccess
640 <<
" (before update).");
642 station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateSuccess++;
643 station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateAttempt++;
648 "DoReportDataOk m_txrate = "
650 <<
", attempt = " <<
station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateAttempt
651 <<
", success = " <<
station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateSuccess
652 <<
" (after update).");
655 station->m_sampleDeferred =
false;
703 station->m_sampleDeferred =
false;
752 station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateAttempt +=
763 station->m_sampleDeferred =
false;
834 else if (
station->m_longRetry <
843 else if (
station->m_longRetry <=
853 NS_FATAL_ERROR(
"Max retries reached and m_longRetry not cleared properly. longRetry= "
871 else if (
station->m_longRetry <=
880 NS_FATAL_ERROR(
"Max retries reached and m_longRetry not cleared properly. longRetry= "
907 if (
station->m_totalPacketsCount == ~0)
909 station->m_samplePacketsCount = 0;
910 station->m_totalPacketsCount = 0;
931 NS_LOG_DEBUG(
"Channel width is not greater than allowed width, nothing to do");
940 auto width =
group.chWidth / 2;
942 while (width >=
MHz_u{20})
951 if (
group.isSupported)
991 const auto mcsIndex =
station->m_groupsTable[groupId].m_ratesTable[
rateId].mcsIndex;
1068 const auto mcsIndex =
station->m_groupsTable[groupId].m_ratesTable[
rateId].mcsIndex;
1091 const auto rate = mode.GetDataRate(
MHz_u{20});
1115std::list<Ptr<WifiMpdu>>
1126 (mpdu->GetRetryCount() <
GetMac()->GetFrameRetryLimit())))
1221 }
while (!
station->m_groupsTable[
station->m_sampleGroup].m_supported);
1226 auto index =
station->m_groupsTable[
station->m_sampleGroup].m_index;
1241 <<
" index= " << +
station->m_sampleTable[index][
col]);
1250 if ((
station->m_samplePacketsCount +
station->m_totalPacketsCount) == 0)
1349 if (
station->m_sampleWait > 0)
1357 <<
"maxTpRrate=" <<
station->m_maxTpRate);
1368 station->m_numSamplesSlow = 0;
1373 if (
station->m_ampduPacketCount > 0)
1379 station->m_ampduPacketCount = 0;
1390 if (
station->m_groupsTable[
j].m_supported)
1401 if (
station->m_groupsTable[
j].m_ratesTable[
i].supported)
1403 station->m_groupsTable[
j].m_ratesTable[
i].retryUpdated =
false;
1408 station->m_groupsTable[
j].m_ratesTable[
i].mcsIndex)
1410 <<
station->m_groupsTable[
j].m_ratesTable[
i].numRateAttempt
1412 <<
station->m_groupsTable[
j].m_ratesTable[
i].numRateSuccess);
1415 if (
station->m_groupsTable[
j].m_ratesTable[
i].numRateAttempt > 0)
1417 station->m_groupsTable[
j].m_ratesTable[
i].numSamplesSkipped = 0;
1423 (100 *
station->m_groupsTable[
j].m_ratesTable[
i].numRateSuccess) /
1424 station->m_groupsTable[
j].m_ratesTable[
i].numRateAttempt;
1429 if (
station->m_groupsTable[
j].m_ratesTable[
i].successHist == 0)
1435 station->m_groupsTable[
j].m_ratesTable[
i].ewmsdProb =
1438 station->m_groupsTable[
j].m_ratesTable[
i].ewmaProb,
1448 station->m_groupsTable[
j].m_ratesTable[
i].throughput =
1451 station->m_groupsTable[
j].m_ratesTable[
i].successHist +=
1452 station->m_groupsTable[
j].m_ratesTable[
i].numRateSuccess;
1453 station->m_groupsTable[
j].m_ratesTable[
i].attemptHist +=
1454 station->m_groupsTable[
j].m_ratesTable[
i].numRateAttempt;
1458 station->m_groupsTable[
j].m_ratesTable[
i].numSamplesSkipped++;
1462 station->m_groupsTable[
j].m_ratesTable[
i].prevNumRateSuccess =
1463 station->m_groupsTable[
j].m_ratesTable[
i].numRateSuccess;
1464 station->m_groupsTable[
j].m_ratesTable[
i].prevNumRateAttempt =
1465 station->m_groupsTable[
j].m_ratesTable[
i].numRateAttempt;
1466 station->m_groupsTable[
j].m_ratesTable[
i].numRateSuccess = 0;
1467 station->m_groupsTable[
j].m_ratesTable[
i].numRateAttempt = 0;
1469 if (
station->m_groupsTable[
j].m_ratesTable[
i].throughput != 0)
1488 <<
"\nmax prob=" <<
station->m_maxProbRate);
1497 std::size_t groupId,
1516 const auto txTime =
station->m_groupsTable[groupId].m_ratesTable[
rateId].perfectTxTime;
1519 return 90 / txTime.GetSeconds();
1523 return ewmaProb / txTime.GetSeconds();
1537 std::size_t groupId;
1560 station->m_maxProbRate = index;
1569 group->m_maxProbRate = index;
1576 station->m_maxProbRate = index;
1581 group->m_maxProbRate = index;
1596 std::size_t groupId;
1611 prob =
station->m_groupsTable[groupId].m_ratesTable[
rateId].ewmaProb;
1631 station->m_maxTpRate2 = index;
1650 group->m_maxTpRate = index;
1654 group->m_maxTpRate2 = index;
1670 for (std::size_t groupId = 0; groupId <
m_numGroups; groupId++)
1674 station->m_groupsTable[groupId].m_supported =
false;
1733 station->m_groupsTable[groupId].m_supported =
true;
1734 station->m_groupsTable[groupId].m_col = 0;
1735 station->m_groupsTable[groupId].m_index = 0;
1737 station->m_groupsTable[groupId].m_ratesTable =
1741 station->m_groupsTable[groupId].m_ratesTable[
i].supported =
false;
1746 for (uint8_t
i = 0;
i <
station->m_nModes;
i++)
1755 auto rateId = mode.GetMcsValue();
1761 station->m_groupsTable[groupId].m_ratesTable[
rateId].supported =
true;
1762 station->m_groupsTable[groupId].m_ratesTable[
rateId].mcsIndex =
1764 station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateAttempt = 0;
1765 station->m_groupsTable[groupId].m_ratesTable[
rateId].numRateSuccess = 0;
1766 station->m_groupsTable[groupId].m_ratesTable[
rateId].prob = 0;
1767 station->m_groupsTable[groupId].m_ratesTable[
rateId].ewmaProb = 0;
1768 station->m_groupsTable[groupId].m_ratesTable[
rateId].prevNumRateAttempt = 0;
1769 station->m_groupsTable[groupId].m_ratesTable[
rateId].prevNumRateSuccess = 0;
1770 station->m_groupsTable[groupId].m_ratesTable[
rateId].numSamplesSkipped = 0;
1771 station->m_groupsTable[groupId].m_ratesTable[
rateId].successHist = 0;
1772 station->m_groupsTable[groupId].m_ratesTable[
rateId].attemptHist = 0;
1773 station->m_groupsTable[groupId].m_ratesTable[
rateId].throughput = 0;
1774 station->m_groupsTable[groupId].m_ratesTable[
rateId].perfectTxTime =
1776 station->m_groupsTable[groupId].m_ratesTable[
rateId].retryCount = 0;
1777 station->m_groupsTable[groupId].m_ratesTable[
rateId].adjustedRetryCount = 0;
1800 if (!
station->m_groupsTable[groupId].m_ratesTable[
rateId].retryUpdated)
1808 std::size_t groupId,
1821 if (
station->m_groupsTable[groupId].m_ratesTable[
rateId].ewmaProb < 1)
1823 station->m_groupsTable[groupId].m_ratesTable[
rateId].retryCount = 1;
1827 station->m_groupsTable[groupId].m_ratesTable[
rateId].retryCount = 2;
1828 station->m_groupsTable[groupId].m_ratesTable[
rateId].retryUpdated =
true;
1834 station->m_groupsTable[groupId].m_ratesTable[
rateId].mcsIndex)) +
1838 station->m_groupsTable[groupId].m_ratesTable[
rateId].mcsIndex)) *
1843 cw =
Min((cw + 1) * 2, cwMax);
1845 cw =
Min((cw + 1) * 2, cwMax);
1855 cw =
Min((cw + 1) * 2, cwMax);
1860 (++
station->m_groupsTable[groupId].m_ratesTable[
rateId].retryCount < 7));
1918 if (!
station->m_statsFile.is_open())
1920 std::ostringstream
tmp;
1921 tmp <<
"minstrel-ht-stats-" <<
station->m_state->m_address <<
".txt";
1922 station->m_statsFile.open(
tmp.str(), std::ios::out);
1926 <<
" best ____________rate__________ ________statistics________ "
1927 "________last_______ ______sum-of________\n"
1928 <<
" mode guard # rate [name idx airtime max_tp] [avg(tp) avg(prob) sd(prob)] "
1929 "[prob.|retry|suc|att] [#success | #attempts]\n";
1935 station->m_statsFile <<
"\nTotal packet count:: ideal "
1937 <<
" lookaround " <<
station->m_samplePacketsCount <<
"\n";
1938 station->m_statsFile <<
"Average # of aggregated frames per A-MPDU: " <<
station->m_avgAmpduLen
1946 std::size_t groupId,
1954 if (
station->m_groupsTable[groupId].m_supported &&
1955 station->m_groupsTable[groupId].m_ratesTable[
i].supported)
1992 of << std::setw(4) <<
" MCS"
1993 << (
group.streams - 1) *
1999 of << std::setw(7) <<
" MCS" << +
i <<
"/" <<
static_cast<int>(
group.streams);
2002 of <<
" " << std::setw(3) <<
idx <<
" ";
2011 << std::setw(7) <<
station->m_groupsTable[groupId].m_ratesTable[
i].throughput / 100
2012 <<
" " << std::setw(7) <<
station->m_groupsTable[groupId].m_ratesTable[
i].ewmaProb
2013 <<
" " << std::setw(7) <<
station->m_groupsTable[groupId].m_ratesTable[
i].ewmsdProb
2014 <<
" " << std::setw(7) <<
station->m_groupsTable[groupId].m_ratesTable[
i].prob
2015 <<
" " << std::setw(2) <<
station->m_groupsTable[groupId].m_ratesTable[
i].retryCount
2016 <<
" " << std::setw(3)
2017 <<
station->m_groupsTable[groupId].m_ratesTable[
i].prevNumRateSuccess <<
" "
2018 << std::setw(3) <<
station->m_groupsTable[groupId].m_ratesTable[
i].prevNumRateAttempt
2019 <<
" " << std::setw(9)
2020 <<
station->m_groupsTable[groupId].m_ratesTable[
i].successHist <<
" "
2021 << std::setw(9) <<
station->m_groupsTable[groupId].m_ratesTable[
i].attemptHist
2126 std::size_t groupId = 0;
2137 station->m_groupsTable[groupId].m_ratesTable[
rateId].supported);
2152 station->m_groupsTable[groupId].m_ratesTable[
rateId].supported);
AttributeValue implementation for Boolean.
Implementation of Minstrel-HT Rate Control Algorithm.
static TypeId GetTypeId()
Get the type ID.
uint32_t CountRetries(MinstrelHtWifiRemoteStation *station)
Count retries.
void StatsDump(MinstrelHtWifiRemoteStation *station, std::size_t groupId, std::ofstream &of)
Print group statistics.
uint32_t m_frameLength
Frame length used to calculate modes TxTime in bytes.
void InitSampleTable(MinstrelHtWifiRemoteStation *station)
Initialize Sample Table.
bool m_printStats
If statistics table should be printed.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
void DoReportRxOk(WifiRemoteStation *station, double rxSnr, WifiMode txMode) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportDataOk(WifiRemoteStation *station, double ackSnr, WifiMode ackMode, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss) override
This method is a pure virtual method that must be implemented by the sub-class.
WifiTxVector DoGetRtsTxVector(WifiRemoteStation *station) override
Time GetFirstMpduTxTime(std::size_t groupId, WifiMode mode) const
Obtain the TxTime saved in the group information.
MinstrelMcsGroups m_minstrelGroups
Global array for groups information.
void SetNextSample(MinstrelHtWifiRemoteStation *station)
Set the next sample from Sample Table.
uint8_t m_numRates
Number of rates per group Minstrel should consider.
uint16_t UpdateRateAfterAllowedWidth(uint16_t txRate, MHz_u allowedWidth)
Given the index of the current TX rate, check whether the channel width is not greater than the given...
uint8_t m_nSampleCol
Number of sample columns.
std::list< Ptr< WifiMpdu > > DoGetMpdusToDropOnTxFailure(WifiRemoteStation *station, Ptr< WifiPsdu > psdu) override
Find the MPDUs to drop (possibly based on their frame retry count) in the given PSDU,...
void RateInit(MinstrelHtWifiRemoteStation *station)
Initialize Minstrel Table.
void SetBestStationThRates(MinstrelHtWifiRemoteStation *station, uint16_t index)
Set index rate as maxTpRate or maxTp2Rate if is better than current values.
~MinstrelHtWifiManager() override
void AddMpduTxTime(std::size_t groupId, WifiMode mode, Time t)
Save a TxTime to the vector of groups.
void PrintTable(MinstrelHtWifiRemoteStation *station)
Printing Minstrel Table.
std::size_t GetHeGroupId(uint8_t streams, Time guardInterval, MHz_u chWidth)
Returns the groupId of an HE MCS with the given number of streams, GI and channel width used.
double CalculateEwmsd(double oldEwmsd, double currentProb, double ewmaProb, double weight)
Perform EWMSD (Exponentially Weighted Moving Standard Deviation) calculation.
void DoReportDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void SetBestProbabilityRate(MinstrelHtWifiRemoteStation *station, uint16_t index)
Set index rate as maxProbRate if it is better than current value.
void AddFirstMpduTxTime(std::size_t groupId, WifiMode mode, Time t)
Save a TxTime to the vector of groups.
double CalculateThroughput(MinstrelHtWifiRemoteStation *station, std::size_t groupId, uint8_t rateId, double ewmaProb)
Return the average throughput of the MCS defined by groupId and rateId.
Time m_updateStats
How frequent do we calculate the stats.
Time GetMpduTxTime(std::size_t groupId, WifiMode mode) const
Obtain the TxTime saved in the group information.
TracedValue< uint64_t > m_currentRate
Trace rate changes.
uint16_t GetLowestIndex(MinstrelHtWifiRemoteStation *station)
Returns the lowest global index of the rates supported by the station.
void DoInitialize() override
Initialize() implementation.
bool ShouldAddMcsToGroup(WifiMode mode, std::size_t groupId)
Check whether a given MCS mode should be added to a given group.
std::size_t GetGroupId(uint16_t index)
Return the groupId from the global index.
std::size_t GetIdInGroup(WifiModulationClass mc, uint8_t streams, Time guardInterval, MHz_u chWidth)
Returns the Id of a MCS of a given modulation class with the given number of streams,...
WifiTxVector DoGetDataTxVector(WifiRemoteStation *station, MHz_u allowedWidth) override
void CheckInit(MinstrelHtWifiRemoteStation *station)
Check for initializations.
bool DoNeedRetransmission(WifiRemoteStation *st, Ptr< const Packet > packet, bool normally)
std::size_t GetNumGroups(WifiModulationClass mc)
Returns the number of groups for a given modulation class.
void UpdateRetry(MinstrelHtWifiRemoteStation *station)
Update the number of retries and reset accordingly.
void CalculateRetransmits(MinstrelHtWifiRemoteStation *station, uint16_t index)
Calculate the number of retransmissions to set for the index rate.
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...
std::size_t GetVhtGroupId(uint8_t streams, Time guardInterval, MHz_u chWidth)
Returns the groupId of a VHT MCS with the given number of streams, GI and channel width used.
bool IsValidMcs(uint8_t streams, MHz_u chWidth, WifiMode mode)
Check the validity of a combination of number of streams, chWidth and mode.
void InitializeGroups(WifiModulationClass mc)
Initialize all groups belonging to a given modulation class.
uint8_t m_ewmaLevel
Exponential weighted moving average level (or coefficient).
uint16_t FindRate(MinstrelHtWifiRemoteStation *station)
Find a rate to use from Minstrel Table.
uint8_t m_lookAroundRate
The % to try other rates than our current rate.
std::size_t GetHtGroupId(uint8_t streams, Time guardInterval, MHz_u chWidth)
Returns the groupId of an HT MCS with the given number of streams, GI and channel width used.
std::size_t m_numGroups
Number of groups Minstrel should consider.
Time CalculateMpduTxDuration(uint8_t streams, Time gi, MHz_u chWidth, WifiMode mode, MpduType mpduType)
Estimates the TxTime of a frame with a given mode and group (stream, guard interval and channel width...
void UpdateRate(MinstrelHtWifiRemoteStation *station)
Update rate.
uint8_t GetRateId(uint16_t index)
Return the rateId inside a group, from the global index.
Time m_legacyUpdateStats
How frequent do we calculate the stats for legacy MinstrelWifiManager.
WifiModeList GetDeviceMcsList(WifiModulationClass mc) const
Returns a list of only the MCS supported by the device for a given modulation class.
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< UniformRandomVariable > m_uniformRandomVariable
Provides uniform random variables.
uint16_t GetNextSample(MinstrelHtWifiRemoteStation *station)
Getting the next sample from Sample Table.
uint16_t GetIndex(std::size_t groupId, uint8_t rateId)
Returns the global index corresponding to the groupId and rateId.
void UpdateStats(MinstrelHtWifiRemoteStation *station)
Update the Minstrel Table.
WifiRemoteStation * DoCreateStation() const override
Ptr< MinstrelWifiManager > m_legacyManager
Pointer to an instance of MinstrelWifiManager.
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...
void DoReportFinalDataFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void UpdatePacketCounters(MinstrelHtWifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus)
Update the number of sample count variables.
void DoReportFinalRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
std::size_t GetGroupIdForType(McsGroupType type, uint8_t streams, Time guardInterval, MHz_u chWidth)
Returns the group ID of an MCS of a given group type with the given number of streams,...
bool m_useLatestAmendmentOnly
Flag if only the latest supported amendment by both peers should be used.
void DoReportRtsFailed(WifiRemoteStation *station) override
This method is a pure virtual method that must be implemented by the sub-class.
void DoReportAmpduTxStatus(WifiRemoteStation *station, uint16_t nSuccessfulMpdus, uint16_t nFailedMpdus, double rxSnr, double dataSnr, MHz_u dataChannelWidth, uint8_t dataNss) override
Typically called per A-MPDU, either when a Block ACK was successfully received or when a BlockAckTime...
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
Simulation virtual time values and global simulation resolution.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
represent a single transmission mode
WifiModulationClass GetModulationClass() const
uint64_t GetDataRate(MHz_u channelWidth, Time guardInterval, uint8_t nss) const
uint8_t GetMcsValue() const
Time GetBlockAckTxTime() const
Return the estimated BlockAck TX time for this PHY.
static Time GetPayloadDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, MpduType mpdutype=NORMAL_MPDU, uint16_t staId=SU_STA_ID)
Time GetSlot() const
Return the slot duration for this PHY.
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
MHz_u GetTxBandwidth(WifiMode mode, MHz_u maxAllowedBandWidth=MHz_u{ std::numeric_limits< double >::max()}) const
Get the bandwidth for a transmission occurring on the current operating channel and using the given W...
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
std::list< WifiMode > GetMcsList() const
The WifiPhy::GetMcsList() method is used (e.g., by a WifiRemoteStationManager) to determine the set o...
std::list< WifiMode > GetModeList() const
The WifiPhy::GetModeList() method is used (e.g., by a WifiRemoteStationManager) to determine the set ...
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
hold a list of per-remote-station state.
uint8_t GetNumberOfSupportedStreams(Mac48Address address) const
Return the number of spatial streams supported by the station.
uint8_t GetNess(const WifiRemoteStation *station) const
uint8_t GetNBasicModes() const
Return the number of basic modes we support.
Time GetGuardInterval() const
Return the shortest supported HE guard interval duration.
uint8_t GetDefaultTxPowerLevel() const
Ptr< WifiPhy > GetPhy() const
Return the WifiPhy.
MHz_u GetChannelWidth(const WifiRemoteStation *station) const
Return the channel width supported by the station.
Ptr< const He6GhzBandCapabilities > GetStationHe6GhzCapabilities(const Mac48Address &from) const
Return the HE 6 GHz Band Capabilities sent by a remote station.
bool GetAggregation(const WifiRemoteStation *station) const
Return whether the given station supports A-MPDU.
bool GetHtSupported() const
Return whether the device has HT capability support enabled on the link this manager is associated wi...
Ptr< WifiMac > GetMac() const
Return the WifiMac.
uint8_t GetNumberOfAntennas() const
uint8_t GetNMcsSupported(Mac48Address address) const
Return the number of MCS supported by the station.
WifiMode GetBasicMode(uint8_t i) const
Return a basic mode from the set of basic modes.
bool GetShortGuardIntervalSupported() const
Return whether the device has SGI support enabled.
virtual 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...
WifiMode GetMcsSupported(const WifiRemoteStation *station, uint8_t i) const
Return the WifiMode supported by the specified station at the specified index.
bool GetVhtSupported() const
Return whether the device has VHT capability support enabled on the link this manager is associated w...
bool GetShortPreambleEnabled() const
Return whether the device uses short PHY preambles.
bool GetHeSupported() const
Return whether the device has HE capability support enabled.
virtual 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...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
MpduType
The type of an MPDU.
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ FIRST_MPDU_IN_AGGREGATE
The MPDU is the first aggregate in an A-MPDU with multiple MPDUs, but is not the last aggregate.
@ MIDDLE_MPDU_IN_AGGREGATE
The MPDU is part of an A-MPDU with multiple MPDUs, but is neither the first nor the last aggregate.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
U * PeekPointer(const Ptr< U > &p)
std::vector< RateInfo > MinstrelRate
Data structure for a Minstrel Rate table A vector of a struct RateInfo.
std::vector< McsGroup > MinstrelMcsGroups
Data structure for a table of group definitions.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
double MHz_u
MHz weak type.
McsGroupType
Available MCS group types.
@ WIFI_MINSTREL_GROUP_VHT
const std::map< WifiModulationClass, MinstrelHtWifiManager::StandardInfo > minstrelHtStandardInfos
standard information for each modulation class
std::vector< MinstrelHtRateInfo > MinstrelHtRate
Data structure for a Minstrel Rate table.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
std::vector< WifiMode > WifiModeList
In various parts of the code, folk are interested in maintaining a list of transmission modes.
std::vector< std::vector< uint8_t > > SampleRate
Data structure for a Sample Rate table A vector of a vector uint8_t.
std::vector< GroupInfo > McsGroupData
Data structure for a table of groups.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
A struct to contain information of a group.
Data structure to contain the information that defines a group.
A struct to contain all statistics information related to a data rate.
double ewmaProb
Exponential weighted moving average of probability.
MinstrelHtWifiRemoteStation structure.
McsGroupData m_groupsTable
Table of groups with stats.
uint32_t m_sampleCount
Max number of samples per update interval.
uint8_t m_sampleGroup
The group that the sample rate belongs to.
uint32_t m_ampduPacketCount
Number of A-MPDUs transmitted.
uint32_t m_numSamplesSlow
Number of times a slow rate was sampled.
uint32_t m_sampleTries
Number of sample tries after waiting sampleWait.
std::ofstream m_statsFile
File where statistics table is written.
uint32_t m_sampleWait
How many transmission attempts to wait until a new sample.
bool m_isHt
If the station is HT capable.
uint32_t m_avgAmpduLen
Average number of MPDUs in an A-MPDU.
uint32_t m_ampduLen
Number of MPDUs in an A-MPDU.
hold per-remote-station state for Minstrel Wifi manager.
hold per-remote-station state.
void CalculateThroughput()
Calculate the throughput.