28#include "ns3/ap-emlsr-manager.h"
29#include "ns3/eht-configuration.h"
30#include "ns3/eht-frame-exchange-manager.h"
31#include "ns3/he-configuration.h"
32#include "ns3/ht-configuration.h"
34#include "ns3/packet.h"
35#include "ns3/pointer.h"
36#include "ns3/random-variable-stream.h"
37#include "ns3/simulator.h"
38#include "ns3/string.h"
39#include "ns3/uinteger.h"
60 "Delay between two beacons",
64 .AddAttribute(
"BeaconJitter",
65 "A random variable to cause the initial beacon starting time (after "
66 "simulation time 0) to be distributed between 0 and the BeaconInterval. "
67 "Generated values must be between 0 and 1.",
71 .AddAttribute(
"EnableBeaconJitter",
72 "If beacons are enabled, whether to jitter the initial send event.",
76 .AddAttribute(
"BeaconDtimPeriod",
77 "The DTIM Period, in number of beacons",
81 .AddAttribute(
"BeaconGeneration",
82 "Whether or not beacons are generated.",
86 .AddAttribute(
"FdBeaconInterval6GHz",
87 "Time between a Beacon frame and a FILS Discovery (FD) frame or between "
88 "two FD frames to be sent on a 6GHz link. A value of zero disables the "
89 "transmission of FD frames.",
93 .AddAttribute(
"FdBeaconIntervalNon6GHz",
94 "Time between a Beacon frame and a FILS Discovery (FD) frame or between "
95 "two FD frames to be sent on a non-6GHz link. A value of zero disables "
96 "the transmission of FD frames.",
100 .AddAttribute(
"SendUnsolProbeResp",
101 "Send unsolicited broadcast Probe Response instead of FILS Discovery",
105 .AddAttribute(
"EnableNonErpProtection",
106 "Whether or not protection mechanism should be used when non-ERP STAs "
107 "are present within the BSS."
108 "This parameter is only used when ERP is supported by the AP.",
112 .AddAttribute(
"BsrLifetime",
113 "Lifetime of Buffer Status Reports received from stations.",
119 "The CW min values that the AP advertises in EDCA Parameter Set elements and the "
120 "associated stations will use. The value of this attribute is an AC-indexed map "
121 "containing the CW min values for given ACs for all the links (sorted in "
122 "increasing order of link ID). If no values are provided for an AC, the same "
123 "values used by the AP are advertised. In case a string is used to set this "
124 "attribute, the string shall contain the pairs separated by a semicolon (;); "
125 "in every pair, the AC index and the list of values are separated by a blank "
126 "space, and the values of a list are separated by a comma (,) without spaces. "
127 "E.g. \"BE 31,31,31; VI 15,15,15\" defines the CW min values for AC BE and AC VI "
128 "for an AP MLD having three links.",
135 "The CW max values that the AP advertises in EDCA Parameter Set elements and the "
136 "associated stations will use. The value of this attribute is an AC-indexed map "
137 "containing the CW max values for given ACs for all the links (sorted in "
138 "increasing order of link ID). If no values are provided for an AC, the same "
139 "values used by the AP are advertised. In case a string is used to set this "
140 "attribute, the string shall contain the pairs separated by a semicolon (;); "
141 "in every pair, the AC index and the list of values are separated by a blank "
142 "space, and the values of a list are separated by a comma (,) without spaces. "
143 "E.g. \"BE 31,31,31; VI 15,15,15\" defines the CW max values for AC BE and AC VI "
144 "for an AP MLD having three links.",
151 "The AIFSN values that the AP advertises in EDCA Parameter Set elements and the "
152 "associated stations will use. The value of this attribute is an AC-indexed map "
153 "containing the AIFSN values for given ACs for all the links (sorted in "
154 "increasing order of link ID). If no values are provided for an AC, the same "
155 "values used by the AP are advertised. In case a string is used to set this "
156 "attribute, the string shall contain the pairs separated by a semicolon (;); "
157 "in every pair, the AC index and the list of values are separated by a blank "
158 "space, and the values of a list are separated by a comma (,) without spaces. "
159 "E.g. \"BE 3,3,3; VI 2,2,2\" defines the AIFSN values for AC BE and AC VI "
160 "for an AP MLD having three links.",
167 "The TXOP limit values that the AP advertises in EDCA Parameter Set elements and "
168 "the associated stations will use. The value of this attribute is an AC-indexed "
169 "map containing the TXOP limit values for given ACs for all the links (sorted in "
170 "increasing order of link ID). If no values are provided for an AC, the same "
171 "values used by the AP are advertised. In case a string is used to set this "
172 "attribute, the string shall contain the pairs separated by a semicolon (;); "
173 "in every pair, the AC index and the list of values are separated by a blank "
174 "space, and the values of a list are separated by a comma (,) without spaces. "
175 "E.g. \"BE 3200us,3200us,3200us; VI 2400us,2400us,2400us\" defines the TXOP limit "
176 "values for AC BE and AC VI for an AP MLD having three links.",
181 .AddAttribute(
"GcrManager",
182 "The GCR manager object.",
188 .AddTraceSource(
"AssociatedSta",
189 "A station associated with this access point.",
191 "ns3::ApWifiMac::AssociationCallback")
192 .AddTraceSource(
"DeAssociatedSta",
193 "A station lost association with this access point.",
195 "ns3::ApWifiMac::AssociationCallback");
263std::unique_ptr<WifiMac::LinkEntity>
266 return std::make_unique<ApLinkEntity>();
351 for (uint8_t linkId = 0; linkId <
GetNLinks(); linkId++)
379 for (uint8_t linkId = 0; linkId <
GetNLinks(); ++linkId)
419 NS_FATAL_ERROR(
"beacon interval should be multiple of 1024us (802.11 time unit), see IEEE "
425 "beacon interval should be smaller then or equal to 65535 * 1024us (802.11 time unit)");
435 auto currentStream = stream + 1;
436 currentStream +=
m_beaconTxop->AssignStreams(currentStream);
438 return (currentStream - stream);
448 for (
const auto& sta : link.staList)
452 link.shortSlotTimeEnabled =
false;
456 link.shortSlotTimeEnabled =
true;
460 link.shortSlotTimeEnabled =
false;
471 for (
const auto& sta : link.staList)
476 link.shortPreambleEnabled =
false;
480 link.shortPreambleEnabled =
true;
484 link.shortPreambleEnabled =
false;
499 std::list<Mac48Address> addr2Set;
503 for (uint8_t linkId = 0; linkId <
GetNLinks(); linkId++)
514 NS_ASSERT_MSG(linkId,
"Station " << to <<
"is not associated, cannot send it a frame");
521 for (
auto addr2 = addr2Set.cbegin(); addr2 != addr2Set.cend(); ++addr2)
523 auto& hdr = mpdu->GetHeader();
526 hdr.SetAddr2(*addr2);
536 if (std::next(addr2) != addr2Set.cend())
557 for (
const auto& mode :
GetWifiPhy(linkId)->GetModeList())
559 uint64_t modeDataRate = mode.GetDataRate(
GetWifiPhy(linkId)->GetChannelWidth());
560 NS_LOG_DEBUG(
"Adding supported rate of " << modeDataRate);
568 NS_LOG_DEBUG(
"Adding basic mode " << mode.GetUniqueName());
587 for (
const auto& selector :
GetWifiPhy(linkId)->GetBssMembershipSelectorList())
602 return dsssParameters;
630 for (uint8_t tid = 0; tid < 8; ++tid)
648 if (std::none_of(
GetLinks().cbegin(),
GetLinks().cend(), [=,
this](
const auto& pair) {
649 const auto lnkId = pair.first;
650 const auto& link = pair.second;
653 return link->stationManager->IsAssociated(address) &&
654 !link->stationManager->IsInPsMode(address) &&
659 NS_LOG_DEBUG(
"Found BU: " << *mpdu <<
" for STA " << address <<
" and TID=" << +tid);
678 for (
const auto&
id : linkIds)
681 if (!link.stationManager->IsInPsMode(address))
685 for (
const auto& aci : acList)
690 link.stationManager->GetAffiliatedStaAddress(address).value_or(address),
693 if (
auto mpdu =
GetTxopQueue(aci)->PeekByQueueId(queueId))
695 NS_LOG_DEBUG(
"Found MMPDU: " << *mpdu <<
" for STA " << address <<
" on link "
723 const auto found = std::any_of(acList.cbegin(), acList.cend(), [=,
this](
const auto aci) {
724 auto queueId = m_scheduler->GetNext(aci, linkId);
728 if (const auto addrType = std::get<1>(*queueId);
729 addrType == WifiRcvAddr::BROADCAST || addrType == WifiRcvAddr::GROUPCAST)
731 NS_LOG_DEBUG(
"Found some group addressed frames for link " << +linkId);
734 queueId = m_scheduler->GetNext(aci, linkId, *queueId);
771 if (
GetLink(linkId).nStationsInPsMode > 0)
788 for (uint8_t
id = 0;
id <
GetNLinks(); ++id)
790 if (
id == linkId ||
GetLink(
id).nStationsInPsMode == 0)
812 const auto& hdr = mpdu->GetHeader();
813 const auto addr1 = hdr.GetAddr1();
821 "Expected unicast transmissions to be blocked");
823 return std::any_of(acList.cbegin(), acList.cend(), [=,
this](
const auto aci) {
824 auto item = mpdu->IsQueued() && mpdu->GetQueueAc() == aci ? mpdu : nullptr;
825 return GetTxopQueue(aci)->PeekFirstAvailable(linkId, item) != nullptr;
839 const auto isSingleLink = (addr1 == receiver);
848 auto start = hdr.IsData() ? mpdu :
nullptr;
857 for (uint8_t tid = 0; tid < 8; ++tid)
865 (hdr.IsQosData() && hdr.GetQosTid() == tid) ? mpdu->GetOriginal() :
nullptr;
868 ->PeekByTidAndAddress(tid, receiver, start))
877 for (
const auto aci : acList)
883 auto start = (hdr.IsMgt() && mpdu->GetQueueAc() == aci) ? mpdu :
nullptr;
885 if (
auto bu =
GetTxopQueue(aci)->PeekByQueueId(queueId, start))
904 if (
GetLink(linkId).shortPreambleEnabled)
929 : edca->GetMinCw(linkId));
931 : edca->GetMaxCw(linkId));
933 : edca->GetAifsn(linkId));
935 : edca->GetTxopLimit(linkId);
941 : edca->GetMinCw(linkId));
943 : edca->GetMaxCw(linkId));
945 : edca->GetAifsn(linkId));
947 : edca->GetTxopLimit(linkId);
953 : edca->GetMinCw(linkId));
955 : edca->GetMaxCw(linkId));
957 : edca->GetAifsn(linkId));
959 : edca->GetTxopLimit(linkId);
965 : edca->GetMinCw(linkId));
967 : edca->GetMaxCw(linkId));
969 : edca->GetAifsn(linkId));
971 : edca->GetTxopLimit(linkId);
976 return edcaParameters;
979std::optional<MuEdcaParameterSet>
1013 auto timerNotNull = [&muEdcaParameters](uint8_t aci) {
1016 auto aci = {0, 1, 2, 3};
1017 if (std::all_of(aci.begin(), aci.end(), timerNotNull))
1019 return muEdcaParameters;
1023 "MU EDCA Timers must be all zero if the IE is not advertised.");
1025 return std::nullopt;
1028std::optional<ReducedNeighborReport>
1035 return std::nullopt;
1041 for (uint8_t index = 0; index <
GetNLinks(); ++index)
1043 if (index != linkId)
1063 const std::optional<MultiLinkElement>& mlProbeReqMle)
1068 "ML Probe Request Multi-Link Element cannot be provided for frame type "
1079 if (ehtConfiguration->m_emlsrActivated)
1098 commonInfo.SetMediumSyncOfdmEdThreshold(ehtConfiguration->m_msdOfdmEdThreshold);
1099 commonInfo.SetMediumSyncMaxNTxops(ehtConfiguration->m_msdMaxNTxops);
1112 mldCapabilities.emplace();
1113 mldCapabilities->maxNSimultaneousLinks =
GetNLinks() - 1;
1114 mldCapabilities->srsSupport = 0;
1115 mldCapabilities->tidToLinkMappingSupport =
1116 static_cast<uint8_t
>(ehtConfiguration->m_tidLinkMappingSupport);
1117 mldCapabilities->freqSepForStrApMld = 0;
1118 mldCapabilities->aarSupport = 0;
1126 staMldAddress.has_value())
1128 for (uint8_t i = 0; i <
GetNLinks(); i++)
1131 if (
auto staAddress = remoteStationManager->GetAffiliatedStaAddress(*staMldAddress);
1132 i != linkId && staAddress.has_value() &&
1133 (remoteStationManager->IsWaitAssocTxOk(*staAddress) ||
1134 remoteStationManager->IsAssocRefused(*staAddress)))
1147 perStaProfile.SetCompleteProfile();
1151 perStaProfile.SetAssocResponse(
GetAssocResp(*staAddress, i));
1156 if (!mlProbeReqMle.has_value())
1161 auto reqVar = mlProbeReqMle->GetVariant();
1163 "Invalid MLE variant " << reqVar);
1173 auto apMldId = mlProbeReqMle->GetApMldId();
1174 NS_ASSERT_MSG(apMldId.has_value(),
"AP MLD ID subfield missing");
1180 NS_ASSERT_MSG(*apMldId == 0,
"AP MLD ID expected value is 0. value = " << +apMldId.value());
1183 std::set<uint8_t> respLinkIds{};
1184 if (
const auto nProfiles = mlProbeReqMle->GetNPerStaProfileSubelements(); nProfiles == 0)
1190 for (std::size_t i = 0; i <
GetNLinks(); ++i)
1194 respLinkIds.insert(i);
1199 for (std::size_t i = 0; i < mlProbeReqMle->GetNPerStaProfileSubelements(); ++i)
1206 const auto& perStaProfile = mlProbeReqMle->GetPerStaProfile(i);
1207 auto currLinkId = perStaProfile.GetLinkId();
1208 if ((currLinkId <
GetNLinks()) && (currLinkId != linkId))
1210 respLinkIds.insert(currLinkId);
1214 auto setPerStaProfile = [&](uint8_t id) ->
void {
1221 perStaProfile.SetCompleteProfile();
1224 std::for_each(respLinkIds.begin(), respLinkIds.end(), setPerStaProfile);
1240 if (phy->GetChannelWidth() >
MHz_u{20})
1245 if (
GetLink(linkId).numNonHtStations == 0)
1253 uint64_t maxSupportedRate = 0;
1256 uint8_t nss = (mcs.GetMcsValue() / 8) + 1;
1259 mcs.GetDataRate(phy->GetChannelWidth(),
1262 if (dataRate > maxSupportedRate)
1264 maxSupportedRate = dataRate;
1265 NS_LOG_DEBUG(
"Updating maxSupportedRate to " << maxSupportedRate);
1268 uint8_t maxSpatialStream = phy->GetMaxSupportedTxSpatialStreams();
1270 uint8_t nMcs = mcsList.size();
1271 for (
const auto& sta :
GetLink(linkId).staList)
1273 if (remoteStationManager->GetHtSupported(sta.second) ||
1274 remoteStationManager->GetStationHe6GhzCapabilities(sta.second))
1276 uint64_t maxSupportedRateByHtSta = 0;
1277 auto itMcs = mcsList.begin();
1279 j < (std::min(nMcs, remoteStationManager->GetNMcsSupported(sta.second)));
1286 remoteStationManager->GetChannelWidthSupported(sta.second),
1287 NanoSeconds(remoteStationManager->GetShortGuardIntervalSupported(sta.second)
1291 if (dataRate > maxSupportedRateByHtSta)
1293 maxSupportedRateByHtSta = dataRate;
1296 if (maxSupportedRateByHtSta < maxSupportedRate)
1298 maxSupportedRate = maxSupportedRateByHtSta;
1300 if (remoteStationManager->GetNMcsSupported(sta.second) < nMcs)
1302 nMcs = remoteStationManager->GetNMcsSupported(sta.second);
1304 if (remoteStationManager->GetNumberOfSupportedStreams(sta.second) < maxSpatialStream)
1306 maxSpatialStream = remoteStationManager->GetNumberOfSupportedStreams(sta.second);
1311 static_cast<uint16_t
>(maxSupportedRate / 1e6));
1338 const auto bssBandwidth = phy->GetChannelWidth();
1350 ? phy->GetPrimaryChannelNumber(
MHz_u{80})
1351 : phy->GetChannelNumber());
1358 const auto& operatingChannel = phy->GetOperatingChannel();
1359 const auto is80Plus80 =
1362 ? is80Plus80 ? operatingChannel.GetNumber(1)
1363 : phy->GetChannelNumber()
1365 uint8_t maxSpatialStream = phy->GetMaxSupportedRxSpatialStreams();
1366 for (
const auto& sta :
GetLink(linkId).staList)
1368 if (remoteStationManager->GetVhtSupported(sta.second))
1370 if (remoteStationManager->GetNumberOfSupportedStreams(sta.second) < maxSpatialStream)
1372 maxSpatialStream = remoteStationManager->GetNumberOfSupportedStreams(sta.second);
1376 for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
1394 uint8_t maxSpatialStream =
GetWifiPhy(linkId)->GetMaxSupportedRxSpatialStreams();
1395 for (
const auto& sta :
GetLink(linkId).staList)
1397 if (remoteStationManager->GetHeSupported(sta.second))
1399 if (remoteStationManager->GetNumberOfSupportedStreams(sta.second) < maxSpatialStream)
1401 maxSpatialStream = remoteStationManager->GetNumberOfSupportedStreams(sta.second);
1405 for (uint8_t nss = 1; nss <= maxSpatialStream; nss++)
1416 const auto bw = phy->GetChannelWidth();
1417 const auto ch = phy->GetOperatingChannel();
1441 auto maxSpatialStream = phy->GetMaxSupportedRxSpatialStreams();
1442 for (
const auto& sta :
GetLink(linkId).staList)
1444 if (remoteStationManager->GetEhtSupported(sta.second))
1446 if (remoteStationManager->GetNumberOfSupportedStreams(sta.second) < maxSpatialStream)
1448 maxSpatialStream = remoteStationManager->GetNumberOfSupportedStreams(sta.second);
1456 if (
const auto bw = phy->GetChannelWidth();
1478 packet->AddHeader(probeResp);
1512 GetLink(linkId).shortPreambleEnabled);
1514 GetLink(linkId).shortSlotTimeEnabled);
1603 if (remoteStationManager->IsWaitAssocTxOk(to))
1609 NS_ABORT_IF(!remoteStationManager->IsAssocRefused(to));
1611 remoteStationManager->RecordDisassociated(to);
1669 linkIdStaAddrMap[linkId] = to;
1676 "Sending a Multi-Link Element to a single link device");
1677 for (std::size_t idx = 0; idx < mle->GetNPerStaProfileSubelements(); idx++)
1679 auto& perStaProfile = mle->GetPerStaProfile(idx);
1680 if (perStaProfile.HasAssocResponse() &&
1681 perStaProfile.GetAssocResponse().m_statusCode.IsSuccess())
1683 uint8_t otherLinkId = perStaProfile.GetLinkId();
1685 ->GetAffiliatedStaAddress(*staMldAddress);
1687 "No STA to associate with on link " << +otherLinkId);
1688 const auto [it, inserted] = linkIdStaAddrMap.insert({otherLinkId, *staAddress});
1690 "More than one Association Response to MLD "
1691 << *staMldAddress <<
" on link ID " << +otherLinkId);
1696 return linkIdStaAddrMap;
1702 if (linkIdStaAddrMap.empty())
1708 const auto& [linkId, staAddr] = *linkIdStaAddrMap.cbegin();
1712 std::set<uint16_t> aids;
1714 for (
const auto& [
id, link] :
GetLinks())
1716 if (
const auto aid = link->stationManager->GetAssociationId(addr); aid !=
SU_STA_ID)
1722 NS_ABORT_MSG_IF(aids.size() > 1, addr <<
" cannot have more than one AID assigned");
1729 NS_ABORT_MSG_IF(!inserted,
"AID " << aid <<
" already present, cannot be assigned to " << addr);
1731 for (
const auto& [
id, staAddr] : linkIdStaAddrMap)
1735 if (
const auto [it, inserted] = link.staList.emplace(aid, staAddr); inserted)
1738 link.stationManager->SetAssociationId(staAddr, aid);
1740 if (link.stationManager->GetDsssSupported(staAddr) &&
1741 !link.stationManager->GetErpOfdmSupported(staAddr))
1743 link.numNonErpStations++;
1745 if (!link.stationManager->GetHtSupported(staAddr) &&
1746 !link.stationManager->GetStationHe6GhzCapabilities(staAddr))
1748 link.numNonHtStations++;
1757 "AID " << it->first <<
" already assigned to " << staAddr
1758 <<
", could not assign " << aid);
1773 for (std::size_t idx = 0; idx < mle->GetNPerStaProfileSubelements(); idx++)
1775 if (
const auto& perStaProfile = mle->GetPerStaProfile(idx);
1776 perStaProfile.HasAssocResponse() &&
1777 perStaProfile.GetAssocResponse().m_statusCode.IsSuccess())
1779 perStaProfile.GetAssocResponse().m_aid = aid;
1812 SetAid(assoc, linkIdStaAddrMap);
1815 packet->AddHeader(assoc);
1846 hdr.
SetAddr2(link.feManager->GetAddress());
1847 hdr.
SetAddr3(link.feManager->GetAddress());
1926 packet->AddHeader(beacon);
1928 NS_LOG_INFO(
"Generating beacon from " << link.feManager->GetAddress() <<
" linkID " << +linkId);
1941 if (link.shortSlotTimeEnabled)
1955 dtimCount = dtimCount == 0 ? (
m_dtimPeriod - 1) : (dtimCount - 1);
1957 const auto& tim = beacon.Get<
Tim>();
1959 if (tim->m_dtimCount == 0 && tim->m_hasMulticastPending)
1963 link.phy->TraceConnectWithoutContext(
1977 if (psduMap.size() > 1 || !psduMap.cbegin()->second->GetHeader(0).IsBeacon())
1984 std::map<AcIndex, bool> hasFramesToTransmit;
1985 for (
const auto aci : acList)
1988 hasFramesToTransmit[aci] =
GetTxopFor(aci)->HasFramesToTransmit(linkId);
1991 NS_LOG_DEBUG(
"Unblock transmission of group addressed frames on link " << +linkId);
1996 NS_LOG_DEBUG(
"Block transmission of unicast frames on link " << +linkId);
2001 for (
const auto aci : acList)
2003 GetTxopFor(aci)->StartAccessAfterEvent(linkId,
2004 hasFramesToTransmit[aci],
2011 GetLink(linkId).
phy->TraceDisconnectWithoutContext(
2018 for (
const auto aci : acList)
2042 NS_LOG_DEBUG(
"Unicast frames are not blocked on link " << +linkId <<
", nothing to do");
2049 const auto noGroupAddressed =
2050 !mpdu && std::all_of(acList.cbegin(), acList.cend(), [=,
this](
const auto aci) {
2051 return (GetTxopQueue(aci)->PeekFirstAvailable(linkId) == nullptr);
2053 const auto lastGroupAddressed =
2054 mpdu && mpdu->GetHeader().GetAddr1().IsGroup() && !mpdu->GetHeader().IsMoreData();
2056 if (noGroupAddressed || lastGroupAddressed)
2058 NS_LOG_DEBUG((noGroupAddressed ?
"No group addressed frames queued for link "
2059 :
"Sent a group addressed frame with More Data=0 on link ")
2062 std::map<AcIndex, bool> hasFramesToTransmit;
2063 for (
const auto aci : acList)
2066 hasFramesToTransmit[aci] =
GetTxopFor(aci)->HasFramesToTransmit(linkId);
2082 for (
const auto aci : acList)
2084 GetTxopFor(aci)->StartAccessAfterEvent(linkId,
2085 hasFramesToTransmit[aci],
2091 for (
const auto aci : acList)
2110 hdr.
SetAddr2(link.feManager->GetAddress());
2111 hdr.
SetAddr3(link.feManager->GetAddress());
2125 fils.
m_fdCap->SetOpChannelWidth(link.phy->GetChannelWidth());
2126 fils.
m_fdCap->SetMaxNss(std::min(link.phy->GetMaxSupportedTxSpatialStreams(),
2127 link.phy->GetMaxSupportedRxSpatialStreams()));
2128 fils.
m_fdCap->SetStandard(link.phy->GetStandard());
2134 packet->AddHeader(fils);
2135 packet->AddHeader(actionHdr);
2149 if (!fdBeaconInterval.IsStrictlyPositive())
2151 NS_LOG_DEBUG(
"Sending FILS Discovery/unsolicited Probe Response disabled");
2156 for (uint8_t count = 1; count < (
m_beaconInterval / fdBeaconInterval).GetHigh(); ++count)
2184 mpdu->GetPacket()->PeekHeader(assocResp);
2185 auto aid = assocResp.
m_aid;
2197 if (
auto staMldAddress =
2199 staMldAddress.has_value())
2212 for (uint8_t i = 0; i <
GetNLinks(); i++)
2215 if (
auto staAddress = stationManager->GetAffiliatedStaAddress(*staMldAddress);
2216 staAddress.has_value() && i != *linkId &&
2217 stationManager->IsWaitAssocTxOk(*staAddress))
2220 <<
" associated with STA=" << *staAddress);
2221 stationManager->RecordGotAssocTxOk(*staAddress);
2231 if (
auto extendedCapabilities =
2236 const auto isGcrCapable =
2237 extendedCapabilities && extendedCapabilities->m_robustAvStreaming;
2245 action.protectedEhtAction ==
2255 eventIt->second.PeekEventImpl()->Invoke();
2256 eventIt->second.Cancel();
2276 <<
" association failed with STA=" << hdr.
GetAddr1());
2280 if (
auto staMldAddress =
2282 staMldAddress.has_value())
2285 for (uint8_t i = 0; i <
GetNLinks(); i++)
2288 if (
auto staAddress = stationManager->GetAffiliatedStaAddress(*staMldAddress);
2289 staAddress.has_value() && i != *linkId &&
2290 stationManager->IsWaitAssocTxOk(*staAddress))
2293 <<
" association failed with STA=" << *staAddress);
2294 stationManager->RecordGotAssocTxFailed(*staAddress);
2301 mpdu->GetPacket()->PeekHeader(assocResp);
2302 auto aid = assocResp.
m_aid;
2304 for (
const auto& [
id, lnk] :
GetLinks())
2307 link.staList.erase(aid);
2320 if (!staInPsMode && mpdu->GetHeader().IsPowerManagement())
2325 else if (staInPsMode && !mpdu->GetHeader().IsPowerManagement())
2338 if (rsm->IsInPsMode(staAddr))
2340 NS_LOG_DEBUG(staAddr <<
" is already in PS mode, nothing to do");
2344 rsm->SetPsMode(staAddr,
true);
2347 NS_LOG_DEBUG(
"Block destination " << staAddr <<
" on link " << +linkId);
2348 auto staMldAddr = rsm->GetMldAddress(staAddr).value_or(staAddr);
2351 if (
GetLink(linkId).nStationsInPsMode++ == 0)
2355 NS_LOG_DEBUG(
"Block transmission of group addressed frames on link " << +linkId);
2375 NS_LOG_DEBUG(staAddr <<
" is already in active mode, nothing to do");
2382 NS_LOG_DEBUG(
"Unblock destination " << staAddr <<
" on link " << +linkId);
2386 if (--
GetLink(linkId).nStationsInPsMode == 0)
2390 NS_LOG_DEBUG(
"Unblock transmission of group addressed frames on link " << +linkId);
2403std::optional<uint8_t>
2406 for (uint8_t linkId = 0; linkId <
GetNLinks(); linkId++)
2414 return std::nullopt;
2425std::optional<Mac48Address>
2431 return staIt->second;
2433 return std::nullopt;
2441 const WifiMacHeader* hdr = &mpdu->GetOriginal()->GetHeader();
2446 std::optional<uint8_t> apLinkId;
2448 (apLinkId =
IsAssociated(mpdu->GetHeader().GetAddr2())) &&
2467 <<
", size=" << packet->GetSize());
2483 NS_LOG_DEBUG(
"forwarding frame from=" << from <<
", to=" << to);
2520 else if (hdr->
IsMgt())
2543 packet->PeekHeader(probeRequestHeader);
2544 const auto& ssid = probeRequestHeader.Get<
Ssid>();
2545 if (ssid ==
GetSsid() || ssid->IsBroadcast())
2547 NS_LOG_DEBUG(
"Probe request received from " << from <<
": send probe response");
2564 <<
" request received from " << from
2565 << ((
GetNLinks() > 1) ?
" on link ID " + std::to_string(linkId) :
""));
2572 packet->PeekHeader(assocReq);
2576 packet->PeekHeader(reassocReq);
2591 NS_LOG_DEBUG(
"Station " << from <<
" is not associated");
2594 const auto address =
2602 for (
const auto& [
id, lnk] :
GetLinks())
2605 auto it = link.staList.find(aid);
2607 if (it == link.staList.cend())
2614 link.staList.erase(it);
2620 link.numNonErpStations--;
2625 link.numNonHtStations--;
2633 auto pkt = mpdu->GetPacket()->Copy();
2636 action.protectedEhtAction ==
2642 pkt->RemoveHeader(frame);
2668 auto failure = [&](
const std::string& msg) ->
bool {
2669 NS_LOG_DEBUG(
"Association Request from " << from <<
" refused: " << msg);
2670 remoteStationManager->RecordAssocRefused(from);
2675 auto recvAssocRequest = [&](
auto&& frameRefWrapper) ->
bool {
2676 const auto& frame = frameRefWrapper.get();
2681 remoteStationManager->AddSupportedPhyPreamble(from, capabilities.
IsShortPreamble());
2682 NS_ASSERT(frame.template Get<SupportedRates>());
2684 frame.template Get<ExtendedSupportedRatesIE>()};
2686 if (rates.GetNRates() == 0)
2688 return failure(
"STA's supported rate set not compatible with our Basic Rate set");
2694 const auto& htCapabilities = frame.template Get<HtCapabilities>();
2695 if (htCapabilities.has_value() && htCapabilities->IsSupportedMcs(0))
2697 for (uint8_t i = 0; i < remoteStationManager->GetNBasicMcs(); i++)
2699 WifiMode mcs = remoteStationManager->GetBasicMcs(i);
2700 if (!htCapabilities->IsSupportedMcs(mcs.
GetMcsValue()))
2702 return failure(
"HT STA does not support all MCSs in Basic MCS Set");
2710 const auto& vhtCapabilities = frame.template Get<VhtCapabilities>();
2711 if (vhtCapabilities.has_value() && vhtCapabilities->GetVhtCapabilitiesInfo() != 0)
2713 for (uint8_t i = 0; i < remoteStationManager->GetNBasicMcs(); i++)
2715 WifiMode mcs = remoteStationManager->GetBasicMcs(i);
2716 if (!vhtCapabilities->IsSupportedTxMcs(mcs.
GetMcsValue()))
2718 return failure(
"VHT STA does not support all MCSs in Basic MCS Set");
2726 const auto& heCapabilities = frame.template Get<HeCapabilities>();
2727 if (heCapabilities.has_value() && heCapabilities->GetSupportedMcsAndNss() != 0)
2729 for (uint8_t i = 0; i < remoteStationManager->GetNBasicMcs(); i++)
2731 WifiMode mcs = remoteStationManager->GetBasicMcs(i);
2732 if (!heCapabilities->IsSupportedTxMcs(mcs.
GetMcsValue()))
2734 return failure(
"HE STA does not support all MCSs in Basic MCS Set");
2740 if (
const auto& he6GhzCapabilities = frame.template Get<He6GhzBandCapabilities>())
2742 remoteStationManager->AddStationHe6GhzCapabilities(from, *he6GhzCapabilities);
2752 if (
const auto& tidLinkMapping = frame.template Get<TidToLinkMapping>();
2753 !tidLinkMapping.empty())
2761 if (tidLinkMapping.size() > 2)
2763 return failure(
"More than two TID-to-Link Mapping IEs");
2768 bool bothDirIfOneTlm =
2769 tidLinkMapping.size() != 1 ||
2776 bool distinctDirsIfTwoTlms =
2777 tidLinkMapping.size() != 2 ||
2780 tidLinkMapping[0].m_control.direction !=
2781 tidLinkMapping[1].m_control.direction);
2783 if (!bothDirIfOneTlm || !distinctDirsIfTwoTlms)
2785 return failure(
"Incorrect directions in TID-to-Link Mapping IEs");
2788 if (ehtConfig->m_tidLinkMappingSupport ==
2791 return failure(
"TID-to-Link Mapping negotiation not supported");
2799 for (uint8_t tid = 0; tid < 8; tid++)
2803 mapping.emplace(tid, std::move(linkSet));
2811 switch (tidLinkMapping[0].m_control.direction)
2814 getMapping(tidLinkMapping.at(0), dlMapping);
2815 ulMapping = dlMapping;
2818 getMapping(tidLinkMapping.at(0), dlMapping);
2819 getMapping(tidLinkMapping.at(1), ulMapping);
2822 getMapping(tidLinkMapping.at(0), ulMapping);
2823 getMapping(tidLinkMapping.at(1), dlMapping);
2827 if (ehtConfig->m_tidLinkMappingSupport ==
2831 return failure(
"Mapping TIDs to distinct link sets is incompatible with "
2832 "negotiation support of 1");
2836 const auto& mle = frame.template Get<MultiLinkElement>();
2838 "Multi-Link Element not present in an Association Request including "
2839 "TID-to-Link Mapping element(s)");
2840 auto mldAddr = mle->GetMldMacAddress();
2852 for (
const auto& mode : phy->GetModeList())
2854 if (rates.IsSupportedRate(mode.GetDataRate(phy->GetChannelWidth())))
2856 remoteStationManager->AddSupportedMode(from, mode);
2859 if (
GetErpSupported(linkId) && remoteStationManager->GetErpOfdmSupported(from) &&
2862 remoteStationManager->AddSupportedErpSlotTime(from,
true);
2866 const auto& htCapabilities = frame.template Get<HtCapabilities>();
2867 if (htCapabilities.has_value())
2869 remoteStationManager->AddStationHtCapabilities(from, *htCapabilities);
2871 const auto& extendedCapabilities = frame.template Get<ExtendedCapabilities>();
2872 if (extendedCapabilities.has_value())
2874 remoteStationManager->AddStationExtendedCapabilities(from, *extendedCapabilities);
2879 const auto& vhtCapabilities = frame.template Get<VhtCapabilities>();
2882 if (vhtCapabilities.has_value() &&
2883 vhtCapabilities->GetRxHighestSupportedLgiDataRate() > 0)
2885 remoteStationManager->AddStationVhtCapabilities(from, *vhtCapabilities);
2888 if (vhtCapabilities->IsSupportedTxMcs(mcs.GetMcsValue()))
2890 remoteStationManager->AddSupportedMcs(from, mcs);
2898 const auto& heCapabilities = frame.template Get<HeCapabilities>();
2899 if (heCapabilities.has_value() && heCapabilities->GetSupportedMcsAndNss() != 0)
2901 remoteStationManager->AddStationHeCapabilities(from, *heCapabilities);
2904 if (heCapabilities->IsSupportedTxMcs(mcs.GetMcsValue()))
2906 remoteStationManager->AddSupportedMcs(from, mcs);
2914 if (
const auto& ehtCapabilities = frame.template Get<EhtCapabilities>())
2916 remoteStationManager->AddStationEhtCapabilities(from, *ehtCapabilities);
2921 remoteStationManager->AddSupportedMcs(from, mcs);
2926 NS_LOG_DEBUG(
"Association Request from " << from <<
" accepted");
2927 remoteStationManager->RecordWaitAssocTxOk(from);
2931 return std::visit(recvAssocRequest, assoc);
2940 auto recvMle = [&](
auto&& frame) {
2941 const auto& mle = frame.get().template Get<MultiLinkElement>();
2943 if (!mle.has_value())
2948 auto mleCommonInfo = std::make_shared<CommonInfoBasicMle>(mle->GetCommonInfoBasic());
2951 for (std::size_t i = 0; i < mle->GetNPerStaProfileSubelements(); i++)
2953 auto& perStaProfile = mle->GetPerStaProfile(i);
2954 if (!perStaProfile.HasStaMacAddress())
2957 <<
"] Cannot setup a link if the STA MAC address is missing");
2960 uint8_t newLinkId = perStaProfile.GetLinkId();
2961 if (newLinkId == linkId || newLinkId >=
GetNLinks())
2963 NS_LOG_DEBUG(
"[i=" << i <<
"] Link ID " << newLinkId <<
" not valid");
2966 if (!perStaProfile.HasAssocRequest() && !perStaProfile.HasReassocRequest())
2968 NS_LOG_DEBUG(
"[i=" << i <<
"] No (Re)Association Request frame body present");
2973 perStaProfile.GetStaMacAddress(),
2976 perStaProfile.GetStaMacAddress(),
2981 std::visit(recvMle, assoc);
2991 if (!ehtConfiguration || !ehtConfiguration->m_emlsrActivated)
2994 "Received an EML Operating Mode Notification frame but EMLSR is not activated");
3001 auto emlCapabilities =
3003 NS_ASSERT_MSG(emlCapabilities,
"EML Capabilities not stored for STA " << sender);
3007 emlCapabilities->get().emlsrTransitionDelay = frame.
m_emlsrParamUpdate->transitionDelay;
3023 NS_ASSERT_MSG(psduMap.size() == 1 && psduMap.begin()->second->GetNMpdus() == 1 &&
3024 psduMap.begin()->second->GetHeader(0).IsAck(),
3025 "Expected a Normal Ack after EML Notification frame");
3042 phy->TraceConnectWithoutContext(
"PhyTxPsduBegin", cb);
3044 [=]() { phy->TraceDisconnectWithoutContext(
"PhyTxPsduBegin", cb); });
3063 ehtFem->SendEmlOmn(sender, frame);
3074 NS_ASSERT_MSG(mldAddress,
"No MLD address stored for STA " << sender);
3078 for (uint8_t
id = 0;
id <
GetNLinks();
id++)
3087 if (!emlsrLinks.empty())
3102 std::find(emlsrLinks.cbegin(), emlsrLinks.cend(),
id) != emlsrLinks.cend();
3139 auto from = i.second.GetSourceAddr();
3140 auto to = i.second.GetDestinationAddr();
3144 NS_LOG_DEBUG(
"forwarding QoS frame from=" << from <<
", to=" << to);
3145 WifiMac::Enqueue(i.first->Copy(), to, from, mpdu->GetHeader().GetQosTid());
3158 for (uint8_t linkId = 0; linkId <
GetNLinks(); ++linkId)
3163 uint64_t jitterUs{0};
3168 "Jitter (" << value <<
") must be between 0 and 1");
3172 NS_LOG_DEBUG(
"Scheduling initial beacon for access point "
3173 <<
GetAddress() <<
" at time " << jitterUs <<
"us");
3199 return useProtection;
3213 for (uint16_t nextAid = startAid; nextAid <= maxAid; ++nextAid)
3215 if (std::none_of(links.cbegin(), links.cend(), [&](
auto&& idLinkPair) {
3216 return GetStaList(idLinkPair.first).contains(nextAid);
3226const std::map<uint16_t, Mac48Address>&
3246 return it->second.value;
3266 uint8_t maxSize = 0;
3269 for (uint8_t tid = 0; tid < 8; tid++)
3274 maxSize = std::max(maxSize, size);
3291 return GetQosTxop(tid)->GetBaManager()->IsGcrAgreementEstablished(
3294 m_gcrManager->GetMemberStasForGroupAddress(groupAddress));
void SendAssocResp(Mac48Address to, bool isReassoc, uint8_t linkId)
Forward an association or a reassociation response packet to the DCF/EDCA.
uint16_t GetAssociationId(Mac48Address addr, uint8_t linkId) const
std::unique_ptr< LinkEntity > CreateLinkEntity() const override
Create a LinkEntity object.
void RespondToEmlOmn(MgtEmlOmn frame, const Mac48Address &sender, uint8_t linkId)
Respond to the EML Operating Mode Notification frame received from the given station on the given lin...
Ptr< Txop > m_beaconTxop
Dedicated Txop for beacons.
void SetBeaconGeneration(bool enable)
Enable or disable beacon generation of the AP.
void ParseReportedStaInfo(const AssocReqRefVariant &assoc, Mac48Address from, uint8_t linkId)
Given a (Re)Association Request frame body containing a Multi-Link Element, check if a link can be se...
void UpdateShortSlotTimeEnabled(uint8_t linkId)
Update whether short slot time should be enabled or not in the BSS corresponding to the given link.
void DoCompleteConfig() override
Allow subclasses to complete the configuration of the MAC layer components.
const std::map< uint16_t, Mac48Address > & GetStaList(uint8_t linkId) const
Get a const reference to the map of associated stations on the given link.
void DoDispose() override
Destructor implementation.
void SetBeaconInterval(Time interval)
bool ReceiveAssocRequest(const AssocReqRefVariant &assoc, const Mac48Address &from, uint8_t linkId)
Check whether the supported rate set included in the received (Re)Association Request frame is compat...
std::map< uint8_t, Mac48Address > LinkIdStaAddrMap
Map of (link ID, remote STA address) of the links to setup.
Ptr< RandomVariableStream > m_beaconJitter
UniformRandomVariable used to randomize the time of the first beacon.
std::map< Mac48Address, EventId > m_transitionTimeoutEvents
transition timeout events running for EMLSR clients
UintAccessParamsMap m_cwMaxsForSta
Per-AC CW max values to advertise to stations.
void ScheduleFilsDiscOrUnsolProbeRespFrames(uint8_t linkId)
Schedule the transmission of FILS Discovery frames or unsolicited Probe Response frames on the given ...
Mac48Address DoGetLocalAddress(const Mac48Address &remoteAddr) const override
This method is called if this device is an MLD to determine the MAC address of the affiliated STA use...
CapabilityInformation GetCapabilities(uint8_t linkId) const
Return the Capability information of the current AP for the given link.
Ptr< ApEmlsrManager > m_apEmlsrManager
AP EMLSR Manager.
Ptr< WifiMpdu > GetBufferedMmpduFor(Mac48Address address, uint8_t linkId=WIFI_LINKID_UNDEFINED) const
Check whether the AP MLD has buffered MMPDUs for the given destination because non-AP STAs operating ...
void EnqueueProbeResp(const MgtProbeResponseHeader &probeResp, Mac48Address to, uint8_t linkId)
Send a packet prepared using the given Probe Response to the given receiver on the given link.
void TxGroupAddrFramesAfterDtim(uint8_t linkId, WifiConstPsduMap psduMap, WifiTxVector, Watt_u)
This function is connected to the PhyTxPsduBegin PHY trace source when enqueuing a Beacon frame conta...
bool CanForwardPacketsTo(Mac48Address to) const override
Return true if packets can be forwarded to the given destination, false otherwise.
bool m_enableNonErpProtection
Flag whether protection mechanism is used or not when non-ERP STAs are present within the BSS.
bool HasMoreDataAfter(Ptr< const WifiMpdu > mpdu, uint8_t linkId) const
Return whether at least one additional buffered unit is present for the same STA after transmitting t...
uint8_t m_dtimPeriod
DTIM Period.
EdcaParameterSet GetEdcaParameterSet(uint8_t linkId) const
Return the EDCA Parameter Set of the current AP for the given link.
void StaSwitchingToActiveModeOrDeassociated(const Mac48Address &staAddr, uint8_t linkId)
Perform the necessary actions when a given station that is in powersave mode deassociates or switches...
HtOperation GetHtOperation(uint8_t linkId) const
Return the HT operation of the current AP for the given link.
std::optional< Mac48Address > GetMldOrLinkAddressByAid(uint16_t aid) const
Ptr< GcrManager > m_gcrManager
GCR Manager.
void UpdateShortPreambleEnabled(uint8_t linkId)
Update whether short preamble should be enabled or not in the BSS corresponding to the given link.
uint16_t GetNextAssociationId() const
void TxOk(Ptr< const WifiMpdu > mpdu)
The packet we sent was successfully received by the receiver (i.e.
Time m_fdBeaconIntervalNon6GHz
Time elapsing between a beacon and FILS Discovery (FD) frame or between two FD frames on 2....
Tim GetTim(uint8_t linkId) const
Return the TIM for the current AP to transmit on the given link.
std::map< uint16_t, Mac48Address > m_aidToMldOrLinkAddress
Maps AIDs to MLD addresses (for MLDs) or link addresses (in case of single link devices).
TracedCallback< uint16_t, Mac48Address > m_deAssocLogger
deassociation logger
void Enqueue(Ptr< WifiMpdu > mpdu, Mac48Address to, Mac48Address from) override
LinkIdStaAddrMap GetLinkIdStaAddrMap(MgtAssocResponseHeader &assoc, const Mac48Address &to, uint8_t linkId)
Get a map of (link ID, remote STA address) of the links to setup.
void SetAid(MgtAssocResponseHeader &assoc, const LinkIdStaAddrMap &linkIdStaAddrMap)
Set the AID field of the given Association Response frame.
void EmlOmnExchangeCompleted(const MgtEmlOmn &frame, const Mac48Address &sender, uint8_t linkId)
Take necessary actions upon completion of an exchange of EML Operating Mode Notification frames.
static Ptr< const AttributeChecker > GetTimeAccessParamsChecker()
Get a checker for the TxopLimitsForSta attribute, which can be used to deserialize an ACI-indexed map...
bool m_enableBeaconGeneration
Flag whether beacons are being generated.
Time m_beaconInterval
Beacon interval.
Ptr< GcrManager > GetGcrManager() const
MultiLinkElement GetMultiLinkElement(uint8_t linkId, WifiMacType frameType, const Mac48Address &to=Mac48Address::GetBroadcast(), const std::optional< MultiLinkElement > &mlProbeReqMle=std::nullopt)
Return the Multi-Link Element that the current AP includes in the management frames of the given type...
bool m_enableBeaconJitter
Flag whether the first beacon should be generated at random time.
std::unordered_map< WifiAddressTidPair, BsrType, WifiAddressTidHash > m_bufferStatus
Per (MAC address, TID) buffer status reports.
PairValue< EnumValue< AcIndex >, AttributeContainerValue< TimeValue, ',', std::vector > > TimeAccessParamsPairValue
AttributeValue type of a pair (ACI, access parameters of type Time).
DsssParameterSet GetDsssParameterSet(uint8_t linkId) const
Return the DSSS Parameter Set that we support on the given link.
void ReceiveEmlOmn(const MgtEmlOmn &frame, const Mac48Address &sender, uint8_t linkId)
Process the EML Operating Mode Notification frame received from the given station on the given link.
TracedCallback< uint16_t, Mac48Address > m_assocLogger
association logger
uint8_t m_grpAddrBuIndicExp
Group Addressed BU Indication Exponent of EHT Operation IE.
Time GetBeaconInterval() const
static TypeId GetTypeId()
Get the type ID.
std::optional< ReducedNeighborReport > GetReducedNeighborReport(uint8_t linkId) const
Return the Reduced Neighbor Report (RNR) element that the current AP sends on the given link,...
Ptr< ApEmlsrManager > GetApEmlsrManager() const
Time m_fdBeaconInterval6GHz
Time elapsing between a beacon and FILS Discovery (FD) frame or between two FD frames on 6GHz links.
uint8_t GetMaxBufferStatus(Mac48Address address) const
Return the maximum among the values of the Queue Size subfield of the last QoS Data or QoS Null frame...
Time m_bsrLifetime
Lifetime of Buffer Status Reports.
bool HasBufferedGroupcast(uint8_t linkId) const
Check whether the AP MLD has buffered frames with a destination groupcast address to be sent on the g...
ApLinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId) override
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
std::size_t GetNStationsInPsMode(linkId_t linkId) const
Get the number of STAs associated on the given link that are in PowerSave mode.
void CheckGroupAddrFramesAfterDtimDone(uint8_t linkId, Ptr< const WifiMpdu > mpdu=nullptr) const
Check whether the AP is done with the transmission of group addressed frames after a DTIM transmitted...
uint8_t GetBufferStatus(uint8_t tid, Mac48Address address) const
Return the value of the Queue Size subfield of the last QoS Data or QoS Null frame received from the ...
EhtOperation GetEhtOperation(uint8_t linkId) const
Return the EHT operation of the current AP for the given link.
bool UseGcr(const WifiMacHeader &hdr) const
Return whether GCR is used to transmit a packet.
bool m_sendUnsolProbeResp
send unsolicited Probe Response instead of FILS Discovery
ErpInformation GetErpInformation(uint8_t linkId) const
Return the ERP information of the current AP for the given link.
void SetLinkUpCallback(Callback< void > linkUp) override
VhtOperation GetVhtOperation(uint8_t linkId) const
Return the VHT operation of the current AP for the given link.
Ptr< WifiMpdu > GetBufferedDataFor(Mac48Address address, uint8_t linkId=WIFI_LINKID_UNDEFINED) const
Check whether the AP MLD has buffered (QoS) data frame(s) for the given destination because non-AP ST...
void TxFailed(WifiMacDropReason timeoutReason, Ptr< const WifiMpdu > mpdu)
The packet we sent was successfully received by the receiver (i.e.
HeOperation GetHeOperation(uint8_t linkId) const
Return the HE operation of the current AP for the given link.
bool IsGcrBaAgreementEstablishedWithAllMembers(const Mac48Address &groupAddress, uint8_t tid) const
Check if a GCR Block Ack agreement has been successfully established with all members of its group.
void SetBufferStatus(uint8_t tid, Mac48Address address, uint8_t size)
Store the value of the Queue Size subfield of the last QoS Data or QoS Null frame received from the s...
TimeAccessParamsMap m_txopLimitsForSta
Per-AC TXOP limits values to advertise to stations.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
PairValue< EnumValue< AcIndex >, AttributeContainerValue< UintegerValue, ',', std::vector > > UintAccessParamsPairValue
AttributeValue type of a pair (ACI, access parameters of type unsigned integer).
Ptr< Txop > GetTxopFor(AcIndex ac) const override
Get the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer,...
std::optional< MuEdcaParameterSet > GetMuEdcaParameterSet() const
Return the MU EDCA Parameter Set of the current AP, if one needs to be advertised.
void ProcessPowerManagementFlag(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
Process the Power Management bit in the Frame Control field of an MPDU successfully received on the g...
void DeaggregateAmsduAndForward(Ptr< const WifiMpdu > mpdu) override
This method is called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
bool SupportsSendFrom() const override
MgtAssocResponseHeader GetAssocResp(Mac48Address to, uint8_t linkId)
Get the Association Response frame to send on a given link.
void SetGcrManager(Ptr< GcrManager > gcrManager)
Set the GCR Manager.
Ptr< WifiMpdu > GetFilsDiscovery(uint8_t linkId) const
Get the FILS Discovery frame to send on the given link.
static Ptr< const AttributeChecker > GetUintAccessParamsChecker()
Get a checker for the CwMinsForSta, CwMaxsForSta and AifsnsForSta attributes, which can be used to de...
void DoInitialize() override
Initialize() implementation.
std::optional< uint8_t > IsAssociated(const Mac48Address &address) const
Get the ID of a link (if any) that has been setup with the station having the given MAC address.
void SendOneBeacon(uint8_t linkId)
Forward a beacon packet to the beacon special DCF for transmission on the given link.
void SetApEmlsrManager(Ptr< ApEmlsrManager > apEmlsrManager)
Set the AP EMLSR Manager.
bool GetUseNonErpProtection(uint8_t linkId) const
Return whether protection for non-ERP stations is used in the BSS corresponding to the given link.
MgtProbeResponseHeader GetProbeRespProfile(uint8_t linkId) const
Get Probe Response Per-STA Profile for the given link.
UintAccessParamsMap m_cwMinsForSta
Per-AC CW min values to advertise to stations.
UintAccessParamsMap m_aifsnsForSta
Per-AC AIFS values to advertise to stations.
MgtProbeResponseHeader GetProbeResp(uint8_t linkId, const std::optional< MultiLinkElement > &reqMle)
Get Probe Response based on the given Probe Request Multi-link Element (if any).
void StaSwitchingToPsMode(const Mac48Address &staAddr, uint8_t linkId)
Perform the necessary actions when a given station that is in active mode switches to powersave mode.
AllSupportedRates GetSupportedRates(uint8_t linkId) const
Return an instance of SupportedRates that contains all rates that we support for the given link (incl...
A container for one type of attribute.
AttributeValue implementation for Boolean.
Base class for Callback class.
void SetCurrentChannel(uint8_t currentChannel)
Set the Current Channel field in the DsssParameterSet information element.
void SetViTxopLimit(uint16_t txop)
Set the AC_VI TXOP Limit field in the EdcaParameterSet information element.
void SetViAifsn(uint8_t aifsn)
Set the AC_VI AIFSN field in the EdcaParameterSet information element.
void SetVoAci(uint8_t aci)
Set the AC_VO ACI field in the EdcaParameterSet information element.
void SetVoCWmax(uint32_t cwMax)
Set the AC_VO CWmax field in the EdcaParameterSet information element.
void SetViCWmin(uint32_t cwMin)
Set the AC_VI CWmin field in the EdcaParameterSet information element.
void SetVoTxopLimit(uint16_t txop)
Set the AC_VO TXOP Limit field in the EdcaParameterSet information element.
void SetVoAifsn(uint8_t aifsn)
Set the AC_VO AIFSN field in the EdcaParameterSet information element.
void SetQosInfo(uint8_t qosInfo)
Set the QoS Info field in the EdcaParameterSet information element.
void SetBkCWmin(uint32_t cwMin)
Set the AC_BK CWmin field in the EdcaParameterSet information element.
void SetViAci(uint8_t aci)
Set the AC_VI ACI field in the EdcaParameterSet information element.
void SetViCWmax(uint32_t cwMax)
Set the AC_VI CWmax field in the EdcaParameterSet information element.
void SetVoCWmin(uint32_t cwMin)
Set the AC_VO CWmin field in the EdcaParameterSet information element.
void SetBeTxopLimit(uint16_t txop)
Set the AC_BE TXOP Limit field in the EdcaParameterSet information element.
void SetBeCWmax(uint32_t cwMax)
Set the AC_BE CWmax field in the EdcaParameterSet information element.
void SetBeAci(uint8_t aci)
Set the AC_BE ACI field in the EdcaParameterSet information element.
void SetBkCWmax(uint32_t cwMax)
Set the AC_BK CWmax field in the EdcaParameterSet information element.
void SetBkTxopLimit(uint16_t txop)
Set the AC_BK TXOP Limit field in the EdcaParameterSet information element.
void SetBkAifsn(uint8_t aifsn)
Set the AC_BK AIFSN field in the EdcaParameterSet information element.
void SetBeCWmin(uint32_t cwMin)
Set the AC_BE CWmin field in the EdcaParameterSet information element.
void SetBkAci(uint8_t aci)
Set the AC_BK ACI field in the EdcaParameterSet information element.
void SetBeAifsn(uint8_t aifsn)
Set the AC_BE AIFSN field in the EdcaParameterSet information element.
The IEEE 802.11be EHT Capabilities.
EHT Operation Information Element.
void SetMaxTxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
Set the max Tx NSS for input MCS index range.
void SetMaxRxNss(uint8_t maxNss, uint8_t mcsStart, uint8_t mcsEnd)
Set the max Rx NSS for input MCS index range.
EhtOpParams m_params
EHT Operation Parameters.
std::optional< EhtOpInfo > m_opInfo
EHT Operation Information.
Hold variables of type enum.
void Cancel()
This method is syntactic sugar for the ns3::Simulator::Cancel method.
The Extended Capabilities Information Element.
The Extended Supported Rates Information Element.
The HE 6 GHz Band Capabilities (IEEE 802.11ax-2021 9.4.2.263).
The IEEE 802.11ax HE Capabilities.
The HE Operation Information Element.
OptFieldWithPresenceInd< OpInfo6GHz > m_6GHzOpInfo
6 GHz Operation Information field
void SetMaxHeMcsPerNss(uint8_t nss, uint8_t maxHeMcs)
Set the Basic HE-MCS and NSS field in the HE Operation information element by specifying the pair (ns...
BssColorInfo m_bssColorInfo
BSS Color Information field.
The HT Capabilities Information Element.
The HT Operation Information Element.
void SetObssNonHtStasPresent(uint8_t obssNonHtStasPresent)
Set the OBSS non HT STAs present.
void SetRifsMode(uint8_t rifsMode)
Set the RIFS mode.
void SetSecondaryChannelOffset(uint8_t secondaryChannelOffset)
Set the secondary channel offset.
void SetPcoActive(uint8_t pcoActive)
Set the PCO active.
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
void SetHtProtection(uint8_t htProtection)
Set the HT protection.
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum number spatial streams.
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
void SetDualBeacon(uint8_t dualBeacon)
Set the dual beacon.
void SetNonGfHtStasPresent(uint8_t nonGfHtStasPresent)
Set the non GF HT STAs present.
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
void SetLSigTxopProtectionFullSupport(uint8_t lSigTxopProtectionFullSupport)
Set the LSIG TXOP protection full support.
void SetStaChannelWidth(uint8_t staChannelWidth)
Set the STA channel width.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
void SetPrimaryChannel(uint8_t ctrl)
Set the Primary Channel field in the HT Operation information element.
void SetDualCtsProtection(uint8_t dualCtsProtection)
Set the dual CTS protection.
void SetPhase(uint8_t pcoPhase)
Set the PCO phase.
void SetStbcBeacon(uint8_t stbcBeacon)
Set the STBC beacon.
static Mac48Address GetBroadcast()
Implement the header for Action frames of type EML Operating Mode Notification.
EmlControl m_emlControl
EML Control field.
std::optional< EmlsrParamUpdate > m_emlsrParamUpdate
EMLSR Parameter Update field.
std::list< uint8_t > GetLinkBitmap() const
The MU EDCA Parameter Set.
void SetMuCwMin(uint8_t aci, uint16_t cwMin)
Set the ECWmin subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
void SetMuEdcaTimer(uint8_t aci, Time timer)
Set the MU EDCA Timer field in the MU AC Parameter Record field corresponding to the given AC Index (...
void SetMuAifsn(uint8_t aci, uint8_t aifsn)
Set the AIFSN subfield of the ACI/AIFSN field in the MU AC Parameter Record field corresponding to th...
void SetQosInfo(uint8_t qosInfo)
Set the QoS Info field in the MuEdcaParameterSet information element.
Time GetMuEdcaTimer(uint8_t aci) const
Get the MU EDCA Timer value encoded in the MU AC Parameter Record field corresponding to the given AC...
void SetMuCwMax(uint8_t aci, uint16_t cwMax)
Set the ECWmax subfield of the ECWmin/ECWmax field in the MU AC Parameter Record field corresponding ...
void SetLinkId(uint8_t linkId)
Set the Link ID subfield in the STA Control field.
void AddPerStaProfileSubelement()
Add a Per-STA Profile Subelement in the Link Info field.
void SetEmlsrSupported(bool supported)
Set the EMLSR Support subfield of the EML Capabilities subfield in the Common Info field to 1 if EMLS...
void SetBssParamsChangeCount(uint8_t count)
Set the BSS Parameters Change Count subfield in the Common Info field.
void SetLinkIdInfo(uint8_t linkIdInfo)
Set the Link ID Info subfield in the Common Info field.
CommonInfoBasicMle & GetCommonInfoBasic()
PerStaProfileSubelement & GetPerStaProfile(std::size_t i)
Get a reference to the i-th Per-STA Profile Subelement in the Link Info field.
void SetMldMacAddress(Mac48Address address)
Set the MLD MAC Address subfield in the Common Info field.
void SetTransitionTimeout(Time timeout)
Set the Transition Timeout subfield of the EML Capabilities subfield in the Common Info field.
std::size_t GetNPerStaProfileSubelements() const
Return the number of Per-STA Profile Subelement in the Link Info field.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
The Reduced Neighbor Report element.
std::size_t GetNNbrApInfoFields() const
Get the number of Neighbor AP Information fields.
void SetShortSsid(std::size_t nbrApInfoId, std::size_t index, uint32_t shortSsid)
Set the Short SSID field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
void SetBssid(std::size_t nbrApInfoId, std::size_t index, Mac48Address bssid)
Set the BSSID field of the i-th TBTT Information field of the given Neighbor AP Information field.
void SetPsd20MHz(std::size_t nbrApInfoId, std::size_t index, uint8_t psd20MHz)
Set the 20 MHz PSD field of the i-th TBTT Information field of the given Neighbor AP Information fiel...
void AddNbrApInfoField()
Add a Neighbor AP Information field.
void SetBssParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t bssParameters)
Set the BSS Parameters field of the i-th TBTT Information field of the given Neighbor AP Information ...
void SetMldParameters(std::size_t nbrApInfoId, std::size_t index, const MldParameters &mldParams)
Set the MLD Parameters subfield of the i-th TBTT Information field of the given Neighbor AP Informati...
void AddTbttInformationField(std::size_t nbrApInfoId)
Add a TBTT Information fields to the TBTT Information Set field of the given Neighbor AP Information ...
void SetOperatingChannel(std::size_t nbrApInfoId, const WifiPhyOperatingChannel &channel)
Set the Operating Class and the Channel Number fields of the given Neighbor AP Information field base...
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static Time Now()
Return the current simulation virtual time.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
The IEEE 802.11 SSID Information Element.
Status code for association response.
bool IsSuccess() const
Return whether the status code is success.
void SetFailure()
Set success bit to 1 (failure).
void SetSuccess()
Set success bit to 0 (success).
Hold variables of type string.
The Supported Rates Information Element.
TID-to-Link Mapping Information Element.
std::set< uint8_t > GetLinkMappingOfTid(uint8_t tid) const
Get the Link Mapping field of the given TID.
TidToLinkMapping::Control m_control
TID-to-link Mapping Control.
The Traffic Indication Map Information Element.
uint8_t m_dtimPeriod
The DTIM Period field.
uint8_t m_dtimCount
The DTIM Count field.
void AddAid(uint16_t aid)
Add the provided AID value to the list contained in the Virtual Bitmap.
bool m_hasMulticastPending
Whether there is Multicast / Broadcast data.
Simulation virtual time values and global simulation resolution.
bool IsZero() const
Exactly equivalent to t == 0.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
static constexpr bool CHECK_MEDIUM_BUSY
generation of backoff (also) depends on the busy/idle state of the medium
a unique identifier for an interface.
@ ATTR_GET
The attribute can be read.
@ ATTR_CONSTRUCT
The attribute can be written at construction-time.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
The IEEE 802.11ac VHT Capabilities.
The VHT Operation Information Element.
void SetMaxVhtMcsPerNss(uint8_t nss, uint8_t maxVhtMcs)
Set the Basic VHT-MCS and NSS field in the VHT Operation information element by specifying the tuple ...
void SetChannelWidth(uint8_t channelWidth)
Set the Channel Width field in the VHT Operation information element.
void SetChannelCenterFrequencySegment1(uint8_t channelCenterFrequencySegment1)
Set the Channel Center Frequency Segment 1 field in the VHT Operation information element.
void SetChannelCenterFrequencySegment0(uint8_t channelCenterFrequencySegment0)
Set the Channel Center Frequency Segment 0 field in the VHT Operation information element.
Ptr< FrameExchangeManager > GetFrameExchangeManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Frame Exchange Manager associated with the given link.
Ptr< QosTxop > GetBEQueue() const
Accessor for the AC_BE channel access function.
std::optional< Mac48Address > GetMldAddress(const Mac48Address &remoteAddr) const
Ptr< HeConfiguration > GetHeConfiguration() const
const std::map< uint8_t, std::unique_ptr< LinkEntity > > & GetLinks() const
Ptr< Txop > GetTxop() const
Accessor for the Txop object.
VhtCapabilities GetVhtCapabilities(uint8_t linkId) const
Return the VHT capabilities of the device for the given link.
bool GetQosSupported() const
Return whether the device supports QoS.
Ptr< WifiMacQueueScheduler > GetMacQueueScheduler() const
Get the wifi MAC queue scheduler.
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
void Enqueue(Ptr< Packet > packet, Mac48Address to)
void UnblockUnicastTxOnLinks(WifiQueueBlockedReason reason, Mac48Address address, const std::set< uint8_t > &linkIds)
Unblock the transmission on the given links of all unicast frames addressed to the station with the g...
void DoInitialize() override
Initialize() implementation.
bool TidMappedOnLink(Mac48Address mldAddr, WifiDirection dir, uint8_t tid, uint8_t linkId) const
Check whether the given TID is mapped on the given link in the given direction for the given MLD.
bool GetErpSupported(uint8_t linkId) const
Return whether the device supports ERP on the given link.
Ptr< QosTxop > GetVOQueue() const
Accessor for the AC_VO channel access function.
void SetTypeOfStation(TypeOfStation type)
This method is invoked by a subclass to specify what type of station it is implementing.
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
bool GetEhtSupported() const
Return whether the device supports EHT.
bool GetHeSupported() const
Return whether the device supports HE.
HtCapabilities GetHtCapabilities(uint8_t linkId) const
Return the HT capabilities of the device for the given link.
virtual std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const
Get the ID of the link having the given MAC address, if any.
void ApplyTidLinkMapping(const Mac48Address &mldAddr, WifiDirection dir)
Apply the TID-to-Link Mapping negotiated with the given MLD for the given direction by properly confi...
Ptr< EhtConfiguration > GetEhtConfiguration() const
bool GetVhtSupported(uint8_t linkId) const
Return whether the device supports VHT on the given link.
void BlockUnicastTxOnLinks(WifiQueueBlockedReason reason, Mac48Address address, const std::set< uint8_t > &linkIds)
Block the transmission on the given links of all unicast frames addressed to the station with the giv...
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.).
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Ptr< HtConfiguration > GetHtConfiguration() const
virtual Ptr< Txop > GetTxopFor(AcIndex ac) const
Get the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed, or a null pointer,...
void UpdateTidToLinkMapping(const Mac48Address &mldAddr, WifiDirection dir, const WifiTidLinkMapping &mapping)
Update the TID-to-Link Mappings for the given MLD in the given direction based on the given negotiate...
ExtendedCapabilities GetExtendedCapabilities() const
Return the extended capabilities of the device.
He6GhzBandCapabilities GetHe6GhzBandCapabilities(uint8_t linkId) const
Return the HE 6GHz band capabilities of the device for the given 6 GHz link.
Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const
Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed,...
bool GetShortSlotTimeSupported() const
void NotifyRxDrop(Ptr< const Packet > packet)
virtual void SetLinkUpCallback(Callback< void > linkUp)
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
const std::set< uint8_t > & GetLinkIds() const
bool GetHtSupported(uint8_t linkId) const
Return whether the device supports HT on the given link.
void ForwardUp(Ptr< const Packet > packet, Mac48Address from, Mac48Address to)
Forward the packet up to the device.
bool Is6GhzBand(uint8_t linkId) const
Indicate if a given link is on the 6 GHz band.
virtual void Receive(Ptr< const WifiMpdu > mpdu, uint8_t linkId)
This method acts as the MacRxMiddle receive callback and is invoked to notify us that a frame has bee...
Mac48Address GetAddress() const
EhtCapabilities GetEhtCapabilities(uint8_t linkId) const
Return the EHT capabilities of the device for the given link.
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
HeCapabilities GetHeCapabilities(uint8_t linkId) const
Return the HE capabilities of the device for the given link.
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
void DoDispose() override
Destructor implementation.
bool GetDsssSupported(uint8_t linkId) const
Return whether the device supports DSSS on the given link.
represent a single transmission mode
const std::string & GetUniqueName() const
uint64_t GetDataRate(MHz_u channelWidth, Time guardInterval, uint8_t nss) const
uint8_t GetMcsValue() const
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#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< AttributeChecker > MakeAttributeContainerChecker()
Make uninitialized AttributeContainerChecker using explicit types.
Ptr< AttributeChecker > MakeAttributeContainerChecker(const AttributeContainerValue< A, Sep, C > &value)
Make AttributeContainerChecker from AttributeContainerValue.
Ptr< const AttributeAccessor > MakeAttributeContainerAccessor(T1 a1)
Make AttributeContainerAccessor using explicit types.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePairChecker(const PairValue< A, B > &value)
Make a PairChecker from a PairValue.
Ptr< const AttributeAccessor > MakePointerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< AttributeChecker > MakePointerChecker()
Create a PointerChecker for a type.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_ABORT_IF(cond)
Abnormal program termination if a condition is true.
#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_NOARGS()
Output the name of the function.
#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.
Ptr< T > CreateObjectWithAttributes(Args... args)
Allocate an Object on the heap and initialize with a set of attributes.
#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 MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
WifiMacDropReason
The reason why an MPDU was dropped.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
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_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).
Every class exported by the ns3 library is enclosed in the ns3 namespace.
U * PeekPointer(const Ptr< U > &p)
const Time WIFI_TU
Wi-Fi Time Unit value in microseconds (see IEEE 802.11-2020 sec.
double MHz_u
MHz weak type.
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
bool IsGroupcast(const Mac48Address &adr)
Check whether a MAC destination address corresponds to a groupcast transmission.
const std::list< AcIndex > edcaAcIndices
List of the Access Categories corresponding to the four EDCA functions.
constexpr uint8_t WIFI_EHT_MAX_MCS_INDEX
IEEE 802.11be D2.0 Figure 9-1002ai.
WifiMacType
Combination of valid MAC header type/subtype.
@ WIFI_MAC_MGT_ASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_DISASSOCIATION
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
@ WIFI_MAC_MGT_REASSOCIATION_REQUEST
@ WIFI_MAC_MGT_PROBE_RESPONSE
@ WIFI_MAC_MGT_REASSOCIATION_RESPONSE
bool TidToLinkMappingValidForNegType1(const WifiTidLinkMapping &dlLinkMapping, const WifiTidLinkMapping &ulLinkMapping)
Check if the given TID-to-Link Mappings are valid for a negotiation type of 1.
std::tuple< WifiContainerQueueType, WifiRcvAddr, Mac48Address, std::optional< uint8_t > > WifiContainerQueueId
Tuple (queue type, receiver address type, Address, TID) identifying a container queue.
Ptr< T1 > StaticCast(const Ptr< T2 > &p)
Cast a Ptr.
std::map< tid_t, std::set< linkId_t > > WifiTidLinkMapping
TID-indexed map of the link set to which the TID is mapped.
static constexpr uint8_t WIFI_LINKID_UNDEFINED
Invalid link identifier.
std::pair< Mac48Address, uint8_t > WifiAddressTidPair
(MAC address, TID) pair
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
uint8_t linkId_t
IEEE 802.11be D7.0 Figure 9-207e—Link ID Info field format.
static constexpr uint16_t MIN_AID
The minimum value for the association ID (Sec. 9.4.1.8 of 802.11-2020).
std::variant< std::reference_wrapper< MgtAssocRequestHeader >, std::reference_wrapper< MgtReassocRequestHeader > > AssocReqRefVariant
variant holding a reference to a (Re)Association Request
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU).
double Watt_u
Watt weak type.
static constexpr uint16_t MAX_AID
The maximum value for the association ID (Sec. 9.4.1.8 of 802.11-2020).
const Time DEFAULT_BEACON_INTERVAL
Default Beacon interval.
static constexpr uint16_t EHT_MAX_AID
The maximum value for the association ID updated since 802.11be (Sec. 9.4.1.8 of 802....
Struct containing all supported rates.
void SetBasicRate(uint64_t bs)
Set the given rate to basic rates.
void AddBssMembershipSelectorRate(uint64_t bs)
Add a special value to the supported rate set, corresponding to a BSS membership selector.
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
Structure holding information specific to a single link.
std::map< uint16_t, Mac48Address > staList
Map of all stations currently associated to the AP with their association ID.
EventId beaconEvent
Event to generate one beacon.
~ApLinkEntity() override
Destructor (a virtual method is needed to make this struct polymorphic).
uint16_t numNonErpStations
Number of non-ERP stations currently associated to the AP.
uint8_t beaconDtimCount
Number of beacons to DTIM.
std::size_t nStationsInPsMode
Number of associated stations in PS mode.
std::optional< MldCapabilities > m_mldCapabilities
MLD Capabilities.
void SetMediumSyncDelayTimer(Time delay)
Set the Medium Synchronization Duration subfield of the Medium Synchronization Delay Information in t...
EHT Operation Information subfield IEEE 802.11be D2.0 Figure 9-1002c.
uint8_t grpBuExp
Group Addressed BU Indication Exponent.
uint8_t opInfoPresent
EHT Operation Information Present.
uint8_t m_bssColor
BSS Color.
6 GHz Operation Information field
uint8_t m_chCntrFreqSeg0
Channel center frequency segment 0.
uint8_t m_chWid
Channel Width.
uint8_t m_chCntrFreqSeg1
Channel center frequency segment 1.
uint8_t m_primCh
Primary Channel.
uint8_t emlsrMode
EMLSR Mode.
uint8_t emlsrParamUpdateCtrl
EMLSR Parameter Update Control.
bool defaultMapping
Default link mapping.
Ptr< WifiRemoteStationManager > stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.).
Ptr< WifiPhy > phy
Wifi PHY object.
Ptr< ChannelAccessManager > channelAccessManager
channel access manager object
Declaration of default values used across wifi module.