20 #include "ns3/ap-wifi-mac.h"
21 #include "ns3/boolean.h"
22 #include "ns3/config.h"
23 #include "ns3/ctrl-headers.h"
25 #include "ns3/he-configuration.h"
26 #include "ns3/he-phy.h"
27 #include "ns3/mobility-helper.h"
28 #include "ns3/multi-model-spectrum-channel.h"
29 #include "ns3/rng-seed-manager.h"
30 #include "ns3/spectrum-wifi-helper.h"
31 #include "ns3/sta-wifi-mac.h"
33 #include "ns3/tuple.h"
34 #include "ns3/wifi-net-device.h"
35 #include "ns3/wifi-psdu.h"
82 void Transmit(std::string context,
93 void SendDlSuPpdu(uint8_t bss, uint16_t txChannelWidth);
103 void SendDlMuPpdu(uint8_t bss, uint16_t txChannelWidth,
HeRu::RuType ruType, std::size_t nRus);
114 void SendHeTbPpdu(uint8_t bss, uint16_t txChannelWidth,
HeRu::RuType ruType, std::size_t nRus);
124 void DoSendHeTbPpdu(uint8_t bss,
125 uint16_t txChannelWidth,
138 void ReceiveDl(uint8_t bss,
143 std::vector<bool> perMpduStatus);
153 void ReceiveUl(uint8_t bss,
157 std::vector<bool> perMpduStatus);
161 void CheckAssociation();
172 void CheckReceivedSuPpdus(std::set<uint8_t> txBss, uint16_t txChannelWidth);
186 void CheckReceivedMuPpdus(std::set<uint8_t> txBss,
187 uint16_t txChannelWidth,
200 void CheckReceivedTriggerFrames(std::set<uint8_t> txBss, uint16_t txChannelWidth);
203 void DoSetup()
override;
204 void DoRun()
override;
223 :
TestCase(
"Check correct transmissions for various primary channel settings"),
224 m_channelWidth(channelWidth),
225 m_useDistinctBssColors(useDistinctBssColors)
239 for (
const auto& psduPair : psduMap)
241 std::stringstream ss;
245 ss <<
" STA-ID " << psduPair.first;
247 ss <<
" " << psduPair.second->GetHeader(0).GetTypeString() <<
" seq "
248 << psduPair.second->GetHeader(0).GetSequenceNumber() <<
" from "
249 << psduPair.second->GetAddr2() <<
" to " << psduPair.second->GetAddr1();
261 std::vector<bool> perMpduStatus)
269 NS_LOG_INFO(
"RECEIVED BY BSS=" << +bss <<
" STA=" << +station <<
" " << *psdu);
273 "Station [" << +bss <<
"][" << +station
274 <<
"] received a frame twice");
277 auto dev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(station));
283 "Station [" << +bss <<
"][" << +station
284 <<
"] processed a frame twice");
296 std::vector<bool> perMpduStatus)
305 uint8_t station = staId - 1;
311 "AP of BSS " << +bss <<
" received a frame from station " << +station
319 "AP of BSS " << +bss <<
" received a frame from station "
320 << +station <<
" twice");
329 RngSeedManager::SetSeed(1);
330 RngSeedManager::SetRun(40);
331 int64_t streamNumber = 100;
372 spectrumChannel->AddPropagationLossModel(lossModel);
374 CreateObject<ConstantSpeedPropagationDelayModel>();
375 spectrumChannel->SetPropagationDelayModel(delayModel);
378 phy.SetChannel(spectrumChannel);
382 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager");
385 mac.SetType(
"ns3::StaWifiMac",
387 SsidValue(
Ssid(
"non-existent-ssid")),
396 for (uint8_t bss = 0; bss <
m_nBss; bss++)
400 phy.Set(
"ChannelSettings", channelValue);
405 for (uint8_t bss = 0; bss <
m_nBss; bss++)
409 phy.Set(
"ChannelSettings", channelValue);
411 mac.SetType(
"ns3::ApWifiMac",
416 "EnableBeaconJitter",
424 for (uint8_t bss = 0; bss <
m_nBss; bss++)
432 for (uint8_t bss = 0; bss <
m_nBss; bss++)
435 dev->GetHeConfiguration()->SetBssColor(bss + 1);
442 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
443 mobility.SetPositionAllocator(positionAlloc);
445 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
447 for (uint8_t bss = 0; bss <
m_nBss; bss++)
460 hdr.
SetAddr1(Mac48Address::GetBroadcast());
466 trigger.
SetType(TriggerFrameType::BASIC_TRIGGER);
484 apDev->GetMac()->GetWifiPhy()->GetPhyBand());
496 for (uint8_t bss = 0; bss <
m_nBss; bss++)
498 dev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(0));
503 dev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(i));
513 for (uint8_t bss = 0; bss <
m_nBss; bss++)
516 auto mac = DynamicCast<ApWifiMac>(dev->
GetMac());
519 &ApWifiMac::SetBeaconInterval,
530 for (uint8_t bss = 0; bss <
m_nBss; bss++)
534 auto dev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(i));
537 &WifiPhy::SetReceiveOkCallback,
542 Simulator::Schedule(
m_time,
543 &WifiPhy::SetReceiveOkCallback,
621 for (uint16_t txChannelWidth = 20, nRounds = 2, nApsPerRound =
m_channelWidth / 20 / 2;
623 txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2)
625 nRounds = std::min<uint16_t>(nRounds,
m_nBss);
626 nApsPerRound = std::max<uint16_t>(nApsPerRound, 1);
628 for (uint16_t round = 0; round < nRounds; round++)
630 std::set<uint8_t> txBss;
632 for (uint16_t i = 0; i < nApsPerRound; i++)
634 uint16_t ap = round + i * nRounds;
636 Simulator::Schedule(
m_time,
643 Simulator::Schedule(
m_time + roundDuration,
657 for (uint16_t txChannelWidth = 20, nRounds = 2, nApsPerRound =
m_channelWidth / 20 / 2;
659 txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2)
661 nRounds = std::min<uint16_t>(nRounds,
m_nBss);
662 nApsPerRound = std::max<uint16_t>(nApsPerRound, 1);
664 for (uint16_t round = 0; round < nRounds; round++)
669 std::size_t nRus = HeRu::GetNRus(txChannelWidth, ruType);
670 std::set<uint8_t> txBss;
673 for (uint16_t i = 0; i < nApsPerRound; i++)
675 uint16_t ap = round + i * nRounds;
677 Simulator::Schedule(
m_time,
686 Simulator::Schedule(
m_time + roundDuration,
705 for (uint16_t txChannelWidth = 20, nRounds = 2, nApsPerRound =
m_channelWidth / 20 / 2;
707 txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2)
709 nRounds = std::min<uint16_t>(nRounds,
m_nBss);
710 nApsPerRound = std::max<uint16_t>(nApsPerRound, 1);
712 for (uint16_t round = 0; round < nRounds; round++)
717 std::size_t nRus = HeRu::GetNRus(txChannelWidth, ruType);
718 std::set<uint8_t> txBss;
721 for (uint16_t i = 0; i < nApsPerRound; i++)
723 uint16_t ap = round + i * nRounds;
725 Simulator::Schedule(
m_time,
740 Simulator::Schedule(
m_time + roundDuration,
755 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
761 Simulator::Destroy();
767 NS_LOG_INFO(
"*** BSS " << +bss <<
" transmits on primary " << txChannelWidth <<
" MHz channel");
770 auto staDev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(0));
772 uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor();
788 hdr.
SetAddr1(staDev->GetMac()->GetAddress());
789 hdr.
SetAddr2(apDev->GetMac()->GetAddress());
790 hdr.
SetAddr3(apDev->GetMac()->GetBssid(0));
792 Ptr<WifiPsdu> psdu = Create<WifiPsdu>(Create<Packet>(1000), hdr);
798 uint16_t txChannelWidth,
802 NS_LOG_INFO(
"*** BSS " << +bss <<
" transmits on primary " << txChannelWidth
803 <<
" MHz channel a DL MU PPDU "
804 <<
"addressed to " << nRus <<
" stations (RU type: " << ruType <<
")");
807 uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor();
824 hdr.
SetAddr2(apDev->GetMac()->GetAddress());
825 hdr.
SetAddr3(apDev->GetMac()->GetBssid(0));
830 for (std::size_t i = 1; i <= nRus; i++)
832 bool primary80 = !(txChannelWidth == 160 && i > nRus / 2);
833 std::size_t index = (primary80 ? i : i - nRus / 2);
835 auto staDev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(i - 1));
836 uint16_t staId = DynamicCast<StaWifiMac>(staDev->GetMac())->GetAssociationId();
838 hdr.
SetAddr1(staDev->GetMac()->GetAddress());
839 psduMap[staId] = Create<const WifiPsdu>(Create<Packet>(1000), hdr);
843 auto numRuAllocs = txChannelWidth / 20;
844 ruAllocations.resize(numRuAllocs);
845 auto IsOddNum = (nRus / numRuAllocs) % 2 == 1;
846 auto ruAlloc = HeRu::GetEqualizedRuAllocation(ruType, IsOddNum);
847 std::fill_n(ruAllocations.begin(), numRuAllocs, ruAlloc);
850 apDev->GetPhy()->Send(psduMap, txVector);
855 uint16_t txChannelWidth,
859 NS_LOG_INFO(
"*** BSS " << +bss <<
" transmits a Basic Trigger Frame");
879 uint16_t txChannelWidth,
884 uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor();
889 hdr.
SetAddr1(apDev->GetMac()->GetAddress());
890 hdr.
SetAddr3(apDev->GetMac()->GetBssid(0));
908 for (std::size_t i = 1; i <= nRus; i++)
910 NS_LOG_INFO(
"*** BSS " << +bss <<
" STA " << i - 1 <<
" transmits on primary "
912 <<
" MHz channel an HE TB PPDU (RU type: " << ruType <<
")");
914 bool primary80 = !(txChannelWidth == 160 && i > nRus / 2);
915 std::size_t index = (primary80 ? i : i - nRus / 2);
917 auto staDev = DynamicCast<WifiNetDevice>(
m_staDevices[bss].Get(i - 1));
918 uint16_t staId = DynamicCast<StaWifiMac>(staDev->GetMac())->GetAssociationId();
935 hdr.
SetAddr2(staDev->GetMac()->GetAddress());
941 duration = WifiPhy::CalculateTxDuration(psdu->
GetSize(),
943 staDev->GetMac()->GetWifiPhy()->GetPhyBand(),
945 std::tie(length, duration) = HePhy::ConvertHeTbPpduDurationToLSigLength(
948 staDev->GetMac()->GetWifiPhy()->GetPhyBand());
957 auto apHePhy = StaticCast<HePhy>(apDev->GetPhy()->GetLatestPhyEntity());
958 apHePhy->SetTrigVector(trigVector, duration);
964 for (uint8_t bss = 0; bss <
m_nBss; bss++)
967 auto mac = DynamicCast<ApWifiMac>(dev->GetMac());
970 "Not all the stations completed association");
977 for (uint8_t bss = 0; bss <
m_nBss; bss++)
979 if (txBss.find(bss) != txBss.end())
987 "Station [" << +bss <<
"][" << +sta
988 <<
"] did not receive the SU frame on primary"
989 << txChannelWidth <<
" channel");
994 "Station [" << +bss <<
"][0]"
995 <<
" did not process the SU frame on primary"
996 << txChannelWidth <<
" channel");
1001 "Station [" << +bss <<
"][" << +sta
1002 <<
"] processed the SU frame on primary"
1003 << txChannelWidth <<
" channel");
1012 std::none_of(txBss.begin(), txBss.end(), [&](
const uint8_t& txAp) {
1013 auto txApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(txAp))->GetPhy();
1014 auto thisApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(bss))->GetPhy();
1015 return txApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth) ==
1016 thisApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth);
1023 "Station [" << +bss <<
"][" << +sta
1024 <<
"] received the SU frame on primary"
1025 << txChannelWidth <<
" channel");
1035 "Station [" << +bss <<
"][" << +sta
1036 <<
"] did not receive the SU frame on primary"
1037 << txChannelWidth <<
" channel");
1040 "Station [" << +bss <<
"][" << +sta
1041 <<
"] processed the SU frame on primary"
1042 << txChannelWidth <<
" channel");
1054 uint16_t txChannelWidth,
1059 for (uint8_t bss = 0; bss <
m_nBss; bss++)
1061 if (txBss.find(bss) != txBss.end())
1066 for (std::size_t sta = 0; sta < nRus; sta++)
1071 (isDlMu ?
"A DL MU PPDU transmitted to" :
"An HE TB PPDU transmitted by")
1072 <<
" station [" << +bss <<
"][" << +sta <<
"] on primary" << txChannelWidth
1073 <<
" channel, RU type " << ruType <<
" was not received");
1079 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1080 <<
" transmitted on primary" << txChannelWidth
1081 <<
" channel, RU type " << ruType <<
" was received "
1082 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1083 <<
"][" << +sta <<
"]");
1087 for (std::size_t sta = 0; sta < nRus; sta++)
1092 (isDlMu ?
"A DL MU PPDU transmitted to" :
"An HE TB PPDU transmitted by")
1093 <<
" station [" << +bss <<
"][" << +sta <<
"] on primary" << txChannelWidth
1094 <<
" channel, RU type " << ruType <<
" was not processed");
1100 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1101 <<
" transmitted on primary" << txChannelWidth
1102 <<
" channel, RU type " << ruType <<
" was received "
1103 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1104 <<
"][" << +sta <<
"] and processed");
1114 std::none_of(txBss.begin(), txBss.end(), [&](
const uint8_t& txAp) {
1115 auto txApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(txAp))->GetPhy();
1116 auto thisApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(bss))->GetPhy();
1117 return txApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth) ==
1118 thisApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth);
1125 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1126 <<
" transmitted on primary" << txChannelWidth
1127 <<
" channel, RU type " << ruType <<
" was received "
1128 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1129 <<
"][" << +sta <<
"]");
1136 for (std::size_t sta = 0; sta < nRus; sta++)
1141 (isDlMu ?
"A DL MU PPDU transmitted to" :
"An HE TB PPDU transmitted by")
1142 <<
" station [" << +bss <<
"][" << +sta <<
"] on primary"
1143 << txChannelWidth <<
" channel, RU type " << ruType
1144 <<
" was not received");
1150 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1151 <<
" transmitted on primary" << txChannelWidth
1152 <<
" channel, RU type " << ruType <<
" was received "
1153 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1154 <<
"][" << +sta <<
"]");
1161 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1162 <<
" transmitted on primary" << txChannelWidth
1163 <<
" channel, RU type " << ruType <<
" was received "
1164 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1165 <<
"][" << +sta <<
"] and processed");
1177 uint16_t txChannelWidth)
1179 for (uint8_t bss = 0; bss <
m_nBss; bss++)
1181 if (txBss.find(bss) != txBss.end())
1189 "Station [" << +bss <<
"][" << +sta
1190 <<
"] did not receive the Trigger Frame "
1191 "soliciting a transmission on primary"
1192 << txChannelWidth <<
" channel");
1195 "Station [" << +bss <<
"][" << +sta
1196 <<
"] did not process the Trigger Frame "
1197 "soliciting a transmission on primary"
1198 << txChannelWidth <<
" channel");
1211 << +bss <<
"][" << +sta
1212 <<
"] received the Trigger Frame soliciting a transmission on primary"
1213 << txChannelWidth <<
" channel");
1249 void RunOne(uint8_t primary20,
1250 const std::set<uint8_t>& secondary20,
1251 const std::set<uint8_t>& primary40,
1252 const std::set<uint8_t>& secondary40,
1253 const std::set<uint8_t>& primary80,
1254 const std::set<uint8_t>& secondary80);
1257 void DoRun()
override;
1263 :
TestCase(
"Check computation of primary and secondary channel indices")
1269 const std::set<uint8_t>& secondary20,
1270 const std::set<uint8_t>& primary40,
1271 const std::set<uint8_t>& secondary40,
1272 const std::set<uint8_t>& primary80,
1273 const std::set<uint8_t>& secondary80)
1275 auto printToStr = [](
const std::set<uint8_t>& s) {
1276 std::stringstream ss;
1278 for (
const auto& index : s)
1280 ss << +index <<
" ";
1291 "Expected Primary20 {" << +primary20 <<
"}"
1292 <<
" differs from actual "
1293 << printToStr(actualPrimary20));
1298 "Expected Secondary20 " << printToStr(secondary20)
1299 <<
" differs from actual "
1300 << printToStr(actualSecondary20));
1305 "Expected Primary40 " << printToStr(primary40) <<
" differs from actual "
1306 << printToStr(actualPrimary40));
1311 "Expected Secondary40 " << printToStr(secondary40)
1312 <<
" differs from actual "
1313 << printToStr(actualSecondary40));
1318 "Expected Primary80 " << printToStr(primary80) <<
" differs from actual "
1319 << printToStr(actualPrimary80));
1324 "Expected Secondary80 " << printToStr(secondary80)
1325 <<
" differs from actual "
1326 << printToStr(actualSecondary80));
1334 RunOne(0, {}, {}, {}, {}, {});
1338 RunOne(0, {1}, {0, 1}, {}, {}, {});
1339 RunOne(1, {0}, {0, 1}, {}, {}, {});
1343 RunOne(0, {1}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {});
1344 RunOne(1, {0}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {});
1345 RunOne(2, {3}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {});
1346 RunOne(3, {2}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {});
1350 RunOne(0, {1}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {4, 5, 6, 7});
1351 RunOne(1, {0}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {4, 5, 6, 7});
1352 RunOne(2, {3}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {4, 5, 6, 7});
1353 RunOne(3, {2}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {4, 5, 6, 7});
1354 RunOne(4, {5}, {4, 5}, {6, 7}, {4, 5, 6, 7}, {0, 1, 2, 3});
1355 RunOne(5, {4}, {4, 5}, {6, 7}, {4, 5, 6, 7}, {0, 1, 2, 3});
1356 RunOne(6, {7}, {6, 7}, {4, 5}, {4, 5, 6, 7}, {0, 1, 2, 3});
1357 RunOne(7, {6}, {6, 7}, {4, 5}, {4, 5, 6, 7}, {0, 1, 2, 3});
1373 :
TestSuite(
"wifi-primary-channels", UNIT)
Test functions returning the indices of primary and secondary channels of different width.
Wifi20MHzChannelIndicesTest()
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
~Wifi20MHzChannelIndicesTest() override=default
void RunOne(uint8_t primary20, const std::set< uint8_t > &secondary20, const std::set< uint8_t > &primary40, const std::set< uint8_t > &secondary40, const std::set< uint8_t > &primary80, const std::set< uint8_t > &secondary80)
Check that the indices of the 20 MHz channels included in all the primary and secondary channels are ...
WifiPhyOperatingChannel m_channel
operating channel
Test transmissions under different primary channel settings.
std::vector< std::bitset< 74 > > m_processed
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed
void CheckAssociation()
Check that all stations associated with an AP.
std::vector< std::bitset< 74 > > m_received
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received
uint8_t m_nBss
number of BSSes
void SendHeTbPpdu(uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
Have the AP of the given BSS transmit a Basic Trigger Frame.
void Transmit(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when PHY receives a PSDU to transmit.
Ptr< WifiPsdu > m_trigger
Basic Trigger Frame.
void DoRun() override
Implementation to actually run this TestCase.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
Time m_time
the time when the current action is executed
void CheckReceivedTriggerFrames(std::set< uint8_t > txBss, uint16_t txChannelWidth)
Check that (i) all stations belonging to the given BSSes received the transmitted Trigger Frame; and ...
void DoSendHeTbPpdu(uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
Have the STAs of the given BSS transmit an HE TB PPDU using the given transmission channel width and ...
Time m_triggerTxDuration
TX duration for Basic Trigger Frame.
uint16_t m_channelWidth
operating channel width in MHz
WifiPrimaryChannelsTest(uint16_t channelWidth, bool useDistinctBssColors)
Constructor.
uint8_t m_nStationsPerBss
number of stations per AP
std::vector< NetDeviceContainer > m_staDevices
containers for stations' NetDevices
void SendDlSuPpdu(uint8_t bss, uint16_t txChannelWidth)
Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.
NetDeviceContainer m_apDevices
container for AP's NetDevice
void ReceiveDl(uint8_t bss, uint8_t station, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
Callback invoked when a station receives a DL PPDU.
void SendDlMuPpdu(uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
Have the AP of the given BSS transmit a MU PPDU using the given transmission channel width and RU typ...
void ReceiveUl(uint8_t bss, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
Callback invoked when an AP receives an UL PPDU.
~WifiPrimaryChannelsTest() override
void CheckReceivedMuPpdus(std::set< uint8_t > txBss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus, bool isDlMu)
Check that (i) all stations/APs belonging to the given BSSes received the DL/UL MU PPDUs transmitted ...
bool m_useDistinctBssColors
true to set distinct BSS colors to BSSes
void CheckReceivedSuPpdus(std::set< uint8_t > txBss, uint16_t txChannelWidth)
Check that (i) all stations belonging to the given BSSes received the SU PPDUs transmitted over the g...
WifiTxVector m_triggerTxVector
TX vector for Basic Trigger Frame.
wifi primary channels test suite
WifiPrimaryChannelsTestSuite()
RuType
The different HE Resource Unit (RU) types.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of 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.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void AddHeader(const Header &header)
Add header to this packet.
Make it easy to create and manage PHY objects for the spectrum model.
The IEEE 802.11 SSID Information Element.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
bool IsZero() const
Exactly equivalent to t == 0.
Hold objects of type std::tuple<Args...>.
void Set(const result_type &value)
Set the stored values.
Hold an unsigned integer type.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
Ptr< WifiMac > GetMac() const
Ptr< WifiPhy > GetPhy() const
std::tuple< uint8_t, uint16_t, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Class that keeps track of all information about the current PHY operating channel.
void SetPrimary20Index(uint8_t index)
Set the index of the primary 20 MHz channel (0 indicates the 20 MHz subchannel with the lowest center...
void SetDefault(uint16_t width, WifiStandard standard, WifiPhyBand band)
Set the default channel of the given width and for the given standard and band.
std::set< uint8_t > GetAll20MHzChannelIndicesInSecondary(uint16_t width) const
Get the channel indices of all the 20 MHz channels included in the secondary channel of the given wid...
std::set< uint8_t > GetAll20MHzChannelIndicesInPrimary(uint16_t width) const
Get the channel indices of all the 20 MHz channels included in the primary channel of the given width...
const WifiMacHeader & GetHeader(std::size_t i) const
Get the header of the i-th MPDU.
uint32_t GetSize() const
Return the size of the PSDU in bytes.
std::size_t GetNMpdus() const
Return the number of MPDUs constituting the PSDU.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetRuAllocation(const RuAllocation &ruAlloc, uint8_t p20Index)
Set RU_ALLOCATION field.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
void Connect(std::string path, const CallbackBase &cb)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#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_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report 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.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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...
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::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
RxSignalInfo structure containing info on the received signal.
static WifiPrimaryChannelsTestSuite g_wifiPrimaryChannelsTestSuite
the test suite