20#include "ns3/ap-wifi-mac.h"
21#include "ns3/config.h"
22#include "ns3/he-configuration.h"
23#include "ns3/he-frame-exchange-manager.h"
24#include "ns3/he-phy.h"
26#include "ns3/mgt-headers.h"
27#include "ns3/mobility-helper.h"
28#include "ns3/multi-link-element.h"
29#include "ns3/multi-model-spectrum-channel.h"
30#include "ns3/node-list.h"
31#include "ns3/packet-socket-client.h"
32#include "ns3/packet-socket-helper.h"
33#include "ns3/packet-socket-server.h"
34#include "ns3/packet.h"
35#include "ns3/pointer.h"
36#include "ns3/qos-utils.h"
37#include "ns3/rng-seed-manager.h"
38#include "ns3/rr-multi-user-scheduler.h"
39#include "ns3/spectrum-wifi-helper.h"
40#include "ns3/spectrum-wifi-phy.h"
41#include "ns3/sta-wifi-mac.h"
42#include "ns3/string.h"
44#include "ns3/wifi-acknowledgment.h"
45#include "ns3/wifi-assoc-manager.h"
46#include "ns3/wifi-mac-header.h"
47#include "ns3/wifi-mac-queue.h"
48#include "ns3/wifi-net-device.h"
49#include "ns3/wifi-protection.h"
50#include "ns3/wifi-psdu.h"
81 void DoRun()
override;
85 :
TestCase(
"Check the implementation of WifiAssocManager::GetNextAffiliatedAp()")
159 "Unexpected neighbor ID of the second reported AP");
162 "Unexpected tbtt ID of the second reported AP");
168 "Did not expect to find a third suitable reported AP");
175 auto apIt = allAps.begin();
178 "Unexpected neighbor ID of the first reported AP");
181 "Unexpected tbtt ID of the first reported AP");
186 "Unexpected neighbor ID of the second reported AP");
189 "Unexpected tbtt ID of the second reported AP");
216 std::vector<std::string> staChannels,
217 std::vector<std::string> apChannels,
218 std::vector<uint8_t> fixedPhyBands = {});
231 virtual void Transmit(uint8_t linkId,
240 using ChannelMap = std::map<FrequencyRange, Ptr<MultiModelSpectrumChannel>>;
258 std::optional<Direction> direction = std::nullopt);
289 const std::vector<std::string>& channels,
311 std::vector<std::string> staChannels,
312 std::vector<std::string> apChannels,
313 std::vector<uint8_t> fixedPhyBands)
315 m_staChannels(staChannels),
316 m_apChannels(apChannels),
317 m_fixedPhyBands(fixedPhyBands),
318 m_staMacs(nStations),
319 m_nStations(nStations),
326 std::optional<Direction> direction)
328 std::optional<Mac48Address> apAddr;
329 std::optional<Mac48Address> staAddr;
332 if (psdu->GetHeader(0).IsQosData())
334 direction = (!psdu->GetHeader(0).IsToDs() && psdu->GetHeader(0).IsFromDs()) ?
DL :
UL;
340 if (!psdu->GetAddr1().IsGroup())
342 staAddr = psdu->GetAddr1();
344 apAddr = psdu->GetAddr2();
348 if (!psdu->GetAddr1().IsGroup())
350 apAddr = psdu->GetAddr1();
352 staAddr = psdu->GetAddr2();
368 "Address " << *apAddr <<
" is not an AP device address. "
369 <<
"PSDU: " << *psdu);
377 for (uint8_t linkId = 0; linkId <
m_staMacs[i]->GetNLinks(); linkId++)
379 if (
m_staMacs[i]->GetFrameExchangeManager(linkId)->GetAddress() == *staAddr)
392 "Address " << *staAddr <<
" is not a STA device address. "
393 <<
"PSDU: " << *psdu);
406 for (
const auto& [aid, psdu] : psduMap)
408 std::stringstream ss;
409 ss << std::setprecision(10) <<
"PSDU #" <<
m_txPsdus.size() <<
" Link ID " << +linkId <<
" "
410 << psdu->GetHeader(0).GetTypeString() <<
" #MPDUs " << psdu->GetNMpdus()
411 <<
" duration/ID " << psdu->GetHeader(0).GetDuration() <<
" RA = " << psdu->GetAddr1()
412 <<
" TA = " << psdu->GetAddr2() <<
" ADDR3 = " << psdu->GetHeader(0).GetAddr3()
413 <<
" ToDS = " << psdu->GetHeader(0).IsToDs()
414 <<
" FromDS = " << psdu->GetHeader(0).IsFromDs();
415 if (psdu->GetHeader(0).IsQosData())
420 ss << mpdu->GetHeader().GetSequenceNumber() <<
",";
422 ss <<
"} TID = " << +psdu->GetHeader(0).GetQosTid();
431 const std::vector<std::string>& channels,
438 for (
const auto& str : channels)
445 for (
const auto& [band, channel] : channelMap)
456 int64_t streamNumber = 30;
459 wifiApNode.Create(1);
467 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
488 mac.SetType(
"ns3::StaWifiMac",
494 mac.SetType(
"ns3::ApWifiMac",
507 streamNumber += wifi.AssignStreams(apDevices, streamNumber);
508 streamNumber += wifi.AssignStreams(staDevices, streamNumber);
513 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
514 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
515 mobility.SetPositionAllocator(positionAlloc);
517 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
518 mobility.Install(wifiApNode);
519 mobility.Install(wifiStaNodes);
521 m_apMac = DynamicCast<ApWifiMac>(DynamicCast<WifiNetDevice>(apDevices.Get(0))->GetMac());
525 DynamicCast<StaWifiMac>(DynamicCast<WifiNetDevice>(staDevices.Get(i))->GetMac());
529 for (uint8_t linkId = 0; linkId < StaticCast<WifiNetDevice>(apDevices.Get(0))->GetNPhys();
533 std::to_string(linkId) +
"/PhyTxPsduBegin",
538 for (uint8_t linkId = 0; linkId < StaticCast<WifiNetDevice>(staDevices.Get(i))->GetNPhys();
542 "/NodeList/" + std::to_string(i + 1) +
"/DeviceList/*/$ns3::WifiNetDevice/Phys/" +
543 std::to_string(linkId) +
"/PhyTxPsduBegin",
600 std::vector<std::string> apChannels,
602 std::vector<std::pair<uint8_t, uint8_t>> setupLinks,
603 std::vector<uint8_t> fixedPhyBands = {});
608 void DoRun()
override;
660 std::vector<std::string> apChannels,
662 std::vector<std::pair<uint8_t, uint8_t>> setupLinks,
663 std::vector<uint8_t> fixedPhyBands)
669 m_setupLinks(setupLinks),
670 m_scanType(scanType),
696 const auto& mpdu = *frameInfo.psduMap.begin()->second->begin();
697 const auto& linkId = frameInfo.linkId;
699 switch (mpdu->GetHeader().GetType())
725 std::size_t expectedProbeResp = 0;
734 if (staChannel == apChannel)
756 mpdu->GetHeader().GetAddr2(),
757 "TA of Beacon frame is not the address of the link it is transmitted on");
759 mpdu->GetPacket()->PeekHeader(beacon);
767 "RNR Element in Beacon frame from single link AP");
770 "Multi-Link Element in Beacon frame from single link AP");
779 "Unexpected number of Neighbor AP Info fields in RNR");
780 for (std::size_t nbrApInfoId = 0; nbrApInfoId < rnr->GetNNbrApInfoFields(); nbrApInfoId++)
784 "MLD Parameters not present");
787 "Expected only one TBTT Info subfield per Neighbor AP Info");
788 uint8_t nbrLinkId = rnr->GetLinkId(nbrApInfoId, 0);
791 "BSSID advertised in Neighbor AP Info field "
793 <<
" does not match the address configured on the link "
794 "advertised in the same field");
800 "Incorrect MLD address advertised in Multi-Link Element");
803 "Incorrect Link ID advertised in Multi-Link Element");
815 mpdu->GetHeader().GetAddr2(),
816 "TA of Probe Response is not the address of the link it is transmitted on");
818 mpdu->GetPacket()->PeekHeader(probeResp);
826 "RNR Element in Probe Response frame from single link AP");
829 "Multi-Link Element in Probe Response frame from single link AP");
838 "Unexpected number of Neighbor AP Info fields in RNR");
839 for (std::size_t nbrApInfoId = 0; nbrApInfoId < rnr->GetNNbrApInfoFields(); nbrApInfoId++)
843 "MLD Parameters not present");
846 "Expected only one TBTT Info subfield per Neighbor AP Info");
847 uint8_t nbrLinkId = rnr->GetLinkId(nbrApInfoId, 0);
850 "BSSID advertised in Neighbor AP Info field "
852 <<
" does not match the address configured on the link "
853 "advertised in the same field");
859 "Incorrect MLD address advertised in Multi-Link Element");
862 "Incorrect Link ID advertised in Multi-Link Element");
873 m_staMacs[0]->GetFrameExchangeManager(linkId)->GetAddress(),
874 mpdu->GetHeader().GetAddr2(),
875 "TA of Assoc Request frame is not the address of the link it is transmitted on");
877 mpdu->GetPacket()->PeekHeader(assoc);
884 "Multi-Link Element in Assoc Request frame from single link STA");
891 "Incorrect MLD Address advertised in Multi-Link Element");
894 "Incorrect number of Per-STA Profile subelements in Multi-Link Element");
895 for (std::size_t i = 0; i < mle->GetNPerStaProfileSubelements(); i++)
897 auto& perStaProfile = mle->GetPerStaProfile(i);
900 "Per-STA Profile must contain STA MAC address");
902 auto staLinkId =
m_staMacs[0]->GetLinkIdByAddress(perStaProfile.GetStaMacAddress());
904 staLinkId.has_value(),
906 "No link found with the STA MAC address advertised in Per-STA Profile");
910 "The STA that sent the Assoc Request should not be included in a Per-STA Profile");
912 return pair.first == staLinkId.value();
916 "Not expecting to setup STA link ID " << +staLinkId.value());
919 +perStaProfile.GetLinkId(),
920 "Not expecting to request association to AP Link ID in Per-STA Profile");
923 "Missing Association Request in Per-STA Profile");
936 mpdu->GetHeader().GetAddr2(),
937 "TA of Assoc Response frame is not the address of the link it is transmitted on");
939 mpdu->GetPacket()->PeekHeader(assoc);
947 "Multi-Link Element in Assoc Response frame with single link AP or single link STA");
954 "Incorrect MLD Address advertised in Multi-Link Element");
957 "Incorrect number of Per-STA Profile subelements in Multi-Link Element");
958 for (std::size_t i = 0; i < mle->GetNPerStaProfileSubelements(); i++)
960 auto& perStaProfile = mle->GetPerStaProfile(i);
963 "Per-STA Profile must contain STA MAC address");
967 apLinkId.has_value(),
969 "No link found with the STA MAC address advertised in Per-STA Profile");
971 +perStaProfile.GetLinkId(),
972 "Link ID and MAC address advertised in Per-STA Profile do not match");
976 "The AP that sent the Assoc Response should not be included in a Per-STA Profile");
978 return pair.second == apLinkId.value();
982 "Not expecting to setup AP link ID " << +apLinkId.value());
985 "Missing Association Response in Per-STA Profile");
999 auto staAddr =
m_staMacs[0]->GetFrameExchangeManager(staLinkId)->GetAddress();
1002 auto staRemoteMgr =
m_staMacs[0]->GetWifiRemoteStationManager(staLinkId);
1008 "Unexpected BSSID for STA link ID " << +staLinkId);
1013 "Incorrect MLD address stored by STA on link ID " << +staLinkId);
1017 "Incorrect affiliated address stored by STA on link ID " << +staLinkId);
1023 "Expecting STA " << staAddr <<
" to be associated on link "
1028 (apRemoteMgr->GetMldAddress(staAddr) ==
m_staMacs[0]->GetAddress()),
1030 "Incorrect MLD address stored by AP on link ID " << +apLinkId);
1032 (apRemoteMgr->GetAffiliatedStaAddress(
m_staMacs[0]->GetAddress()) == staAddr),
1034 "Incorrect affiliated address stored by AP on link ID " << +apLinkId);
1040 "STA " << staAddr <<
" not found in list of associated STAs");
1044 +
m_staMacs[0]->GetWifiPhy(staLinkId)->GetOperatingChannel().GetNumber(),
1046 "Incorrect operating channel number for STA on link " << +staLinkId);
1048 m_staMacs[0]->GetWifiPhy(staLinkId)->GetOperatingChannel().GetFrequency(),
1050 "Incorrect operating channel frequency for STA on link " << +staLinkId);
1053 "Incorrect operating channel width for STA on link " << +staLinkId);
1055 +
m_staMacs[0]->GetWifiPhy(staLinkId)->GetOperatingChannel().GetPhyBand(),
1057 "Incorrect operating PHY band for STA on link " << +staLinkId);
1059 +
m_staMacs[0]->GetWifiPhy(staLinkId)->GetOperatingChannel().GetPrimaryChannelIndex(20),
1061 "Incorrect operating primary channel index for STA on link " << +staLinkId);
1068 for (std::size_t linkId = 0; linkId <
m_staChannels.size(); linkId++)
1071 return link.first == linkId;
1078 "Link " << +linkId <<
" has not been setup but is not disabled");
1085 "Expecting link " << +linkId <<
" to be active");
1165 uint8_t nMaxInflight,
1166 const std::vector<std::string>& staChannels,
1167 const std::vector<std::string>& apChannels,
1168 const std::vector<uint8_t>& fixedPhyBands = {});
1191 std::string context,
1194 double txPowerW)
override;
1196 void DoRun()
override;
1224 uint8_t nMaxInflight,
1225 const std::vector<std::string>& staChannels,
1226 const std::vector<std::string>& apChannels,
1227 const std::vector<uint8_t>& fixedPhyBands)
1229 std::string(
"Check data transmission between MLDs ") +
1232 ?
"with BA agreement, send BAR after BlockAck timeout"
1233 :
"with BA agreement, send Data frames after BlockAck timeout")
1234 :
"without BA agreement") +
1235 " (Traffic pattern: " +
std::to_string(static_cast<uint8_t>(trafficPattern)) +
1243 m_trafficPattern(trafficPattern),
1246 m_nMaxInflight(nMaxInflight),
1256 std::string context,
1261 auto psdu = psduMap.begin()->second;
1263 switch (psdu->GetHeader(0).GetType())
1268 psdu->GetHeader(0).GetAddr2() == psdu->GetHeader(0).GetAddr3() ?
DL :
UL);
1273 m_uidList.push_front(psdu->GetPacket()->GetUid());
1281 for (
const auto& mpdu : *psdu)
1285 if (
m_baEnabled && linkId < m_sourceMac->GetNLinks() &&
1287 mpdu->GetHeader().GetAddr2() &&
1288 !mpdu->GetHeader().GetAddr1().IsGroup())
1290 auto seqNo = mpdu->GetHeader().GetSequenceNumber();
1291 auto [it, success] =
1295 it->second = std::max(it->second, mpdu->GetInFlightLinkIds().size());
1299 for (std::size_t i = 0; i < psdu->GetNMpdus(); i++)
1305 if (psdu->GetHeader(i).GetSequenceNumber() != 1 ||
1312 auto uid = psdu->GetPayload(i)->GetUid();
1349 m_uidList.push_front(psdu->GetPacket()->GetUid());
1376 "No BlockAck expected in AP to broadcast traffic pattern");
1390 auto mpdu = *psdu->begin();
1392 mpdu->GetPacket()->PeekHeader(blockAck);
1393 bool isMpdu1corrupted = (
m_trafficPattern == WifiTrafficPattern::STA_TO_AP ||
1401 "MPDU 0 expected to be successfully received");
1405 "MPDU 1 expected to be received only in STA_TO_STA/STA_TO_BCAST scenarios");
1408 if (
m_staMacs[0]->GetSetupLinkIds().size() > 1)
1413 auto item = queue->PeekByTidAndAddress(0, rcvMac->GetAddress());
1414 std::size_t nQueuedPkt = 0;
1417 rcvMac->GetWifiPhy(linkId)->GetPhyBand()) +
1422 auto seqNo = item->GetHeader().GetSequenceNumber();
1425 "MPDU with seqNo=" << seqNo <<
" is not in flight");
1426 auto linkIds = item->GetInFlightLinkIds();
1429 "MPDU with seqNo=" << seqNo
1430 <<
" is in flight on multiple links");
1437 "Addr1 of BlockAck is not an originator's link address");
1440 "MPDU with seqNo=" << seqNo
1441 <<
" in flight on unexpected link");
1446 bool isQueued = (seqNo > (isMpdu1corrupted ? 0 : 1));
1450 bool isRetry = isQueued && seqNo <= 1;
1456 << item->GetHeader().GetSequenceNumber() <<
" should "
1457 << (isQueued ?
"" :
"not") <<
" be queued");
1459 item->GetHeader().IsRetry(),
1461 "Unexpected value for the Retry subfield of the MPDU with seqNo="
1462 << item->GetHeader().GetSequenceNumber());
1466 item = queue->PeekByTidAndAddress(0, rcvMac->GetAddress(), item);
1477 "Did not expect to receive a second BlockAck");
1479 std::pair<uint16_t, uint16_t> seqNos;
1484 if (
m_staMacs[0]->GetSetupLinkIds().size() > 1)
1494 "MPDU " << seqNos.first <<
" expected to be successfully received");
1497 "MPDU " << seqNos.second <<
" expected to be successfully received");
1505 NS_LOG_INFO(
"Packet received by NODE " << +nodeId <<
"\n");
1520 mac->GetQosTxop(
AC_BE)->SetAttribute(
"UseExplicitBarAfterMissedBlockAck",
1529 auto errorModel = CreateObject<ListErrorModel>();
1533 for (std::size_t linkId = 0; linkId <
m_staMacs[0]->GetNLinks(); linkId++)
1535 auto errorModel = CreateObject<ListErrorModel>();
1537 m_staMacs[0]->GetWifiPhy(linkId)->SetPostReceptionErrorModel(errorModel);
1539 errorModel = CreateObject<ListErrorModel>();
1541 m_staMacs[1]->GetWifiPhy(linkId)->SetPostReceptionErrorModel(errorModel);
1553 case WifiTrafficPattern::STA_TO_STA:
1555 destAddr =
m_staMacs[1]->GetDevice()->GetAddress();
1557 case WifiTrafficPattern::STA_TO_AP:
1561 case WifiTrafficPattern::AP_TO_STA:
1563 destAddr =
m_staMacs[1]->GetDevice()->GetAddress();
1565 case WifiTrafficPattern::AP_TO_BCAST:
1569 case WifiTrafficPattern::STA_TO_BCAST:
1586 auto client1 = CreateObject<PacketSocketClient>();
1590 client1->SetRemote(socket);
1592 client1->SetStartTime(
Seconds(0));
1593 client1->SetStopTime(duration);
1598 auto client2 = CreateObject<PacketSocketClient>();
1602 client2->SetRemote(socket);
1606 client2->SetStopTime(duration);
1613 server->SetLocal(socket);
1614 (*nodeIt)->AddApplication(server);
1615 server->SetStartTime(
Seconds(0));
1616 server->SetStopTime(duration);
1622 "/ApplicationList/*/$ns3::PacketSocketServer/Rx",
1635 std::array<std::size_t, 3> expectedRxPkts{};
1639 case WifiTrafficPattern::STA_TO_STA:
1640 case WifiTrafficPattern::AP_TO_STA:
1644 case WifiTrafficPattern::STA_TO_AP:
1648 case WifiTrafficPattern::AP_TO_BCAST:
1654 case WifiTrafficPattern::STA_TO_BCAST:
1664 "Unexpected number of packets received by the AP");
1667 "Unexpected number of packets received by STA 0");
1670 "Unexpected number of packets received by STA 1");
1675 std::size_t expectedBaCount = 0;
1676 std::size_t expectedBarCount = 0;
1680 case WifiTrafficPattern::STA_TO_AP:
1681 case WifiTrafficPattern::AP_TO_STA:
1683 expectedBaCount = 3;
1687 case WifiTrafficPattern::STA_TO_STA:
1688 case WifiTrafficPattern::STA_TO_BCAST:
1690 expectedBaCount = 1;
1696 "Unexpected number of BlockAck frames");
1699 "Unexpected number of BlockAckReq frames");
1710 "Did not collect number of simultaneous transmissions for all data frames");
1713 std::size_t maxCount = 0;
1719 "MPDU with seqNo=" << seqNo
1720 <<
" transmitted simultaneously more times than allowed");
1721 maxCount = std::max(maxCount, count);
1727 "Expected that at least one data frame was transmitted simultaneously a number of "
1728 "times equal to the NMaxInflights attribute");
1784 uint8_t nMaxInflight,
1785 const std::vector<std::string>& staChannels,
1786 const std::vector<std::string>& apChannels,
1787 const std::vector<uint8_t>& fixedPhyBands = {});
1810 std::string context,
1813 double txPowerW)
override;
1815 void DoRun()
override;
1848 uint8_t nMaxInflight,
1849 const std::vector<std::string>& staChannels,
1850 const std::vector<std::string>& apChannels,
1851 const std::vector<uint8_t>& fixedPhyBands)
1853 std::string(
"Check MU data transmission between MLDs ") +
1855 ?
"(send BAR after BlockAck timeout,"
1856 :
"(send Data frames after BlockAck timeout,") +
1857 " MU Traffic pattern: " +
std::to_string(static_cast<uint8_t>(muTrafficPattern)) +
1858 ", nMaxInflight=" +
std::to_string(nMaxInflight) +
")",
1863 m_muTrafficPattern(muTrafficPattern),
1865 m_nMaxInflight(nMaxInflight),
1866 m_sockets(m_nStations),
1873 std::string context,
1880 for (
const auto& [staId, psdu] : psduMap)
1882 switch (psdu->GetHeader(0).GetType())
1886 if (psdu->GetHeader(0).HasData())
1888 bool isDl = psdu->GetHeader(0).IsFromDs();
1890 isDl ? psdu->GetHeader(0).GetAddr1() : psdu->GetHeader(0).GetAddr2();
1893 for (
const auto& mpdu : *psdu)
1896 auto seqNo = mpdu->GetHeader().GetSequenceNumber();
1898 {{address, seqNo}, mpdu->GetInFlightLinkIds().size()});
1901 it->second = std::max(it->second, mpdu->GetInFlightLinkIds().size());
1904 for (std::size_t i = 0; i < psdu->GetNMpdus(); i++)
1907 if (psdu->GetHeader(i).GetSequenceNumber() == 2)
1913 "MPDU " << **std::next(psdu->begin(), i)
1914 <<
" not transmitted in a TB PPDU");
1920 "MPDU " << **std::next(psdu->begin(), i)
1921 <<
" not transmitted in a DL MU PPDU");
1925 if (psdu->GetHeader(i).GetSequenceNumber() != 3)
1929 auto uid = psdu->GetPayload(i)->GetUid();
1966 m_uidList.push_front(psdu->GetPacket()->GetUid());
1972 psdu->GetPayload(0)->PeekHeader(trigger);
1990 m_staMacs[i]->GetDevice()->GetNode()->AddApplication(client);
1991 client->SetStartTime(txDuration);
1992 client->SetStopTime(
Seconds(1.0));
1993 client->Initialize();
2043 auto mpdu = *psdu->begin();
2045 mpdu->GetPacket()->PeekHeader(blockAck);
2046 bool isMpdu3corrupted;
2061 auto index = indices.front();
2064 "Expected that a QoS data frame was corrupted");
2066 m_staMacs[i]->GetLinkIdByAddress(*m_dataCorruptedSta).has_value();
2069 "MPDU 2 expected to be successfully received");
2072 "Unexpected reception status for MPDU 3");
2082 "MPDU 2 expected to be successfully received");
2085 "Unexpected reception status for MPDU 3");
2089 m_staMacs[0]->GetSetupLinkIds().size() > 1)
2093 if (
m_staMacs[0]->GetFrameExchangeManager(linkId)->GetAddress() ==
2094 mpdu->GetHeader().GetAddr2())
2098 else if (
m_staMacs[1]->GetFrameExchangeManager(linkId)->GetAddress() ==
2099 mpdu->GetHeader().GetAddr2())
2105 NS_ABORT_MSG(
"BlockAck frame not sent by a station in DL scenario");
2107 auto item = queue->PeekByTidAndAddress(0, rcvMac->GetAddress());
2108 std::size_t nQueuedPkt = 0;
2111 rcvMac->GetWifiPhy(linkId)->GetPhyBand()) +
2116 auto seqNo = item->GetHeader().GetSequenceNumber();
2119 "MPDU with seqNo=" << seqNo <<
" is not in flight");
2120 auto linkIds = item->GetInFlightLinkIds();
2123 "MPDU with seqNo=" << seqNo
2124 <<
" is in flight on multiple links");
2131 "Addr1 of BlockAck is not an originator's link address");
2134 "MPDU with seqNo=" << seqNo
2135 <<
" in flight on unexpected link");
2140 bool isQueued = (seqNo > (isMpdu3corrupted ? 2 : 3));
2144 bool isRetry = isQueued && seqNo <= 3;
2150 << item->GetHeader().GetSequenceNumber() <<
" should "
2151 << (isQueued ?
"" :
"not") <<
" be queued");
2153 item->GetHeader().IsRetry(),
2155 "Unexpected value for the Retry subfield of the MPDU with seqNo="
2156 << item->GetHeader().GetSequenceNumber());
2160 item = queue->PeekByTidAndAddress(0, rcvMac->GetAddress(), item);
2172 NS_LOG_INFO(
"Packet received by NODE " << +nodeId <<
"\n");
2181 case WifiMuTrafficPattern::DL_MU_BAR_BA_SEQUENCE:
2185 case WifiMuTrafficPattern::DL_MU_MU_BAR:
2189 case WifiMuTrafficPattern::DL_MU_AGGR_MU_BAR:
2202 mac->GetQosTxop(
AC_BE)->SetAttribute(
"UseExplicitBarAfterMissedBlockAck",
2207 mac->GetQosTxop(
AC_VI)->SetAttribute(
"UseExplicitBarAfterMissedBlockAck",
2213 auto muScheduler = CreateObjectWithAttributes<RrMultiUserScheduler>(
2225 auto errorModel = CreateObject<ListErrorModel>();
2229 for (std::size_t linkId = 0; linkId <
m_staMacs[0]->GetNLinks(); linkId++)
2231 auto errorModel = CreateObject<ListErrorModel>();
2233 m_staMacs[0]->GetWifiPhy(linkId)->SetPostReceptionErrorModel(errorModel);
2235 errorModel = CreateObject<ListErrorModel>();
2237 m_staMacs[1]->GetWifiPhy(linkId)->SetPostReceptionErrorModel(errorModel);
2264 auto client1 = CreateObject<PacketSocketClient>();
2268 client1->SetRemote(socket);
2271 client1->SetStopTime(duration);
2275 auto client2 = CreateObject<PacketSocketClient>();
2279 client2->SetRemote(socket);
2283 client2->SetStopTime(duration);
2287 auto client3 = CreateObject<PacketSocketClient>();
2291 client3->SetRemote(socket);
2295 client3->SetStopTime(duration);
2315 m_staMacs[i]->GetDevice()->GetNode()->AddApplication(client1);
2317 client1->SetStopTime(duration);
2329 muScheduler->SetAccessReqInterval(
Seconds(0));
2337 auto device = DynamicCast<WifiNetDevice>((*nodeIt)->GetDevice(0));
2343 server->SetLocal(srvAddr);
2344 (*nodeIt)->AddApplication(server);
2345 server->SetStartTime(
Seconds(0));
2346 server->SetStopTime(duration);
2347 server->TraceConnectWithoutContext(
2361 std::array<std::size_t, 3> expectedRxPkts{};
2365 case WifiMuTrafficPattern::DL_MU_BAR_BA_SEQUENCE:
2366 case WifiMuTrafficPattern::DL_MU_MU_BAR:
2367 case WifiMuTrafficPattern::DL_MU_AGGR_MU_BAR:
2372 case WifiMuTrafficPattern::UL_MU:
2380 "Unexpected number of packets received by the AP");
2383 "Unexpected number of packets received by STA 0");
2386 "Unexpected number of packets received by STA 1");
2394 "Did not collect number of simultaneous transmissions for all data frames");
2397 std::size_t maxCount = 0;
2403 << txSeqNoPair.second
2404 <<
" transmitted simultaneously more times than allowed");
2405 maxCount = std::max(maxCount, count);
2411 "Expected that at least one data frame was transmitted simultaneously a number of "
2412 "times equal to the NMaxInflights attribute");
2443 void DoRun()
override;
2445 std::string context,
2448 double txPowerW)
override;
2466 "Check sequence numbers after CTS timeout",
2468 {
"{36, 0, BAND_5GHZ, 0}",
"{2, 0, BAND_2_4GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}"},
2469 {
"{36, 0, BAND_5GHZ, 0}",
"{2, 0, BAND_2_4GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}"}),
2470 m_nQosDataFrames(0),
2471 m_errorModel(CreateObject<ListErrorModel>()),
2472 m_rtsCorrupted(
false)
2485 for (std::size_t linkId = 0; linkId <
m_staMacs[0]->GetNLinks(); linkId++)
2496 auto client = CreateObject<PacketSocketClient>();
2501 client->SetStartTime(
Seconds(0));
2502 client->SetStopTime(duration);
2528 (*nodeIt)->AddApplication(server);
2529 server->SetStartTime(
Seconds(0));
2530 server->SetStopTime(duration);
2536 std::string context,
2541 auto psdu = psduMap.begin()->second;
2550 else if (psdu->GetHeader(0).IsQosData())
2572 std::size_t count{};
2576 auto psdu = txPsdu.psduMap.begin()->second;
2578 if (!psdu->GetHeader(0).IsQosData())
2586 uint16_t expectedSeqNo{};
2605 "Unexpected sequence number");
2628 std::tuple<std::vector<std::string>,
2629 std::vector<std::string>,
2630 std::vector<std::pair<uint8_t, uint8_t>>,
2632 std::vector<uint8_t>>;
2636 for (
const auto& [staChannels, apChannels, setupLinks, fixedPhyBands] :
2638 ParamsTuple({
"{36, 0, BAND_5GHZ, 0}",
"{2, 0, BAND_2_4GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}"},
2639 {
"{36, 0, BAND_5GHZ, 0}",
"{2, 0, BAND_2_4GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}"},
2640 {{0, 0}, {1, 1}, {2, 2}},
2643 ParamsTuple({
"{108, 0, BAND_5GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}"},
2644 {
"{36, 0, BAND_5GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}",
"{5, 0, BAND_6GHZ, 0}"},
2645 {{1, 0}, {0, 1}, {2, 2}},
2648 ParamsTuple({
"{2, 0, BAND_2_4GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}"},
2649 {
"{36, 0, BAND_5GHZ, 0}",
"{9, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2650 {{2, 0}, {0, 1}, {1, 2}},
2655 {
"{2, 0, BAND_2_4GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}",
"{8, 20, BAND_2_4GHZ, 0}"},
2656 {
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2663 {
"{2, 0, BAND_2_4GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}",
"{8, 20, BAND_2_4GHZ, 0}"},
2664 {
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2672 ParamsTuple({
"{2, 0, BAND_2_4GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}",
"{60, 0, BAND_5GHZ, 0}"},
2673 {
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2679 ParamsTuple({
"{2, 0, BAND_2_4GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}"},
2680 {
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2684 ParamsTuple({
"{2, 0, BAND_2_4GHZ, 0}",
"{36, 0, BAND_5GHZ, 0}"},
2685 {
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2689 ParamsTuple({
"{120, 0, BAND_5GHZ, 0}"},
2690 {
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2694 ParamsTuple({
"{36, 0, BAND_5GHZ, 0}",
"{1, 0, BAND_6GHZ, 0}",
"{120, 0, BAND_5GHZ, 0}"},
2695 {
"{120, 0, BAND_5GHZ, 0}"},
2701 WifiScanType::PASSIVE,
2707 WifiScanType::ACTIVE,
2712 for (
const auto& trafficPattern : {WifiTrafficPattern::STA_TO_STA,
2713 WifiTrafficPattern::STA_TO_AP,
2714 WifiTrafficPattern::AP_TO_STA,
2715 WifiTrafficPattern::AP_TO_BCAST,
2716 WifiTrafficPattern::STA_TO_BCAST})
2721 WifiUseBarAfterMissedBa::NO,
2727 for (
const auto& useBarAfterMissedBa :
2728 {WifiUseBarAfterMissedBa::YES, WifiUseBarAfterMissedBa::NO})
2733 useBarAfterMissedBa,
2742 useBarAfterMissedBa,
2751 for (
const auto& muTrafficPattern : {WifiMuTrafficPattern::DL_MU_BAR_BA_SEQUENCE,
2752 WifiMuTrafficPattern::DL_MU_MU_BAR,
2753 WifiMuTrafficPattern::DL_MU_AGGR_MU_BAR,
2754 WifiMuTrafficPattern::UL_MU})
2756 for (
const auto& useBarAfterMissedBa :
2757 {WifiUseBarAfterMissedBa::YES, WifiUseBarAfterMissedBa::NO})
2761 useBarAfterMissedBa,
2769 useBarAfterMissedBa,
Test the implementation of WifiAssocManager::GetNextAffiliatedAp(), which searches a given RNR elemen...
GetRnrLinkInfoTest()
Constructor.
~GetRnrLinkInfoTest() override=default
void DoRun() override
Implementation to actually run this TestCase.
Test data transmission between MLDs using OFDMA MU transmissions.
std::optional< Mac48Address > m_dataCorruptedSta
MAC address of the station that received MPDU with SeqNo=2 corrupted.
MultiLinkMuTxTest(WifiMuTrafficPattern muTrafficPattern, WifiUseBarAfterMissedBa useBarAfterMissedBa, uint8_t nMaxInflight, const std::vector< std::string > &staChannels, const std::vector< std::string > &apChannels, const std::vector< uint8_t > &fixedPhyBands={})
Constructor.
std::pair< Mac48Address, uint16_t > AddrSeqNoPair
A pair of a MAC address (the address of the receiver for DL frames and the address of the sender for ...
~MultiLinkMuTxTest() override=default
void CheckBlockAck(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint8_t linkId)
Check the content of a received BlockAck frame when the max number of links on which an MPDU can be i...
std::vector< PacketSocketAddress > m_sockets
packet socket addresses for STAs
void L7Receive(uint8_t nodeId, Ptr< const Packet > p, const Address &addr)
Function to trace packets received by the server application.
std::array< std::size_t, 3 > m_rxPkts
number of packets received at application layer by each node (AP, STA 0, STA 1)
std::size_t m_nPackets
number of application packets to generate
void Transmit(uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override
Callback invoked when a FEM passes PSDUs to the PHY.
void DoRun() override
Implementation to actually run this TestCase.
std::list< uint64_t > m_uidList
list of UIDs of packets to corrupt
std::unordered_map< Mac48Address, Ptr< ListErrorModel >, WifiAddressHash > RxErrorModelMap
Receiver address-indexed map of list error models.
std::size_t m_blockAckCount
transmitted BlockAck counter
void DoSetup() override
Implementation to do any local setup required for this TestCase.
RxErrorModelMap m_errorModels
error rate models to corrupt packets
std::map< AddrSeqNoPair, std::size_t > m_inflightCount
max number of simultaneous transmissions of each data frame
Ptr< WifiMac > m_sourceMac
MAC of the node sending application packets.
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
bool m_useBarAfterMissedBa
whether to send BAR after missed BlockAck
bool m_waitFirstTf
whether we are waiting for the first Basic Trigger Frame
WifiMuTrafficPattern m_muTrafficPattern
the pattern of traffic to generate
std::size_t m_nMaxInflight
max number of links on which an MPDU can be inflight
Base class for Multi-Link Operations tests.
void SetSsid(uint16_t aid, Mac48Address)
Set the SSID on the next station that needs to start the association procedure.
virtual void StartTraffic()
Start the generation of traffic (needs to be overridden)
std::vector< Ptr< StaWifiMac > > m_staMacs
STA wifi MACs.
const std::vector< std::string > m_staChannels
strings specifying channels for STA
~MultiLinkOperationsTestBase() override=default
void CheckAddresses(Ptr< const WifiPsdu > psdu, std::optional< Direction > direction=std::nullopt)
Check that the Address 1 and Address 2 fields of the given PSDU contain device MAC addresses.
virtual void Transmit(uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when a FEM passes PSDUs to the PHY.
void SetChannels(SpectrumWifiPhyHelper &helper, const std::vector< std::string > &channels, const ChannelMap &channelMap)
Reset the given PHY helper, use the given strings to set the ChannelSettings attribute of the PHY obj...
const std::vector< std::string > m_apChannels
strings specifying channels for AP
uint16_t m_lastAid
AID of last associated station.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint8_t m_nStations
number of stations to create
const std::vector< uint8_t > m_fixedPhyBands
links on non-AP MLD with fixed PHY band
Direction
Uplink or Downlink direction.
std::vector< FrameInfo > m_txPsdus
transmitted PSDUs
Ptr< ApWifiMac > m_apMac
AP wifi MAC.
MultiLinkOperationsTestBase(const std::string &name, uint8_t nStations, std::vector< std::string > staChannels, std::vector< std::string > apChannels, std::vector< uint8_t > fixedPhyBands={})
Constructor.
std::map< FrequencyRange, Ptr< MultiModelSpectrumChannel > > ChannelMap
PHY band-indexed map of spectrum channels.
Multi-Link Discovery & Setup test.
void CheckAssocRequest(Ptr< WifiMpdu > mpdu, uint8_t linkId)
Check correctness of the given Association Request frame.
~MultiLinkSetupTest() override=default
void CheckProbeResponse(Ptr< WifiMpdu > mpdu, uint8_t linkId)
Check correctness of the given Probe Response frame.
WifiScanType m_scanType
the scan type (active or passive)
void CheckMlSetup()
Check correctness of Multi-Link Setup procedure.
void CheckDisabledLinks()
Check that links that are not setup on the non-AP MLD are disabled.
std::size_t m_nProbeResp
number of Probe Responses received by the non-AP MLD
MultiLinkSetupTest(std::vector< std::string > staChannels, std::vector< std::string > apChannels, WifiScanType scanType, std::vector< std::pair< uint8_t, uint8_t > > setupLinks, std::vector< uint8_t > fixedPhyBands={})
Constructor.
const std::vector< std::pair< uint8_t, uint8_t > > m_setupLinks
expected links to setup (STA link ID, AP link ID)
void DoRun() override
Implementation to actually run this TestCase.
void CheckAssocResponse(Ptr< WifiMpdu > mpdu, uint8_t linkId)
Check correctness of the given Association Response frame.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void CheckBeacon(Ptr< WifiMpdu > mpdu, uint8_t linkId)
Check correctness of the given Beacon frame.
Test data transmission between two MLDs.
void Transmit(uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override
Callback invoked when a FEM passes PSDUs to the PHY.
~MultiLinkTxTest() override=default
std::unordered_map< Mac48Address, Ptr< ListErrorModel >, WifiAddressHash > RxErrorModelMap
Receiver address-indexed map of list error models.
bool m_dataCorrupted
whether second data frame has been already corrupted
RxErrorModelMap m_errorModels
error rate models to corrupt packets
std::list< uint64_t > m_uidList
list of UIDs of packets to corrupt
void DoRun() override
Implementation to actually run this TestCase.
std::size_t m_nPackets
number of application packets to generate
std::size_t m_nMaxInflight
max number of links on which an MPDU can be inflight
bool m_baEnabled
whether BA agreement is enabled or disabled
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
void L7Receive(uint8_t nodeId, Ptr< const Packet > p, const Address &addr)
Function to trace packets received by the server application.
bool m_useBarAfterMissedBa
whether to send BAR after missed BlockAck
std::size_t m_blockAckCount
transmitted BlockAck counter
WifiTrafficPattern m_trafficPattern
the pattern of traffic to generate
std::array< std::size_t, 3 > m_rxPkts
number of packets received at application layer by each node (AP, STA 0, STA 1)
std::size_t m_blockAckReqCount
transmitted BlockAckReq counter
std::map< uint16_t, std::size_t > m_inflightCount
seqNo-indexed max number of simultaneous transmissions of a data frame
void DoSetup() override
Implementation to do any local setup required for this TestCase.
Ptr< WifiMac > m_sourceMac
MAC of the node sending application packets.
MultiLinkTxTest(WifiTrafficPattern trafficPattern, WifiBaEnabled baEnabled, WifiUseBarAfterMissedBa useBarAfterMissedBa, uint8_t nMaxInflight, const std::vector< std::string > &staChannels, const std::vector< std::string > &apChannels, const std::vector< uint8_t > &fixedPhyBands={})
Constructor.
void CheckBlockAck(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector, uint8_t linkId)
Check the content of a received BlockAck frame when the max number of links on which an MPDU can be i...
Test release of sequence numbers upon CTS timeout in multi-link operations.
ReleaseSeqNoAfterCtsTimeoutTest()
Ptr< ListErrorModel > m_errorModel
error rate model to corrupt first RTS frame
void Transmit(uint8_t linkId, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override
Callback invoked when a FEM passes PSDUs to the PHY.
std::size_t m_nQosDataFrames
counter for transmitted QoS data frames
void StartTraffic() override
Start the generation of traffic (needs to be overridden)
PacketSocketAddress m_socket
packet socket address
Ptr< PacketSocketClient > GetApplication() const
bool m_rtsCorrupted
whether the first RTS frame has been corrupted
void DoSetup() override
Implementation to do any local setup required for this TestCase.
~ReleaseSeqNoAfterCtsTimeoutTest() override=default
void DoRun() override
Implementation to actually run this TestCase.
WifiMultiLinkOperationsTestSuite()
a polymophic address class
uint16_t GetAssociationId(Mac48Address addr, uint8_t linkId) const
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.
Ptr< WifiMacQueue > GetTxopQueue(AcIndex ac) const override
Get the wifi MAC queue of the (Qos)Txop associated with the given AC, if such (Qos)Txop is installed,...
AttributeValue implementation for Boolean.
Hold variables of type enum.
void SetList(const std::list< uint64_t > &packetlist)
static Mac48Address GetBroadcast()
Helper class used to assign positions and mobility models to nodes.
MultiUserScheduler is an abstract base class defining the API that APs supporting at least VHT can us...
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
static uint32_t GetNNodes()
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetPhysicalAddress(const Address address)
Set the destination address.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
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 SetMldParameters(std::size_t nbrApInfoId, std::size_t index, uint8_t mldId, uint8_t linkId, uint8_t changeSequence)
Set the MLD Parameters subfield of the i-th TBTT Information field of the given Neighbor AP Informati...
std::size_t GetNTbttInformationFields(std::size_t nbrApInfoId) const
Get the number of TBTT Information fields included in the TBTT Information Set field of the given Nei...
void AddNbrApInfoField()
Add a Neighbor AP Information field.
void AddTbttInformationField(std::size_t nbrApInfoId)
Add a TBTT Information fields to the TBTT Information Set field of the given Neighbor AP Information ...
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Make it easy to create and manage PHY objects for the spectrum model.
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
The IEEE 802.11 SSID Information Element.
AttributeValue implementation for Ssid.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Hold an unsigned integer type.
static std::optional< WifiAssocManager::RnrLinkInfo > GetNextAffiliatedAp(const ReducedNeighborReport &rnr, std::size_t nbrApInfoId)
Search the given RNR element for APs affiliated to the same AP MLD as the reporting AP.
static std::list< WifiAssocManager::RnrLinkInfo > GetAllAffiliatedAps(const ReducedNeighborReport &rnr)
Find all the APs affiliated to the same AP MLD as the reporting AP that sent the given RNR element.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
Ptr< FrameExchangeManager > GetFrameExchangeManager(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get the Frame Exchange Manager associated with the given link.
std::optional< Mac48Address > GetMldAddress(const Mac48Address &remoteAddr) const
uint8_t GetNLinks() const
Get the number of links (can be greater than 1 for 11be devices only).
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
virtual std::optional< uint8_t > GetLinkIdByAddress(const Mac48Address &address) const
Get the ID of the link having the given MAC address, if any.
Ptr< WifiNetDevice > GetDevice() const
Return the device this PHY is associated with.
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,...
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Mac48Address GetAddress() const
uint32_t GetIfIndex() const override
Address GetAddress() const override
Ptr< Node > GetNode() const override
void SetPcapDataLinkType(SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
void Set(std::string name, const AttributeValue &v)
@ DLT_IEEE802_11_RADIO
Include Radiotap link layer information.
void SetPostReceptionErrorModel(const Ptr< ErrorModel > em)
Attach a receive ErrorModel to the WifiPhy.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the operating channel.
uint8_t GetPrimaryChannelIndex(uint16_t primaryChannelWidth) const
If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of th...
uint16_t GetWidth() const
Return the width of the whole operating channel (in MHz).
WifiPhyBand GetPhyBand() const
Return the PHY band of the operating channel.
uint8_t GetNumber() const
Return the channel number identifying the whole operating channel.
uint16_t GetFrequency() const
Return the center frequency of the operating channel (in MHz).
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination 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_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report if not.
#define NS_TEST_EXPECT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiScanType
Scan type (active or passive)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr FrequencyRange WIFI_SPECTRUM_6_GHZ
Identifier for the frequency range covering the wifi spectrum in the 6 GHz band.
U * PeekPointer(const Ptr< U > &p)
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
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...
constexpr FrequencyRange WIFI_SPECTRUM_5_GHZ
Identifier for the frequency range covering the wifi spectrum in the 5 GHz band.
@ WIFI_MAC_MGT_ASSOCIATION_RESPONSE
@ WIFI_MAC_MGT_ASSOCIATION_REQUEST
@ WIFI_MAC_MGT_PROBE_RESPONSE
constexpr FrequencyRange WIFI_SPECTRUM_2_4_GHZ
Identifier for the frequency range covering the wifi spectrum in the 2.4 GHz band.
Information about transmitted frames.
WifiConstPsduMap psduMap
transmitted PSDU map
WifiTxVector txVector
TXVECTOR.
Time startTx
TX start time.
Function object to compute the hash of a MAC address.
WifiMuTrafficPattern
Tested MU traffic patterns.
WifiTrafficPattern
Tested traffic patterns.
WifiUseBarAfterMissedBa
Whether to send a BlockAckReq after a missed BlockAck.
static WifiMultiLinkOperationsTestSuite g_wifiMultiLinkOperationsTestSuite
the test suite
WifiBaEnabled
Block Ack agreement enabled/disabled.