21#include "ns3/eht-configuration.h"
22#include "ns3/eht-frame-exchange-manager.h"
23#include "ns3/he-configuration.h"
24#include "ns3/ht-configuration.h"
26#include "ns3/object-vector.h"
27#include "ns3/packet.h"
28#include "ns3/pointer.h"
29#include "ns3/shuffle.h"
30#include "ns3/socket.h"
31#include "ns3/string.h"
32#include "ns3/vht-configuration.h"
47 : m_qosSupported(false)
70 "The ssid we want to belong to.",
74 .AddAttribute(
"QosSupported",
75 "This Boolean attribute is set to enable 802.11e/WMM-style QoS support "
82 .AddAttribute(
"CtsToSelfSupported",
83 "Use CTS to Self when using a rate that is not in the basic rate set.",
88 "ShortSlotTimeSupported",
89 "Whether or not short slot time is supported (only used by ERP APs or STAs).",
101 .AddAttribute(
"VO_Txop",
102 "Queue that manages packets belonging to AC_VO access class.",
108 .AddAttribute(
"VI_Txop",
109 "Queue that manages packets belonging to AC_VI access class.",
115 .AddAttribute(
"BE_Txop",
116 "Queue that manages packets belonging to AC_BE access class.",
122 .AddAttribute(
"BK_Txop",
123 "Queue that manages packets belonging to AC_BK access class.",
130 "ChannelAccessManagers",
131 "The Channel Access Manager(s) attached to this device.",
136 "FrameExchangeManagers",
137 "The Frame Exchange Manager(s) attached to this device.",
143 "The size (in number of MPDUs) of the buffer used for each BlockAck "
144 "agreement in which this node is a recipient. The provided value is "
145 "capped to the maximum allowed value based on the supported standard.",
149 .AddAttribute(
"VO_MaxAmsduSize",
150 "Maximum length in bytes of an A-MSDU for AC_VO access class "
151 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). "
152 "Value 0 means A-MSDU aggregation is disabled for that AC.",
156 .AddAttribute(
"VI_MaxAmsduSize",
157 "Maximum length in bytes of an A-MSDU for AC_VI access class "
158 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). "
159 "Value 0 means A-MSDU aggregation is disabled for that AC.",
163 .AddAttribute(
"BE_MaxAmsduSize",
164 "Maximum length in bytes of an A-MSDU for AC_BE access class "
165 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). "
166 "Value 0 means A-MSDU aggregation is disabled for that AC.",
170 .AddAttribute(
"BK_MaxAmsduSize",
171 "Maximum length in bytes of an A-MSDU for AC_BK access class "
172 "(capped to 7935 for HT PPDUs and 11398 for VHT/HE/EHT PPDUs). "
173 "Value 0 means A-MSDU aggregation is disabled for that AC.",
179 "Maximum length in bytes of an A-MPDU for AC_VO access class "
180 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs "
181 "and 15523200 for EHT PPDUs). "
182 "Value 0 means A-MPDU aggregation is disabled for that AC.",
188 "Maximum length in bytes of an A-MPDU for AC_VI access class "
189 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs "
190 "and 15523200 for EHT PPDUs). "
191 "Value 0 means A-MPDU aggregation is disabled for that AC.",
197 "Maximum length in bytes of an A-MPDU for AC_BE access class "
198 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs "
199 "and 15523200 for EHT PPDUs). "
200 "Value 0 means A-MPDU aggregation is disabled for that AC.",
206 "Maximum length in bytes of an A-MPDU for AC_BK access class "
207 "(capped to 65535 for HT PPDUs, 1048575 for VHT PPDUs, 6500631 for HE PPDUs "
208 "and 15523200 for EHT PPDUs). "
209 "Value 0 means A-MPDU aggregation is disabled for that AC.",
214 "VO_BlockAckThreshold",
215 "If number of packets in VO queue reaches this value, "
216 "block ack mechanism is used. If this value is 0, block ack is never used."
217 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
222 "VI_BlockAckThreshold",
223 "If number of packets in VI queue reaches this value, "
224 "block ack mechanism is used. If this value is 0, block ack is never used."
225 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
230 "BE_BlockAckThreshold",
231 "If number of packets in BE queue reaches this value, "
232 "block ack mechanism is used. If this value is 0, block ack is never used."
233 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
238 "BK_BlockAckThreshold",
239 "If number of packets in BK queue reaches this value, "
240 "block ack mechanism is used. If this value is 0, block ack is never used."
241 "When A-MPDU is enabled, block ack mechanism is used regardless of this value.",
246 "VO_BlockAckInactivityTimeout",
247 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
248 "inactivity for AC_VO. If this value isn't equal to 0 a timer start after that a"
249 "block ack setup is completed and will be reset every time that a block ack"
250 "frame is received. If this value is 0, block ack inactivity timeout won't be "
256 "VI_BlockAckInactivityTimeout",
257 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
258 "inactivity for AC_VI. If this value isn't equal to 0 a timer start after that a"
259 "block ack setup is completed and will be reset every time that a block ack"
260 "frame is received. If this value is 0, block ack inactivity timeout won't be "
266 "BE_BlockAckInactivityTimeout",
267 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
268 "inactivity for AC_BE. If this value isn't equal to 0 a timer start after that a"
269 "block ack setup is completed and will be reset every time that a block ack"
270 "frame is received. If this value is 0, block ack inactivity timeout won't be "
276 "BK_BlockAckInactivityTimeout",
277 "Represents max time (blocks of 1024 microseconds) allowed for block ack"
278 "inactivity for AC_BK. If this value isn't equal to 0 a timer start after that a"
279 "block ack setup is completed and will be reset every time that a block ack"
280 "frame is received. If this value is 0, block ack inactivity timeout won't be "
285 .AddTraceSource(
"MacTx",
286 "A packet has been received from higher layers and is being processed "
287 "in preparation for "
288 "queueing for transmission.",
290 "ns3::Packet::TracedCallback")
293 "A packet has been dropped in the MAC layer before being queued for transmission. "
294 "This trace source is fired, e.g., when an AP's MAC receives from the upper layer "
295 "a packet destined to a station that is not associated with the AP or a STA's MAC "
296 "receives a packet from the upper layer while it is not associated with any AP.",
298 "ns3::Packet::TracedCallback")
301 "A packet has been received by this device, has been passed up from the physical "
303 "and is being forwarded up the local protocol stack. This is a promiscuous trace.",
305 "ns3::Packet::TracedCallback")
306 .AddTraceSource(
"MacRx",
307 "A packet has been received by this device, has been passed up from "
308 "the physical layer "
309 "and is being forwarded up the local protocol stack. This is a "
310 "non-promiscuous trace.",
312 "ns3::Packet::TracedCallback")
313 .AddTraceSource(
"MacRxDrop",
314 "A packet has been dropped in the MAC layer after it has been passed "
315 "up from the physical layer.",
317 "ns3::Packet::TracedCallback")
318 .AddTraceSource(
"AckedMpdu",
319 "An MPDU that was successfully acknowledged, via either a "
320 "Normal Ack or a Block Ack.",
322 "ns3::WifiMpdu::TracedCallback")
323 .AddTraceSource(
"NAckedMpdu",
324 "An MPDU that was negatively acknowledged via a Block Ack.",
326 "ns3::WifiMpdu::TracedCallback")
329 "An MPDU that was dropped for the given reason (see WifiMacDropReason).",
331 "ns3::WifiMac::DroppedMpduCallback")
333 "MpduResponseTimeout",
334 "An MPDU whose response was not received before the timeout, along with "
335 "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
336 "TXVECTOR used to transmit the MPDU. This trace source is fired when a "
337 "CTS is missing after an RTS, when all CTS frames are missing after an MU-RTS, "
338 "or when a Normal Ack is missing after an MPDU or after a DL MU PPDU "
339 "acknowledged in SU format.",
341 "ns3::WifiMac::MpduResponseTimeoutCallback")
343 "PsduResponseTimeout",
344 "A PSDU whose response was not received before the timeout, along with "
345 "an identifier of the type of timeout (see WifiTxTimer::Reason) and the "
346 "TXVECTOR used to transmit the PSDU. This trace source is fired when a "
347 "BlockAck is missing after an A-MPDU, a BlockAckReq (possibly in the "
348 "context of the acknowledgment of a DL MU PPDU in SU format) or a TB PPDU "
349 "(in the latter case the missing BlockAck is a Multi-STA BlockAck).",
351 "ns3::WifiMac::PsduResponseTimeoutCallback")
353 "PsduMapResponseTimeout",
354 "A PSDU map for which not all the responses were received before the timeout, "
355 "along with an identifier of the type of timeout (see WifiTxTimer::Reason), "
356 "the set of MAC addresses of the stations that did not respond and the total "
357 "number of stations that had to respond. This trace source is fired when not "
358 "all the addressed stations responded to an MU-BAR Trigger frame (either sent as "
359 "a SU frame or aggregated to PSDUs in the DL MU PPDU), a Basic Trigger Frame or "
360 "a BSRP Trigger Frame.",
362 "ns3::WifiMac::PsduMapResponseTimeoutCallback")
363 .AddTraceSource(
"IcfDropReason",
364 "An ICF is dropped by an EMLSR client for the given reason on the "
365 "link with the given ID. This trace source is actually fed by the "
366 "EHT Frame Exchange Manager through the m_icfDropCallback member "
369 "ns3::WifiMac::IcfDropCallback");
412 for (
auto it =
m_edca.begin(); it !=
m_edca.end(); ++it)
414 it->second->Initialize();
417 for (
const auto& [
id, link] :
m_links)
419 if (
auto cam = link->channelAccessManager)
441 for (
auto it =
m_edca.begin(); it !=
m_edca.end(); ++it)
444 it->second =
nullptr;
485 if (device->GetHtConfiguration())
540 for (
auto& [
id, link] :
m_links)
542 link->feManager->SetPromisc();
612 const auto it = std::find_if(
m_edca.cbegin(),
m_edca.cend(), [ac](
const auto& pair) {
613 return pair.first == ac;
615 return (it ==
m_edca.cend() ?
nullptr : it->second);
652 return (txop ? txop->GetWifiMacQueue() :
nullptr);
662 for (
const auto& [aci, qosTxop] :
m_edca)
664 if (qosTxop->HasFramesToTransmit(linkId))
744 auto edcaIt =
m_edca.find(ac);
748 edcaIt->second->GetBaManager()->SetTxOkCallback(
750 edcaIt->second->GetBaManager()->SetTxFailedCallback(
752 edcaIt->second->SetDroppedMpduCallback(
759 std::list<bool> isDsssOnly;
760 for (
const auto& [
id, link] :
m_links)
762 isDsssOnly.push_back(link->dsssSupported && !link->erpSupported);
773 for (
auto it =
m_edca.begin(); it !=
m_edca.end(); ++it)
775 ConfigureDcf(it->second, cwMin, cwMax, isDsssOnly, it->first);
783 std::list<bool> isDsss,
790 uint8_t aifsnValue = 0;
791 Time txopLimitDsss(0);
792 Time txopLimitNoDsss(0);
798 cwMinValue = (cwmin + 1) / 4 - 1;
799 cwMaxValue = (cwmin + 1) / 2 - 1;
805 cwMinValue = (cwmin + 1) / 2 - 1;
839 const auto& userDefinedParams = dcf->GetUserAccessParams();
841 dcf->SetMinCws(!userDefinedParams.cwMins.empty()
842 ? userDefinedParams.cwMins
843 : std::vector<uint32_t>(
m_links.size(), cwMinValue));
844 dcf->SetMaxCws(!userDefinedParams.cwMaxs.empty()
845 ? userDefinedParams.cwMaxs
846 : std::vector<uint32_t>(
m_links.size(), cwMaxValue));
847 dcf->SetAifsns(!userDefinedParams.aifsns.empty()
848 ? userDefinedParams.aifsns
849 : std::vector<uint8_t>(
m_links.size(), aifsnValue));
851 if (!userDefinedParams.txopLimits.empty())
853 dcf->SetTxopLimits(userDefinedParams.txopLimits);
857 std::vector<Time> txopLimitValues(
m_links.size());
858 std::transform(isDsss.begin(),
860 txopLimitValues.begin(),
861 [&txopLimitDsss, &txopLimitNoDsss](
bool dsss) {
862 return (dsss ? txopLimitDsss : txopLimitNoDsss);
864 dcf->SetTxopLimits(txopLimitValues);
873 const auto& link = *
m_links.cbegin()->second;
875 if (!link.phy || !link.stationManager || !link.channelAccessManager || !link.feManager)
882 for (
auto& [
id, link] :
m_links)
885 !link->phy || !link->phy->GetOperatingChannel().IsSet(),
887 <<
"] PHY must have been set and an operating channel must have been set");
890 "[LinkID " << +
id <<
"] A channel access manager must have been set");
893 "[LinkID " << +
id <<
"] A frame exchange manager must have been set");
895 link->channelAccessManager->SetupPhyListener(link->phy);
896 link->channelAccessManager->SetupFrameExchangeManager(link->feManager);
898 link->feManager->SetWifiPhy(link->phy);
905 link->channelAccessManager->Add(
m_txop);
907 for (
auto it =
m_edca.begin(); it !=
m_edca.end(); ++it)
909 it->second->SetWifiMac(
this);
910 link->channelAccessManager->Add(it->second);
945 for (std::size_t i = 0; i < nLinks; i++)
961 "The number of provided Frame Exchange Manager objects ("
962 << feManagers.size() <<
") must match the number of existing links ("
966 for (
auto managerIt = feManagers.cbegin();
auto& [id, link] :
m_links)
968 link->feManager = *managerIt++;
969 link->feManager->SetWifiMac(
this);
970 link->feManager->SetLinkId(
id);
972 link->feManager->GetWifiTxTimer().SetMpduResponseTimeoutCallback(
973 MakeCallback(&MpduResponseTimeoutTracedCallback::operator(),
975 link->feManager->GetWifiTxTimer().SetPsduResponseTimeoutCallback(
976 MakeCallback(&PsduResponseTimeoutTracedCallback::operator(),
978 link->feManager->GetWifiTxTimer().SetPsduMapResponseTimeoutCallback(
979 MakeCallback(&PsduMapResponseTimeoutTracedCallback::operator(),
981 link->feManager->SetDroppedMpduCallback(
983 link->feManager->SetAckedMpduCallback(
987 ehtFem->m_icfDropCallback.ConnectWithoutContext(
1009 "The number of provided Channel Access Manager objects ("
1010 << caManagers.size() <<
") must match the number of existing links ("
1014 for (
auto managerIt = caManagers.cbegin();
auto& [id, link] :
m_links)
1016 link->channelAccessManager = *managerIt++;
1017 link->channelAccessManager->SetLinkId(
id);
1045 "The number of provided Remote Manager objects ("
1046 << stationManagers.size()
1047 <<
") must match the number of existing links (" <<
m_links.size()
1051 for (
auto managerIt = stationManagers.cbegin();
auto& [id, link] :
m_links)
1053 link->stationManager = *managerIt++;
1065std::unique_ptr<WifiMac::LinkEntity>
1068 return std::make_unique<LinkEntity>();
1071const std::map<uint8_t, std::unique_ptr<WifiMac::LinkEntity>>&
1080 auto it =
m_links.find(linkId);
1092const std::set<uint8_t>&
1106 link.feManager->SetLinkId(
id);
1108 if (link.channelAccessManager)
1110 link.channelAccessManager->SetLinkId(
id);
1114std::optional<uint8_t>
1117 for (
const auto& [
id, link] :
m_links)
1119 if (link->feManager->GetAddress() == address)
1124 return std::nullopt;
1127std::optional<uint8_t>
1130 for (
const auto& [
id, link] :
m_links)
1132 if (link->phy == phy)
1137 return std::nullopt;
1140std::optional<uint8_t>
1144 auto phy =
m_device->GetPhy(phyId);
1154 std::map<uint8_t, std::reference_wrapper<const LinkEntity>> origLinkRefMap;
1155 for (
const auto& [
id, link] :
m_links)
1157 origLinkRefMap.insert_or_assign(
id, *link.get());
1160 while (!links.empty())
1162 auto from = links.cbegin()->first;
1163 auto to = links.cbegin()->second;
1168 links.erase(links.cbegin());
1172 std::unique_ptr<LinkEntity> linkToMove;
1174 linkToMove.swap(
m_links.at(from));
1179 auto [it, inserted] =
1192 auto nextTo = links.find(to);
1193 if (nextTo == links.cend())
1196 m_links[empty].swap(linkToMove);
1201 to = nextTo->second;
1206 for (
const auto& [
id, link] :
m_links)
1211 std::map<uint8_t, uint8_t> actualPairs;
1212 for (
const auto& [from, ref] : origLinkRefMap)
1215 for (
const auto& [to, link] :
m_links)
1217 if (link.get() == &ref.get())
1219 actualPairs[from] = to;
1231 for (
auto& [ac, edca] :
m_edca)
1233 edca->SwapLinks(actualPairs);
1253 "DL and UL directions for TID-to-Link mapping must be set separately");
1257 auto [it, inserted] = mappings.emplace(mldAddr, mapping);
1266 if (mapping.empty())
1273 for (
const auto& [tid, linkSet] : mapping)
1275 it->second[tid] = linkSet;
1279std::optional<std::reference_wrapper<const WifiTidLinkMapping>>
1283 "Cannot request TID-to-Link mapping for both directions");
1285 const auto& mappings =
1288 if (
const auto it = mappings.find(mldAddr); it != mappings.cend())
1292 return std::nullopt;
1299 "Cannot request TID-to-Link mapping for both directions");
1301 const auto& mappings =
1304 const auto it = mappings.find(mldAddr);
1306 if (it == mappings.cend())
1312 auto linkSetIt = it->second.find(tid);
1314 if (linkSetIt == it->second.cend())
1321 return std::find(linkSetIt->second.cbegin(), linkSetIt->second.cend(), linkId) !=
1322 linkSetIt->second.cend();
1334 "The number of provided PHY objects ("
1335 << phys.size() <<
") must match the number of existing links ("
1339 for (
auto phyIt = phys.cbegin();
auto& [id, link] :
m_links)
1341 link->phy = *phyIt++;
1357 for (
auto& [
id, link] :
m_links)
1359 if (link->feManager)
1361 link->feManager->ResetPhy();
1363 if (link->channelAccessManager)
1365 link->channelAccessManager->RemovePhyListener(link->phy);
1367 link->phy =
nullptr;
1469 "This method can be used to enforce TID-to-Link mapping for one direction at a time");
1471 const auto& mappings =
1474 auto it = mappings.find(mldAddr);
1476 if (it == mappings.cend())
1482 std::set<uint8_t> setupLinks;
1485 for (
const auto& [
id, link] :
m_links)
1487 if (link->stationManager->GetMldAddress(mldAddr))
1489 setupLinks.insert(
id);
1493 auto linkMapping = it->second;
1495 if (linkMapping.empty())
1498 for (uint8_t tid = 0; tid < 8; tid++)
1500 linkMapping.emplace(tid, setupLinks);
1504 for (
const auto& [tid, linkSet] : linkMapping)
1506 decltype(setupLinks) mappedLinks;
1507 auto notMappedLinks = setupLinks;
1509 for (
const auto id : linkSet)
1511 if (setupLinks.find(
id) != setupLinks.cend())
1514 mappedLinks.insert(
id);
1515 notMappedLinks.erase(
id);
1520 NS_ABORT_MSG_IF(mappedLinks.empty(),
"Every TID must be mapped to at least a link");
1531 if (!notMappedLinks.empty())
1547 const std::set<uint8_t>& linkIds)
1549 std::stringstream ss;
1552 std::copy(linkIds.cbegin(), linkIds.cend(), std::ostream_iterator<uint16_t>(ss,
" "));
1557 for (
const auto linkId : linkIds)
1560 auto linkAddr = link.stationManager->GetAffiliatedStaAddress(address).value_or(address);
1562 if (link.stationManager->GetMldAddress(address) == address && linkAddr == address)
1564 NS_LOG_DEBUG(
"Link " << +linkId <<
" has not been setup with the MLD, skip");
1576 {ac.GetLowTid(), ac.GetHighTid()},
1583 link.feManager->GetAddress(),
1593 const std::set<uint8_t>& linkIds)
1598 std::vector<uint8_t> shuffledLinkIds(linkIds.cbegin(), linkIds.cend());
1601 std::stringstream ss;
1604 std::copy(shuffledLinkIds.cbegin(),
1605 shuffledLinkIds.cend(),
1606 std::ostream_iterator<uint16_t>(ss,
" "));
1610 for (
const auto linkId : shuffledLinkIds)
1613 auto linkAddr = link.stationManager->GetAffiliatedStaAddress(address).value_or(address);
1615 if (link.stationManager->GetMldAddress(address) == address && linkAddr == address)
1617 NS_LOG_DEBUG(
"Link " << +linkId <<
" has not been setup with the MLD, skip");
1632 {ac.GetLowTid(), ac.GetHighTid()},
1639 link.feManager->GetAddress(),
1647 hasFramesToTransmit,
1659 auto mask =
m_scheduler->GetQueueLinkMask(ac, queueId, linkId);
1661 if (!mask.has_value())
1669 return mask->test(
static_cast<std::size_t
>(reason));
1693 if (packet->RemovePacketTag(qos) && qos.
GetPriority() < 8)
1698 Enqueue(packet, to, from, tid);
1707 "This Mac does not support forwarding frames");
1760 const auto& hdr = mpdu->GetOriginal()->GetHeader();
1761 const auto to = hdr.GetAddr1();
1777 if ((hdr.IsData() && !hdr.HasData()) || hdr.IsMgt())
1782 NS_FATAL_ERROR(
"Don't know how to handle frame (type=" << hdr.GetType());
1792 msduPair.second.GetSourceAddr(),
1793 msduPair.second.GetDestinationAddr());
1797std::optional<Mac48Address>
1800 for (
const auto& [
id, link] :
m_links)
1802 if (
auto mldAddress = link->stationManager->GetMldAddress(remoteAddr))
1807 return std::nullopt;
1813 for (
const auto& [
id, link] :
m_links)
1815 if (
auto mldAddress = link->stationManager->GetMldAddress(remoteAddr))
1818 if (mldAddress != remoteAddr)
1821 return link->feManager->GetAddress();
1851 if (!agreement || !agreement->get().IsEstablished())
1853 return std::nullopt;
1862 originator =
GetMldAddress(originator).value_or(originator);
1871 "No existing Block Ack agreement with " << recipient <<
" TID: " << +tid);
1872 return agreement->get().GetBlockAckType();
1880 "No existing Block Ack agreement with " << recipient <<
" TID: " << +tid);
1881 return agreement->get().GetBlockAckReqType();
1889 "No existing Block Ack agreement with " << originator <<
" TID: " << +tid);
1890 return agreement->get().GetBlockAckType();
1898 "No existing Block Ack agreement with " << originator <<
" TID: " << +tid);
1899 return agreement->get().GetBlockAckReqType();
1905 return GetDevice()->GetHtConfiguration();
1911 return GetDevice()->GetVhtConfiguration();
1917 return GetDevice()->GetHeConfiguration();
1923 return GetDevice()->GetEhtConfiguration();
1956 for (
const auto& [
id, link] :
m_links)
1958 if (link->stationManager->GetHtSupported(address))
1969 for (
const auto& [
id, link] :
m_links)
1971 if (link->stationManager->GetVhtSupported(address))
1982 for (
const auto& [
id, link] :
m_links)
1984 if (link->stationManager->GetHeSupported(address))
1995 for (
const auto& [
id, link] :
m_links)
1997 if (link->stationManager->GetEhtSupported(address))
2121 return capabilities;
2133 bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported();
2134 capabilities.
SetLdpc(htConfiguration->GetLdpcSupported());
2139 uint16_t maxAmsduSize =
2141 if (maxAmsduSize <= 3839)
2152 maxAmpduLength = (1UL <<
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
2154 capabilities.
SetMaxAmpduLength(std::min(std::max(maxAmpduLength, 8191U), 65535U));
2157 uint64_t maxSupportedRate = 0;
2161 uint8_t nss = (mcs.GetMcsValue() / 8) + 1;
2163 uint64_t dataRate = mcs.GetDataRate(htConfiguration->Get40MHzOperationSupported() ? 40 : 20,
2166 if (dataRate > maxSupportedRate)
2168 maxSupportedRate = dataRate;
2169 NS_LOG_DEBUG(
"Updating maxSupportedRate to " << maxSupportedRate);
2173 static_cast<uint16_t
>(maxSupportedRate / 1e6));
2180 return capabilities;
2193 "VHT stations have to support 40 MHz operation");
2195 bool sgiSupported = htConfiguration->GetShortGuardIntervalSupported();
2199 uint16_t maxAmsduSize =
2201 if (maxAmsduSize <= 3839)
2205 else if (maxAmsduSize <= 7935)
2216 maxAmpduLength = (1UL <<
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
2218 capabilities.
SetMaxAmpduLength(std::min(std::max(maxAmpduLength, 8191U), 1048575U));
2220 capabilities.
SetRxLdpc(htConfiguration->GetLdpcSupported());
2226 if (mcs.GetMcsValue() > maxMcs)
2228 maxMcs = mcs.GetMcsValue();
2232 for (uint8_t nss = 1; nss <= phy->GetMaxSupportedRxSpatialStreams(); nss++)
2236 for (uint8_t nss = 1; nss <= phy->GetMaxSupportedTxSpatialStreams(); nss++)
2240 uint64_t maxSupportedRateLGI = 0;
2241 MHz_u maxWidth = vhtConfiguration->Get160MHzOperationSupported() ? 160 : 80;
2244 if (!mcs.IsAllowed(maxWidth, 1))
2248 if (mcs.GetDataRate(maxWidth) > maxSupportedRateLGI)
2250 maxSupportedRateLGI = mcs.GetDataRate(maxWidth);
2251 NS_LOG_DEBUG(
"Updating maxSupportedRateLGI to " << maxSupportedRateLGI);
2255 static_cast<uint16_t
>(maxSupportedRateLGI / 1e6));
2257 static_cast<uint16_t
>(maxSupportedRateLGI / 1e6));
2262 return capabilities;
2276 uint8_t channelWidthSet = 0;
2277 if ((htConfiguration->Get40MHzOperationSupported()) &&
2280 channelWidthSet |= 0x01;
2285 channelWidthSet |= 0x02;
2287 if ((vhtConfiguration->Get160MHzOperationSupported()) &&
2290 channelWidthSet |= 0x04;
2294 if (heConfiguration->GetGuardInterval().GetNanoSeconds() == 800)
2305 maxAmpduLength = (1UL <<
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
2307 capabilities.
SetMaxAmpduLength(std::min(std::max(maxAmpduLength, 1048575U), 8388607U));
2312 if (mcs.GetMcsValue() > maxMcs)
2314 maxMcs = mcs.GetMcsValue();
2320 return capabilities;
2328 "Getting HE 6 GHz band capabilities on band different than 6 GHz");
2333 const auto maxAmsduSize =
2335 if (maxAmsduSize <= 3839)
2339 else if (maxAmsduSize <= 7935)
2348 auto maxAmpduLength =
2351 maxAmpduLength = (1UL <<
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
2353 capabilities.
SetMaxAmpduLength(std::min(std::max(maxAmpduLength, 8191U), 1048575U));
2355 return capabilities;
2370 uint16_t maxAmsduSize =
2373 if (maxAmsduSize <= 3839)
2377 else if (maxAmsduSize <= 7935)
2391 maxAmpduLength = (1UL <<
static_cast<uint32_t>(std::ceil(std::log2(maxAmpduLength + 1)))) - 1;
2393 capabilities.
SetMaxAmpduLength(std::min(std::max(maxAmpduLength, 8388607U), 16777215U));
2398 support4096Qam ? 1 : 0;
2400 support4096Qam ? 1 : 0;
2402 const uint8_t maxTxNss = phy->GetMaxSupportedTxSpatialStreams();
2403 const uint8_t maxRxNss = phy->GetMaxSupportedRxSpatialStreams();
2406 for (
auto maxMcs : {7, 9, 11, 13})
2420 for (
auto maxMcs : {9, 11, 13})
2434 for (
auto maxMcs : {9, 11, 13})
2448 return capabilities;
2479 uint16_t maxSize = 0;
The IEEE 802.11be EHT Capabilities.
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
void SetSupportedTxEhtMcsAndNss(EhtMcsAndNssSet::EhtMcsMapType mapType, uint8_t upperMcs, uint8_t maxNss)
Set a subfield of the Supported EHT-MCS And NSS Set.
EhtPhyCapabilities m_phyCapabilities
EHT PHY Capabilities Info subfield.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum A-MPDU length.
void SetSupportedRxEhtMcsAndNss(EhtMcsAndNssSet::EhtMcsMapType mapType, uint8_t upperMcs, uint8_t maxNss)
Set a subfield of the Supported EHT-MCS And NSS Set.
The Extended Capabilities Information Element.
The HE 6 GHz Band Capabilities (IEEE 802.11ax-2021 9.4.2.263)
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
The IEEE 802.11ax HE Capabilities.
void SetHeSuPpdu1xHeLtf800nsGi(bool heSuPpdu1xHeLtf800nsGi)
Set 1xHE-LTF and 800ns GI in HE SU PPDU reception support.
void SetLdpcCodingInPayload(uint8_t ldpcCodingInPayload)
Set indication whether the transmission and reception of LDPC encoded packets is supported.
void SetHePpdu4xHeLtf800nsGi(bool heSuPpdu4xHeLtf800nsGi)
Set 4xHE-LTF and 800ns GI in HE SU PPDU and HE MU PPDU reception support.
void SetHighestNssSupported(uint8_t nss)
Set highest NSS supported.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetChannelWidthSet(uint8_t channelWidthSet)
Set channel width set.
void SetHighestMcsSupported(uint8_t mcs)
Set highest MCS supported.
The HT Capabilities Information Element.
void SetLdpc(uint8_t ldpc)
Set the LDPC field.
void SetTxRxMcsSetUnequal(uint8_t txRxMcsSetUnequal)
Set the transmit / receive MCS set unequal.
void SetRxHighestSupportedDataRate(uint16_t maxSupportedRate)
Set the receive highest supported data rate.
void SetLSigProtectionSupport(uint8_t lSigProtection)
Set the LSIG protection support.
void SetMaxAmsduLength(uint16_t maxAmsduLength)
Set the maximum AMSDU length.
void SetTxMaxNSpatialStreams(uint8_t maxTxSpatialStreams)
Set the transmit maximum N spatial streams.
void SetShortGuardInterval20(uint8_t shortGuardInterval)
Set the short guard interval 20 field.
void SetTxUnequalModulation(uint8_t txUnequalModulation)
Set the transmit unequal modulation.
void SetTxMcsSetDefined(uint8_t txMcsSetDefined)
Set the transmit MCS set defined.
void SetRxMcsBitmask(uint8_t index)
Set the receive MCS bitmask.
void SetSupportedChannelWidth(uint8_t supportedChannelWidth)
Set the supported channel width field.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetShortGuardInterval40(uint8_t shortGuardInterval)
Set the short guard interval 40 field.
static Mac48Address ConvertFrom(const Address &address)
A base class which provides memory management and object aggregation.
void Initialize()
Invoke DoInitialize on all Objects aggregated to this one.
void Dispose()
Dispose of this Object.
bool IsInitialized() const
Check if the object has been initialized.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
Ptr< BlockAckManager > GetBaManager()
Get the Block Ack Manager associated with this QosTxop.
void SetBlockAckThreshold(uint8_t threshold)
Set threshold for block ack mechanism.
void SetBlockAckInactivityTimeout(uint16_t timeout)
Set the BlockAck inactivity timeout.
bool HasFramesToTransmit(uint8_t linkId) override
Check if the Txop has frames to transmit over the given link.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
indicates whether the socket has a priority set.
uint8_t GetPriority() const
Get the tag's priority.
The IEEE 802.11 SSID Information Element.
Simulation virtual time values and global simulation resolution.
void StartAccessAfterEvent(uint8_t linkId, bool hadFramesToTransmit, bool checkMediumBusy)
Request channel access on the given link after the occurrence of an event that possibly requires to g...
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the Txop has frames to transmit over the given link.
virtual void SetWifiMac(const Ptr< WifiMac > mac)
Set the wifi MAC this Txop is associated to.
void SwapLinks(std::map< uint8_t, uint8_t > links)
Swap the links based on the information included in the given map.
void SetTxMiddle(const Ptr< MacTxMiddle > txMiddle)
Set MacTxMiddle this Txop is associated to.
virtual void SetDroppedMpduCallback(DroppedMpdu callback)
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.
void SetRxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the receive highest supported LGI data rate.
void SetSupportedChannelWidthSet(uint8_t channelWidthSet)
Set the supported channel width set.
void SetMaxMpduLength(uint16_t length)
Set the maximum MPDU length.
void SetRxLdpc(uint8_t rxLdpc)
Set the receive LDPC.
void SetTxStbc(uint8_t txStbc)
Set the transmit STBC.
void SetTxMcsMap(uint8_t mcs, uint8_t nss)
void SetShortGuardIntervalFor80Mhz(uint8_t shortGuardInterval)
Set the short guard interval 80 MHz.
void SetTxHighestSupportedLgiDataRate(uint16_t supportedDatarate)
Set the transmit highest supported LGI data rate.
void SetShortGuardIntervalFor160Mhz(uint8_t shortGuardInterval)
Set the short guard interval 160 MHz.
void SetMaxAmpduLength(uint32_t maxAmpduLength)
Set the maximum AMPDU length.
void SetRxMcsMap(uint8_t mcs, uint8_t nss)
void SetRxStbc(uint8_t rxStbc)
Set the receive STBC.
virtual void DoCompleteConfig()=0
Allow subclasses to complete the configuration of the MAC layer components.
uint16_t GetMaxAmsduSize(AcIndex ac) const
Return the maximum A-MSDU size of the given Access Category.
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.
virtual void NotifyChannelSwitching(uint8_t linkId)
Notify that channel on the given link has been switched.
std::optional< Mac48Address > GetMldAddress(const Mac48Address &remoteAddr) const
virtual void SetMacQueueScheduler(Ptr< WifiMacQueueScheduler > scheduler)
Set the wifi MAC queue scheduler.
Mac48Address GetBssid(uint8_t linkId) const
uint16_t m_viMaxAmsduSize
maximum A-MSDU size for AC_VI (in bytes)
bool m_shortSlotTimeSupported
flag whether short slot time is supported
void ConfigurePhyDependentParameters(uint8_t linkId)
Configure PHY dependent parameters such as CWmin and CWmax on the given link.
Ptr< HeConfiguration > GetHeConfiguration() const
DroppedMpduTracedCallback m_droppedMpduCallback
This trace indicates that an MPDU was dropped for the given reason.
TypeOfStation GetTypeOfStation() const
Return the type of station.
bool m_qosSupported
This Boolean is set true iff this WifiMac is to model 802.11e/WMM style Quality of Service.
void SetBkQueue(Ptr< QosTxop > edca)
Set the AC_BK channel access function This method is private so that it is only used while constructi...
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.
Callback< void > m_linkDown
Callback when a link is down.
bool GetQosSupported() const
Return whether the device supports QoS.
virtual void SetAddress(Mac48Address address)
void SetFrameExchangeManagers(const std::vector< Ptr< FrameExchangeManager > > &feManagers)
bool CreateLinksIfNeeded(std::size_t nLinks)
If no link has been already created, create the given number links; otherwise, do nothing.
Ptr< Txop > m_txop
TXOP used for transmission of frames to non-QoS peers.
void SetQosSupported(bool enable)
Enable or disable QoS support for the device.
Mac48Address m_address
MAC address of this station.
std::set< uint8_t > m_linkIds
IDs of the links in use.
Ptr< WifiMacQueueScheduler > GetMacQueueScheduler() const
Get the wifi MAC queue scheduler.
uint16_t GetMpduBufferSize() const
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
BlockAckType GetBaTypeAsRecipient(Mac48Address originator, uint8_t tid) const
void SwapLinks(std::map< uint8_t, uint8_t > links)
Swap the links based on the information included in the given map.
void Enqueue(Ptr< Packet > packet, Mac48Address to)
uint16_t m_voMaxAmsduSize
maximum A-MSDU size for AC_VO (in bytes)
Ptr< MacRxMiddle > m_rxMiddle
RX middle (defragmentation etc.)
Ptr< WifiMacQueueScheduler > m_scheduler
wifi MAC queue scheduler
void DoInitialize() override
Initialize() implementation.
TypeOfStation m_typeOfStation
the type of station
uint16_t m_mpduBufferSize
BlockAck buffer size (in number of MPDUs)
uint32_t m_beMaxAmpduSize
maximum A-MPDU size for AC_BE (in bytes)
void SetChannelAccessManagers(const std::vector< Ptr< ChannelAccessManager > > &caManagers)
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.
void UnblockUnicastTxOnLinks(WifiQueueBlockedReason reason, const 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 SetWifiRemoteStationManagers(const std::vector< Ptr< WifiRemoteStationManager > > &stationManagers)
void SetBeBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BE.
bool GetErpSupported(uint8_t linkId) const
Return whether the device supports ERP on the given link.
void ResetWifiPhys()
Remove currently attached WifiPhy objects from this MAC.
TracedCallback< Ptr< const Packet > > m_macTxTrace
The trace source fired when packets come into the "top" of the device at the L3/L2 transition,...
void SetErpSupported(bool enable, uint8_t linkId)
Enable or disable ERP support for the given link.
bool GetTxBlockedOnLink(AcIndex ac, const WifiContainerQueueId &queueId, uint8_t linkId, WifiQueueBlockedReason reason=WifiQueueBlockedReason::REASONS_COUNT) const
Check whether the transmission of the packets in the given container queue of the given Access Catego...
uint32_t m_voMaxAmpduSize
maximum A-MPDU size for AC_VO (in bytes)
void ConfigureDcf(Ptr< Txop > dcf, uint32_t cwmin, uint32_t cwmax, std::list< bool > isDsss, AcIndex ac)
Ptr< WifiNetDevice > m_device
Pointer to the device.
virtual void NotifyDropPacketToEnqueue(Ptr< Packet > packet, Mac48Address to)
Allow subclasses to take actions when a packet to enqueue has been dropped.
void UpdateLinkId(uint8_t id)
This method is intended to be called when a link changes ID in order to update the link ID stored by ...
IcfDropTracedCallback m_icfDropCallback
traced callback for ICF drop events
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.
MpduTracedCallback m_ackedMpduCallback
ack'ed MPDU callback
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
void SetMpduBufferSize(uint16_t size)
void BlockUnicastTxOnLinks(WifiQueueBlockedReason reason, const 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...
MpduTracedCallback m_nackedMpduCallback
nack'ed MPDU callback
bool GetEhtSupported() const
Return whether the device supports EHT.
void SetTxop(Ptr< Txop > dcf)
Set the Txop object.
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.
void SetBkBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_BK.
void SetVoBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VO.
virtual std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const
Get the ID of the link having the given MAC address, if any.
std::optional< std::reference_wrapper< const RecipientBlockAckAgreement > > RecipientAgreementOptConstRef
optional const reference to RecipientBlockAckAgreement
void NotifyPromiscRx(Ptr< const Packet > packet)
std::unordered_map< Mac48Address, WifiTidLinkMapping, WifiAddressHash > m_dlTidLinkMappings
DL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address)
void SetVoQueue(Ptr< QosTxop > edca)
Set the AC_VO channel access function This method is private so that it is only used while constructi...
virtual bool HasFramesToTransmit(uint8_t linkId)
Check if the MAC has frames to transmit over the given link.
void SetWifiRemoteStationManager(Ptr< WifiRemoteStationManager > stationManager)
UniformRandomBitGenerator m_shuffleLinkIdsGen
random number generator to shuffle link IDs
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...
void CompleteConfig()
Complete the configuration of the MAC layer components.
RecipientAgreementOptConstRef GetBaAgreementEstablishedAsRecipient(Mac48Address originator, uint8_t tid) const
void SetBeBlockAckInactivityTimeout(uint16_t timeout)
Set BE block ack inactivity timeout.
Ptr< EhtConfiguration > GetEhtConfiguration() const
TracedCallback< Ptr< const Packet > > m_macRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
bool GetVhtSupported(uint8_t linkId) const
Return whether the device supports VHT on the given link.
void SetDsssSupported(bool enable, uint8_t linkId)
Enable or disable DSSS support for the given link.
TracedCallback< Ptr< const Packet > > m_macTxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
Ptr< MacTxMiddle > m_txMiddle
TX middle (aggregation etc.)
void NotifyTx(Ptr< const Packet > packet)
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId()
Get the type ID.
Ptr< HtConfiguration > GetHtConfiguration() const
std::optional< std::reference_wrapper< const WifiTidLinkMapping > > GetTidToLinkMapping(Mac48Address mldAddr, WifiDirection dir) const
Get the TID-to-Link Mapping negotiated with the given MLD (if any) for the given direction.
uint32_t GetMaxAmpduSize(AcIndex ac) const
Return the maximum A-MPDU size of the given Access Category.
BlockAckReqType GetBarTypeAsRecipient(Mac48Address originator, uint8_t tid) const
Ssid m_ssid
Service Set ID (SSID)
std::map< uint8_t, std::unique_ptr< LinkEntity > > m_links
ID-indexed map of Link objects.
virtual void DeaggregateAmsduAndForward(Ptr< const WifiMpdu > mpdu)
This method can be called to de-aggregate an A-MSDU and forward the constituent packets up the stack.
Ptr< QosTxop > GetVIQueue() const
Accessor for the AC_VI channel access function.
void SetBssid(Mac48Address bssid, uint8_t linkId)
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
void NotifyRx(Ptr< const Packet > packet)
TracedCallback< Ptr< const Packet > > m_macRxDropTrace
The trace source fired when packets coming into the "top" of the device are dropped at the MAC layer ...
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...
BlockAckType GetBaTypeAsOriginator(const Mac48Address &recipient, uint8_t tid) const
MpduResponseTimeoutTracedCallback m_mpduResponseTimeoutCallback
MPDU response timeout traced callback.
void SetForwardUpCallback(ForwardUpCallback upCallback)
PsduMapResponseTimeoutTracedCallback m_psduMapResponseTimeoutCallback
PSDU map response timeout traced callback.
ExtendedCapabilities GetExtendedCapabilities() const
Return the extended capabilities of the device.
TracedCallback< Ptr< const Packet > > m_macPromiscRxTrace
The trace source fired for packets successfully received by the device immediately before being forwa...
uint16_t m_bkMaxAmsduSize
maximum A-MSDU size for AC_BK (in bytes)
void SetBkBlockAckInactivityTimeout(uint16_t timeout)
Set BK block ack inactivity timeout.
std::unordered_map< Mac48Address, WifiTidLinkMapping, WifiAddressHash > m_ulTidLinkMappings
UL TID-to-Link Mapping negotiated with an MLD (identified by its MLD address)
virtual bool SupportsSendFrom() const
He6GhzBandCapabilities GetHe6GhzBandCapabilities(uint8_t linkId) const
Return the HE 6GHz band capabilities of the device for the given 6 GHz link.
uint16_t GetMaxBaBufferSize(std::optional< Mac48Address > address=std::nullopt) const
Get the maximum Block Ack buffer size (in number of MPDUs) supported by the given device,...
virtual 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,...
std::optional< uint8_t > GetLinkForPhy(Ptr< const WifiPhy > phy) const
Get the ID of the link (if any) on which the given PHY is operating.
void SetViBlockAckThreshold(uint8_t threshold)
Set the block ack threshold for AC_VI.
void SetViBlockAckInactivityTimeout(uint16_t timeout)
Set VI block ack inactivity timeout.
bool GetShortSlotTimeSupported() const
BlockAckReqType GetBarTypeAsOriginator(const Mac48Address &recipient, uint8_t tid) const
void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
void SetupEdcaQueue(AcIndex ac)
This method is a private utility invoked to configure the channel access function for the specified A...
void SetLinkDownCallback(Callback< void > linkDown)
Ptr< QosTxop > GetBKQueue() const
Accessor for the AC_BK channel access function.
void SetPromisc()
Sets the interface in promiscuous mode.
Ptr< VhtConfiguration > GetVhtConfiguration() 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
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void SetCtsToSelfSupported(bool enable)
Enable or disable CTS-to-self feature.
Mac48Address GetLocalAddress(const Mac48Address &remoteAddr) const
Get the local MAC address used to communicate with a remote STA.
EdcaQueues m_edca
This is a map from Access Category index to the corresponding channel access function.
uint32_t m_bkMaxAmpduSize
maximum A-MPDU size for AC_BK (in bytes)
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.
virtual void ConfigureContentionWindow(uint32_t cwMin, uint32_t cwMax)
bool Is6GhzBand(uint8_t linkId) const
Indicate if a given link is on the 6 GHz band.
OriginatorAgreementOptConstRef GetBaAgreementEstablishedAsOriginator(Mac48Address recipient, uint8_t tid) const
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...
std::optional< std::reference_wrapper< const OriginatorBlockAckAgreement > > OriginatorAgreementOptConstRef
optional const reference to OriginatorBlockAckAgreement
Mac48Address GetAddress() const
ForwardUpCallback m_forwardUp
Callback to forward packet up the stack.
EhtCapabilities GetEhtCapabilities(uint8_t linkId) const
Return the EHT capabilities of the device for the given link.
Callback< void > m_linkUp
Callback when a link is up.
LinkEntity & GetLink(uint8_t linkId) const
Get a reference to the link associated with the given ID.
void SetupDcfQueue()
This method is a private utility invoked to configure the channel access function for devices that do...
void SetBeQueue(Ptr< QosTxop > edca)
Set the AC_BE channel access function This method is private so that it is only used while constructi...
HeCapabilities GetHeCapabilities(uint8_t linkId) const
Return the HE capabilities of the device for the given link.
virtual bool CanForwardPacketsTo(Mac48Address to) const =0
Return true if packets can be forwarded to the given destination, false otherwise.
virtual void SetWifiPhys(const std::vector< Ptr< WifiPhy > > &phys)
PsduResponseTimeoutTracedCallback m_psduResponseTimeoutCallback
PSDU response timeout traced callback.
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
void NotifyTxDrop(Ptr< const Packet > packet)
void DoDispose() override
Destructor implementation.
bool GetDsssSupported(uint8_t linkId) const
Return whether the device supports DSSS on the given link.
Ptr< ChannelAccessManager > GetChannelAccessManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Channel Access Manager associated with the given link.
void SetVoBlockAckInactivityTimeout(uint16_t timeout)
Set VO block ack inactivity timeout.
virtual std::unique_ptr< LinkEntity > CreateLinkEntity() const
Create a LinkEntity object.
void SetViQueue(Ptr< QosTxop > edca)
Set the AC_VI channel access function This method is private so that it is only used while constructi...
void SetShortSlotTimeSupported(bool enable)
Enable or disable short slot time feature.
bool m_ctsToSelfSupported
flag indicating whether CTS-To-Self is supported
uint16_t m_beMaxAmsduSize
maximum A-MSDU size for AC_BE (in bytes)
virtual Mac48Address DoGetLocalAddress(const Mac48Address &remoteAddr) const
This method is called if this device is an MLD to determine the MAC address of the affiliated STA use...
uint32_t m_viMaxAmpduSize
maximum A-MPDU size for AC_VI (in bytes)
WifiStandard GetStandard() const
Get the configured Wi-Fi standard.
#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 > 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.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_UNLESS(cond)
Abnormal program termination if a condition is false.
#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(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
TypeOfStation
Enumeration for type of WiFi station.
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
AcIndex QosUtilsMapTidToAc(uint8_t tid)
Maps TID (Traffic ID) to Access classes.
WifiQueueBlockedReason
Enumeration of the reasons to block container queues.
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_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)
@ AC_UNDEF
Total number of ACs.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Ptr< const AttributeChecker > MakeSsidChecker()
U * PeekPointer(const Ptr< U > &p)
Ptr< const AttributeChecker > MakeUintegerChecker()
std:: tuple< WifiContainerQueueType, WifiReceiverAddressType, Mac48Address, std::optional< uint8_t > > WifiContainerQueueId
Tuple (queue type, receiver address type, Address, TID) identifying a container queue.
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...
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeSsidAccessor(T1 a1)
Ptr< const AttributeChecker > MakeObjectVectorChecker()
ObjectPtrContainerValue ObjectVectorValue
ObjectVectorValue is an alias for ObjectPtrContainerValue.
Ptr< const AttributeAccessor > MakeObjectVectorAccessor(U T::*memberVariable)
MakeAccessorHelper implementation for ObjectVector.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
std::map< uint8_t, std::set< uint8_t > > WifiTidLinkMapping
TID-indexed map of the link set to which the TID is mapped.
void Shuffle(RND_ACCESS_ITER first, RND_ACCESS_ITER last, Ptr< UniformRandomVariable > rv)
Shuffle the elements in the range first to last.
const std::map< AcIndex, WifiAc > wifiAcList
Map containing the four ACs in increasing order of priority (according to Table 10-1 "UP-to-AC Mappin...
WifiDirection
Wifi direction.
@ LOG_FUNCTION
Function tracing for non-trivial function calls.
Ptr< T1 > StaticCast(const Ptr< T2 > &p)
Cast a Ptr.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
The different BlockAckRequest variants.
The different BlockAck variants.
@ EHT_MCS_MAP_TYPE_20_MHZ_ONLY
@ EHT_MCS_MAP_TYPE_NOT_LARGER_THAN_80_MHZ
@ EHT_MCS_MAP_TYPE_160_MHZ
uint8_t supportTx1024And4096QamForRuSmallerThan242Tones
Tx 1024-QAM And 4096-QAM < 242-tone RU Support.
uint8_t supportRx1024And4096QamForRuSmallerThan242Tones
Rx 1024-QAM And 4096-QAM < 242-tone RU Support.
Structure holding information specific to a single link.
Ptr< WifiRemoteStationManager > stationManager
Remote station manager (rate control, RTS/CTS/fragmentation thresholds etc.)
Ptr< WifiPhy > phy
Wifi PHY object.
virtual ~LinkEntity()
Destructor (a virtual method is needed to make this struct polymorphic)
bool dsssSupported
set to true iff this WifiMac is to model 802.11b
bool erpSupported
set to true iff this WifiMac is to model 802.11g
Ptr< FrameExchangeManager > feManager
Frame Exchange Manager object.
Ptr< ChannelAccessManager > channelAccessManager
channel access manager object