20 #include "ns3/config.h"
21 #include "ns3/he-configuration.h"
22 #include "ns3/he-frame-exchange-manager.h"
23 #include "ns3/he-phy.h"
24 #include "ns3/mobility-helper.h"
25 #include "ns3/multi-model-spectrum-channel.h"
26 #include "ns3/multi-user-scheduler.h"
27 #include "ns3/packet-socket-client.h"
28 #include "ns3/packet-socket-helper.h"
29 #include "ns3/packet-socket-server.h"
30 #include "ns3/packet.h"
31 #include "ns3/qos-utils.h"
32 #include "ns3/rng-seed-manager.h"
33 #include "ns3/spectrum-wifi-helper.h"
34 #include "ns3/string.h"
36 #include "ns3/wifi-acknowledgment.h"
37 #include "ns3/wifi-mac-header.h"
38 #include "ns3/wifi-mac-queue.h"
39 #include "ns3/wifi-net-device.h"
40 #include "ns3/wifi-protection.h"
41 #include "ns3/wifi-psdu.h"
81 void ComputeWifiTxVector();
99 TypeId(
"ns3::TestMultiUserScheduler")
101 .SetGroupName(
"Wifi")
103 .AddAttribute(
"ModulationClass",
104 "Modulation class for DL MU PPDUs and TB PPDUs.",
143 : TriggerFrameType::BASIC_TRIGGER);
152 uint32_t ampduSize = (ulTriggerType == TriggerFrameType::BSRP_TRIGGER)
157 WifiPhy::CalculateTxDuration(ampduSize,
163 std::tie(length, duration) = HePhy::ConvertHeTbPpduDurationToLSigLength(
192 NS_LOG_DEBUG(
"Remaining TXOP duration is not enough for BSRP TF exchange");
204 NS_ABORT_MSG_IF(staList.size() != 4,
"There must be 4 associated stations");
210 for (
auto& sta : staList)
215 for (tid = 0; tid < 8; tid++)
237 NS_LOG_DEBUG(
"Not enough time to send frames to all the stations");
241 std::vector<Ptr<WifiMpdu>> mpduList;
243 ->GetMpduAggregator()
246 if (mpduList.size() > 1)
248 m_psduMap[sta.first] = Create<WifiPsdu>(std::move(mpduList));
252 m_psduMap[sta.first] = Create<WifiPsdu>(mpdu,
true);
296 NS_ABORT_MSG_IF(staList.size() != 4,
"There must be 4 associated stations");
302 ruType = HeRu::RU_52_TONE;
306 ruType = HeRu::RU_106_TONE;
310 ruType = HeRu::RU_242_TONE;
314 ruType = HeRu::RU_484_TONE;
321 bool primary80 =
true;
322 std::size_t ruIndex = 1;
324 for (
auto& sta : staList)
326 if (bw == 160 && ruIndex == 3)
333 m_txVector.SetSigBMode(VhtPhy::GetVhtMcs5());
404 uint32_t maxAmpduSize,
406 uint16_t nPktsPerSta,
423 void TraceCw(uint32_t staIndex, uint32_t cw, uint8_t );
444 void DoRun()
override;
481 uint32_t maxAmpduSize,
483 uint16_t nPktsPerSta,
486 :
TestCase(
"Check correct operation of DL OFDMA acknowledgment sequences"),
488 m_sockets(m_nStations),
489 m_channelWidth(width),
490 m_dlMuAckType(dlType),
491 m_maxAmpduSize(maxAmpduSize),
492 m_txopLimit(txopLimit),
493 m_nPktsPerSta(nPktsPerSta),
494 m_muEdcaParameterSet(muEdcaParameterSet),
495 m_scenario(scenario),
496 m_ulPktsGenerated(false),
499 m_edcaDisabledStartTime(
Seconds(0)),
500 m_cwValues(std::vector<uint32_t>(m_nStations, 2))
571 for (
const auto& [staId, psdu] : psduMap)
574 << psdu->GetHeader(0).GetTypeString() <<
" #MPDUs " << psdu->GetNMpdus()
575 << (psdu->GetHeader(0).IsQosData()
576 ?
" TID " + std::to_string(*psdu->GetTids().begin())
578 << std::setprecision(10) <<
" txDuration " << txDuration <<
" duration/ID "
579 << psdu->GetHeader(0).GetDuration() <<
" #TX PSDUs = " <<
m_txPsdus.size()
580 <<
" size=" << (*psdu->begin())->GetSize() <<
"\n"
581 <<
"TXVECTOR: " << txVector <<
"\n");
598 while ((mpdu = queue->PeekByTidAndAddress(i * 2,
599 staDev->GetMac()->GetAddress(),
600 lastInFlight)) !=
nullptr)
602 if (mpdu->IsInFlight())
615 psduMap.begin()->second->GetHeader(0).HasData())
617 Mac48Address sender = psduMap.begin()->second->GetAddr2();
623 if (dev->GetAddress() == sender)
647 else if (!txVector.
IsMu() && psduMap.begin()->second->GetHeader(0).IsBlockAck() &&
652 psduMap.begin()->second->GetPayload(0)->PeekHeader(blockAck);
662 else if (!txVector.
IsMu() && psduMap.begin()->second->GetHeader(0).IsTrigger() &&
666 psduMap.
begin()->second->GetPayload(0)->PeekHeader(trigger);
675 client->SetAttribute(
"PacketSize",
UintegerValue(1400 + i * 100));
681 client->SetStartTime(txDuration);
682 client->SetStopTime(
Seconds(1.0));
683 client->Initialize();
728 "Expected a Trigger Frame");
733 "Expected one User Info field per station");
736 "Expected the MU-RTS to occupy the entire channel width");
737 for (
const auto& userInfo : trigger)
741 "Unexpected RU Allocation value in MU-RTS");
750 m_txPsdus[1].psduMap.begin()->second->GetNMpdus() == 1 &&
753 "Expected a CTS frame");
756 "Expected the CTS to occupy the entire channel width");
770 m_txPsdus[2].psduMap.begin()->second->GetNMpdus() == 1 &&
773 "Expected a CTS frame");
776 "Expected the CTS to occupy the entire channel width");
790 m_txPsdus[3].psduMap.begin()->second->GetNMpdus() == 1 &&
793 "Expected a CTS frame");
796 "Expected the CTS to occupy the entire channel width");
810 m_txPsdus[4].psduMap.begin()->second->GetNMpdus() == 1 &&
813 "Expected a CTS frame");
816 "Expected the CTS to occupy the entire channel width");
832 "Expected a Trigger Frame");
837 "Expected one User Info field per station");
850 m_txPsdus[6].psduMap.begin()->second->GetNMpdus() == 1),
852 "Expected a QoS Null frame in a TB PPDU");
865 uint8_t tid = staId * 2;
872 tEnd + sifs + tolerance,
873 "QoS Null frame in HE TB PPDU sent too late");
879 "Expected null Duration/ID for QoS Null frame in HE TB PPDU");
888 m_txPsdus[7].psduMap.begin()->second->GetNMpdus() == 1),
890 "Expected a QoS Null frame in a TB PPDU");
903 uint8_t tid = staId * 2;
909 tEnd + sifs + tolerance,
910 "QoS Null frame in HE TB PPDU sent too late");
911 qosNullNavEnd =
m_txPsdus[7].endTx +
m_txPsdus[7].psduMap.begin()->second->GetDuration();
916 "Expected null Duration/ID for QoS Null frame in HE TB PPDU");
925 m_txPsdus[8].psduMap.begin()->second->GetNMpdus() == 1),
927 "Expected a QoS Null frame in an HE TB PPDU");
940 uint8_t tid = staId * 2;
946 tEnd + sifs + tolerance,
947 "QoS Null frame in HE TB PPDU sent too late");
948 qosNullNavEnd =
m_txPsdus[8].endTx +
m_txPsdus[8].psduMap.begin()->second->GetDuration();
953 "Expected null Duration/ID for QoS Null frame in HE TB PPDU");
962 m_txPsdus[9].psduMap.begin()->second->GetNMpdus() == 1),
964 "Expected a QoS Null frame in an HE TB PPDU");
977 uint8_t tid = staId * 2;
983 tEnd + sifs + tolerance,
984 "QoS Null frame in HE TB PPDU sent too late");
985 qosNullNavEnd =
m_txPsdus[9].endTx +
m_txPsdus[9].psduMap.begin()->second->GetDuration();
990 "Expected null Duration/ID for QoS Null frame in HE TB PPDU");
1002 "Expected a Trigger Frame");
1007 "Expected one User Info field per station");
1010 "Expected the MU-RTS to occupy the entire channel width");
1011 for (
const auto& userInfo : trigger)
1015 "Unexpected RU Allocation value in MU-RTS");
1038 m_txPsdus[11].psduMap.begin()->second->GetNMpdus() == 1 &&
1041 "Expected a CTS frame");
1044 "Expected the CTS to occupy the entire channel width");
1058 m_txPsdus[12].psduMap.begin()->second->GetNMpdus() == 1 &&
1061 "Expected a CTS frame");
1064 "Expected the CTS to occupy the entire channel width");
1078 m_txPsdus[13].psduMap.begin()->second->GetNMpdus() == 1 &&
1081 "Expected a CTS frame");
1084 "Expected the CTS to occupy the entire channel width");
1098 m_txPsdus[14].psduMap.begin()->second->GetNMpdus() == 1 &&
1101 "Expected a CTS frame");
1104 "Expected the CTS to occupy the entire channel width");
1120 "Expected a Trigger Frame");
1125 "Expected one User Info field per station");
1138 m_txPsdus[16].psduMap.begin()->second->GetNMpdus() == 2 &&
1139 m_txPsdus[16].psduMap.begin()->second->GetHeader(0).IsQosData() &&
1140 m_txPsdus[16].psduMap.begin()->second->GetHeader(1).IsQosData()),
1142 "Expected 2 QoS data frames in an HE TB PPDU");
1147 tEnd + sifs + tolerance,
1148 "QoS data frames in HE TB PPDU sent too late");
1157 m_txPsdus[17].psduMap.begin()->second->GetNMpdus() == 2 &&
1158 m_txPsdus[17].psduMap.begin()->second->GetHeader(0).IsQosData() &&
1159 m_txPsdus[17].psduMap.begin()->second->GetHeader(1).IsQosData()),
1161 "Expected 2 QoS data frames in an HE TB PPDU");
1165 tEnd + sifs + tolerance,
1166 "QoS data frames in HE TB PPDU sent too late");
1167 qosDataNavEnd =
m_txPsdus[17].endTx +
m_txPsdus[17].psduMap.begin()->second->GetDuration();
1175 m_txPsdus[18].psduMap.begin()->second->GetNMpdus() == 2 &&
1176 m_txPsdus[18].psduMap.begin()->second->GetHeader(0).IsQosData() &&
1177 m_txPsdus[18].psduMap.begin()->second->GetHeader(1).IsQosData()),
1179 "Expected 2 QoS data frames in an HE TB PPDU");
1183 tEnd + sifs + tolerance,
1184 "QoS data frames in HE TB PPDU sent too late");
1185 qosDataNavEnd =
m_txPsdus[18].endTx +
m_txPsdus[18].psduMap.begin()->second->GetDuration();
1193 m_txPsdus[19].psduMap.begin()->second->GetNMpdus() == 2 &&
1194 m_txPsdus[19].psduMap.begin()->second->GetHeader(0).IsQosData() &&
1195 m_txPsdus[19].psduMap.begin()->second->GetHeader(1).IsQosData()),
1197 "Expected 2 QoS data frames in an HE TB PPDU");
1201 tEnd + sifs + tolerance,
1202 "QoS data frames in HE TB PPDU sent too late");
1203 qosDataNavEnd =
m_txPsdus[19].endTx +
m_txPsdus[19].psduMap.begin()->second->GetDuration();
1213 "Expected a Block Ack");
1218 "Expected one Per AID TID Info subfield per station");
1219 for (uint8_t i = 0; i < 4; i++)
1232 "Duration/ID in Multi-STA BlockAck is too short");
1235 "Duration/ID in Multi-STA BlockAck is too long");
1243 "Expected a Trigger Frame");
1248 "Expected one User Info field per station");
1251 "Expected the MU-RTS to occupy the entire channel width");
1252 for (
const auto& userInfo : trigger)
1256 "Unexpected RU Allocation value in MU-RTS");
1268 m_txPsdus[22].psduMap.begin()->second->GetNMpdus() == 1 &&
1271 "Expected a CTS frame");
1274 "Expected the CTS to occupy the entire channel width");
1288 m_txPsdus[23].psduMap.begin()->second->GetNMpdus() == 1 &&
1291 "Expected a CTS frame");
1294 "Expected the CTS to occupy the entire channel width");
1308 m_txPsdus[24].psduMap.begin()->second->GetNMpdus() == 1 &&
1311 "Expected a CTS frame");
1314 "Expected the CTS to occupy the entire channel width");
1328 m_txPsdus[25].psduMap.begin()->second->GetNMpdus() == 1 &&
1331 "Expected a CTS frame");
1334 "Expected the CTS to occupy the entire channel width");
1348 "Expected a DL MU PPDU");
1351 "Expected 4 PSDUs within the DL MU PPDU");
1355 "TX duration cannot exceed max PPDU duration");
1356 for (
auto& psdu :
m_txPsdus[26].psduMap)
1360 "Max A-MPDU size exceeded");
1369 for (
auto& psdu :
m_txPsdus[26].psduMap)
1373 dlMuNavEnd += psdu.second->GetDuration();
1379 "Duration/ID must be the same for all PSDUs");
1386 std::size_t nTxPsdus = 0;
1388 if (
m_dlMuAckType == WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE)
1418 "Expected a Block Ack");
1429 "Duration/ID in 1st BlockAck frame is too short");
1432 "Duration/ID in 1st BlockAck is too long");
1438 "Expected a Block Ack Request");
1443 tEnd + sifs + tolerance,
1444 "First Block Ack Request sent too late");
1454 "Duration/ID in BlockAckReq is too short");
1457 "Duration/ID in BlockAckReq is too long");
1464 "Expected a Block Ack");
1476 "Duration/ID in BlockAck is too long");
1483 "Duration/ID in BlockAck is too short");
1485 barNavEnd + tolerance,
1486 "Duration/ID in BlockAck is too long");
1489 "Expected null Duration/ID for BlockAck");
1496 "Expected a Block Ack Request");
1501 tEnd + sifs + tolerance,
1502 "Second Block Ack Request sent too late");
1512 "Duration/ID in BlockAckReq is too short");
1515 "Duration/ID in BlockAckReq is too long");
1522 "Expected a Block Ack");
1534 "Duration/ID in BlockAck is too long");
1541 "Duration/ID in BlockAck is too short");
1543 barNavEnd + tolerance,
1544 "Duration/ID in BlockAck is too long");
1547 "Expected null Duration/ID for BlockAck");
1554 "Expected a Block Ack Request");
1559 tEnd + sifs + tolerance,
1560 "Third Block Ack Request sent too late");
1570 "Duration/ID in BlockAckReq is too short");
1573 "Duration/ID in BlockAckReq is too long");
1580 "Expected a Block Ack");
1592 "Duration/ID in BlockAck is too long");
1599 "Duration/ID in BlockAck is too short");
1601 barNavEnd + tolerance,
1602 "Duration/ID in BlockAck is too long");
1605 "Expected null Duration/ID for BlockAck");
1610 else if (
m_dlMuAckType == WifiAcknowledgment::DL_MU_TF_MU_BAR)
1635 "Expected a MU-BAR Trigger Frame");
1643 "Duration/ID in MU-BAR Trigger Frame is too short");
1646 "Duration/ID in MU-BAR Trigger Frame is too long");
1651 m_txPsdus[28].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1653 "Expected a Block Ack");
1658 tEnd + sifs + tolerance,
1659 "Block Ack in HE TB PPDU sent too late");
1668 "Expected null Duration/ID for BlockAck");
1674 m_txPsdus[29].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1676 "Expected a Block Ack");
1680 tEnd + sifs + tolerance,
1681 "Block Ack in HE TB PPDU sent too late");
1682 baNavEnd =
m_txPsdus[29].endTx +
m_txPsdus[29].psduMap.begin()->second->GetDuration();
1687 "Duration/ID in 1st BlockAck is too long");
1692 "Expected null Duration/ID for BlockAck");
1698 m_txPsdus[30].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1700 "Expected a Block Ack");
1704 tEnd + sifs + tolerance,
1705 "Block Ack in HE TB PPDU sent too late");
1706 baNavEnd =
m_txPsdus[30].endTx +
m_txPsdus[30].psduMap.begin()->second->GetDuration();
1711 "Duration/ID in 1st BlockAck is too long");
1716 "Expected null Duration/ID for BlockAck");
1722 m_txPsdus[31].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1724 "Expected a Block Ack");
1728 tEnd + sifs + tolerance,
1729 "Block Ack in HE TB PPDU sent too late");
1730 baNavEnd =
m_txPsdus[31].endTx +
m_txPsdus[31].psduMap.begin()->second->GetDuration();
1735 "Duration/ID in 1st BlockAck is too long");
1740 "Expected null Duration/ID for BlockAck");
1745 else if (
m_dlMuAckType == WifiAcknowledgment::DL_MU_AGGREGATE_TF)
1766 for (
auto& psdu :
m_txPsdus[26].psduMap)
1770 "Expected an aggregated MU-BAR Trigger Frame");
1776 m_txPsdus[27].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1778 "Expected a Block Ack");
1783 tEnd + sifs + tolerance,
1784 "Block Ack in HE TB PPDU sent too late");
1793 "Expected null Duration/ID for BlockAck");
1799 m_txPsdus[28].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1801 "Expected a Block Ack");
1805 tEnd + sifs + tolerance,
1806 "Block Ack in HE TB PPDU sent too late");
1807 baNavEnd =
m_txPsdus[28].endTx +
m_txPsdus[28].psduMap.begin()->second->GetDuration();
1815 "Expected null Duration/ID for BlockAck");
1821 m_txPsdus[29].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1823 "Expected a Block Ack");
1827 tEnd + sifs + tolerance,
1828 "Block Ack in HE TB PPDU sent too late");
1829 baNavEnd =
m_txPsdus[29].endTx +
m_txPsdus[29].psduMap.begin()->second->GetDuration();
1837 "Expected null Duration/ID for BlockAck");
1843 m_txPsdus[30].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1845 "Expected a Block Ack");
1849 tEnd + sifs + tolerance,
1850 "Block Ack in HE TB PPDU sent too late");
1851 baNavEnd =
m_txPsdus[30].endTx +
m_txPsdus[30].psduMap.begin()->second->GetDuration();
1859 "Expected null Duration/ID for BlockAck");
1867 "Not all DL packets have been received");
1874 for (std::size_t i = nTxPsdus; i <
m_txPsdus.size(); ++i)
1877 !
m_txPsdus[i].psduMap.begin()->second->GetHeader(0).IsCts() &&
1878 m_txPsdus[i].psduMap.begin()->second->GetHeader(0).GetAddr2() !=
1886 "A station transmitted before the MU EDCA timer expired");
1898 "A station did not set the correct MU CW min");
1908 uint32_t previousSeed = RngSeedManager::GetSeed();
1909 uint64_t previousRun = RngSeedManager::GetRun();
1912 int64_t streamNumber = 10;
1925 spectrumChannel->AddPropagationLossModel(lossModel);
1927 CreateObject<ConstantSpeedPropagationDelayModel>();
1928 spectrumChannel->SetPropagationDelayModel(delayModel);
1931 phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
1932 phy.SetErrorRateModel(
"ns3::NistErrorRateModel");
1933 phy.SetChannel(spectrumChannel);
1937 phy.Set(
"ChannelSettings",
StringValue(
"{36, 20, BAND_5GHZ, 0}"));
1940 phy.Set(
"ChannelSettings",
StringValue(
"{38, 40, BAND_5GHZ, 0}"));
1943 phy.Set(
"ChannelSettings",
StringValue(
"{42, 80, BAND_5GHZ, 0}"));
1946 phy.Set(
"ChannelSettings",
StringValue(
"{50, 160, BAND_5GHZ, 0}"));
1949 NS_ABORT_MSG(
"Invalid channel bandwidth (must be 20, 40, 80 or 160)");
1995 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1998 wifi.ConfigHeOptions(
"MuBeAifsn",
2016 mac.SetType(
"ns3::StaWifiMac",
2024 "BE_BlockAckThreshold",
2031 "BK_BlockAckThreshold",
2038 "VI_BlockAckThreshold",
2045 "VO_BlockAckThreshold",
2056 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(
true));
2057 mac.SetMultiUserScheduler(
2058 "ns3::TestMultiUserScheduler",
2062 "AccessReqInterval",
2064 "DelayAccessReqUponAccess",
2066 mac.SetAckManager(
"ns3::WifiDefaultAckManager",
2067 "DlMuAckSequenceType",
2079 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2080 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2081 positionAlloc->Add(Vector(0.0, 1.0, 0.0));
2082 positionAlloc->Add(Vector(-1.0, 0.0, 0.0));
2083 positionAlloc->Add(Vector(-1.0, -1.0, 0.0));
2084 mobility.SetPositionAllocator(positionAlloc);
2086 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2091 for (uint32_t i = 0; i < allDevices.
GetN(); i++)
2093 auto dev = DynamicCast<WifiNetDevice>(allDevices.
Get(i));
2100 dev->GetMac()->GetQosTxop(
AC_BE)->SetAifsn(3);
2101 dev->GetMac()->GetQosTxop(
AC_BK)->SetAifsn(3);
2102 dev->GetMac()->GetQosTxop(
AC_VI)->SetAifsn(3);
2103 dev->GetMac()->GetQosTxop(
AC_VO)->SetAifsn(3);
2125 client1->SetRemote(socket);
2128 client1->SetStopTime(
Seconds(2.0));
2133 client2->SetAttribute(
"PacketSize",
UintegerValue(1400 + i * 100));
2137 client2->SetRemote(socket);
2139 client2->SetStartTime(
Seconds(1.5003));
2140 client2->SetStopTime(
Seconds(2.5));
2143 server->SetLocal(socket);
2145 server->SetStartTime(
Seconds(0.0));
2146 server->SetStopTime(
Seconds(3.0));
2166 client1->SetStopTime(
Seconds(2.0));
2174 server->SetStartTime(
Seconds(0.0));
2175 server->SetStopTime(
Seconds(3.0));
2178 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
2181 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
2191 Simulator::Destroy();
2213 using MuEdcaParams = std::initializer_list<OfdmaAckSequenceTest::MuEdcaParameterSet>;
2215 for (
auto& muEdcaParameterSet : MuEdcaParams{{0, 0, 0, 0} ,
2216 {0, 127, 2047, 100} ,
2217 {10, 127, 2047, 100} })
2219 for (
const auto scenario :
2223 WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE,
2231 WifiAcknowledgment::DL_MU_AGGREGATE_TF,
2239 WifiAcknowledgment::DL_MU_TF_MU_BAR,
2247 WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE,
2255 WifiAcknowledgment::DL_MU_AGGREGATE_TF,
2263 WifiAcknowledgment::DL_MU_TF_MU_BAR,
Test OFDMA acknowledgment sequences.
OfdmaAckSequenceTest(uint16_t width, WifiAcknowledgment::Method dlType, uint32_t maxAmpduSize, uint16_t txopLimit, uint16_t nPktsPerSta, MuEdcaParameterSet muEdcaParameterSet, WifiOfdmaScenario scenario)
Constructor.
std::vector< FrameInfo > m_txPsdus
transmitted PSDUs
Time m_edcaDisabledStartTime
time when disabling EDCA started
uint16_t m_flushed
number of DL packets flushed after DL MU PPDU
uint8_t m_muRtsRuAllocation
B7-B1 of RU Allocation subfield of MU-RTS.
void Transmit(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when FrameExchangeManager passes PSDUs to the PHY.
static constexpr uint16_t m_muTimerRes
MU timer resolution in usec.
uint16_t m_received
number of packets received by the stations
void CheckResults(Time sifs, Time slotTime, uint8_t aifsn)
Check correctness of transmitted frames.
WifiAcknowledgment::Method m_dlMuAckType
DL MU ack sequence type.
bool m_ulPktsGenerated
whether UL packets for HE TB PPDUs have been generated
uint16_t m_nPktsPerSta
number of packets to send to each station
NetDeviceContainer m_staDevices
stations' devices
std::vector< PacketSocketAddress > m_sockets
packet socket addresses for STAs
uint16_t m_txopLimit
TXOP limit in microseconds.
void DoRun() override
Implementation to actually run this TestCase.
void L7Receive(std::string context, Ptr< const Packet > p, const Address &addr)
Function to trace packets received by the server application.
uint16_t m_channelWidth
PHY channel bandwidth in MHz.
WifiOfdmaScenario m_scenario
OFDMA scenario to test.
~OfdmaAckSequenceTest() override
uint32_t m_maxAmpduSize
maximum A-MPDU size in bytes
Ptr< WifiNetDevice > m_apDevice
AP's device.
std::vector< uint32_t > m_cwValues
CW used by stations after MU exchange.
void TraceCw(uint32_t staIndex, uint32_t cw, uint8_t)
Function to trace CW value used by the given station after the MU exchange.
WifiPreamble m_tbPreamble
expected preamble type for TB PPDUs
uint16_t m_nStations
number of stations
MuEdcaParameterSet m_muEdcaParameterSet
MU EDCA Parameter Set.
WifiPreamble m_dlMuPreamble
expected preamble type for DL MU PPDUs
Dummy Multi User Scheduler used to test OFDMA ack sequences.
WifiPsduMap m_psduMap
the DL MU PPDU to transmit
TxFormat m_txFormat
the format of next transmission
WifiModulationClass m_modClass
modulation class for DL MU PPDUs and TB PPDUs
WifiTxVector m_txVector
the TX vector for MU PPDUs
UlMuInfo ComputeUlMuInfo() override
Prepare the information required to solicit an UL MU transmission.
TriggerFrameType m_ulTriggerType
Trigger Frame type for UL MU.
WifiTxParameters m_txParams
TX parameters.
TxFormat SelectTxFormat() override
Select the format of the next transmission.
void ComputeWifiTxVector()
Compute the TX vector to use for MU PPDUs.
~TestMultiUserScheduler() override
static TypeId GetTypeId()
Get the type ID.
WifiMacHeader m_triggerHdr
MAC header for Trigger Frame.
CtrlTriggerHeader m_trigger
Trigger Frame to send.
DlMuInfo ComputeDlMuInfo() override
Compute the information required to perform a DL MU transmission.
wifi MAC OFDMA Test Suite
a polymophic address class
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.
AttributeValue implementation for Boolean.
Hold variables of type enum.
RuType
The different HE Resource Unit (RU) types.
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...
bool m_initialFrame
true if a TXOP is being started
Ptr< ApWifiMac > m_apMac
the AP wifi MAC
Time m_availableTime
the time available for frame exchange
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId) const
Get the station manager attached to the AP on the given link.
uint32_t GetMaxSizeOfQosNullAmpdu(const CtrlTriggerHeader &trigger) const
Get the maximum size in bytes among the A-MPDUs containing QoS Null frames and solicited by the given...
Ptr< HeFrameExchangeManager > GetHeFem(uint8_t linkId) const
Get the HE Frame Exchange Manager attached to the AP on the given link.
TxFormat
Enumeration of the possible transmission formats.
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
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.
Ptr< WifiMpdu > PeekNextMpdu(uint8_t linkId, uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast(), Ptr< const WifiMpdu > mpdu=nullptr)
Peek the next frame to transmit on the given link to the given receiver and of the given TID from the...
Ptr< WifiMpdu > GetNextMpdu(uint8_t linkId, Ptr< WifiMpdu > peekedItem, WifiTxParameters &txParams, Time availableTime, bool initialFrame)
Prepare the frame to transmit on the given link starting from the MPDU that has been previously peeke...
Make it easy to create and manage PHY objects for the spectrum model.
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.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
Ptr< HeConfiguration > GetHeConfiguration() const
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Mac48Address GetAddress() const
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
Ptr< WifiMac > GetMac() const
uint32_t GetIfIndex() const override
Address GetAddress() const override
Time GetSlot() const
Return the slot duration for this PHY.
uint16_t GetChannelWidth() const
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
WifiTxVector GetRtsTxVector(Mac48Address address)
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
std::unique_ptr< WifiProtection > m_protection
protection method
std::unique_ptr< WifiAcknowledgment > m_acknowledgment
acknowledgment method
Time m_txDuration
TX duration of the frame.
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
void Clear()
Reset the TX parameters.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetEhtPpduType(uint8_t type)
Set the EHT_PPDU_TYPE parameter.
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
WifiPreamble GetPreambleType() const
void SetRuAllocation(const RuAllocation &ruAlloc)
Set RU Allocation of SIG-B common field.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
void SetGlobal(std::string name, const AttributeValue &value)
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_EXPECT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to limit and report 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_LT(actual, limit, msg)
Test that an actual value is less than 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_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to a limit and report and abort if not.
WifiOfdmaScenario
The scenarios.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
TriggerFrameType
The different Trigger frame types.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_EHT
EHT (Clause 36)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetPpduMaxTime(WifiPreamble preamble)
Get the maximum PPDU duration (see Section 10.14 of 802.11-2016) for the PHY layers defining the aPPD...
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...
bool IsEht(WifiPreamble preamble)
Return true if a preamble corresponds to an EHT transmission.
Ptr< const AttributeChecker > MakeEnumChecker(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
std::unordered_map< uint16_t, Ptr< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
Information about transmitted frames.
Time startTx
start TX time
WifiTxVector txVector
TXVECTOR.
WifiConstPsduMap psduMap
transmitted PSDU map
uint8_t muAifsn
MU AIFS (0 to disable EDCA)
uint16_t muCwMin
MU CW min.
uint8_t muTimer
MU EDCA Timer in units of 8192 microseconds (0 not to use MU EDCA)
uint16_t muCwMax
MU CW max.
Information to be provided in case of DL MU transmission.
Information to be provided in case of UL MU transmission.
Method
Available acknowledgment methods.
static WifiMacOfdmaTestSuite g_wifiMacOfdmaTestSuite
the test suite