21 #include "ns3/dsss-phy.h"
22 #include "ns3/eht-phy.h"
23 #include "ns3/eht-ppdu.h"
24 #include "ns3/erp-ofdm-phy.h"
25 #include "ns3/he-ru.h"
27 #include "ns3/packet.h"
28 #include "ns3/simulator.h"
30 #include "ns3/wifi-psdu.h"
31 #include "ns3/yans-wifi-phy.h"
51 void DoRun()
override;
67 bool CheckPayloadDuration(uint32_t size,
69 uint16_t channelWidth,
70 uint16_t guardInterval,
87 bool CheckTxDuration(uint32_t size,
89 uint16_t channelWidth,
90 uint16_t guardInterval,
107 static bool CheckMuTxDuration(std::list<uint32_t> sizes,
108 std::list<HeMuUserInfo> userInfos,
109 uint16_t channelWidth,
110 uint16_t guardInterval,
128 static Time CalculateTxDurationUsingList(std::list<uint32_t> sizes,
129 std::list<uint16_t> staIds,
146 uint16_t channelWidth,
147 uint16_t guardInterval,
159 std::list<WifiPhyBand> testedBands;
173 for (
auto& testedBand : testedBands)
181 Time calculatedDuration =
phy->GetPayloadDuration(size, txVector, testedBand);
182 if (calculatedDuration != knownDuration)
184 std::cerr <<
"size=" << size <<
" band=" << testedBand <<
" mode=" << payloadMode
185 <<
" channelWidth=" << channelWidth <<
" guardInterval=" << guardInterval
186 <<
" datarate=" << payloadMode.
GetDataRate(channelWidth, guardInterval, 1)
187 <<
" known=" << knownDuration <<
" calculated=" << calculatedDuration
198 uint16_t channelWidth,
199 uint16_t guardInterval,
211 std::list<WifiPhyBand> testedBands;
225 for (
auto& testedBand : testedBands)
233 Time calculatedDuration =
phy->CalculateTxDuration(size, txVector, testedBand);
234 Time calculatedDurationUsingList =
239 if (calculatedDuration != knownDuration ||
240 calculatedDuration != calculatedDurationUsingList)
242 std::cerr <<
"size=" << size <<
" band=" << testedBand <<
" mode=" << payloadMode
243 <<
" channelWidth=" << +channelWidth <<
" guardInterval=" << guardInterval
244 <<
" datarate=" << payloadMode.
GetDataRate(channelWidth, guardInterval, 1)
245 <<
" preamble=" << preamble <<
" known=" << knownDuration
246 <<
" calculated=" << calculatedDuration
247 <<
" calculatedUsingList=" << calculatedDurationUsingList << std::endl;
256 std::list<HeMuUserInfo> userInfos,
257 uint16_t channelWidth,
258 uint16_t guardInterval,
262 NS_ASSERT(sizes.size() == userInfos.size() && sizes.size() > 1);
264 channelWidth < std::accumulate(
265 std::begin(userInfos),
269 return prevBw + HeRu::GetBandwidth(info.
ru.
GetRuType());
271 "Cannot accommodate all the RUs in the provided band");
283 std::list<uint16_t> staIds;
286 for (
const auto& userInfo : userInfos)
289 staIds.push_back(staId++);
295 std::list<WifiPhyBand> testedBands{
300 for (
auto& testedBand : testedBands)
308 uint32_t longestSize = 0;
309 auto iterStaId = staIds.begin();
310 for (
auto& size : sizes)
312 Time ppduDurationForSta =
313 phy->CalculateTxDuration(size, txVector, testedBand, *iterStaId);
314 if (ppduDurationForSta > calculatedDuration)
316 calculatedDuration = ppduDurationForSta;
322 Time calculatedDurationUsingList =
324 if (calculatedDuration != knownDuration ||
325 calculatedDuration != calculatedDurationUsingList)
327 std::cerr <<
"size=" << longestSize <<
" band=" << testedBand <<
" staId=" << staId
328 <<
" nss=" << +txVector.
GetNss(staId) <<
" mode=" << txVector.
GetMode(staId)
329 <<
" channelWidth=" << channelWidth <<
" guardInterval=" << guardInterval
334 <<
" known=" << knownDuration <<
" calculated=" << calculatedDuration
335 <<
" calculatedUsingList=" << calculatedDurationUsingList << std::endl;
344 std::list<uint16_t> staIds,
348 NS_ASSERT(sizes.size() == staIds.size());
350 auto itStaId = staIds.begin();
353 for (
auto& size : sizes)
356 psduMap[*itStaId++] =
359 return WifiPhy::CalculateTxDuration(psduMap, txVector, band);
370 DsssPhy::GetDsssRate11Mbps(),
376 DsssPhy::GetDsssRate11Mbps(),
382 DsssPhy::GetDsssRate11Mbps(),
388 DsssPhy::GetDsssRate11Mbps(),
402 DsssPhy::GetDsssRate11Mbps(),
408 DsssPhy::GetDsssRate11Mbps(),
414 DsssPhy::GetDsssRate11Mbps(),
420 DsssPhy::GetDsssRate11Mbps(),
426 DsssPhy::GetDsssRate11Mbps(),
432 DsssPhy::GetDsssRate11Mbps(),
438 DsssPhy::GetDsssRate11Mbps(),
444 DsssPhy::GetDsssRate11Mbps(),
450 DsssPhy::GetDsssRate5_5Mbps(),
456 DsssPhy::GetDsssRate5_5Mbps(),
462 DsssPhy::GetDsssRate5_5Mbps(),
468 DsssPhy::GetDsssRate5_5Mbps(),
474 DsssPhy::GetDsssRate5_5Mbps(),
480 DsssPhy::GetDsssRate5_5Mbps(),
486 DsssPhy::GetDsssRate5_5Mbps(),
492 DsssPhy::GetDsssRate5_5Mbps(),
498 DsssPhy::GetDsssRate2Mbps(),
504 DsssPhy::GetDsssRate2Mbps(),
510 DsssPhy::GetDsssRate2Mbps(),
516 DsssPhy::GetDsssRate2Mbps(),
522 DsssPhy::GetDsssRate2Mbps(),
528 DsssPhy::GetDsssRate2Mbps(),
534 DsssPhy::GetDsssRate2Mbps(),
540 DsssPhy::GetDsssRate2Mbps(),
546 DsssPhy::GetDsssRate1Mbps(),
552 DsssPhy::GetDsssRate1Mbps(),
558 DsssPhy::GetDsssRate1Mbps(),
564 DsssPhy::GetDsssRate1Mbps(),
570 DsssPhy::GetDsssRate1Mbps(),
576 DsssPhy::GetDsssRate1Mbps(),
582 DsssPhy::GetDsssRate1Mbps(),
588 DsssPhy::GetDsssRate1Mbps(),
597 DsssPhy::GetDsssRate1Mbps(),
606 DsssPhy::GetDsssRate11Mbps(),
612 DsssPhy::GetDsssRate11Mbps(),
618 DsssPhy::GetDsssRate11Mbps(),
630 OfdmPhy::GetOfdmRate54Mbps(),
636 OfdmPhy::GetOfdmRate54Mbps(),
642 OfdmPhy::GetOfdmRate54Mbps(),
653 ErpOfdmPhy::GetErpOfdmRate54Mbps(),
659 ErpOfdmPhy::GetErpOfdmRate54Mbps(),
665 ErpOfdmPhy::GetErpOfdmRate54Mbps(),
722 VhtPhy::GetVhtMcs8(),
728 VhtPhy::GetVhtMcs8(),
734 VhtPhy::GetVhtMcs8(),
740 VhtPhy::GetVhtMcs8(),
746 VhtPhy::GetVhtMcs8(),
752 VhtPhy::GetVhtMcs8(),
758 VhtPhy::GetVhtMcs9(),
764 VhtPhy::GetVhtMcs9(),
770 VhtPhy::GetVhtMcs9(),
776 VhtPhy::GetVhtMcs9(),
782 VhtPhy::GetVhtMcs9(),
788 VhtPhy::GetVhtMcs9(),
794 VhtPhy::GetVhtMcs0(),
800 VhtPhy::GetVhtMcs0(),
806 VhtPhy::GetVhtMcs0(),
812 VhtPhy::GetVhtMcs0(),
818 VhtPhy::GetVhtMcs0(),
824 VhtPhy::GetVhtMcs0(),
830 VhtPhy::GetVhtMcs9(),
836 VhtPhy::GetVhtMcs9(),
842 VhtPhy::GetVhtMcs9(),
848 VhtPhy::GetVhtMcs9(),
854 VhtPhy::GetVhtMcs9(),
860 VhtPhy::GetVhtMcs9(),
866 VhtPhy::GetVhtMcs8(),
872 VhtPhy::GetVhtMcs8(),
878 VhtPhy::GetVhtMcs8(),
884 VhtPhy::GetVhtMcs8(),
890 VhtPhy::GetVhtMcs8(),
896 VhtPhy::GetVhtMcs8(),
1059 HePhy::GetHeMcs11(),
1065 HePhy::GetHeMcs11(),
1071 HePhy::GetHeMcs11(),
1077 HePhy::GetHeMcs11(),
1083 HePhy::GetHeMcs11(),
1089 HePhy::GetHeMcs11(),
1095 HePhy::GetHeMcs11(),
1101 HePhy::GetHeMcs11(),
1107 HePhy::GetHeMcs11(),
1113 HePhy::GetHeMcs11(),
1119 HePhy::GetHeMcs11(),
1125 HePhy::GetHeMcs11(),
1131 HePhy::GetHeMcs11(),
1137 HePhy::GetHeMcs11(),
1143 HePhy::GetHeMcs11(),
1149 HePhy::GetHeMcs11(),
1155 HePhy::GetHeMcs11(),
1161 HePhy::GetHeMcs11(),
1167 HePhy::GetHeMcs11(),
1173 HePhy::GetHeMcs11(),
1179 HePhy::GetHeMcs11(),
1185 HePhy::GetHeMcs11(),
1191 HePhy::GetHeMcs11(),
1197 HePhy::GetHeMcs11(),
1203 HePhy::GetHeMcs11(),
1211 HePhy::GetHeMcs11(),
1219 HePhy::GetHeMcs11(),
1227 HePhy::GetHeMcs11(),
1233 HePhy::GetHeMcs11(),
1245 std::list<uint32_t>{1536, 1536},
1246 std::list<HeMuUserInfo>{{{HeRu::RU_242_TONE, 1,
true}, 0, 1},
1247 {{HeRu::RU_242_TONE, 2,
true}, 0, 1}},
1254 std::list<HeMuUserInfo>{{{HeRu::RU_242_TONE, 1,
true}, 1, 1},
1255 {{HeRu::RU_242_TONE, 2,
true}, 0, 1}},
1261 std::list<HeMuUserInfo>{{{HeRu::RU_242_TONE, 1,
true}, 0, 1},
1262 {{HeRu::RU_242_TONE, 2,
true}, 0, 1}},
1273 std::list<HeMuUserInfo>{{{HeRu::RU_242_TONE, 1,
true}, 0, 1},
1274 {{HeRu::RU_242_TONE, 2,
true}, 0, 1}},
1280 std::list<HeMuUserInfo>{{{HeRu::RU_242_TONE, 1,
true}, 1, 1},
1281 {{HeRu::RU_242_TONE, 2,
true}, 0, 1}},
1287 std::list<HeMuUserInfo>{{{HeRu::RU_242_TONE, 1,
true}, 0, 1},
1288 {{HeRu::RU_242_TONE, 2,
true}, 0, 1}},
1296 Simulator::Destroy();
1330 uint16_t channelWidth,
1333 const std::pair<std::size_t, std::size_t>& expectedNumUsersPerCc,
1334 Time expectedSigBDuration);
1337 void DoRun()
override;
1351 std::pair<std::size_t, std::size_t>
1357 const std::list<HeMuUserInfo>& userInfos,
1359 uint16_t channelWidth,
1362 const std::pair<std::size_t, std::size_t>& expectedNumUsersPerCc,
1363 Time expectedSigBDuration)
1364 :
TestCase{
"Check HE-SIG-B duration computation"},
1365 m_userInfos{userInfos},
1366 m_sigBMode{sigBMode},
1367 m_channelWidth{channelWidth},
1368 m_expectedMuType{expectedMuType},
1369 m_expectedRuAllocation{expectedRuAllocation},
1370 m_expectedNumUsersPerCc{expectedNumUsersPerCc},
1371 m_expectedSigBDuration{expectedSigBDuration}
1384 std::list<uint16_t> staIds;
1389 staIds.push_back(staId++);
1405 "Incorrect mode used to send HE-SIG-B");
1410 "Incorrect RU_ALLOCATION");
1413 const auto& numUsersPerCc = HePpdu::GetNumRusPerHeSigBContentChannel(
1414 txVector.GetChannelWidth(),
1415 txVector.GetRuAllocation(0),
1416 txVector.IsSigBCompression(),
1417 txVector.IsSigBCompression() ? txVector.GetHeMuUserInfoMap().size() : 0);
1418 const auto contentChannels = HePpdu::GetHeSigBContentChannels(txVector, 0);
1421 "Incorrect number of users in HE-SIG-B content channel 1");
1424 "Incorrect number of users in HE-SIG-B content channel 2");
1427 "Incorrect number of users in HE-SIG-B content channel 1");
1430 "Incorrect number of users in HE-SIG-B content channel 2");
1435 "Incorrect duration for HE-SIG-B");
1449 void DoRun()
override;
1464 :
TestCase(
"PHY header sections consistency")
1477 "The expected map size (" << expected.size() <<
") was not obtained ("
1478 << obtained.size() <<
")");
1480 auto itObtained = obtained.begin();
1481 auto itExpected = expected.begin();
1482 for (; itObtained != obtained.end() || itExpected != expected.end();)
1485 auto window = itObtained->second.first;
1486 auto mode = itObtained->second.second;
1489 auto windowRef = itExpected->second.first;
1490 auto modeRef = itExpected->second.second;
1494 "The expected PPDU field (" << fieldRef <<
") was not obtained ("
1498 "The expected start time (" << windowRef.first
1499 <<
") was not obtained (" <<
window.first
1503 "The expected stop time (" << windowRef.second
1504 <<
") was not obtained (" <<
window.second
1508 "The expected mode (" << modeRef <<
") was not obtained (" << mode
1526 phyEntity = Create<DsssPhy>();
1527 txVector.
SetMode(DsssPhy::GetDsssRate1Mbps());
1532 nonHtMode = DsssPhy::GetDsssRate1Mbps();
1545 txVector.
SetMode(DsssPhy::GetDsssRate11Mbps());
1546 nonHtMode = DsssPhy::GetDsssRate2Mbps();
1560 std::map<OfdmPhyVariant, std::size_t> variants{
1566 for (
auto variant : variants)
1568 phyEntity = Create<OfdmPhy>(variant.first);
1569 std::size_t ratio = variant.second;
1570 uint16_t bw = 20 / ratio;
1572 txVector.
SetMode(OfdmPhy::GetOfdmRate(12000000 / ratio, bw));
1573 nonHtMode = OfdmPhy::GetOfdmRate(6000000 / ratio, bw);
1576 {{ppduStart, ppduStart +
MicroSeconds(16 * ratio)}, nonHtMode}},
1586 phyEntity = Create<ErpOfdmPhy>();
1588 txVector.
SetMode(ErpOfdmPhy::GetErpOfdmRate(54000000));
1589 nonHtMode = ErpOfdmPhy::GetErpOfdmRate6Mbps();
1599 phyEntity = Create<HtPhy>(4);
1601 txVector.
SetMode(HtPhy::GetHtMcs6());
1602 nonHtMode = OfdmPhy::GetOfdmRate6Mbps();
1634 phyEntity = Create<VhtPhy>();
1637 txVector.
SetMode(VhtPhy::GetVhtMcs7());
1639 WifiMode sigBMode = VhtPhy::GetVhtMcs0();
1677 phyEntity = Create<HePhy>();
1681 txVector.
SetMode(HePhy::GetHeMcs9());
1682 std::map<uint16_t, HeMuUserInfo> userInfoMap = {{1, {{HeRu::RU_106_TONE, 1,
true}, 4, 2}},
1683 {2, {{HeRu::RU_106_TONE, 1,
true}, 9, 1}}};
1684 sigAMode = HePhy::GetVhtMcs0();
1685 sigBMode = HePhy::GetVhtMcs4();
1749 phyEntity = Create<EhtPhy>();
1753 txVector.
SetMode(EhtPhy::GetEhtMcs9());
1754 userInfoMap = {{1, {{HeRu::RU_106_TONE, 1,
true}, 4, 2}},
1755 {2, {{HeRu::RU_106_TONE, 1,
true}, 9, 1}}};
1756 WifiMode uSigMode = EhtPhy::GetVhtMcs0();
1757 WifiMode ehtSigMode = EhtPhy::GetVhtMcs4();
1804 :
TestSuite(
"wifi-devices-tx-duration", UNIT)
1812 {{{HeRu::RU_106_TONE, 1,
true}, 11, 1}, {{HeRu::RU_106_TONE, 2,
true}, 10, 4}},
1813 VhtPhy::GetVhtMcs5(),
1817 std::make_pair(2, 0),
1824 {{HeRu::RU_106_TONE, 2,
true}, 10, 4},
1825 {{HeRu::RU_52_TONE, 5,
true}, 4, 1},
1826 {{HeRu::RU_52_TONE, 6,
true}, 6, 2},
1827 {{HeRu::RU_52_TONE, 7,
true}, 5, 3},
1828 {{HeRu::RU_52_TONE, 8,
true}, 6, 2}},
1829 VhtPhy::GetVhtMcs4(),
1833 std::make_pair(2, 4),
1841 {{HeRu::RU_106_TONE, 2,
true}, 10, 4},
1842 {{HeRu::RU_52_TONE, 5,
true}, 4, 1},
1843 {{HeRu::RU_52_TONE, 6,
true}, 6, 2},
1844 {{HeRu::RU_52_TONE, 7,
true}, 5, 3},
1845 {{HeRu::RU_52_TONE, 8,
true}, 6, 2},
1846 {{HeRu::RU_26_TONE, 14,
true}, 3, 1}},
1847 VhtPhy::GetVhtMcs3(),
1851 std::make_pair(2, 5),
1859 {{HeRu::RU_106_TONE, 2,
true}, 10, 4},
1860 {{HeRu::RU_52_TONE, 5,
true}, 4, 1},
1861 {{HeRu::RU_52_TONE, 6,
true}, 6, 2},
1862 {{HeRu::RU_52_TONE, 7,
true}, 5, 3},
1863 {{HeRu::RU_52_TONE, 8,
true}, 6, 2},
1864 {{HeRu::RU_26_TONE, 14,
true}, 3, 1},
1865 {{HeRu::RU_242_TONE, 3,
true}, 1, 1},
1866 {{HeRu::RU_242_TONE, 4,
true}, 4, 1}},
1867 VhtPhy::GetVhtMcs1(),
1871 std::make_pair(3, 6),
1879 {{HeRu::RU_106_TONE, 2,
true}, 10, 4},
1880 {{HeRu::RU_52_TONE, 5,
true}, 4, 1},
1881 {{HeRu::RU_52_TONE, 6,
true}, 6, 2},
1882 {{HeRu::RU_52_TONE, 7,
true}, 5, 3},
1883 {{HeRu::RU_52_TONE, 8,
true}, 6, 2},
1884 {{HeRu::RU_26_TONE, 14,
true}, 3, 1},
1885 {{HeRu::RU_242_TONE, 3,
true}, 1, 1},
1886 {{HeRu::RU_242_TONE, 4,
true}, 4, 1},
1887 {{HeRu::RU_996_TONE, 1,
false}, 1, 1}},
1888 VhtPhy::GetVhtMcs1(),
1891 {96, 15, 192, 192, 208, 208, 208, 208},
1892 std::make_pair(4, 7),
1900 {{HeRu::RU_26_TONE, 2,
true}, 11, 1},
1901 {{HeRu::RU_26_TONE, 3,
true}, 11, 1},
1902 {{HeRu::RU_26_TONE, 4,
true}, 11, 1},
1903 {{HeRu::RU_26_TONE, 6,
true}, 11, 1},
1904 {{HeRu::RU_26_TONE, 7,
true}, 11, 1},
1905 {{HeRu::RU_26_TONE, 8,
true}, 11, 1},
1906 {{HeRu::RU_26_TONE, 9,
true}, 11, 1}},
1907 VhtPhy::GetVhtMcs5(),
1911 std::make_pair(9, 0),
1919 {{HeRu::RU_52_TONE, 3,
true}, 10, 2},
1920 {{HeRu::RU_52_TONE, 5,
true}, 11, 1},
1921 {{HeRu::RU_52_TONE, 8,
true}, 11, 2}},
1922 VhtPhy::GetVhtMcs5(),
1926 std::make_pair(4, 4),
1934 {{HeRu::RU_52_TONE, 2,
true}, 10, 2},
1935 {{HeRu::RU_52_TONE, 3,
true}, 11, 1},
1936 {{HeRu::RU_52_TONE, 5,
true}, 11, 2},
1937 {{HeRu::RU_52_TONE, 6,
true}, 11, 3}},
1938 VhtPhy::GetVhtMcs5(),
1942 std::make_pair(4, 4),
1948 {{{HeRu::RU_242_TONE, 1,
true}, 11, 1}, {{HeRu::RU_242_TONE, 1,
true}, 10, 4}},
1949 VhtPhy::GetVhtMcs5(),
1953 std::make_pair(2, 0),
1960 {{HeRu::RU_242_TONE, 1,
true}, 5, 2},
1961 {{HeRu::RU_242_TONE, 1,
true}, 6, 1}},
1962 VhtPhy::GetVhtMcs4(),
1966 std::make_pair(3, 0),
1973 {{HeRu::RU_242_TONE, 1,
true}, 5, 2},
1974 {{HeRu::RU_242_TONE, 1,
true}, 6, 3},
1975 {{HeRu::RU_242_TONE, 1,
true}, 7, 2}},
1976 VhtPhy::GetVhtMcs4(),
1980 std::make_pair(4, 0),
1987 {{HeRu::RU_242_TONE, 1,
true}, 5, 1},
1988 {{HeRu::RU_242_TONE, 1,
true}, 6, 2},
1989 {{HeRu::RU_242_TONE, 1,
true}, 7, 2},
1990 {{HeRu::RU_242_TONE, 1,
true}, 8, 1},
1991 {{HeRu::RU_242_TONE, 1,
true}, 9, 1}},
1992 VhtPhy::GetVhtMcs4(),
1996 std::make_pair(6, 0),
2003 {{HeRu::RU_242_TONE, 1,
true}, 5, 1},
2004 {{HeRu::RU_242_TONE, 1,
true}, 6, 1},
2005 {{HeRu::RU_242_TONE, 1,
true}, 7, 1},
2006 {{HeRu::RU_242_TONE, 1,
true}, 8, 1},
2007 {{HeRu::RU_242_TONE, 1,
true}, 9, 1},
2008 {{HeRu::RU_242_TONE, 1,
true}, 10, 1},
2009 {{HeRu::RU_242_TONE, 1,
true}, 11, 1}},
2010 VhtPhy::GetVhtMcs4(),
2014 std::make_pair(8, 0),
2020 {{{HeRu::RU_484_TONE, 1,
true}, 11, 1}, {{HeRu::RU_484_TONE, 1,
true}, 10, 4}},
2021 VhtPhy::GetVhtMcs5(),
2025 std::make_pair(1, 1),
2032 {{{HeRu::RU_484_TONE, 1,
true}, 4, 3},
2033 {{HeRu::RU_484_TONE, 1,
true}, 5, 2},
2034 {{HeRu::RU_484_TONE, 1,
true}, 6, 1}},
2035 VhtPhy::GetVhtMcs4(),
2039 std::make_pair(2, 1),
2045 {{{HeRu::RU_484_TONE, 1,
true}, 4, 1},
2046 {{HeRu::RU_484_TONE, 1,
true}, 5, 2},
2047 {{HeRu::RU_484_TONE, 1,
true}, 6, 3},
2048 {{HeRu::RU_484_TONE, 1,
true}, 7, 2}},
2049 VhtPhy::GetVhtMcs4(),
2053 std::make_pair(2, 2),
2059 {{{HeRu::RU_484_TONE, 1,
true}, 4, 1},
2060 {{HeRu::RU_484_TONE, 1,
true}, 5, 1},
2061 {{HeRu::RU_484_TONE, 1,
true}, 6, 2},
2062 {{HeRu::RU_484_TONE, 1,
true}, 7, 2},
2063 {{HeRu::RU_484_TONE, 1,
true}, 8, 1},
2064 {{HeRu::RU_484_TONE, 1,
true}, 9, 1}},
2065 VhtPhy::GetVhtMcs4(),
2069 std::make_pair(3, 3),
2075 {{{HeRu::RU_484_TONE, 1,
true}, 4, 1},
2076 {{HeRu::RU_484_TONE, 1,
true}, 5, 1},
2077 {{HeRu::RU_484_TONE, 1,
true}, 6, 1},
2078 {{HeRu::RU_484_TONE, 1,
true}, 7, 1},
2079 {{HeRu::RU_484_TONE, 1,
true}, 8, 1},
2080 {{HeRu::RU_484_TONE, 1,
true}, 9, 1},
2081 {{HeRu::RU_484_TONE, 1,
true}, 10, 1},
2082 {{HeRu::RU_484_TONE, 1,
true}, 11, 1}},
2083 VhtPhy::GetVhtMcs4(),
2087 std::make_pair(4, 4),
2093 {{{HeRu::RU_996_TONE, 1,
true}, 11, 1}, {{HeRu::RU_996_TONE, 1,
true}, 10, 4}},
2094 VhtPhy::GetVhtMcs5(),
2097 {208, 208, 208, 208},
2098 std::make_pair(1, 1),
2105 {{{HeRu::RU_996_TONE, 1,
true}, 4, 3},
2106 {{HeRu::RU_996_TONE, 1,
true}, 5, 2},
2107 {{HeRu::RU_996_TONE, 1,
true}, 6, 1}},
2108 VhtPhy::GetVhtMcs4(),
2111 {208, 208, 208, 208},
2112 std::make_pair(2, 1),
2118 {{{HeRu::RU_996_TONE, 1,
true}, 4, 1},
2119 {{HeRu::RU_996_TONE, 1,
true}, 5, 2},
2120 {{HeRu::RU_996_TONE, 1,
true}, 6, 3},
2121 {{HeRu::RU_996_TONE, 1,
true}, 7, 2}},
2122 VhtPhy::GetVhtMcs4(),
2125 {208, 208, 208, 208},
2126 std::make_pair(2, 2),
2132 {{{HeRu::RU_996_TONE, 1,
true}, 4, 1},
2133 {{HeRu::RU_996_TONE, 1,
true}, 5, 1},
2134 {{HeRu::RU_996_TONE, 1,
true}, 6, 2},
2135 {{HeRu::RU_996_TONE, 1,
true}, 7, 2},
2136 {{HeRu::RU_996_TONE, 1,
true}, 8, 1},
2137 {{HeRu::RU_996_TONE, 1,
true}, 9, 1}},
2138 VhtPhy::GetVhtMcs4(),
2141 {208, 208, 208, 208},
2142 std::make_pair(3, 3),
2148 {{{HeRu::RU_996_TONE, 1,
true}, 4, 1},
2149 {{HeRu::RU_996_TONE, 1,
true}, 5, 1},
2150 {{HeRu::RU_996_TONE, 1,
true}, 6, 1},
2151 {{HeRu::RU_996_TONE, 1,
true}, 7, 1},
2152 {{HeRu::RU_996_TONE, 1,
true}, 8, 1},
2153 {{HeRu::RU_996_TONE, 1,
true}, 9, 1},
2154 {{HeRu::RU_996_TONE, 1,
true}, 10, 1},
2155 {{HeRu::RU_996_TONE, 1,
true}, 11, 1}},
2156 VhtPhy::GetVhtMcs4(),
2159 {208, 208, 208, 208},
2160 std::make_pair(4, 4),
2167 {{{HeRu::RU_2x996_TONE, 1,
true}, 11, 1}, {{HeRu::RU_2x996_TONE, 1,
true}, 10, 4}},
2168 VhtPhy::GetVhtMcs5(),
2171 {208, 208, 208, 208, 208, 208, 208, 208},
2172 std::make_pair(1, 1),
2179 {{{HeRu::RU_2x996_TONE, 1,
true}, 4, 3},
2180 {{HeRu::RU_2x996_TONE, 1,
true}, 5, 2},
2181 {{HeRu::RU_2x996_TONE, 1,
true}, 6, 1}},
2182 VhtPhy::GetVhtMcs4(),
2185 {208, 208, 208, 208, 208, 208, 208, 208},
2186 std::make_pair(2, 1),
2192 {{{HeRu::RU_2x996_TONE, 1,
true}, 4, 1},
2193 {{HeRu::RU_2x996_TONE, 1,
true}, 5, 2},
2194 {{HeRu::RU_2x996_TONE, 1,
true}, 6, 3},
2195 {{HeRu::RU_2x996_TONE, 1,
true}, 7, 2}},
2196 VhtPhy::GetVhtMcs4(),
2199 {208, 208, 208, 208, 208, 208, 208, 208},
2200 std::make_pair(2, 2),
2206 {{{HeRu::RU_2x996_TONE, 1,
true}, 4, 1},
2207 {{HeRu::RU_2x996_TONE, 1,
true}, 5, 1},
2208 {{HeRu::RU_2x996_TONE, 1,
true}, 6, 2},
2209 {{HeRu::RU_2x996_TONE, 1,
true}, 7, 2},
2210 {{HeRu::RU_2x996_TONE, 1,
true}, 8, 1},
2211 {{HeRu::RU_2x996_TONE, 1,
true}, 9, 1}},
2212 VhtPhy::GetVhtMcs4(),
2215 {208, 208, 208, 208, 208, 208, 208, 208},
2216 std::make_pair(3, 3),
2222 {{{HeRu::RU_2x996_TONE, 1,
true}, 4, 1},
2223 {{HeRu::RU_2x996_TONE, 1,
true}, 5, 1},
2224 {{HeRu::RU_2x996_TONE, 1,
true}, 6, 1},
2225 {{HeRu::RU_2x996_TONE, 1,
true}, 7, 1},
2226 {{HeRu::RU_2x996_TONE, 1,
true}, 8, 1},
2227 {{HeRu::RU_2x996_TONE, 1,
true}, 9, 1},
2228 {{HeRu::RU_2x996_TONE, 1,
true}, 10, 1},
2229 {{HeRu::RU_2x996_TONE, 1,
true}, 11, 1}},
2230 VhtPhy::GetVhtMcs4(),
2233 {208, 208, 208, 208, 208, 208, 208, 208},
2234 std::make_pair(4, 4),
std::list< HeMuUserInfo > m_userInfos
HE MU specific per-user information.
MuType m_expectedMuType
Expected MU type (OFDMA or MU-MIMO)
HeSigBDurationTest(const std::list< HeMuUserInfo > &userInfos, const WifiMode &sigBMode, uint16_t channelWidth, MuType expectedMuType, const RuAllocation &expectedRuAllocation, const std::pair< std::size_t, std::size_t > &expectedNumUsersPerCc, Time expectedSigBDuration)
Constructor.
RuAllocation m_expectedRuAllocation
Expected RU_ALLOCATION.
Time m_expectedSigBDuration
Expected duration of the HE-SIG-B header.
WifiMode m_sigBMode
Mode used to transmit HE-SIG-B.
WifiTxVector BuildTxVector() const
Build a TXVECTOR for HE MU.
void DoRun() override
Implementation to actually run this TestCase.
std::pair< std::size_t, std::size_t > m_expectedNumUsersPerCc
Expected number of users per content channel.
uint16_t m_channelWidth
Channel width in MHz.
~TxDurationTest() override
static Time CalculateTxDurationUsingList(std::list< uint32_t > sizes, std::list< uint16_t > staIds, WifiTxVector txVector, WifiPhyBand band)
Calculate the overall Tx duration returned by WifiPhy for list of sizes.
static bool CheckMuTxDuration(std::list< uint32_t > sizes, std::list< HeMuUserInfo > userInfos, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
Check if the overall Tx duration returned by WifiPhy for a MU PPDU corresponds to a known value.
bool CheckTxDuration(uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
Check if the overall tx duration returned by InterferenceHelper corresponds to a known value.
bool CheckPayloadDuration(uint32_t size, WifiMode payloadMode, uint16_t channelWidth, uint16_t guardInterval, WifiPreamble preamble, Time knownDuration)
Check if the payload tx duration returned by InterferenceHelper corresponds to a known value.
void DoRun() override
Implementation to actually run this TestCase.
RuType GetRuType() const
Get the RU type.
std::map< WifiPpduField, PhyHeaderChunkInfo > PhyHeaderSections
A map of PhyHeaderChunkInfo elements per PPDU field.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
represent a single transmission mode
WifiModulationClass GetModulationClass() const
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) const
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 SetStbc(bool stbc)
Sets if STBC is being used.
void SetNess(uint8_t ness)
Sets the Ness number.
void SetEhtPpduType(uint8_t type)
Set the EHT_PPDU_TYPE parameter.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
bool IsDlOfdma() const
Return true if this TX vector is used for a downlink multi-user transmission using OFDMA.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
bool IsDlMuMimo() const
Return true if this TX vector is used for a downlink multi-user transmission using MU-MIMO.
void SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#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_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 NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
WifiPhyBand
Identifies the PHY band.
WifiPpduField
The type of PPDU field (grouped for convenience)
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ WIFI_PPDU_FIELD_SIG_B
SIG-B field.
@ WIFI_PPDU_FIELD_TRAINING
STF + LTF fields (excluding those in preamble for HT-GF)
@ WIFI_PPDU_FIELD_NON_HT_HEADER
PHY header field for DSSS or ERP, short PHY header field for HR/DSSS or ERP, field not present for HT...
@ WIFI_PPDU_FIELD_EHT_SIG
EHT-SIG field.
@ WIFI_PPDU_FIELD_HT_SIG
HT-SIG field.
@ WIFI_PPDU_FIELD_PREAMBLE
SYNC + SFD fields for DSSS or ERP, shortSYNC + shortSFD fields for HR/DSSS or ERP,...
@ WIFI_PPDU_FIELD_U_SIG
U-SIG field.
@ WIFI_PPDU_FIELD_SIG_A
SIG-A field.
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.
bool IsEht(WifiPreamble preamble)
Return true if a preamble corresponds to an EHT transmission.
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)
HE MU specific user transmission parameters.
HeRu::RuSpec ru
RU specification.
static TxDurationTestSuite g_txDurationTestSuite
the test suite