30 #include "ns3/boolean.h"
31 #include "ns3/eht-configuration.h"
33 #include "ns3/he-configuration.h"
34 #include "ns3/ht-configuration.h"
35 #include "ns3/ht-phy.h"
37 #include "ns3/simulator.h"
38 #include "ns3/uinteger.h"
39 #include "ns3/vht-configuration.h"
52 TypeId(
"ns3::WifiRemoteStationManager")
55 .AddAttribute(
"MaxSsrc",
56 "The maximum number of retransmission attempts for any packet with size "
57 "<= RtsCtsThreshold. "
58 "This value will not have any effect on some rate control algorithms.",
61 MakeUintegerChecker<uint32_t>())
62 .AddAttribute(
"MaxSlrc",
63 "The maximum number of retransmission attempts for any packet with size "
65 "This value will not have any effect on some rate control algorithms.",
68 MakeUintegerChecker<uint32_t>())
69 .AddAttribute(
"RtsCtsThreshold",
70 "If the size of the PSDU is bigger than this value, we use an RTS/CTS "
71 "handshake before sending the data frame."
72 "This value will not have any effect on some rate control algorithms.",
75 MakeUintegerChecker<uint32_t>())
77 "FragmentationThreshold",
78 "If the size of the PSDU is bigger than this value, we fragment it such that the "
79 "size of the fragments are equal or smaller. "
80 "This value does not apply when it is carried in an A-MPDU. "
81 "This value will not have any effect on some rate control algorithms.",
85 MakeUintegerChecker<uint32_t>())
86 .AddAttribute(
"NonUnicastMode",
87 "Wifi mode used for non-unicast transmissions.",
90 MakeWifiModeChecker())
91 .AddAttribute(
"DefaultTxPowerLevel",
92 "Default power level to be used for transmissions. "
93 "This is the power level that is used by all those WifiManagers that do "
94 "not implement TX power control.",
97 MakeUintegerChecker<uint8_t>())
98 .AddAttribute(
"ErpProtectionMode",
99 "Protection mode used when non-ERP STAs are connected to an ERP AP: "
100 "Rts-Cts or Cts-To-Self",
107 .AddAttribute(
"HtProtectionMode",
108 "Protection mode used when non-HT STAs are connected to a HT AP: Rts-Cts "
116 .AddTraceSource(
"MacTxRtsFailed",
117 "The transmission of a RTS by the MAC layer has failed",
119 "ns3::Mac48Address::TracedCallback")
120 .AddTraceSource(
"MacTxDataFailed",
121 "The transmission of a data packet by the MAC layer has failed",
123 "ns3::Mac48Address::TracedCallback")
125 "MacTxFinalRtsFailed",
126 "The transmission of a RTS has exceeded the maximum number of attempts",
128 "ns3::Mac48Address::TracedCallback")
130 "MacTxFinalDataFailed",
131 "The transmission of a data packet has exceeded the maximum number of attempts",
133 "ns3::Mac48Address::TracedCallback");
138 : m_useNonErpProtection(false),
139 m_useNonHtProtection(false),
140 m_shortPreambleEnabled(false),
141 m_shortSlotTimeEnabled(false)
281 return htConfiguration->GetLdpcSupported();
294 if (htConfiguration->GetShortGuardIntervalSupported())
311 gi =
static_cast<uint16_t
>(heConfiguration->GetGuardInterval().GetNanoSeconds());
324 bool isShortPreambleSupported)
333 bool isShortSlotTimeSupported)
346 for (
const auto& i : state->m_operationalRateSet)
356 state->m_dsssSupported =
true;
360 state->m_erpOfdmSupported =
true;
364 state->m_ofdmSupported =
true;
366 state->m_operationalRateSet.push_back(mode);
375 state->m_operationalRateSet.clear();
378 state->m_operationalRateSet.push_back(mode);
379 if (mode.IsMandatory())
392 state->m_operationalMcsSet.clear();
395 state->m_operationalMcsSet.push_back(mcs);
413 for (
const auto& i : state->m_operationalMcsSet)
420 state->m_operationalMcsSet.push_back(mcs);
519 std::shared_ptr<WifiRemoteStationState> state;
520 if (!remoteAddress.
IsGroup() &&
561 state->m_mldAddress = mldAddress;
566 std::optional<Mac48Address>
569 return LookupState(
address)->m_mldAddress;
572 std::optional<Mac48Address>
573 WifiRemoteStationManager::GetAffiliatedStaAddress(
const Mac48Address& mldAddress)
const
575 auto stateIt = m_states.find(mldAddress);
577 if (stateIt == m_states.end() || !stateIt->second->m_mldAddress)
583 NS_ASSERT(*stateIt->second->m_mldAddress == mldAddress);
584 return stateIt->second->m_address;
588 WifiRemoteStationManager::GetDataTxVector(
const WifiMacHeader& header, uint16_t allowedWidth)
594 WifiMode mode = GetNonUnicastMode();
602 v.
SetNTx(GetNumberOfAntennas());
612 if (GetNBasicModes() > 0)
614 mgtMode = GetBasicMode(0);
618 mgtMode = GetDefaultMode();
624 uint16_t channelWidth = allowedWidth;
627 if (uint16_t rxWidth = GetChannelWidthSupported(header.
GetAddr1());
628 rxWidth < channelWidth)
630 channelWidth = rxWidth;
634 txVector.
SetChannelWidth(m_wifiPhy->GetTxBandwidth(mgtMode, channelWidth));
640 txVector = DoGetDataTxVector(Lookup(
address), allowedWidth);
643 : UseLdpcForDestination(
address));
648 txVector.
SetBssColor(heConfiguration->GetBssColor());
655 <<
" MHz) exceeds allowed width (" << allowedWidth
661 WifiRemoteStationManager::GetCtsToSelfTxVector()
663 WifiMode defaultMode = GetDefaultMode();
687 GetDefaultTxPowerLevel(),
690 GetNumberOfAntennas(),
693 m_wifiPhy->GetTxBandwidth(defaultMode),
703 WifiMode mode = GetNonUnicastMode();
711 v.
SetNTx(GetNumberOfAntennas());
716 return DoGetRtsTxVector(Lookup(
address));
723 WifiMode ctsMode = GetControlAnswerMode(rtsTxMode);
730 uint16_t ctsTxGuardInterval =
741 WifiMode ackMode = GetControlAnswerMode(dataTxVector.
GetMode(GetStaId(to, dataTxVector)));
748 uint16_t ackTxGuardInterval =
760 WifiMode blockAckMode = GetControlAnswerMode(dataTxVector.
GetMode(GetStaId(to, dataTxVector)));
767 uint16_t blockAckTxGuardInterval =
775 WifiRemoteStationManager::GetControlAnswerMode(
WifiMode reqMode)
const
795 for (uint8_t i = 0; i < GetNBasicModes(); i++)
797 WifiMode testMode = GetBasicMode(i);
809 if (GetHtSupported())
813 mode = GetDefaultMcs();
814 for (uint8_t i = 0; i != GetNBasicMcs(); i++)
834 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
855 for (
const auto& thismode : m_wifiPhy->GetModeList())
866 if (thismode.IsMandatory() && (!found || thismode.IsHigherDataRate(mode)) &&
867 (!thismode.IsHigherDataRate(reqMode)) &&
869 thismode.GetModulationClass())))
878 if (GetHtSupported())
880 for (
const auto& thismode : m_wifiPhy->GetMcsList())
882 if (thismode.IsMandatory() && (!found || thismode.IsHigherDataRate(mode)) &&
883 (!thismode.IsHigherCodeRate(reqMode)) &&
909 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
920 m_macTxRtsFailed(header.
GetAddr1());
921 DoReportRtsFailed(Lookup(header.
GetAddr1()));
928 NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup());
930 QosUtilsMapTidToAc((mpdu->GetHeader().IsQosData()) ? mpdu->GetHeader().GetQosTid() : 0);
931 bool longMpdu = (mpdu->GetSize() > m_rtsCtsThreshold);
940 m_macTxDataFailed(mpdu->GetHeader().GetAddr1());
941 DoReportDataFailed(Lookup(mpdu->GetHeader().GetAddr1()));
956 DoReportRtsOk(station, ctsSnr, ctsMode, rtsSnr);
966 NS_LOG_FUNCTION(
this << *mpdu << ackSnr << ackMode << dataSnr << dataTxVector);
971 bool longMpdu = (mpdu->GetSize() > m_rtsCtsThreshold);
982 DoReportDataOk(station,
999 m_macTxFinalRtsFailed(header.
GetAddr1());
1000 DoReportFinalRtsFailed(station);
1007 NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup());
1010 QosUtilsMapTidToAc((mpdu->GetHeader().IsQosData()) ? mpdu->GetHeader().GetQosTid() : 0);
1012 bool longMpdu = (mpdu->GetSize() > m_rtsCtsThreshold);
1021 m_macTxFinalDataFailed(mpdu->GetHeader().GetAddr1());
1022 DoReportFinalDataFailed(station);
1036 DoReportRxOk(station, rxSignalInfo.
snr, txVector.
GetMode(GetStaId(
address, txVector)));
1042 uint16_t nSuccessfulMpdus,
1043 uint16_t nFailedMpdus,
1051 for (uint16_t i = 0; i < nFailedMpdus; i++)
1055 DoReportAmpduTxStatus(Lookup(
address),
1069 WifiTxVector txVector = GetDataTxVector(header, m_wifiPhy->GetChannelWidth());
1075 if (m_erpProtectionMode == RTS_CTS &&
1079 m_useNonErpProtection)
1082 "WifiRemoteStationManager::NeedRTS returning true to protect non-ERP stations");
1085 else if (m_htProtectionMode == RTS_CTS &&
1087 m_useNonHtProtection && !(m_erpProtectionMode != RTS_CTS && m_useNonErpProtection))
1089 NS_LOG_DEBUG(
"WifiRemoteStationManager::NeedRTS returning true to protect non-HT stations");
1092 bool normally = (size > m_rtsCtsThreshold);
1093 return DoNeedRts(Lookup(
address), size, normally);
1101 if (m_erpProtectionMode == CTS_TO_SELF &&
1107 m_useNonErpProtection)
1110 "WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-ERP stations");
1113 else if (m_htProtectionMode == CTS_TO_SELF &&
1116 m_useNonHtProtection && !(m_erpProtectionMode != CTS_TO_SELF && m_useNonErpProtection))
1119 "WifiRemoteStationManager::NeedCtsToSelf returning true to protect non-HT stations");
1122 else if (!m_useNonErpProtection)
1130 NS_LOG_DEBUG(
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1134 if (GetHtSupported())
1143 NS_LOG_DEBUG(
"WifiRemoteStationManager::NeedCtsToSelf returning false");
1148 NS_LOG_DEBUG(
"WifiRemoteStationManager::NeedCtsToSelf returning true");
1155 WifiRemoteStationManager::SetUseNonErpProtection(
bool enable)
1158 m_useNonErpProtection = enable;
1162 WifiRemoteStationManager::GetUseNonErpProtection()
const
1164 return m_useNonErpProtection;
1168 WifiRemoteStationManager::SetUseNonHtProtection(
bool enable)
1171 m_useNonHtProtection = enable;
1175 WifiRemoteStationManager::GetUseNonHtProtection()
const
1177 return m_useNonHtProtection;
1184 NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup());
1186 QosUtilsMapTidToAc((mpdu->GetHeader().IsQosData()) ? mpdu->GetHeader().GetQosTid() : 0);
1187 bool longMpdu = (mpdu->GetSize() > m_rtsCtsThreshold);
1188 uint32_t retryCount;
1189 uint32_t maxRetryCount;
1192 retryCount = m_slrc[ac];
1193 maxRetryCount = m_maxSlrc;
1197 retryCount = m_ssrc[ac];
1198 maxRetryCount = m_maxSsrc;
1200 bool normally = retryCount < maxRetryCount;
1201 NS_LOG_DEBUG(
"WifiRemoteStationManager::NeedRetransmission count: "
1202 << retryCount <<
" result: " << std::boolalpha << normally);
1203 return DoNeedRetransmission(Lookup(mpdu->GetHeader().GetAddr1()), mpdu->GetPacket(), normally);
1210 if (mpdu->GetHeader().GetAddr1().IsGroup())
1214 bool normally = mpdu->GetSize() > GetFragmentationThreshold();
1215 NS_LOG_DEBUG(
"WifiRemoteStationManager::NeedFragmentation result: " << std::boolalpha
1217 return DoNeedFragmentation(Lookup(mpdu->GetHeader().GetAddr1()), mpdu->GetPacket(), normally);
1221 WifiRemoteStationManager::DoSetFragmentationThreshold(uint32_t threshold)
1224 if (threshold < 256)
1229 NS_LOG_WARN(
"Fragmentation threshold should be larger than 256. Setting to 256.");
1230 m_fragmentationThreshold = 256;
1238 if (threshold % 2 != 0)
1240 NS_LOG_WARN(
"Fragmentation threshold should be an even number. Setting to "
1242 m_fragmentationThreshold = threshold - 1;
1246 m_fragmentationThreshold = threshold;
1252 WifiRemoteStationManager::DoGetFragmentationThreshold()
const
1254 return m_fragmentationThreshold;
1262 uint32_t nFragments =
1263 (mpdu->GetPacket()->GetSize() /
1267 if ((mpdu->GetPacket()->GetSize() %
1272 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetNFragments returning " << nFragments);
1280 NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup());
1281 uint32_t nFragment = GetNFragments(mpdu);
1282 if (fragmentNumber >= nFragment)
1284 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetFragmentSize returning 0");
1288 if (fragmentNumber == nFragment - 1)
1290 uint32_t lastFragmentSize =
1291 mpdu->GetPacket()->GetSize() -
1294 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetFragmentSize returning " << lastFragmentSize);
1295 return lastFragmentSize;
1300 uint32_t fragmentSize =
1302 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetFragmentSize returning " << fragmentSize);
1303 return fragmentSize;
1311 NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup());
1312 NS_ASSERT(fragmentNumber < GetNFragments(mpdu));
1313 uint32_t fragmentOffset = fragmentNumber * (GetFragmentationThreshold() -
1315 NS_LOG_DEBUG(
"WifiRemoteStationManager::GetFragmentOffset returning " << fragmentOffset);
1316 return fragmentOffset;
1323 NS_ASSERT(!mpdu->GetHeader().GetAddr1().IsGroup());
1324 bool isLast = fragmentNumber == (GetNFragments(mpdu) - 1);
1325 NS_LOG_DEBUG(
"WifiRemoteStationManager::IsLastFragment returning " << std::boolalpha << isLast);
1330 WifiRemoteStationManager::GetDefaultTxPowerLevel()
const
1332 return m_defaultTxPowerLevel;
1338 return LookupState(
address)->m_info;
1341 std::optional<double>
1344 auto station = Lookup(
address);
1345 auto rssi = station->m_rssiAndUpdateTimePair.first;
1346 auto ts = station->m_rssiAndUpdateTimePair.second;
1347 if (ts.IsStrictlyPositive())
1351 return std::nullopt;
1354 std::shared_ptr<WifiRemoteStationState>
1358 auto stateIt = m_states.find(
address);
1360 if (stateIt != m_states.end())
1362 NS_LOG_DEBUG(
"WifiRemoteStationManager::LookupState returning existing state");
1363 return stateIt->second;
1366 auto state = std::make_shared<WifiRemoteStationState>();
1367 state->m_state = WifiRemoteStationState::BRAND_NEW;
1370 state->m_operationalRateSet.push_back(GetDefaultMode());
1371 state->m_operationalMcsSet.push_back(GetDefaultMcs());
1372 state->m_dsssSupported =
false;
1373 state->m_erpOfdmSupported =
false;
1374 state->m_ofdmSupported =
false;
1375 state->m_htCapabilities =
nullptr;
1376 state->m_vhtCapabilities =
nullptr;
1377 state->m_heCapabilities =
nullptr;
1378 state->m_ehtCapabilities =
nullptr;
1379 state->m_channelWidth = m_wifiPhy->GetChannelWidth();
1380 state->m_guardInterval = GetGuardInterval();
1382 state->m_aggregation =
false;
1383 state->m_qosSupported =
false;
1385 NS_LOG_DEBUG(
"WifiRemoteStationManager::LookupState returning new state");
1393 auto stationIt = m_stations.find(
address);
1395 if (stationIt != m_stations.end())
1397 return stationIt->second;
1408 WifiRemoteStationManager::SetAssociationId(
Mac48Address remoteAddress, uint16_t aid)
1411 LookupState(remoteAddress)->m_aid = aid;
1415 WifiRemoteStationManager::SetQosSupport(
Mac48Address from,
bool qosSupported)
1418 LookupState(from)->m_qosSupported = qosSupported;
1426 auto state = LookupState(from);
1429 state->m_channelWidth = 40;
1433 state->m_channelWidth = 20;
1435 SetQosSupport(from,
true);
1440 AddSupportedMcs(from, mcs);
1443 state->m_htCapabilities = Create<const HtCapabilities>(htCapabilities);
1452 auto state = LookupState(from);
1455 state->m_channelWidth = 160;
1459 state->m_channelWidth = 80;
1461 for (uint8_t i = 1; i <= m_wifiPhy->GetMaxSupportedTxSpatialStreams(); i++)
1467 AddSupportedMcs(from, mcs);
1471 state->m_vhtCapabilities = Create<const VhtCapabilities>(vhtCapabilities);
1479 auto state = LookupState(from);
1485 state->m_channelWidth = 160;
1489 state->m_channelWidth = 80;
1497 state->m_channelWidth = 40;
1501 state->m_channelWidth = 20;
1506 state->m_guardInterval = 800;
1511 state->m_guardInterval = 3200;
1517 AddSupportedMcs(from, mcs);
1520 state->m_heCapabilities = Create<const HeCapabilities>(heCapabilities);
1521 SetQosSupport(from,
true);
1530 auto state = LookupState(from);
1533 for (uint8_t mapType = 0; mapType < EhtMcsAndNssSet::EHT_MCS_MAP_TYPE_MAX; ++mapType)
1538 AddSupportedMcs(from, mcs);
1542 state->m_ehtCapabilities = Create<const EhtCapabilities>(ehtCapabilities);
1543 SetQosSupport(from,
true);
1549 return LookupState(from)->m_htCapabilities;
1555 return LookupState(from)->m_vhtCapabilities;
1561 return LookupState(from)->m_heCapabilities;
1567 return LookupState(from)->m_ehtCapabilities;
1576 bool supported =
false;
1579 supported |= htCapabilities->GetLdpc();
1581 if (vhtCapabilities)
1583 supported |= vhtCapabilities->GetRxLdpc();
1587 supported |= heCapabilities->GetLdpcCodingInPayload();
1593 WifiRemoteStationManager::GetDefaultMode()
const
1595 return m_defaultTxMode;
1599 WifiRemoteStationManager::GetDefaultMcs()
const
1601 return m_defaultTxMcs;
1609 if (!GetHtSupported() || !GetHtSupported(st))
1611 return GetDefaultMode();
1616 if (GetHeSupported() && GetHeSupported(st))
1620 else if (GetVhtSupported() && GetVhtSupported(st))
1626 return *m_wifiPhy->GetPhyEntity(modClass)->begin();
1634 for (
auto& state : m_stations)
1636 delete (state.second);
1639 m_bssBasicRateSet.clear();
1640 m_bssBasicMcsSet.clear();
1651 NS_FATAL_ERROR(
"It is not allowed to add a HT rate in the BSSBasicRateSet!");
1653 for (uint8_t i = 0; i < GetNBasicModes(); i++)
1655 if (GetBasicMode(i) == mode)
1660 m_bssBasicRateSet.push_back(mode);
1664 WifiRemoteStationManager::GetNBasicModes()
const
1666 return static_cast<uint8_t
>(m_bssBasicRateSet.size());
1670 WifiRemoteStationManager::GetBasicMode(uint8_t i)
const
1673 return m_bssBasicRateSet[i];
1677 WifiRemoteStationManager::GetNNonErpBasicModes()
const
1692 WifiRemoteStationManager::GetNonErpBasicMode(uint8_t i)
const
1713 return m_bssBasicRateSet[index];
1720 for (uint8_t i = 0; i < GetNBasicMcs(); i++)
1722 if (GetBasicMcs(i) == mcs)
1727 m_bssBasicMcsSet.push_back(mcs);
1731 WifiRemoteStationManager::GetNBasicMcs()
const
1733 return static_cast<uint8_t
>(m_bssBasicMcsSet.size());
1737 WifiRemoteStationManager::GetBasicMcs(uint8_t i)
const
1740 return m_bssBasicMcsSet[i];
1744 WifiRemoteStationManager::GetNonUnicastMode()
const
1746 if (m_nonUnicastMode ==
WifiMode())
1748 if (GetNBasicModes() > 0)
1750 return GetBasicMode(0);
1754 return GetDefaultMode();
1759 return m_nonUnicastMode;
1787 uint16_t nSuccessfulMpdus,
1788 uint16_t nFailedMpdus,
1791 uint16_t dataChannelWidth,
1794 NS_LOG_DEBUG(
"DoReportAmpduTxStatus received but the manager does not handle A-MPDUs!");
1807 NS_ASSERT(i < GetNMcsSupported(station));
1814 NS_ASSERT(i < GetNNonErpSupported(station));
1858 if (!htCapabilities)
1862 return htCapabilities->GetShortGuardInterval20();
1882 if (!htCapabilities)
1886 return htCapabilities->GetRxHighestSupportedAntennas();
1896 WifiRemoteStationManager::GetPhy()
const
1902 WifiRemoteStationManager::GetMac()
const
1969 return LookupState(
address)->m_channelWidth;
1977 if (!htCapabilities)
1981 return htCapabilities->GetShortGuardInterval20();
1989 if (!htCapabilities)
1993 return htCapabilities->GetRxHighestSupportedAntennas();
1999 return static_cast<uint8_t
>(LookupState(
address)->m_operationalMcsSet.size());
2005 return (LookupState(
address)->m_dsssSupported);
2011 return (LookupState(
address)->m_erpOfdmSupported);
2017 return (LookupState(
address)->m_ofdmSupported);
2023 return bool(LookupState(
address)->m_htCapabilities);
2029 return bool(LookupState(
address)->m_vhtCapabilities);
2035 return bool(LookupState(
address)->m_heCapabilities);
2041 return (
bool)(LookupState(
address)->m_ehtCapabilities);
2045 WifiRemoteStationManager::SetDefaultTxPowerLevel(uint8_t txPower)
2047 m_defaultTxPowerLevel = txPower;
2051 WifiRemoteStationManager::GetNumberOfAntennas()
const
2053 return m_wifiPhy->GetNumberOfAntennas();
2057 WifiRemoteStationManager::GetMaxNumberOfTransmitStreams()
const
2059 return m_wifiPhy->GetMaxSupportedTxSpatialStreams();
2065 return (GetLdpcSupported() && GetLdpcSupported(dest));
The IEEE 802.11be EHT Capabilities.
uint8_t GetHighestSupportedRxMcs(EhtMcsAndNssSet::EhtMcsMapType mapType)
Get the highest supported RX MCS for a given EHT-MCS map type.
Hold variables of type enum.
The IEEE 802.11ax HE Capabilities.
uint8_t GetHighestMcsSupported() const
Get highest MCS supported.
bool GetHeSuPpdu1xHeLtf800nsGi() const
Get 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
uint8_t GetChannelWidthSet() const
Get channel width set.
The HT Capabilities Information Element.
uint8_t GetSupportedChannelWidth() const
Return the supported channel width.
bool IsSupportedMcs(uint8_t mcs) const
Return the is MCS supported flag.
static WifiMode GetHtMcs(uint8_t index)
Return the HT MCS corresponding to the provided index.
A base class which provides memory management and object aggregation.
uint16_t GetAssociationId() const
Return the association ID.
bool IsAssociated() const
Return whether we are associated with an AP.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
The IEEE 802.11ac VHT Capabilities.
bool IsSupportedMcs(uint8_t mcs, uint8_t nss) const
Get the is MCS supported.
uint8_t GetSupportedChannelWidthSet() const
Get the supported channel width set.
TypeOfStation GetTypeOfStation() const
Return the type of station.
represent a single transmission mode
bool IsHigherDataRate(WifiMode mode) const
WifiModulationClass GetModulationClass() const
uint8_t GetMcsValue() const
AttributeValue implementation for WifiMode.
Ptr< VhtConfiguration > GetVhtConfiguration() const
Ptr< EhtConfiguration > GetEhtConfiguration() const
Ptr< HtConfiguration > GetHtConfiguration() const
Ptr< HeConfiguration > GetHeConfiguration() const
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
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 ...
TID independent remote station statistics.
void NotifyTxSuccess(uint32_t retryCounter)
Updates average frame error rate when data or RTS was transmitted successfully.
void NotifyTxFailed()
Updates average frame error rate when final data or RTS has failed.
hold a list of per-remote-station state.
bool GetQosSupported(Mac48Address address) const
Return whether the given station is QoS capable.
void SetShortSlotTimeEnabled(bool enable)
Enable or disable short slot time.
void AddBasicMode(WifiMode mode)
Invoked in a STA upon association to store the set of rates which belong to the BSSBasicRateSet of th...
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
uint16_t GetAssociationId(Mac48Address remoteAddress) const
Get the AID of a remote station.
WifiMode m_defaultTxMcs
The default transmission modulation-coding scheme (MCS)
ProtectionMode m_htProtectionMode
Protection mode for HT stations when non-HT stations are detected.
uint32_t GetFragmentationThreshold() const
Return the fragmentation threshold.
uint32_t m_maxSsrc
Maximum STA short retry count (SSRC)
void SetRtsCtsThreshold(uint32_t threshold)
Sets the RTS threshold.
void AddAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to store all of the MCS supported by a destination which is also supported loc...
TracedCallback< Mac48Address > m_macTxRtsFailed
The trace source fired when the transmission of a single RTS has failed.
void DoSetFragmentationThreshold(uint32_t threshold)
Actually sets the fragmentation threshold, it also checks the validity of the given threshold.
bool IsBrandNew(Mac48Address address) const
Return whether the station state is brand new.
bool GetShortSlotTimeEnabled() const
Return whether the device uses short slot time.
void DoDispose() override
Destructor implementation.
~WifiRemoteStationManager() override
bool GetShortPreambleSupported(Mac48Address address) const
Return whether the station supports short PHY preamble or not.
void AddAllSupportedModes(Mac48Address address)
Invoked in a STA or AP to store all of the modes supported by a destination which is also supported l...
void AddSupportedMcs(Mac48Address address, WifiMode mcs)
Record the MCS index supported by the station.
void RemoveAllSupportedMcs(Mac48Address address)
Invoked in a STA or AP to delete all of the supported MCS by a destination.
uint32_t DoGetFragmentationThreshold() const
Return the current fragmentation threshold.
TracedCallback< Mac48Address > m_macTxFinalRtsFailed
The trace source fired when the transmission of a RTS has exceeded the maximum number of attempts.
bool m_shortPreambleEnabled
flag if short PHY preamble is enabled
bool GetShortSlotTimeSupported(Mac48Address address) const
Return whether the station supports short ERP slot time or not.
void SetShortPreambleEnabled(bool enable)
Enable or disable short PHY preambles.
Ptr< WifiPhy > m_wifiPhy
This is a pointer to the WifiPhy associated with this WifiRemoteStationManager that is set on call to...
uint8_t m_defaultTxPowerLevel
Default transmission power level.
static TypeId GetTypeId()
Get the type ID.
WifiMode m_nonUnicastMode
Transmission mode for non-unicast Data frames.
uint16_t GetGuardInterval() const
Return the supported HE guard interval duration (in nanoseconds).
bool IsAssociated(Mac48Address address) const
Return whether the station associated.
WifiRemoteStationManager()
bool GetHtSupported() const
Return whether the device has HT capability support enabled.
void RecordWaitAssocTxOk(Mac48Address address)
Records that we are waiting for an ACK for the association response we sent.
void SetFragmentationThreshold(uint32_t threshold)
Sets a fragmentation threshold.
Ptr< WifiMac > m_wifiMac
This is a pointer to the WifiMac associated with this WifiRemoteStationManager that is set on call to...
void SetMldAddress(const Mac48Address &address, const Mac48Address &mldAddress)
Set the address of the MLD the given station is affiliated with.
void RecordGotAssocTxOk(Mac48Address address)
Records that we got an ACK for the association response we sent.
bool GetLdpcSupported() const
Return whether the device has LDPC support enabled.
bool GetEhtSupported() const
Return whether the device has EHT capability support enabled.
void AddSupportedMode(Mac48Address address, WifiMode mode)
Invoked in a STA or AP to store the set of modes supported by a destination which is also supported l...
std::shared_ptr< WifiRemoteStationState > LookupState(Mac48Address address) const
Return the state of the station associated with the given address.
void RecordAssocRefused(Mac48Address address)
Records that association request was refused.
StationStates m_states
States of known stations.
void SetMaxSsrc(uint32_t maxSsrc)
Sets the maximum STA short retry count (SSRC).
TracedCallback< Mac48Address > m_macTxDataFailed
The trace source fired when the transmission of a single data packet has failed.
uint16_t GetStaId(Mac48Address address, const WifiTxVector &txVector) const
If the given TXVECTOR is used for a MU transmission, return the STAID of the station with the given a...
void AddSupportedPhyPreamble(Mac48Address address, bool isShortPreambleSupported)
Record whether the short PHY preamble is supported by the station.
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...
void RecordDisassociated(Mac48Address address)
Records that the STA was disassociated.
uint32_t m_maxSlrc
Maximum STA long retry count (SLRC)
void Reset()
Reset the station, invoked in a STA upon dis-association or in an AP upon reboot.
bool IsAssocRefused(Mac48Address address) const
Return whether we refused an association request from the given station.
bool GetVhtSupported() const
Return whether the device has VHT capability support enabled.
ProtectionMode m_erpProtectionMode
Protection mode for ERP stations when non-ERP stations are detected.
void AddSupportedErpSlotTime(Mac48Address address, bool isShortSlotTimeSupported)
Record whether the short ERP slot time is supported by the station.
bool GetShortPreambleEnabled() const
Return whether the device uses short PHY preambles.
bool GetHeSupported() const
Return whether the device has HE capability support enabled.
WifiMode m_defaultTxMode
The default transmission mode.
void RecordGotAssocTxFailed(Mac48Address address)
Records that we missed an ACK for the association response we sent.
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...
uint32_t m_rtsCtsThreshold
Threshold for RTS/CTS.
bool m_shortSlotTimeEnabled
flag if short slot time is enabled
bool IsWaitAssocTxOk(Mac48Address address) const
Return whether we are waiting for an ACK for the association response we sent.
void SetMaxSlrc(uint32_t maxSlrc)
Sets the maximum STA long retry count (SLRC).
TracedCallback< Mac48Address > m_macTxFinalDataFailed
The trace source fired when the transmission of a data packet has exceeded the maximum number of atte...
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetNess(uint8_t ness)
Sets the Ness number.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetLdpc(bool ldpc)
Sets if LDPC FEC coding is being used.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
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.
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetBssColor(uint8_t color)
Set the BSS color.
void SetNTx(uint8_t nTx)
Sets the number of TX antennas.
uint16_t GetChannelWidth() const
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#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 AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void Reset()
Reset the initial value of every attribute as well as the value of every global to what they were bef...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#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_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Now()
create an ns3::Time instance which contains the current simulation time.
Time Seconds(double 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.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_HR_DSSS
HR/DSSS (Clause 16)
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_EHT
EHT (Clause 36)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ WIFI_MOD_CLASS_DSSS
DSSS (Clause 15)
@ WIFI_MOD_CLASS_ERP_OFDM
ERP-OFDM (18.4)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint16_t WIFI_MAC_FCS_LENGTH
The length in octets of the IEEE 802.11 MAC FCS field.
bool IsAllowedControlAnswerModulationClass(WifiModulationClass modClassReq, WifiModulationClass modClassAnswer)
Return whether the modulation class of the selected mode for the control answer frame is allowed.
WifiModeList::const_iterator WifiModeListIterator
An iterator for WifiModeList vector.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
uint16_t ConvertGuardIntervalToNanoSeconds(WifiMode mode, const Ptr< WifiNetDevice > device)
Convert the guard interval to nanoseconds based on the WifiMode.
WifiPreamble GetPreambleForTransmission(WifiModulationClass modulation, bool useShortPreamble)
Return the preamble to be used for the transmission.
EhtMcsMapType
The different EHT-MCS map types as defined in 9.4.2.313.4 Supported EHT-MCS And NSS Set field.
RxSignalInfo structure containing info on the received signal.
double snr
SNR in linear scale.
hold per-remote-station state.
WifiRemoteStationState * m_state
Remote station state.
std::pair< double, Time > m_rssiAndUpdateTimePair
RSSI (in dBm) of the most recent packet received from the remote station along with update time.
Mac48Address m_address
Mac48Address of the remote station.
uint16_t m_channelWidth
Channel width (in MHz) supported by the remote station.
uint8_t m_ness
Number of extended spatial streams of the remote station.
bool m_aggregation
Flag if MPDU aggregation is used by the remote station.
bool m_qosSupported
Flag if QoS is supported by the station.
WifiModeList m_operationalRateSet
This member is the list of WifiMode objects that comprise the OperationalRateSet parameter for this r...
WifiModeList m_operationalMcsSet
operational MCS set
uint16_t m_guardInterval
HE Guard interval duration (in nanoseconds) supported by the remote station.
Ptr< const EhtCapabilities > m_ehtCapabilities
remote station EHT capabilities
Ptr< const VhtCapabilities > m_vhtCapabilities
remote station VHT capabilities
WifiRemoteStationInfo m_info
remote station info
Ptr< const HtCapabilities > m_htCapabilities
remote station HT capabilities
Ptr< const HeCapabilities > m_heCapabilities
remote station HE capabilities