20 #include "ns3/ap-wifi-mac.h"
21 #include "ns3/boolean.h"
22 #include "ns3/constant-position-mobility-model.h"
23 #include "ns3/ctrl-headers.h"
24 #include "ns3/double.h"
25 #include "ns3/he-configuration.h"
26 #include "ns3/he-phy.h"
27 #include "ns3/he-ppdu.h"
28 #include "ns3/interference-helper.h"
30 #include "ns3/mobility-helper.h"
31 #include "ns3/multi-model-spectrum-channel.h"
32 #include "ns3/nist-error-rate-model.h"
34 #include "ns3/non-communicating-net-device.h"
35 #include "ns3/pointer.h"
36 #include "ns3/rng-seed-manager.h"
37 #include "ns3/simulator.h"
38 #include "ns3/spectrum-wifi-helper.h"
39 #include "ns3/spectrum-wifi-phy.h"
40 #include "ns3/sta-wifi-mac.h"
41 #include "ns3/string.h"
43 #include "ns3/threshold-preamble-detection-model.h"
44 #include "ns3/waveform-generator.h"
45 #include "ns3/wifi-mac-header.h"
46 #include "ns3/wifi-net-device.h"
47 #include "ns3/wifi-phy-listener.h"
48 #include "ns3/wifi-psdu.h"
49 #include "ns3/wifi-spectrum-signal-parameters.h"
50 #include "ns3/wifi-spectrum-value-helper.h"
51 #include "ns3/wifi-utils.h"
97 void SetGlobalPpduUid(uint64_t uid);
120 return HePhy::GetStaId(ppdu);
211 TypeId(
"ns3::OfdmaSpectrumWifiPhy")
213 .SetGroupName(
"Wifi")
214 .AddTraceSource(
"TxPpduUid",
215 "UID of the PPDU to be transmitted",
217 "ns3::OfdmaSpectrumWifiPhy::TxPpduUidCallback");
237 SpectrumWifiPhy::DoInitialize();
244 SpectrumWifiPhy::DoDispose();
264 SpectrumWifiPhy::StartTx(ppdu);
267 std::map<std::pair<uint64_t, WifiPreamble>,
Ptr<Event>>&
306 void DoRun()
override;
318 std::vector<bool> statusPerMpdu);
329 std::vector<bool> statusPerMpdu);
340 std::vector<bool> statusPerMpdu);
365 uint32_t expectedRxFailure,
366 uint32_t expectedRxBytes);
374 uint32_t expectedRxFailure,
375 uint32_t expectedRxBytes);
383 uint32_t expectedRxFailure,
384 uint32_t expectedRxBytes);
396 void SendMuPpdu(uint16_t rxStaId1, uint16_t rxStaId2);
450 m_countRxSuccessSta1(0),
451 m_countRxSuccessSta2(0),
452 m_countRxSuccessSta3(0),
453 m_countRxFailureSta1(0),
454 m_countRxFailureSta2(0),
455 m_countRxFailureSta3(0),
456 m_countRxBytesSta1(0),
457 m_countRxBytesSta2(0),
458 m_countRxBytesSta3(0),
497 ruType = HeRu::RU_106_TONE;
502 ruType = HeRu::RU_242_TONE;
507 ruType = HeRu::RU_484_TONE;
512 ruType = HeRu::RU_996_TONE;
523 txVector.
SetRu(ru1, rxStaId1);
524 txVector.
SetMode(HePhy::GetHeMcs7(), rxStaId1);
525 txVector.
SetNss(1, rxStaId1);
528 txVector.
SetRu(ru2, rxStaId2);
529 txVector.
SetMode(HePhy::GetHeMcs9(), rxStaId2);
530 txVector.
SetNss(1, rxStaId2);
539 psdus.insert(std::make_pair(rxStaId1, psdu1));
548 psdus.insert(std::make_pair(rxStaId2, psdu2));
628 uint32_t expectedRxFailure,
629 uint32_t expectedRxBytes)
633 "The number of successfully received packets by STA 1 is not correct!");
636 "The number of unsuccessfuly received packets by STA 1 is not correct!");
639 "The number of bytes received by STA 1 is not correct!");
644 uint32_t expectedRxFailure,
645 uint32_t expectedRxBytes)
649 "The number of successfully received packets by STA 2 is not correct!");
652 "The number of unsuccessfuly received packets by STA 2 is not correct!");
655 "The number of bytes received by STA 2 is not correct!");
660 uint32_t expectedRxFailure,
661 uint32_t expectedRxBytes)
665 "The number of successfully received packets by STA 3 is not correct!");
668 "The number of unsuccessfuly received packets by STA 3 is not correct!");
671 "The number of bytes received by STA 3 is not correct!");
688 phy->GetAttribute(
"State", ptr);
690 currentState = state->GetState();
694 "PHY State " << currentState <<
" does not match expected state "
704 spectrumChannel->AddPropagationLossModel(lossModel);
706 CreateObject<ConstantSpeedPropagationDelayModel>();
707 spectrumChannel->SetPropagationDelayModel(delayModel);
711 m_phyAp = CreateObject<SpectrumWifiPhy>();
726 Ptr<Node> sta1Node = CreateObject<Node>();
728 m_phySta1 = CreateObject<OfdmaSpectrumWifiPhy>(1);
746 Ptr<Node> sta2Node = CreateObject<Node>();
748 m_phySta2 = CreateObject<OfdmaSpectrumWifiPhy>(2);
766 Ptr<Node> sta3Node = CreateObject<Node>();
768 m_phySta3 = CreateObject<OfdmaSpectrumWifiPhy>(3);
786 Ptr<Node> interfererNode = CreateObject<Node>();
792 interfererNode->
AddDevice(interfererDev);
813 RngSeedManager::SetSeed(1);
814 RngSeedManager::SetRun(1);
815 int64_t streamNumber = 0;
821 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
877 Simulator::Schedule(
Seconds(1.1),
884 Simulator::Schedule(
Seconds(1.1),
935 Simulator::Schedule(
Seconds(2.1),
944 Simulator::Schedule(
Seconds(2.1),
962 bands.push_back(bandInfo);
965 Ptr<SpectrumValue> interferencePsdRu1 = Create<SpectrumValue>(SpectrumInterferenceRu1);
966 double interferencePower = 0.1;
967 *interferencePsdRu1 = interferencePower / ((
m_channelWidth / 2) * 20e6);
1013 Simulator::Schedule(
Seconds(3.1),
1032 bands.push_back(bandInfo);
1035 Ptr<SpectrumValue> interferencePsdRu2 = Create<SpectrumValue>(SpectrumInterferenceRu2);
1036 *interferencePsdRu2 = interferencePower / ((
m_channelWidth / 2) * 20e6);
1079 Simulator::Schedule(
Seconds(4.1),
1101 bands.push_back(bandInfo);
1104 Ptr<SpectrumValue> interferencePsdAll = Create<SpectrumValue>(SpectrumInterferenceAll);
1105 *interferencePsdAll = interferencePower / (
m_channelWidth * 20e6);
1184 Simulator::Destroy();
1201 void DoRun()
override;
1213 const std::vector<bool> statusPerMpdu);
1225 std::vector<bool> statusPerMpdu);
1246 uint32_t expectedRxFailure,
1247 uint32_t expectedRxBytes);
1256 uint32_t expectedRxFailure,
1257 uint32_t expectedRxBytes);
1273 const std::vector<bool>& puncturedSubchannels);
1329 :
TestCase(
"DL-OFDMA PHY puncturing test"),
1330 m_countRxSuccessSta1(0),
1331 m_countRxSuccessSta2(0),
1332 m_countRxFailureSta1(0),
1333 m_countRxFailureSta2(0),
1334 m_countRxBytesSta1(0),
1335 m_countRxBytesSta2(0),
1338 m_indexSubchannel(0),
1358 const std::vector<bool>& puncturedSubchannels)
1374 puncturedSubchannels.empty()
1376 : (puncturedSubchannels.at(1) ? HeRu::RU_242_TONE : HeRu::RU_484_TONE);
1378 txVector.
SetRu(ru1, rxStaId1);
1379 txVector.
SetMode(HePhy::GetHeMcs7(), rxStaId1);
1380 txVector.
SetNss(1, rxStaId1);
1382 ruType = puncturedSubchannels.empty()
1384 : (puncturedSubchannels.at(1) ? HeRu::RU_484_TONE : HeRu::RU_242_TONE);
1386 ruType == HeRu::RU_484_TONE ? 2 : (puncturedSubchannels.at(3) ? 3 : 4),
1388 txVector.
SetRu(ru2, rxStaId2);
1389 txVector.
SetMode(HePhy::GetHeMcs9(), rxStaId2);
1390 txVector.
SetNss(1, rxStaId2);
1392 std::vector<uint8_t> ruAlloc;
1393 if (puncturedSubchannels.empty())
1395 std::fill_n(std::back_inserter(ruAlloc), 4, 200);
1399 ruAlloc.push_back(puncturedSubchannels.at(1) ? 192 : 200);
1400 ruAlloc.push_back(puncturedSubchannels.at(1) ? 113 : 200);
1401 ruAlloc.push_back(puncturedSubchannels.at(2) ? 113
1402 : (puncturedSubchannels.at(3) ? 192 : 200));
1403 ruAlloc.push_back(puncturedSubchannels.at(2) ? 192
1404 : (puncturedSubchannels.at(3) ? 113 : 200));
1417 psdus.insert(std::make_pair(rxStaId1, psdu1));
1426 psdus.insert(std::make_pair(rxStaId2, psdu2));
1428 if (!puncturedSubchannels.empty())
1491 uint32_t expectedRxFailure,
1492 uint32_t expectedRxBytes)
1496 "The number of successfully received packets by STA 1 is not correct!");
1499 "The number of unsuccessfuly received packets by STA 1 is not correct!");
1502 "The number of bytes received by STA 1 is not correct!");
1507 uint32_t expectedRxFailure,
1508 uint32_t expectedRxBytes)
1512 "The number of successfully received packets by STA 2 is not correct!");
1515 "The number of unsuccessfuly received packets by STA 2 is not correct!");
1518 "The number of bytes received by STA 2 is not correct!");
1534 phy->GetAttribute(
"State", ptr);
1536 currentState = state->GetState();
1540 "PHY State " << currentState <<
" does not match expected state "
1550 spectrumChannel->AddPropagationLossModel(lossModel);
1552 CreateObject<ConstantSpeedPropagationDelayModel>();
1553 spectrumChannel->SetPropagationDelayModel(delayModel);
1555 Ptr<Node> apNode = CreateObject<Node>();
1557 m_phyAp = CreateObject<SpectrumWifiPhy>();
1572 Ptr<Node> sta1Node = CreateObject<Node>();
1574 m_phySta1 = CreateObject<OfdmaSpectrumWifiPhy>(1);
1592 Ptr<Node> sta2Node = CreateObject<Node>();
1594 m_phySta2 = CreateObject<OfdmaSpectrumWifiPhy>(2);
1612 Ptr<Node> interfererNode = CreateObject<Node>();
1618 interfererNode->
AddDevice(interfererDev);
1637 RngSeedManager::SetSeed(1);
1638 RngSeedManager::SetRun(1);
1639 int64_t streamNumber = 0;
1644 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
1663 bandInfo.
fl = bandInfo.
fc - (5 * 1e6);
1664 bandInfo.
fh = bandInfo.
fc + (5 * 1e6);
1666 bands.push_back(bandInfo);
1670 double interferencePower = 0.1;
1671 *interferencePsd = interferencePower / 10e6;
1673 Simulator::Schedule(
Seconds(0.0),
1681 Simulator::Schedule(
Seconds(1.0),
1686 std::vector<bool>{});
1714 Simulator::Schedule(
Seconds(1.1),
1721 Simulator::Schedule(
Seconds(1.1),
1731 Simulator::Schedule(
Seconds(1.1),
1738 Simulator::Schedule(
Seconds(1.1),
1751 std::vector<bool> puncturedSubchannels;
1756 puncturedSubchannels.push_back(
true);
1760 puncturedSubchannels.push_back(
false);
1763 Simulator::Schedule(
Seconds(2.0),
1768 puncturedSubchannels);
1794 Simulator::Schedule(
Seconds(2.1),
1801 Simulator::Schedule(
Seconds(2.1),
1818 for (
auto index : {1, 2, 3})
1823 Simulator::Destroy();
1841 void DoRun()
override;
1882 void CheckUid(uint16_t staId, uint64_t expectedUid);
1894 :
TestCase(
"UL-OFDMA PPDU UID attribution test"),
1895 m_ppduUidAp(UINT64_MAX),
1896 m_ppduUidSta1(UINT64_MAX),
1897 m_ppduUidSta2(UINT64_MAX)
1911 spectrumChannel->AddPropagationLossModel(lossModel);
1913 CreateObject<ConstantSpeedPropagationDelayModel>();
1914 spectrumChannel->SetPropagationDelayModel(delayModel);
1916 Ptr<Node> apNode = CreateObject<Node>();
1918 m_phyAp = CreateObject<OfdmaSpectrumWifiPhy>(0);
1925 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
1944 Ptr<Node> sta1Node = CreateObject<Node>();
1946 m_phySta1 = CreateObject<OfdmaSpectrumWifiPhy>(1);
1965 Ptr<Node> sta2Node = CreateObject<Node>();
1967 m_phySta2 = CreateObject<OfdmaSpectrumWifiPhy>(2);
2022 "UID " << uid <<
" does not match expected one " << expectedUid <<
" for "
2069 uint16_t rxStaId1 = 1;
2071 txVector.
SetRu(ru1, rxStaId1);
2072 txVector.
SetMode(HePhy::GetHeMcs7(), rxStaId1);
2073 txVector.
SetNss(1, rxStaId1);
2075 uint16_t rxStaId2 = 2;
2077 txVector.
SetRu(ru2, rxStaId2);
2078 txVector.
SetMode(HePhy::GetHeMcs9(), rxStaId2);
2079 txVector.
SetNss(1, rxStaId2);
2090 psdus.insert(std::make_pair(rxStaId1, psdu1));
2099 psdus.insert(std::make_pair(rxStaId2, psdu2));
2123 uint16_t rxStaId1 = 1;
2125 txVector1.
SetRu(ru1, rxStaId1);
2126 txVector1.
SetMode(HePhy::GetHeMcs7(), rxStaId1);
2127 txVector1.
SetNss(1, rxStaId1);
2128 trigVector.
SetRu(ru1, rxStaId1);
2129 trigVector.
SetMode(HePhy::GetHeMcs7(), rxStaId1);
2130 trigVector.
SetNss(1, rxStaId1);
2139 psdus1.insert(std::make_pair(rxStaId1, psdu1));
2141 uint16_t rxStaId2 = 2;
2143 txVector2.
SetRu(ru2, rxStaId2);
2144 txVector2.
SetMode(HePhy::GetHeMcs9(), rxStaId2);
2145 txVector2.
SetNss(1, rxStaId2);
2146 trigVector.
SetRu(ru2, rxStaId2);
2147 trigVector.
SetMode(HePhy::GetHeMcs9(), rxStaId2);
2148 trigVector.
SetNss(1, rxStaId2);
2157 psdus2.insert(std::make_pair(rxStaId2, psdu2));
2170 HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector1,
m_phySta1->
GetPhyBand())
2173 HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector2,
m_phySta2->
GetPhyBand())
2177 hePhyAp->SetTrigVector(trigVector, txDuration);
2202 hdr.
SetAddr1(Mac48Address::GetBroadcast());
2205 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
2226 RngSeedManager::SetSeed(1);
2227 RngSeedManager::SetRun(1);
2228 int64_t streamNumber = 0;
2260 Simulator::Destroy();
2278 void DoRun()
override;
2289 void RxHeTbPpdu(uint64_t uid, uint16_t staId,
double txPowerWatts,
size_t payloadSize);
2338 :
TestCase(
"UL-OFDMA multiple RX events test"),
2339 m_totalBytesDropped(0),
2340 m_trigVector(
HePhy::GetHeMcs7(),
2379 for (
const auto& uid : uids)
2382 auto it = events.find(pair);
2383 bool found = (it != events.end());
2386 "HE TB PPDU with UID " << uid <<
" has not been received!");
2394 expectedBytesDropped,
2395 "The number of dropped bytes is not correct!");
2401 double txPowerWatts,
2417 txVector.
SetRu(ru, staId);
2418 txVector.
SetMode(HePhy::GetHeMcs7(), staId);
2419 txVector.
SetNss(1, staId);
2430 psdus.insert(std::make_pair(staId, psdu));
2440 HePpdu::PSD_NON_HE_PORTION);
2443 Time nonOfdmaDuration =
m_phy->
GetHePhy()->CalculateNonOfdmaDurationForHeTb(txVector);
2444 uint32_t centerFrequency =
2445 m_phy->
GetHePhy()->GetCenterFrequencyForNonOfdmaPart(txVector, staId);
2446 uint16_t ruWidth = HeRu::GetBandwidth(txVector.
GetRu(staId).
GetRuType());
2447 uint16_t channelWidth = ruWidth < 20 ? 20 : ruWidth;
2448 Ptr<SpectrumValue> rxPsd = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(
2454 rxParams->psd = rxPsd;
2455 rxParams->txPhy =
nullptr;
2456 rxParams->duration = nonOfdmaDuration;
2457 rxParams->ppdu = ppdu;
2458 rxParams->txWidth = channelWidth;
2461 std::tie(length, ppduDuration) =
2462 HePhy::ConvertHeTbPpduDurationToLSigLength(ppduDuration, txVector,
m_phy->
GetPhyBand());
2467 ppdu->ResetTxVector();
2471 Ptr<HePpdu> ppduOfdma = DynamicCast<HePpdu>(ppdu->Copy());
2472 ppduOfdma->SetTxPsdFlag(HePpdu::PSD_HE_PORTION);
2475 WifiSpectrumValueHelper::CreateHeMuOfdmTxPowerSpectralDensity(
DEFAULT_FREQUENCY,
2481 rxParamsOfdma->psd = rxPsd;
2482 rxParamsOfdma->txPhy =
nullptr;
2483 rxParamsOfdma->duration = ppduDuration - nonOfdmaDuration;
2484 rxParamsOfdma->ppdu = ppduOfdma;
2486 Simulator::Schedule(nonOfdmaDuration,
2512 m_phy = CreateObject<OfdmaSpectrumWifiPhy>(0);
2529 CreateObject<ThresholdPreambleDetectionModel>();
2530 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(4));
2531 preambleDetectionModel->SetAttribute(
"MinimumRssi",
DoubleValue(-82));
2534 heConfiguration->SetMaxTbPpduDelay(
NanoSeconds(400));
2548 RngSeedManager::SetSeed(1);
2549 RngSeedManager::SetRun(1);
2550 int64_t streamNumber = 0;
2553 double txPowerWatts = 0.01;
2557 std::vector<uint64_t> uids{0};
2558 Simulator::Schedule(
Seconds(1),
2585 std::vector<uint64_t> uids{1, 2};
2586 Simulator::Schedule(
Seconds(2),
2629 std::vector<uint64_t> uids{3, 4};
2630 Simulator::Schedule(
Seconds(3),
2673 std::vector<uint64_t> uids{5, 6};
2674 Simulator::Schedule(
Seconds(4),
2708 std::vector<uint64_t>{uids[0]});
2721 std::vector<uint64_t> uids{7, 8};
2722 Simulator::Schedule(
Seconds(5),
2756 std::vector<uint64_t>{uids[0]});
2769 std::vector<uint64_t> uids{9};
2770 Simulator::Schedule(
Seconds(6),
2802 Simulator::Destroy();
2847 const std::vector<Time>& )
override
2963 void DoRun()
override;
2974 uint8_t bssColor)
const;
2993 std::size_t payloadSize,
3005 void SendHeSuPpdu(uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor);
3044 uint32_t expectedFailures,
3045 uint32_t expectedBytes);
3054 uint32_t expectedFailures,
3055 uint32_t expectedBytes);
3065 double expectedRxPower);
3074 double expectedRxPower);
3105 Time expectedLastNotification,
3106 bool expectedSuccess);
3123 std::vector<bool> statusPerMpdu);
3154 uint32_t expectedSuccessFromSta1,
3155 uint32_t expectedFailuresFromSta1,
3156 uint32_t expectedBytesFromSta1,
3157 uint32_t expectedSuccessFromSta2,
3158 uint32_t expectedFailuresFromSta2,
3159 uint32_t expectedBytesFromSta2,
3160 bool scheduleTxSta1 =
true,
3175 double rxPowerNonOfdmaRu1,
3176 double rxPowerNonOfdmaRu2,
3177 double rxPowerOfdmaRu1,
3178 double rxPowerOfdmaRu2);
3191 std::unique_ptr<OfdmaTestPhyListener>
3210 m_countRxSuccessFromSta1(0),
3211 m_countRxSuccessFromSta2(0),
3212 m_countRxFailureFromSta1(0),
3213 m_countRxFailureFromSta2(0),
3214 m_countRxBytesFromSta1(0),
3215 m_countRxBytesFromSta2(0),
3224 std::size_t payloadSize,
3249 std::ostringstream addr;
3250 addr <<
"00:00:00:00:00:0" << txStaId;
3254 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
3261 else if (txStaId == 2)
3265 else if (txStaId == 3)
3269 else if (txStaId == 0)
3273 phy->SetPpduUid(uid);
3274 phy->Send(psdus, txVector);
3280 uint8_t bssColor)
const
3298 ruType = HeRu::RU_106_TONE;
3302 ruType = HeRu::RU_242_TONE;
3306 ruType = HeRu::RU_484_TONE;
3310 ruType = HeRu::RU_996_TONE;
3317 bool primary80MHz =
true;
3320 primary80MHz =
false;
3324 txVector.
SetRu(ru, txStaId);
3325 txVector.
SetMode(HePhy::GetHeMcs7(), txStaId);
3326 txVector.
SetNss(1, txStaId);
3336 channelWidth = (channelWidth == 160 ? 20 : channelWidth * 2);
3353 if (channelWidth == 20)
3355 ruType = HeRu::RU_106_TONE;
3357 else if (channelWidth == 40)
3359 ruType = HeRu::RU_242_TONE;
3361 else if (channelWidth == 80)
3363 ruType = HeRu::RU_484_TONE;
3365 else if (channelWidth == 160)
3367 ruType = HeRu::RU_996_TONE;
3374 uint16_t aid1 = (error ==
AID ? 3 : 1);
3375 uint16_t aid2 = (error ==
AID ? 4 : 2);
3378 txVector.
SetRu(ru1, aid1);
3379 txVector.
SetMode(HePhy::GetHeMcs7(), aid1);
3380 txVector.
SetNss(1, aid1);
3382 HeRu::RuSpec ru2(ruType, (channelWidth == 160 ? 1 : 2), (channelWidth == 160 ?
false :
true));
3383 txVector.
SetRu(ru2, aid2);
3384 txVector.
SetMode(HePhy::GetHeMcs7(), aid2);
3385 txVector.
SetNss(1, aid2);
3404 std::size_t payloadSize,
3409 NS_LOG_FUNCTION(
this << txStaId << index << payloadSize << uid << +bssColor << (incrementUid));
3423 std::ostringstream addr;
3424 addr <<
"00:00:00:00:00:0" << txStaId;
3428 psdus.insert(std::make_pair(txStaId, psdu));
3435 else if (txStaId == 2)
3439 else if (txStaId == 3)
3445 phy->CalculateTxDuration(psdu->
GetSize(), txVector,
phy->GetPhyBand(), txStaId);
3447 HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector,
phy->GetPhyBand()).first);
3449 phy->SetPpduUid(uid);
3450 phy->Send(psdus, txVector);
3508 uint32_t expectedFailures,
3509 uint32_t expectedBytes)
3513 "The number of successfully received packets from STA 1 is not correct!");
3517 "The number of unsuccessfuly received packets from STA 1 is not correct!");
3520 "The number of bytes received from STA 1 is not correct!");
3525 uint32_t expectedFailures,
3526 uint32_t expectedBytes)
3530 "The number of successfully received packets from STA 2 is not correct!");
3534 "The number of unsuccessfuly received packets from STA 2 is not correct!");
3537 "The number of bytes received from STA 2 is not correct!");
3543 double expectedRxPower)
3547 double rxPower =
event->GetRxPowerW(band);
3548 NS_LOG_FUNCTION(
this << band.first << band.second << expectedRxPower << rxPower);
3553 "RX power " << rxPower <<
" over (" << band.first <<
", "
3554 << band.second <<
") does not match expected power "
3561 double expectedRxPower)
3568 NS_LOG_FUNCTION(
this << band.first << band.second << expectedRxPower);
3570 if (expectedRxPower > 0.0)
3573 phy->GetEnergyDuration(expectedRxPower - step, band).IsStrictlyPositive(),
3575 "At least " << expectedRxPower <<
" W expected for OFDMA part over (" << band.first
3578 phy->GetEnergyDuration(expectedRxPower + step, band).IsStrictlyPositive(),
3580 "At most " << expectedRxPower <<
" W expected for OFDMA part over (" << band.first
3586 phy->GetEnergyDuration(expectedRxPower + step, band).IsStrictlyPositive(),
3588 "At most " << expectedRxPower <<
" W expected for OFDMA part over (" << band.first
3598 "m_currentEvent for AP was not cleared");
3601 "m_currentEvent for STA 1 was not cleared");
3604 "m_currentEvent for STA 2 was not cleared");
3621 phy->GetAttribute(
"State", ptr);
3623 currentState = state->GetState();
3627 "PHY State " << currentState <<
" does not match expected state "
3633 Time expectedLastNotification)
3636 expectedNotifications,
3637 "Number of RX start notifications "
3639 <<
" does not match expected count " << expectedNotifications
3642 expectedLastNotification,
3643 "Last time RX start notification has been received "
3645 <<
" does not match expected time " << expectedLastNotification
3651 Time expectedLastNotification,
3652 bool expectedSuccess)
3655 expectedNotifications,
3656 "Number of RX end notifications "
3658 <<
" does not match expected count " << expectedNotifications
3661 expectedLastNotification,
3662 "Last time RX end notification has been received "
3664 <<
" does not match expected time " << expectedLastNotification
3668 "Last time RX end notification indicated a "
3670 <<
" but expected a " << (expectedSuccess ?
"success" :
"failure")
3695 heConfiguration->SetAttribute(
"BssColor",
UintegerValue(bssColor));
3711 spectrumChannel->AddPropagationLossModel(lossModel);
3713 CreateObject<ConstantSpeedPropagationDelayModel>();
3714 spectrumChannel->SetPropagationDelayModel(delayModel);
3717 CreateObject<ThresholdPreambleDetectionModel>();
3718 preambleDetectionModel->SetAttribute(
3722 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(-100));
3724 Ptr<Node> apNode = CreateObject<Node>();
3730 m_phyAp = CreateObject<OfdmaSpectrumWifiPhy>(0);
3753 Ptr<Node> sta1Node = CreateObject<Node>();
3757 m_phySta1 = CreateObject<OfdmaSpectrumWifiPhy>(1);
3773 Ptr<Node> sta2Node = CreateObject<Node>();
3777 m_phySta2 = CreateObject<OfdmaSpectrumWifiPhy>(2);
3793 Ptr<Node> sta3Node = CreateObject<Node>();
3797 m_phySta3 = CreateObject<OfdmaSpectrumWifiPhy>(3);
3813 Ptr<Node> interfererNode = CreateObject<Node>();
3819 interfererNode->
AddDevice(interfererDev);
3823 for (
auto&
phy : phys)
3831 phy->SetAttribute(
"TxMaskInnerBandMinimumRejection",
DoubleValue(-100.0));
3832 phy->SetAttribute(
"TxMaskOuterBandMinimumRejection",
DoubleValue(-100.0));
3833 phy->SetAttribute(
"TxMaskOuterBandMaximumRejection",
DoubleValue(-100.0));
3862 uint32_t expectedSuccessFromSta1,
3863 uint32_t expectedFailuresFromSta1,
3864 uint32_t expectedBytesFromSta1,
3865 uint32_t expectedSuccessFromSta2,
3866 uint32_t expectedFailuresFromSta2,
3867 uint32_t expectedBytesFromSta2,
3868 bool scheduleTxSta1,
3869 Time ulTimeDifference,
3873 static uint64_t uid = 0;
3898 Simulator::Schedule(delay,
3908 Simulator::Schedule(delay + ulTimeDifference,
3923 expectedStateBeforeEnd);
3928 expectedStateAtEnd);
3931 if (expectedSuccessFromSta1 + expectedFailuresFromSta1 + expectedSuccessFromSta2 +
3932 expectedFailuresFromSta2 >
3936 const bool isSuccess = (expectedSuccessFromSta1 > 0) || (expectedSuccessFromSta2 > 0);
3946 Simulator::Schedule(expectedPayloadEnd,
3953 Simulator::Schedule(expectedPayloadEnd +
NanoSeconds(1),
3963 Simulator::Schedule(delay,
3966 expectedSuccessFromSta1,
3967 expectedFailuresFromSta1,
3968 expectedBytesFromSta1);
3970 Simulator::Schedule(delay,
3973 expectedSuccessFromSta2,
3974 expectedFailuresFromSta2,
3975 expectedBytesFromSta2);
3985 double rxPowerNonOfdmaRu1,
3986 double rxPowerNonOfdmaRu2,
3987 double rxPowerOfdmaRu1,
3988 double rxPowerOfdmaRu2)
3990 Time detectionDuration = WifiPhy::GetPreambleDetectionDuration();
3994 Time nonOfdmaDuration = hePhy->CalculateNonOfdmaDurationForHeTb(txVectorSta2);
3995 NS_ASSERT(nonOfdmaDuration == hePhy->CalculateNonOfdmaDurationForHeTb(txVectorSta1));
3997 std::vector<double> rxPowerNonOfdma{rxPowerNonOfdmaRu1, rxPowerNonOfdmaRu2};
3998 std::vector<WifiSpectrumBand> nonOfdmaBand{hePhy->GetNonOfdmaBand(txVectorSta1, 1),
3999 hePhy->GetNonOfdmaBand(txVectorSta2, 2)};
4000 std::vector<double> rxPowerOfdma{rxPowerOfdmaRu1, rxPowerOfdmaRu2};
4001 std::vector<WifiSpectrumBand> ofdmaBand{hePhy->GetRuBandForRx(txVectorSta1, 1),
4002 hePhy->GetRuBandForRx(txVectorSta2, 2)};
4004 for (uint8_t i = 0; i < 2; ++i)
4010 Simulator::Schedule(
4011 delay + detectionDuration +
4017 rxPowerNonOfdma[i]);
4018 Simulator::Schedule(delay + nonOfdmaDuration -
NanoSeconds(1),
4023 rxPowerNonOfdma[i]);
4025 Simulator::Schedule(delay + nonOfdmaDuration +
4046 Simulator::Schedule(
4047 delay + detectionDuration +
4053 rxPowerNonOfdma[i]);
4054 Simulator::Schedule(delay + nonOfdmaDuration -
NanoSeconds(1),
4059 rxPowerNonOfdma[i]);
4061 Simulator::Schedule(delay + nonOfdmaDuration +
4077 if (rxPowerOfdmaRu1 != 0.0)
4084 double rxPowerNonOfdmaSta1Only =
4086 ? rxPowerNonOfdma[0]
4087 : rxPowerNonOfdma[0] / 2;
4089 Simulator::Schedule(
4090 delay + detectionDuration +
4096 rxPowerNonOfdmaSta1Only);
4097 Simulator::Schedule(delay + nonOfdmaDuration -
NanoSeconds(1),
4102 rxPowerNonOfdmaSta1Only);
4104 Simulator::Schedule(delay + nonOfdmaDuration +
4124 RngSeedManager::SetSeed(1);
4125 RngSeedManager::SetRun(1);
4126 int64_t streamNumber = 0;
4132 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
4161 Simulator::Schedule(delay,
4164 "Reception of solicited HE TB PPDUs");
4179 Simulator::Schedule(
4183 "Reception of solicited HE TB PPDUs with delay (< 400ns) between the two signals");
4199 Simulator::Schedule(delay,
4202 "Dropping of unsolicited HE TB PPDUs");
4219 Simulator::Schedule(delay,
4222 "Dropping of HE TB PPDUs with channel width differing from TRIGVECTOR");
4240 Simulator::Schedule(delay,
4243 "Dropping of HE TB PPDUs with UL Length differing from TRIGVECTOR");
4261 Simulator::Schedule(delay,
4264 "Dropping of HE TB PPDUs with AIDs differing from TRIGVECTOR");
4283 Simulator::Schedule(
4287 "Reception of solicited HE TB PPDUs with interference on RU 1 during PSDU reception");
4294 bands.push_back(bandInfo);
4297 Ptr<SpectrumValue> interferencePsdRu1 = Create<SpectrumValue>(SpectrumInterferenceRu1);
4298 double interferencePower = 0.1;
4299 *interferencePsdRu1 = interferencePower / ((
m_channelWidth / 2) * 20e6);
4322 Simulator::Schedule(
4326 "Reception of solicited HE TB PPDUs with interference on RU 2 during PSDU reception");
4332 bands.push_back(bandInfo);
4335 Ptr<SpectrumValue> interferencePsdRu2 = Create<SpectrumValue>(SpectrumInterferenceRu2);
4336 *interferencePsdRu2 = interferencePower / ((
m_channelWidth / 2) * 20e6);
4361 Simulator::Schedule(delay,
4364 "Reception of solicited HE TB PPDUs with interference on the full band "
4365 "during PSDU reception");
4371 bands.push_back(bandInfo);
4374 Ptr<SpectrumValue> interferencePsdAll = Create<SpectrumValue>(SpectrumInterferenceAll);
4375 *interferencePsdAll = interferencePower / (
m_channelWidth * 20e6);
4400 Simulator::Schedule(delay,
4403 "Reception of solicited HE TB PPDUs with another HE TB PPDU arriving on RU "
4404 "1 during PSDU reception");
4452 Simulator::Schedule(delay,
4455 "Reception of solicited HE TB PPDUs with another HE TB PPDU arriving on RU "
4456 "2 during PSDU reception");
4502 Simulator::Schedule(
4506 "Reception of solicited HE TB PPDUs with an HE SU PPDU arriving during the 400 ns window");
4530 Simulator::Schedule(delay,
4533 "Reception of solicited HE TB PPDU only on RU 2");
4560 Simulator::Schedule(delay,
4563 "Measure power for reception of HE TB PPDU only on RU 2");
4588 Simulator::Schedule(
4592 "Measure power for reception of HE TB PPDU only on RU 2 with PSD limitation");
4605 double rxPowerOfdma = rxPower;
4640 Simulator::Schedule(delay,
4643 "Measure power for reception of HE TB PPDU on both RUs");
4663 Simulator::Schedule(delay,
4666 "Reception of an HE TB PPDU from another BSS");
4690 Simulator::Schedule(
4694 "Reception of solicited HE TB PPDUs with delay (< 400ns) between the two signals and "
4695 "reception of an HE TB PPDU from another BSS between the ends of the two HE TB PPDUs");
4749 Simulator::Destroy();
4767 void DoRun()
override;
4778 std::size_t payloadSize,
4810 uint32_t expectedFailures,
4811 uint32_t expectedBytes);
4820 uint32_t expectedFailures,
4821 uint32_t expectedBytes);
4852 std::vector<bool> statusPerMpdu);
4875 :
TestCase(
"PHY padding exclusion test"),
4876 m_countRxSuccessFromSta1(0),
4877 m_countRxSuccessFromSta2(0),
4878 m_countRxFailureFromSta1(0),
4879 m_countRxFailureFromSta2(0),
4880 m_countRxBytesFromSta1(0),
4881 m_countRxBytesFromSta2(0)
4888 std::size_t payloadSize,
4906 txVector.
SetRu(ru, txStaId);
4907 txVector.
SetMode(HePhy::GetHeMcs7(), txStaId);
4908 txVector.
SetNss(1, txStaId);
4915 std::ostringstream addr;
4916 addr <<
"00:00:00:00:00:0" << txStaId;
4920 psdus.insert(std::make_pair(txStaId, psdu));
4927 else if (txStaId == 2)
4933 HePhy::ConvertHeTbPpduDurationToLSigLength(txDuration, txVector,
phy->GetPhyBand()).first);
4936 phy->Send(psdus, txVector);
4993 uint32_t expectedFailures,
4994 uint32_t expectedBytes)
4998 "The number of successfully received packets from STA 1 is not correct!");
5002 "The number of unsuccessfuly received packets from STA 1 is not correct!");
5005 "The number of bytes received from STA 1 is not correct!");
5010 uint32_t expectedFailures,
5011 uint32_t expectedBytes)
5015 "The number of successfully received packets from STA 2 is not correct!");
5019 "The number of unsuccessfuly received packets from STA 2 is not correct!");
5022 "The number of bytes received from STA 2 is not correct!");
5030 "m_currentEvent for AP was not cleared");
5033 "m_currentEvent for STA 1 was not cleared");
5036 "m_currentEvent for STA 2 was not cleared");
5054 "PHY State " << currentState <<
" does not match expected state "
5075 RngSeedManager::SetSeed(1);
5076 RngSeedManager::SetRun(1);
5077 int64_t streamNumber = 0;
5082 spectrumChannel->AddPropagationLossModel(lossModel);
5084 CreateObject<ConstantSpeedPropagationDelayModel>();
5085 spectrumChannel->SetPropagationDelayModel(delayModel);
5087 Ptr<Node> apNode = CreateObject<Node>();
5092 m_phyAp = CreateObject<OfdmaSpectrumWifiPhy>(0);
5104 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
5123 Ptr<Node> sta1Node = CreateObject<Node>();
5125 m_phySta1 = CreateObject<OfdmaSpectrumWifiPhy>(1);
5145 Ptr<Node> sta2Node = CreateObject<Node>();
5147 m_phySta2 = CreateObject<OfdmaSpectrumWifiPhy>(2);
5167 Ptr<Node> interfererNode = CreateObject<Node>();
5173 interfererNode->
AddDevice(interfererDev);
5204 trigVector.
SetMode(HePhy::GetHeMcs7(), 1);
5207 trigVector.
SetMode(HePhy::GetHeMcs7(), 2);
5210 std::tie(length, ppduDuration) =
5211 HePhy::ConvertHeTbPpduDurationToLSigLength(ppduDuration, trigVector,
m_phyAp->
GetPhyBand());
5214 hePhyAp->SetTrigVector(trigVector, ppduDuration);
5221 Time ppduWithPaddingDuration =
5222 expectedPpduDuration + 10 *
NanoSeconds(12800 + 1600 );
5227 Simulator::Schedule(
Seconds(1.0),
5233 ppduWithPaddingDuration);
5234 Simulator::Schedule(
Seconds(1.0),
5240 ppduWithPaddingDuration);
5243 Simulator::Schedule(
Seconds(1.0),
5246 ppduWithPaddingDuration);
5254 Simulator::Schedule(
Seconds(1.0) + ppduWithPaddingDuration,
5270 Simulator::Schedule(
Seconds(2.0),
5276 ppduWithPaddingDuration);
5277 Simulator::Schedule(
Seconds(2.0),
5283 ppduWithPaddingDuration);
5286 Simulator::Schedule(
Seconds(2.0),
5289 ppduWithPaddingDuration);
5297 bands.push_back(bandInfo);
5300 Ptr<SpectrumValue> interferencePsdRu1 = Create<SpectrumValue>(SpectrumInterferenceRu1);
5301 double interferencePower = 0.1;
5317 Simulator::Schedule(
Seconds(2.0) + ppduWithPaddingDuration,
5335 Simulator::Destroy();
5353 void DoRun()
override;
5360 void SendMuBar(std::vector<uint16_t> staIds);
5376 void RunOne(
bool setupBa);
5396 std::vector<bool> statusPerMpdu);
5421 :
TestCase(
"UL-OFDMA power control test"),
5427 m_requestedRssiSta1(0),
5428 m_requestedRssiSta2(0),
5454 NS_ASSERT(!staIds.empty() && staIds.size() <= 2);
5458 muBar.
SetType(TriggerFrameType::MU_BAR_TRIGGER);
5466 HeRu::RuType ru = (staIds.size() == 1) ? HeRu::RU_242_TONE : HeRu::RU_106_TONE;
5467 std::size_t index = 1;
5468 int8_t ulTargetRssi = -40;
5469 for (
const auto& staId : staIds)
5482 else if (staId == 2)
5493 bar.
SetType(BlockAckReqType::COMPRESSED);
5525 if (staIds.size() == 1)
5527 uint16_t aidSta1 = DynamicCast<StaWifiMac>(
m_sta1Dev->
GetMac())->GetAssociationId();
5528 if (staIds.front() == aidSta1)
5552 uint16_t staId = staIds.front();
5558 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
5570 double rssi = rxSignalInfo.
rssi;
5580 "The obtained RSSI from STA 1 at AP is different from the expected one ("
5581 << rssi <<
" vs " <<
m_rssiSta1 <<
", with tolerance of " <<
m_tol <<
")");
5589 "The obtained RSSI from STA 2 at AP is different from the expected one ("
5590 << rssi <<
" vs " <<
m_rssiSta2 <<
", with tolerance of " <<
m_tol <<
")");
5609 Ptr<Node> apNode = CreateObject<Node>();
5615 spectrumChannel->AddPropagationLossModel(lossModel);
5617 CreateObject<ConstantSpeedPropagationDelayModel>();
5618 spectrumChannel->SetPropagationDelayModel(delayModel);
5623 spectrumPhy.
Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_5GHZ, 0}"));
5627 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
5634 mac.SetType(
"ns3::StaWifiMac");
5636 wifi.AssignStreams(staDevs, 0);
5637 m_sta1Dev = DynamicCast<WifiNetDevice>(staDevs.
Get(0));
5639 m_sta2Dev = DynamicCast<WifiNetDevice>(staDevs.
Get(1));
5645 mac.SetType(
"ns3::ApWifiMac",
5650 m_apDev = DynamicCast<WifiNetDevice>(
wifi.Install(spectrumPhy,
mac, apNode).Get(0));
5659 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
5661 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
5662 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
5664 Vector(2.0, 0.0, 0.0));
5665 mobility.SetPositionAllocator(positionAlloc);
5670 lossModel->SetDefaultLoss(50.0);
5693 RngSeedManager::SetSeed(1);
5694 RngSeedManager::SetRun(1);
5695 int64_t streamNumber = 0;
5738 Simulator::Schedule(relativeStart,
5744 std::vector<uint16_t> staIds{1};
5750 std::vector<uint16_t> staIds{2};
5759 std::vector<uint16_t> staIds{1, 2};
5840 Simulator::Destroy();
SpectrumWifiPhy used for testing OFDMA.
Time GetEnergyDuration(double energyW, WifiSpectrumBand band)
Wrapper to InterferenceHelper method.
void SetTriggerFrameUid(uint64_t uid)
Since we assume trigger frame was previously received from AP, this is used to set its UID.
Ptr< const HePhy > GetHePhy() const
void(* TxPpduUidCallback)(uint64_t uid)
TracedCallback signature for UID of transmitted PPDU.
void SetPpduUid(uint64_t uid)
Set the global PPDU UID counter.
~OfdmaSpectrumWifiPhy() override
static TypeId GetTypeId()
Get the type ID.
std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > & GetCurrentPreambleEvents()
Ptr< OfdmaTestHePhy > m_ofdmTestHePhy
Pointer to HE PHY instance used for OFDMA test.
Ptr< Event > GetCurrentEvent()
void StartTx(Ptr< const WifiPpdu > ppdu) override
void DoDispose() override
Destructor implementation.
OfdmaSpectrumWifiPhy(uint16_t staId)
Constructor.
TracedCallback< uint64_t > m_phyTxPpduUidTrace
Callback providing UID of the PPDU that is about to be transmitted.
void DoInitialize() override
Initialize() implementation.
HE PHY slightly modified so as to return a given STA-ID in case of DL MU for OfdmaSpectrumWifiPhy.
OfdmaTestHePhy(uint16_t staId)
Constructor.
~OfdmaTestHePhy() override
void SetGlobalPpduUid(uint64_t uid)
Set the global PPDU UID counter.
uint16_t GetStaId(const Ptr< const WifiPpdu > ppdu) const override
Return the STA ID that has been assigned to the station this PHY belongs to.
uint16_t m_staId
ID of the STA to which this PHY belongs to.
PHY listener for OFDMA tests.
OfdmaTestPhyListener()=default
void NotifyRxEndError() override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
void NotifyTxStart(Time duration, double txPowerDbm) override
bool m_lastRxSuccess
flag whether last RX has been successful
void NotifyRxStart(Time duration) override
Time GetLastRxStartNotification() const
Return the time at which the last RX start notification has been received.
void NotifySwitchingStart(Time duration) override
void NotifyWakeup() override
Notify listeners that we woke up.
uint32_t m_notifyRxStart
count number of RX start notifications
void Reset()
Reset function.
Time m_lastRxEnd
last time a RX end notification has been received
Time m_lastRxStart
last time a RX start notification has been received
Time GetLastRxEndNotification() const
Return the time at which the last RX end notification has been received.
void NotifyCcaBusyStart(Time duration, WifiChannelListType channelType, const std::vector< Time > &) override
uint32_t m_notifyRxEnd
count number of RX end notifications
bool IsLastRxSuccess() const
Return whether last RX has been successful.
void NotifySleep() override
Notify listeners that we went to sleep.
uint32_t GetNumRxEndNotifications() const
Return the number of RX end notifications that has been received since the last reset.
void NotifyRxEndOk() override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
uint32_t GetNumRxStartNotifications() const
Return the number of RX start notifications that has been received since the last reset.
void NotifyOff() override
Notify listeners that we went to switch off.
void NotifyOn() override
Notify listeners that we went to switch on.
DL-OFDMA PHY puncturing test.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
uint32_t m_countRxBytesSta1
count RX bytes for STA 1
uint32_t m_countRxBytesSta2
count RX bytes for STA 2
Ptr< SpectrumWifiPhy > m_phyAp
PHY of AP.
void DoRun() override
Implementation to actually run this TestCase.
TestDlOfdmaPhyPuncturing()
Time m_expectedPpduDuration20Mhz
expected duration to send MU PPDU on 20 MHz RU
void CheckResultsSta1(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 1.
void ResetResults()
Reset the results.
uint32_t m_countRxSuccessSta2
count RX success for STA 2
void RunOne()
Run one function.
Ptr< OfdmaSpectrumWifiPhy > m_phySta1
PHY of STA 1.
void RxFailureSta1(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 1.
uint32_t m_countRxFailureSta2
count RX failure for STA 2
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void SendMuPpdu(uint16_t rxStaId1, uint16_t rxStaId2, const std::vector< bool > &puncturedSubchannels)
Send MU-PPDU function.
uint16_t m_frequency
frequency in MHz
uint16_t m_channelWidth
channel width in MHz
uint32_t m_countRxFailureSta1
count RX failure for STA 1
Time m_expectedPpduDuration40Mhz
expected duration to send MU PPDU on 40 MHz RU
void CheckResultsSta2(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 2.
void DoCheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state now.
void RxFailureSta2(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 2.
Ptr< WaveformGenerator > m_phyInterferer
PHY of interferer.
void StopInterference()
Stop interference function.
void CheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Schedule now to check the PHY state.
uint8_t m_indexSubchannel
Index of the subchannel (starting from 0) that should contain an interference and be punctured during...
uint32_t m_countRxSuccessSta1
count RX success for STA 1
Ptr< OfdmaSpectrumWifiPhy > m_phySta2
PHY of STA 2.
void RxSuccessSta1(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, const std::vector< bool > statusPerMpdu)
Receive success function for STA 1.
void RxSuccessSta2(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 2.
void GenerateInterference(Ptr< SpectrumValue > interferencePsd, Time duration)
Generate interference function.
uint16_t m_frequency
frequency in MHz
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint16_t m_channelWidth
channel width in MHz
uint32_t m_countRxFailureSta2
count RX failure for STA 2
void RxFailureSta2(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 2.
void RunOne()
Run one function.
uint32_t m_countRxBytesSta2
count RX bytes for STA 2
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
Time m_expectedPpduDuration
expected duration to send MU PPDU
void GenerateInterference(Ptr< SpectrumValue > interferencePsd, Time duration)
Generate interference function.
Ptr< WaveformGenerator > m_phyInterferer
PHY of interferer.
uint32_t m_countRxFailureSta3
count RX failure for STA 3
uint32_t m_countRxBytesSta1
count RX bytes for STA 1
TestDlOfdmaPhyTransmission()
Ptr< OfdmaSpectrumWifiPhy > m_phySta2
PHY of STA 2.
void RxSuccessSta2(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 2.
void DoRun() override
Implementation to actually run this TestCase.
Ptr< SpectrumWifiPhy > m_phyAp
PHY of AP.
Ptr< OfdmaSpectrumWifiPhy > m_phySta1
PHY of STA 1.
void CheckResultsSta2(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 2.
void CheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Schedule now to check the PHY state.
uint32_t m_countRxSuccessSta2
count RX success for STA 2
uint32_t m_countRxFailureSta1
count RX failure for STA 1
void RxSuccessSta1(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 1.
void CheckResultsSta1(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 1.
Ptr< OfdmaSpectrumWifiPhy > m_phySta3
PHY of STA 3.
void RxSuccessSta3(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function for STA 3.
uint32_t m_countRxSuccessSta3
count RX success for STA 3
void DoCheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state now.
uint32_t m_countRxBytesSta3
count RX bytes for STA 3
void RxFailureSta3(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 3.
void StopInterference()
Stop interference function.
void ResetResults()
Reset the results.
void RxFailureSta1(Ptr< const WifiPsdu > psdu)
Receive failure function for STA 1.
uint32_t m_countRxSuccessSta1
count RX success for STA 1
void CheckResultsSta3(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 3.
~TestDlOfdmaPhyTransmission() override
void SendMuPpdu(uint16_t rxStaId1, uint16_t rxStaId2)
Send MU-PPDU function.
UL-OFDMA multiple RX events test.
WifiTxVector m_trigVector
TRIGVECTOR.
Ptr< OfdmaSpectrumWifiPhy > m_phy
Phy.
void Reset()
Reset function.
~TestMultipleHeTbPreambles() override
void RxHeTbPpduOfdmaPart(Ptr< WifiSpectrumSignalParameters > rxParamsOfdma)
Receive OFDMA part of HE TB PPDU function.
void CheckHeTbPreambles(size_t nEvents, std::vector< uint64_t > uids)
Check the received HE TB preambles.
void RxHeTbPpdu(uint64_t uid, uint16_t staId, double txPowerWatts, size_t payloadSize)
Receive HE TB PPDU function.
TestMultipleHeTbPreambles()
uint64_t m_totalBytesDropped
total number of dropped bytes
void CheckBytesDropped(size_t expectedBytesDropped)
Check the number of bytes dropped.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void DoRun() override
Implementation to actually run this TestCase.
void RxDropped(Ptr< const Packet > p, WifiPhyRxfailureReason reason)
RX dropped function.
void DoRxHeTbPpduOfdmaPart(Ptr< WifiSpectrumSignalParameters > rxParamsOfdma)
Receive OFDMA part of HE TB PPDU function.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
PHY padding exclusion test.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void CheckRxFromSta1(uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
Check the received PSDUs from STA1.
Ptr< OfdmaSpectrumWifiPhy > m_phySta2
PHY of STA 2.
void VerifyEventsCleared()
Verify all events are cleared at end of TX or RX.
TestPhyPaddingExclusion()
void DoCheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
~TestPhyPaddingExclusion() override
void GenerateInterference(Ptr< SpectrumValue > interferencePsd, Time duration)
Generate interference function.
Ptr< WaveformGenerator > m_phyInterferer
PHY of interferer.
uint32_t m_countRxSuccessFromSta2
count RX success from STA 2
void DoRun() override
Implementation to actually run this TestCase.
void RxFailure(Ptr< const WifiPsdu > psdu)
Receive failure function.
uint32_t m_countRxBytesFromSta1
count RX bytes from STA 1
Ptr< OfdmaSpectrumWifiPhy > m_phyAp
PHY of AP.
Ptr< OfdmaSpectrumWifiPhy > m_phySta1
PHY of STA 1.
void SendHeTbPpdu(uint16_t txStaId, std::size_t index, std::size_t payloadSize, Time txDuration)
Send HE TB PPDU function.
void RxSuccess(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function.
void SetTrigVector(Time ppduDuration)
Set TRIGVECTOR for HE TB PPDU.
void Reset()
Reset function.
uint32_t m_countRxFailureFromSta1
count RX failure from STA 1
uint32_t m_countRxSuccessFromSta1
count RX success from STA 1
void StopInterference()
Stop interference function.
void RunOne()
Run one function.
void CheckRxFromSta2(uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
Check the received PSDUs from STA2.
uint32_t m_countRxFailureFromSta2
count RX failure from STA 2
uint32_t m_countRxBytesFromSta2
count RX bytes from STA 2
void CheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
void ScheduleTest(Time delay, bool solicited, WifiPhyState expectedStateAtEnd, uint32_t expectedSuccessFromSta1, uint32_t expectedFailuresFromSta1, uint32_t expectedBytesFromSta1, uint32_t expectedSuccessFromSta2, uint32_t expectedFailuresFromSta2, uint32_t expectedBytesFromSta2, bool scheduleTxSta1=true, Time ulTimeDifference=Seconds(0), WifiPhyState expectedStateBeforeEnd=WifiPhyState::RX, TrigVectorInfo error=NONE)
Schedule test to perform.
void GenerateInterference(Ptr< SpectrumValue > interferencePsd, Time duration)
Generate interference function.
WifiTxVector GetTxVectorForHeTbPpdu(uint16_t txStaId, std::size_t index, uint8_t bssColor) const
Get TXVECTOR for HE TB PPDU.
uint32_t m_countRxFailureFromSta1
count RX failure from STA 1
void CheckOfdmaRxPower(Ptr< OfdmaSpectrumWifiPhy > phy, WifiSpectrumBand band, double expectedRxPower)
Check the received power for the OFDMA part of the HE TB PPDUs over the given band.
void DoCheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
uint32_t m_countRxBytesFromSta1
count RX bytes from STA 1
uint16_t m_frequency
frequency in MHz
std::unique_ptr< OfdmaTestPhyListener > m_apPhyStateListener
listener for AP PHY state transitions
void RxFailure(Ptr< const WifiPsdu > psdu)
Receive failure function.
void CheckApRxStart(uint32_t expectedNotifications, Time expectedLastNotification)
Check the the number of RX start notifications at the AP as well as the last time a RX start has been...
TrigVectorInfo
Erroneous info included in a TRIGVECTOR.
void SchedulePowerMeasurementChecks(Time delay, double rxPowerNonOfdmaRu1, double rxPowerNonOfdmaRu2, double rxPowerOfdmaRu1, double rxPowerOfdmaRu2)
Schedule power measurement related checks.
void SetBssColor(Ptr< WifiPhy > phy, uint8_t bssColor)
Set the BSS color.
Ptr< OfdmaSpectrumWifiPhy > m_phySta2
PHY of STA 2.
void LogScenario(std::string log) const
Log scenario description.
void CheckRxFromSta2(uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
Check the received PSDUs from STA2.
void SendHeTbPpdu(uint16_t txStaId, std::size_t index, std::size_t payloadSize, uint64_t uid, uint8_t bssColor, bool incrementUid)
Send HE TB PPDU function.
void SetPsdLimit(Ptr< WifiPhy > phy, double psdLimit)
Set the PSD limit.
void DoRun() override
Implementation to actually run this TestCase.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void StopInterference()
Stop interference function.
uint32_t m_countRxBytesFromSta2
count RX bytes from STA 2
void Reset()
Reset function.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void CheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
Ptr< OfdmaSpectrumWifiPhy > m_phySta1
PHY of STA 1.
void RxSuccess(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive success function.
~TestUlOfdmaPhyTransmission() override
TestUlOfdmaPhyTransmission()
void CheckRxFromSta1(uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
Check the received PSDUs from STA1.
void CheckNonOfdmaRxPower(Ptr< OfdmaSpectrumWifiPhy > phy, WifiSpectrumBand band, double expectedRxPower)
Check the received power for the non-OFDMA of the HE TB PPDUs over the given band.
void RunOne()
Run one function.
uint32_t m_countRxSuccessFromSta2
count RX success from STA 2
Ptr< WaveformGenerator > m_phyInterferer
PHY of interferer.
void CheckApRxEnd(uint32_t expectedNotifications, Time expectedLastNotification, bool expectedSuccess)
Check the the number of RX end notifications at the AP as well as the last time a RX end has been not...
Ptr< OfdmaSpectrumWifiPhy > m_phySta3
PHY of STA 3.
uint16_t m_channelWidth
channel width in MHz
void SendHeSuPpdu(uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor)
Send HE SU PPDU function.
uint32_t m_countRxFailureFromSta2
count RX failure from STA 2
void VerifyEventsCleared()
Verify all events are cleared at end of TX or RX.
void SetTrigVector(uint8_t bssColor, TrigVectorInfo error)
Set TRIGVECTOR for HE TB PPDU.
Time m_expectedPpduDuration
expected duration to send MU PPDU
uint32_t m_countRxSuccessFromSta1
count RX success from STA 1
Ptr< OfdmaSpectrumWifiPhy > m_phyAp
PHY of AP.
UL-OFDMA power control test.
double m_requestedRssiSta1
requested RSSI (in dBm) from STA 1 at AP for HE TB PPDUs
double m_txPowerStart
minimum transmission power (in dBm) for STAs
void DoRun() override
Implementation to actually run this TestCase.
double m_rssiSta2
expected RSSI (in dBm) from STA 2 at AP for HE TB PPDUs
Ptr< WifiNetDevice > m_sta2Dev
network device of STA 2
double m_txPowerEnd
maximum transmission power (in dBm) for STAs
void SetupBa(Address destination)
Send a QoS Data packet to the destination station in order to set up a block Ack session (so that the...
Ptr< WifiNetDevice > m_sta1Dev
network device of STA 1
double m_tol
tolerance (in dB) between received and expected RSSIs
Ptr< WifiNetDevice > m_apDev
network device of AP
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
uint8_t m_bssColor
BSS color.
void ReceiveOkCallbackAtAp(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
Receive OK callback function at AP.
void ReplaceReceiveOkCallbackOfAp()
Replace the AP's callback on its PHY's ReceiveOkCallback by the ReceiveOkCallbackAtAp method.
double m_rssiSta1
expected RSSI (in dBm) from STA 1 at AP for HE TB PPDUs
uint8_t m_txPowerLevels
number of transmission power levels for STAs
double m_requestedRssiSta2
requested RSSI (in dBm) from STA 2 at AP for HE TB PPDUs
TestUlOfdmaPowerControl()
double m_txPowerAp
transmit power (in dBm) of AP
void RunOne(bool setupBa)
Run one simulation with an optional BA session set up phase.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
Ptr< SpectrumWifiPhy > m_phyAp
PHY of AP.
~TestUlOfdmaPowerControl() override
void SendMuBar(std::vector< uint16_t > staIds)
Send a MU BAR through the AP to the STAs listed in the provided vector.
UL-OFDMA PPDU UID attribution test.
~TestUlOfdmaPpduUid() override
void TxPpduSta1(uint64_t uid)
Transmitted PPDU information function for STA 1.
void ResetPpduUid()
Reset the global PPDU UID counter in WifiPhy.
void CheckUid(uint16_t staId, uint64_t expectedUid)
Check the UID of the transmitted PPDU.
void TxPpduAp(uint64_t uid)
Transmitted PPDU information function for AP.
void TxPpduSta2(uint64_t uid)
Transmitted PPDU information function for STA 2.
Ptr< OfdmaSpectrumWifiPhy > m_phySta2
PHY of STA 2.
uint64_t m_ppduUidAp
UID of PPDU transmitted by AP.
uint64_t m_ppduUidSta1
UID of PPDU transmitted by STA1.
uint64_t m_ppduUidSta2
UID of PPDU transmitted by STA2.
void DoRun() override
Implementation to actually run this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void SendMuPpdu()
Send MU-PPDU toward both STAs.
Ptr< OfdmaSpectrumWifiPhy > m_phySta1
PHY of STA 1.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void SendTbPpdu()
Send TB-PPDU from both STAs.
Ptr< OfdmaSpectrumWifiPhy > m_phyAp
PHY of AP.
void SendSuPpdu(uint16_t txStaId)
Send SU-PPDU function.
wifi PHY OFDMA Test Suite
a polymophic address class
AttributeValue implementation for Boolean.
User Info field of Trigger frames.
void SetAid12(uint16_t aid)
Set the AID12 subfield, which carries the 12 LSBs of the AID of the station for which this User Info ...
void SetUlFecCodingType(bool ldpc)
Set the UL FEC Coding Type subfield, which indicates whether BCC or LDPC is used.
void SetUlMcs(uint8_t mcs)
Set the UL MCS subfield, which indicates the MCS of the solicited HE TB PPDU.
void SetMuBarTriggerDepUserInfo(const CtrlBAckRequestHeader &bar)
Set the Trigger Dependent User Info subfield for the MU-BAR variant of Trigger frames,...
void SetUlDcm(bool dcm)
Set the UL DCM subfield, which indicates whether or not DCM is used.
void SetSsAllocation(uint8_t startingSs, uint8_t nSs)
Set the SS Allocation subfield, which is present when the AID12 subfield is neither 0 nor 2045.
void SetUlTargetRssi(int8_t dBm)
Set the UL Target RSSI subfield to indicate the expected receive signal power in dBm.
void SetRuAllocation(HeRu::RuSpec ru)
Set the RU Allocation subfield according to the specified RU.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
RuType GetRuType() const
Get the RU type.
RuType
The different HE Resource Unit (RU) types.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
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.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
void Dispose()
Dispose of this Object.
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).
void SetOwner(Ptr< WifiPhy > wifiPhy)
Set the WifiPhy owning this PHY entity.
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
Hold objects of type Ptr<T>.
Smart pointer class similar to boost::intrusive_ptr.
Make it easy to create and manage PHY objects for the spectrum model.
void SetChannel(Ptr< SpectrumChannel > channel)
void SetChannel(const Ptr< SpectrumChannel > channel)
Set the SpectrumChannel this SpectrumWifiPhy is to be connected to.
uint16_t GetGuardBandwidth(uint16_t currentChannelWidth) const override
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
void CreateWifiSpectrumPhyInterface(Ptr< NetDevice > device)
Method to encapsulate the creation of the WifiSpectrumPhyInterface object (used to bind the WifiSpect...
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.
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.
virtual void SetWifiPhys(const std::vector< Ptr< WifiPhy >> &phys)
void SetMac(const Ptr< WifiMac > mac)
void SetHeConfiguration(Ptr< HeConfiguration > heConfiguration)
Ptr< WifiMac > GetMac() const
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
Ptr< HeConfiguration > GetHeConfiguration() const
void SetStandard(WifiStandard standard)
Set the Wifi standard.
Ptr< WifiPhy > GetPhy() const
void SetPhy(const Ptr< WifiPhy > phy)
Address GetAddress() const override
void Set(std::string name, const AttributeValue &v)
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
void Send(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
This function is a wrapper for the Send variant that accepts a WifiConstPsduMap as first argument.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
std::map< std::pair< uint64_t, WifiPreamble >, Ptr< Event > > m_currentPreambleEvents
store event associated to a PPDU (that has a unique ID and preamble combination) whose preamble is be...
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
void SetReceiveErrorCallback(RxErrorCallback callback)
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
Ptr< Event > m_currentEvent
Hold the current event.
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
uint64_t m_previouslyRxPpduUid
UID of the previously received PPDU, reset to UINT64_MAX upon transmission.
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
void RegisterListener(WifiPhyListener *listener)
Ptr< InterferenceHelper > m_interference
Pointer to a helper responsible for interference computations.
void SetReceiveOkCallback(RxOkCallback callback)
void Reset()
Reset data upon end of TX or RX.
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Ptr< PhyEntity > GetLatestPhyEntity() const
Get the latest PHY entity supported by this PHY instance.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
receive notifications about PHY events.
This objects implements the PHY state machine of the Wifi device.
const WifiMacHeader & GetHeader(std::size_t i) const
Get the header of the i-th MPDU.
Mac48Address GetAddr2() const
Get the Transmitter Address (TA), which is common to all the MPDUs.
uint32_t GetSize() const
Return the size of the PSDU in bytes.
void SetDuration(Time duration)
Set the Duration/ID field on all the MPDUs.
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 SetInactiveSubchannels(const std::vector< bool > &inactiveSubchannels)
Set the 20 MHz subchannels that are punctured.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
WifiPreamble GetPreambleType() const
HeRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
void SetRuAllocation(const RuAllocation &ruAlloc)
Set RU Allocation of SIG-B common field.
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
void SetRu(HeRu::RuSpec ru, uint16_t staId)
Set the RU specification for the 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 SetMode(WifiMode mode)
Sets the selected payload transmission mode.
void SetNss(uint8_t nss)
Sets the number of Nss.
#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...
void Reset()
Reset the initial value of every attribute as well as the value of every global to what they were bef...
#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_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#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_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
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.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
WifiPhyBand
Identifies the PHY band.
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
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...
std::pair< uint32_t, uint32_t > WifiSpectrumBand
typedef for a pair of start and stop sub-band indexes
std::vector< BandInfo > Bands
Container of BandInfo.
double DbmToW(double dBm)
Convert from dBm to Watts.
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
The building block of a SpectrumModel.
double fc
center frequency
double fl
lower limit of subband
double fh
upper limit of subband
RxSignalInfo structure containing info on the received signal.
static const uint16_t DEFAULT_CHANNEL_WIDTH
static WifiPhyOfdmaTestSuite wifiPhyOfdmaTestSuite
the test suite
static const uint8_t DEFAULT_CHANNEL_NUMBER
static const WifiPhyBand DEFAULT_WIFI_BAND
static const uint16_t DEFAULT_GUARD_WIDTH
static const uint32_t DEFAULT_FREQUENCY
WifiPhyState
The state of the PHY layer.
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
@ RX
The PHY layer is receiving a packet.
@ IDLE
The PHY layer is IDLE.