9#include "ns3/ap-wifi-mac.h"
10#include "ns3/boolean.h"
11#include "ns3/constant-position-mobility-model.h"
12#include "ns3/ctrl-headers.h"
13#include "ns3/double.h"
14#include "ns3/he-configuration.h"
15#include "ns3/he-phy.h"
16#include "ns3/he-ppdu.h"
17#include "ns3/interference-helper.h"
19#include "ns3/mobility-helper.h"
20#include "ns3/multi-model-spectrum-channel.h"
21#include "ns3/nist-error-rate-model.h"
23#include "ns3/non-communicating-net-device.h"
24#include "ns3/pointer.h"
25#include "ns3/rng-seed-manager.h"
26#include "ns3/simulator.h"
27#include "ns3/spectrum-wifi-helper.h"
28#include "ns3/spectrum-wifi-phy.h"
29#include "ns3/sta-wifi-mac.h"
30#include "ns3/string.h"
32#include "ns3/threshold-preamble-detection-model.h"
34#include "ns3/waveform-generator.h"
35#include "ns3/wifi-mac-header.h"
36#include "ns3/wifi-net-device.h"
37#include "ns3/wifi-phy-listener.h"
38#include "ns3/wifi-psdu.h"
39#include "ns3/wifi-spectrum-phy-interface.h"
40#include "ns3/wifi-spectrum-signal-parameters.h"
41#include "ns3/wifi-spectrum-value-helper.h"
42#include "ns3/wifi-utils.h"
137 NS_ASSERT(channelWidth <= m_wifiPhy->GetChannelWidth());
139 auto ru = txVector.
GetRu(staId);
157 {groupPreamble.front().first, groupPreamble.back().second},
160 for (
const auto& indicesPerSegment : indices)
162 nonOfdmaBand.
indices.emplace_back(indicesPerSegment);
163 nonOfdmaBand.frequencies.emplace_back(
255 TypeId(
"ns3::OfdmaSpectrumWifiPhy")
257 .SetGroupName(
"Wifi")
258 .AddTraceSource(
"TxPpduUid",
259 "UID of the PPDU to be transmitted",
261 "ns3::OfdmaSpectrumWifiPhy::TxPpduUidCallback");
311std::map<std::pair<uint64_t, WifiPreamble>,
Ptr<Event>>&
350 void DoRun()
override;
362 const std::vector<bool>& statusPerMpdu);
373 const std::vector<bool>& statusPerMpdu);
384 const std::vector<bool>& statusPerMpdu);
440 void SendMuPpdu(uint16_t rxStaId1, uint16_t rxStaId2);
494 m_countRxSuccessSta1(0),
495 m_countRxSuccessSta2(0),
496 m_countRxSuccessSta3(0),
497 m_countRxFailureSta1(0),
498 m_countRxFailureSta2(0),
499 m_countRxFailureSta3(0),
500 m_countRxBytesSta1(0),
501 m_countRxBytesSta2(0),
502 m_countRxBytesSta3(0),
538 RuType ruType = RuType::RU_106_TONE;
541 ruType = RuType::RU_106_TONE;
542 txVector.SetRuAllocation({96}, 0);
546 ruType = RuType::RU_242_TONE;
547 txVector.SetRuAllocation({192, 192}, 0);
551 ruType = RuType::RU_484_TONE;
552 const uint16_t ruAllocUser = 200;
553 const uint16_t ruAllocNoUser = 114;
554 txVector.SetRuAllocation({ruAllocUser, ruAllocNoUser, ruAllocNoUser, ruAllocUser}, 0);
558 ruType = RuType::RU_996_TONE;
559 const uint16_t ruAllocUser = 208;
560 const uint16_t ruAllocNoUser = 115;
561 txVector.SetRuAllocation({ruAllocUser,
579 txVector.SetRu(ru1, rxStaId1);
581 txVector.SetNss(1, rxStaId1);
584 txVector.SetRu(ru2, rxStaId2);
586 txVector.SetNss(1, rxStaId2);
595 psdus.insert(std::make_pair(rxStaId1, psdu1));
604 psdus.insert(std::make_pair(rxStaId2, psdu2));
606 m_phyAp->Send(psdus, txVector);
632 const std::vector<bool>& )
643 const std::vector<bool>& )
654 const std::vector<bool>& )
689 "The number of successfully received packets by STA 1 is not correct!");
692 "The number of unsuccessfuly received packets by STA 1 is not correct!");
695 "The number of bytes received by STA 1 is not correct!");
705 "The number of successfully received packets by STA 2 is not correct!");
708 "The number of unsuccessfuly received packets by STA 2 is not correct!");
711 "The number of bytes received by STA 2 is not correct!");
721 "The number of successfully received packets by STA 3 is not correct!");
724 "The number of unsuccessfuly received packets by STA 3 is not correct!");
727 "The number of bytes received by STA 3 is not correct!");
744 phy->GetAttribute(
"State", ptr);
746 currentState = state->GetState();
750 "PHY State " << currentState <<
" does not match expected state "
760 spectrumChannel->AddPropagationLossModel(lossModel);
763 spectrumChannel->SetPropagationDelayModel(delayModel);
769 m_phyAp->SetInterferenceHelper(apInterferenceHelper);
771 m_phyAp->SetErrorRateModel(apErrorModel);
773 m_phyAp->AddChannel(spectrumChannel);
776 m_phyAp->SetMobility(apMobility);
778 apNode->AggregateObject(apMobility);
779 apNode->AddDevice(apDev);
797 sta1Node->AggregateObject(sta1Mobility);
798 sta1Node->AddDevice(sta1Dev);
816 sta2Node->AggregateObject(sta2Mobility);
817 sta2Node->AddDevice(sta2Dev);
835 sta3Node->AggregateObject(sta3Mobility);
836 sta3Node->AddDevice(sta3Dev);
844 interfererNode->AddDevice(interfererDev);
867 int64_t streamNumber = 0;
868 m_phyAp->AssignStreams(streamNumber);
912 WifiPhyState::CCA_BUSY);
965 WifiPhyState::CCA_BUSY);
1015 bands.push_back(bandInfo);
1019 Watt_u interferencePower{0.1};
1045 WifiPhyState::CCA_BUSY);
1050 WifiPhyState::CCA_BUSY);
1055 WifiPhyState::CCA_BUSY);
1060 WifiPhyState::CCA_BUSY);
1085 bands.push_back(bandInfo);
1114 WifiPhyState::CCA_BUSY);
1120 : WifiPhyState::CCA_BUSY);
1126 : WifiPhyState::CCA_BUSY);
1132 : WifiPhyState::CCA_BUSY);
1157 bands.push_back(bandInfo);
1186 WifiPhyState::CCA_BUSY);
1191 WifiPhyState::CCA_BUSY);
1196 WifiPhyState::CCA_BUSY);
1201 WifiPhyState::CCA_BUSY);
1257 void DoRun()
override;
1269 const std::vector<bool>& statusPerMpdu);
1281 const std::vector<bool>& statusPerMpdu);
1329 const std::vector<bool>& puncturedSubchannels);
1385 :
TestCase(
"DL-OFDMA PHY puncturing test"),
1386 m_countRxSuccessSta1(0),
1387 m_countRxSuccessSta2(0),
1388 m_countRxFailureSta1(0),
1389 m_countRxFailureSta2(0),
1390 m_countRxBytesSta1(0),
1391 m_countRxBytesSta2(0),
1392 m_frequency(
MHz_u{5210}),
1393 m_channelWidth(
MHz_u{80}),
1394 m_indexSubchannel(0),
1414 const std::vector<bool>& puncturedSubchannels)
1429 RuType ruType = puncturedSubchannels.empty()
1430 ? RuType::RU_484_TONE
1431 : (puncturedSubchannels.at(1) ? RuType::RU_242_TONE : RuType::RU_484_TONE);
1433 txVector.SetRu(ru1, rxStaId1);
1435 txVector.SetNss(1, rxStaId1);
1437 ruType = puncturedSubchannels.empty()
1438 ? RuType::RU_484_TONE
1439 : (puncturedSubchannels.at(1) ? RuType::RU_484_TONE : RuType::RU_242_TONE);
1441 ruType == RuType::RU_484_TONE ? 2 : (puncturedSubchannels.at(3) ? 3 : 4),
1443 txVector.SetRu(ru2, rxStaId2);
1445 txVector.SetNss(1, rxStaId2);
1448 if (puncturedSubchannels.empty())
1450 ruAlloc.push_back(200);
1451 ruAlloc.push_back(114);
1452 ruAlloc.push_back(114);
1453 ruAlloc.push_back(200);
1457 ruAlloc.push_back(puncturedSubchannels.at(1) ? 192 : 200);
1458 ruAlloc.push_back(puncturedSubchannels.at(1) ? 113 : 114);
1459 ruAlloc.push_back(puncturedSubchannels.at(2) ? 113
1460 : (puncturedSubchannels.at(3) ? 192 : 114));
1461 ruAlloc.push_back(puncturedSubchannels.at(2) ? 192
1462 : (puncturedSubchannels.at(3) ? 113 : 200));
1465 txVector.SetRuAllocation(ruAlloc, 0);
1475 psdus.insert(std::make_pair(rxStaId1, psdu1));
1484 psdus.insert(std::make_pair(rxStaId2, psdu2));
1486 if (!puncturedSubchannels.empty())
1488 txVector.SetInactiveSubchannels(puncturedSubchannels);
1491 m_phyAp->Send(psdus, txVector);
1515 const std::vector<bool>& )
1526 const std::vector<bool>& )
1554 "The number of successfully received packets by STA 1 is not correct!");
1557 "The number of unsuccessfuly received packets by STA 1 is not correct!");
1560 "The number of bytes received by STA 1 is not correct!");
1570 "The number of successfully received packets by STA 2 is not correct!");
1573 "The number of unsuccessfuly received packets by STA 2 is not correct!");
1576 "The number of bytes received by STA 2 is not correct!");
1592 phy->GetAttribute(
"State", ptr);
1594 currentState = state->GetState();
1598 "PHY State " << currentState <<
" does not match expected state "
1608 spectrumChannel->AddPropagationLossModel(lossModel);
1611 spectrumChannel->SetPropagationDelayModel(delayModel);
1617 m_phyAp->SetInterferenceHelper(apInterferenceHelper);
1619 m_phyAp->SetErrorRateModel(apErrorModel);
1621 m_phyAp->AddChannel(spectrumChannel);
1624 m_phyAp->SetMobility(apMobility);
1626 apNode->AggregateObject(apMobility);
1627 apNode->AddDevice(apDev);
1645 sta1Node->AggregateObject(sta1Mobility);
1646 sta1Node->AddDevice(sta1Dev);
1664 sta2Node->AggregateObject(sta2Mobility);
1665 sta2Node->AddDevice(sta2Dev);
1673 interfererNode->AddDevice(interfererDev);
1694 int64_t streamNumber = 0;
1695 m_phyAp->AssignStreams(streamNumber);
1722 bands.push_back(bandInfo);
1726 Watt_u interferencePower{0.1};
1727 *interferencePsd = interferencePower / 10e6;
1742 std::vector<bool>{});
1760 WifiPhyState::IDLE);
1765 WifiPhyState::IDLE);
1807 std::vector<bool> puncturedSubchannels;
1809 for (std::size_t i = 0; i < num20MhzSubchannels; ++i)
1813 puncturedSubchannels.push_back(
true);
1817 puncturedSubchannels.push_back(
false);
1825 puncturedSubchannels);
1843 WifiPhyState::IDLE);
1848 WifiPhyState::IDLE);
1875 for (
auto index : {1, 2, 3})
1898 void DoRun()
override;
1939 void CheckUid(uint16_t staId, uint64_t expectedUid);
1951 :
TestCase(
"UL-OFDMA PPDU UID attribution test"),
1952 m_ppduUidAp(UINT64_MAX),
1953 m_ppduUidSta1(UINT64_MAX),
1954 m_ppduUidSta2(UINT64_MAX)
1968 spectrumChannel->AddPropagationLossModel(lossModel);
1971 spectrumChannel->SetPropagationDelayModel(delayModel);
1996 apNode->AggregateObject(apMobility);
1997 apNode->AddDevice(apDev);
2018 sta1Node->AggregateObject(sta1Mobility);
2019 sta1Node->AddDevice(sta1Dev);
2038 sta2Node->AggregateObject(sta2Mobility);
2039 sta2Node->AddDevice(sta2Dev);
2077 "UID " << uid <<
" does not match expected one " << expectedUid <<
" for "
2124 uint16_t rxStaId1 = 1;
2126 txVector.SetRu(ru1, rxStaId1);
2128 txVector.SetNss(1, rxStaId1);
2130 uint16_t rxStaId2 = 2;
2132 txVector.SetRu(ru2, rxStaId2);
2134 txVector.SetNss(1, rxStaId2);
2136 txVector.SetRuAllocation({96}, 0);
2145 psdus.insert(std::make_pair(rxStaId1, psdu1));
2154 psdus.insert(std::make_pair(rxStaId2, psdu2));
2178 uint16_t rxStaId1 = 1;
2180 txVector1.SetRu(ru1, rxStaId1);
2182 txVector1.SetNss(1, rxStaId1);
2183 trigVector.SetRu(ru1, rxStaId1);
2185 trigVector.SetNss(1, rxStaId1);
2194 psdus1.insert(std::make_pair(rxStaId1, psdu1));
2196 uint16_t rxStaId2 = 2;
2198 txVector2.SetRu(ru2, rxStaId2);
2200 txVector2.SetNss(1, rxStaId2);
2201 trigVector.SetRu(ru2, rxStaId2);
2203 trigVector.SetNss(1, rxStaId2);
2212 psdus2.insert(std::make_pair(rxStaId2, psdu2));
2222 const auto txDuration = std::max(txDuration1, txDuration2);
2224 txVector1.SetLength(
2227 txVector2.SetLength(
2232 hePhyAp->SetTrigVector(trigVector, txDuration);
2260 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
2283 int64_t streamNumber = 0;
2333 void DoRun()
override;
2344 void RxHeTbPpdu(uint64_t uid, uint16_t staId,
Watt_u txPower,
size_t payloadSize);
2393 :
TestCase(
"UL-OFDMA multiple RX events test"),
2394 m_totalBytesDropped(0),
2395 m_trigVector(
HePhy::GetHeMcs7(),
2434 for (
const auto& uid : uids)
2437 auto it = events.find(pair);
2438 bool found = (it != events.end());
2441 "HE TB PPDU with UID " << uid <<
" has not been received!");
2449 expectedBytesDropped,
2450 "The number of dropped bytes is not correct!");
2472 txVector.SetRu(ru, staId);
2474 txVector.SetNss(1, staId);
2485 psdus.insert(std::make_pair(staId, psdu));
2499 const auto nonOfdmaDuration =
m_phy->
GetHePhy()->CalculateNonHeDurationForHeTb(txVector);
2500 const auto centerFrequency =
2501 m_phy->
GetHePhy()->GetCenterFrequenciesForNonHePart(ppdu, staId).front();
2503 auto channelWidth = ruWidth <
MHz_u{20} ?
MHz_u{20} : ruWidth;
2510 rxParams->psd = rxPsd;
2511 rxParams->txPhy =
nullptr;
2512 rxParams->duration = nonOfdmaDuration;
2513 rxParams->ppdu = ppdu;
2516 std::tie(length, ppduDuration) =
2518 txVector.SetLength(length);
2522 ppdu->ResetTxVector();
2528 const auto band =
m_phy->
GetHePhy()->GetRuBandForRx(txVector, staId);
2536 rxParamsOfdma->psd = rxPsd;
2537 rxParamsOfdma->txPhy =
nullptr;
2538 rxParamsOfdma->duration = ppduDuration - nonOfdmaDuration;
2539 rxParamsOfdma->ppdu = ppduOfdma;
2574 mac->SetAttribute(
"BeaconGeneration",
BooleanValue(
false));
2589 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(4));
2590 preambleDetectionModel->SetAttribute(
"MinimumRssi",
DoubleValue(-82));
2593 heConfiguration->m_maxTbPpduDelay =
NanoSeconds(400);
2594 dev->SetHeConfiguration(heConfiguration);
2596 node->AddDevice(dev);
2611 int64_t streamNumber = 0;
2618 std::vector<uint64_t> uids{0};
2646 std::vector<uint64_t> uids{1, 2};
2690 std::vector<uint64_t> uids{3, 4};
2734 std::vector<uint64_t> uids{5, 6};
2769 std::vector<uint64_t>{uids[0]});
2782 std::vector<uint64_t> uids{7, 8};
2817 std::vector<uint64_t>{uids[0]});
2830 std::vector<uint64_t> uids{9};
2908 const std::vector<Time>& )
override
3024 void DoRun()
override;
3035 uint8_t bssColor)
const;
3054 std::size_t payloadSize,
3066 void SendHeSuPpdu(uint16_t txStaId, std::size_t payloadSize, uint64_t uid, uint8_t bssColor);
3166 Time expectedLastNotification,
3167 bool expectedSuccess);
3184 const std::vector<bool>& statusPerMpdu);
3221 bool scheduleTxSta1 =
true,
3223 WifiPhyState expectedStateBeforeEnd = WifiPhyState::RX,
3236 Watt_u rxPowerNonOfdmaRu1,
3237 Watt_u rxPowerNonOfdmaRu2,
3252 std::shared_ptr<OfdmaTestPhyListener>
3271 m_countRxSuccessFromSta1(0),
3272 m_countRxSuccessFromSta2(0),
3273 m_countRxFailureFromSta1(0),
3274 m_countRxFailureFromSta2(0),
3275 m_countRxBytesFromSta1(0),
3276 m_countRxBytesFromSta2(0),
3285 std::size_t payloadSize,
3310 std::ostringstream addr;
3311 addr <<
"00:00:00:00:00:0" << txStaId;
3315 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
3322 else if (txStaId == 2)
3326 else if (txStaId == 3)
3330 else if (txStaId == 0)
3334 phy->SetPpduUid(uid);
3335 phy->Send(psdus, txVector);
3341 uint8_t bssColor)
const
3356 auto ruType = RuType::RU_106_TONE;
3359 ruType = RuType::RU_106_TONE;
3363 ruType = RuType::RU_242_TONE;
3367 ruType = RuType::RU_484_TONE;
3371 ruType = RuType::RU_996_TONE;
3378 auto primary80MHz{
true};
3386 txVector.SetRu(ru, txStaId);
3388 txVector.SetNss(1, txStaId);
3398 channelWidth = (channelWidth ==
MHz_u{160} ?
MHz_u{20} : channelWidth * 2);
3414 RuType ruType = RuType::RU_106_TONE;
3415 if (channelWidth ==
MHz_u{20})
3417 ruType = RuType::RU_106_TONE;
3419 else if (channelWidth ==
MHz_u{40})
3421 ruType = RuType::RU_242_TONE;
3423 else if (channelWidth ==
MHz_u{80})
3425 ruType = RuType::RU_484_TONE;
3427 else if (channelWidth ==
MHz_u{160})
3429 ruType = RuType::RU_996_TONE;
3436 uint16_t aid1 = (error ==
AID ? 3 : 1);
3437 uint16_t aid2 = (error ==
AID ? 4 : 2);
3440 txVector.
SetRu(ru1, aid1);
3442 txVector.
SetNss(1, aid1);
3445 txVector.
SetRu(ru2, aid2);
3447 txVector.
SetNss(1, aid2);
3466 std::size_t payloadSize,
3471 NS_LOG_FUNCTION(
this << txStaId << index << payloadSize << uid << +bssColor << (incrementUid));
3485 std::ostringstream addr;
3486 addr <<
"00:00:00:00:00:0" << txStaId;
3490 psdus.insert(std::make_pair(txStaId, psdu));
3497 else if (txStaId == 2)
3501 else if (txStaId == 3)
3513 phy->SetPpduUid(uid);
3514 phy->Send(psdus, txVector);
3541 const std::vector<bool>& )
3543 NS_LOG_FUNCTION(
this << *psdu << psdu->GetAddr2() << rxSignalInfo << txVector);
3544 if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:01"))
3549 else if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:02"))
3560 if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:01"))
3564 else if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:02"))
3577 "The number of successfully received packets from STA 1 is not correct!");
3581 "The number of unsuccessfuly received packets from STA 1 is not correct!");
3584 "The number of bytes received from STA 1 is not correct!");
3594 "The number of successfully received packets from STA 2 is not correct!");
3598 "The number of unsuccessfuly received packets from STA 2 is not correct!");
3601 "The number of bytes received from STA 2 is not correct!");
3609 auto event = phy->GetCurrentEvent();
3611 auto rxPower =
event->GetRxPower(band);
3617 "RX power " << rxPower <<
" over (" << band
3618 <<
") does not match expected power " << expectedRxPower
3634 if (expectedRxPower >
Watt_u{0.0})
3637 phy->GetEnergyDuration(expectedRxPower - step, band).IsStrictlyPositive(),
3639 "At least " << expectedRxPower <<
" W expected for OFDMA part over (" << band <<
") at "
3642 phy->GetEnergyDuration(expectedRxPower + step, band).IsStrictlyPositive(),
3644 "At most " << expectedRxPower <<
" W expected for OFDMA part over (" << band <<
") at "
3650 phy->GetEnergyDuration(expectedRxPower + step, band).IsStrictlyPositive(),
3652 "At most " << expectedRxPower <<
" W expected for OFDMA part over (" << band <<
") at "
3662 "m_currentEvent for AP was not cleared");
3665 "m_currentEvent for STA 1 was not cleared");
3668 "m_currentEvent for STA 2 was not cleared");
3685 phy->GetAttribute(
"State", ptr);
3687 currentState = state->GetState();
3691 "PHY State " << currentState <<
" does not match expected state "
3697 Time expectedLastNotification)
3700 expectedNotifications,
3701 "Number of RX start notifications "
3703 <<
" does not match expected count " << expectedNotifications
3706 expectedLastNotification,
3707 "Last time RX start notification has been received "
3709 <<
" does not match expected time " << expectedLastNotification
3715 Time expectedLastNotification,
3716 bool expectedSuccess)
3719 expectedNotifications,
3720 "Number of RX end notifications "
3722 <<
" does not match expected count " << expectedNotifications
3725 expectedLastNotification,
3726 "Last time RX end notification has been received "
3728 <<
" does not match expected time " << expectedLastNotification
3732 "Last time RX end notification indicated a "
3734 <<
" but expected a " << (expectedSuccess ?
"success" :
"failure")
3759 heConfiguration->m_bssColor = bssColor;
3766 phy->SetAttribute(
"PowerDensityLimit",
DoubleValue(psdLimit));
3775 spectrumChannel->AddPropagationLossModel(lossModel);
3778 spectrumChannel->SetPropagationDelayModel(delayModel);
3782 preambleDetectionModel->SetAttribute(
3786 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(-100));
3794 apMac->SetAttribute(
"BeaconGeneration",
BooleanValue(
false));
3795 apDev->SetMac(apMac);
3798 apDev->SetHeConfiguration(heConfiguration);
3814 apMac->SetWifiPhys({
m_phyAp});
3815 apNode->AggregateObject(apMobility);
3816 apNode->AddDevice(apDev);
3834 sta1Node->AggregateObject(sta1Mobility);
3835 sta1Node->AddDevice(sta1Dev);
3853 sta2Node->AggregateObject(sta2Mobility);
3854 sta2Node->AddDevice(sta2Dev);
3872 sta3Node->AggregateObject(sta3Mobility);
3873 sta3Node->AddDevice(sta3Dev);
3881 interfererNode->AddDevice(interfererDev);
3885 for (
auto& phy : phys)
3888 phy->SetAttribute(
"TxPowerStart",
DoubleValue(16.0));
3889 phy->SetAttribute(
"TxPowerEnd",
DoubleValue(16.0));
3890 phy->SetAttribute(
"PowerDensityLimit",
DoubleValue(100.0));
3893 phy->SetAttribute(
"TxMaskInnerBandMinimumRejection",
DoubleValue(-100.0));
3894 phy->SetAttribute(
"TxMaskOuterBandMinimumRejection",
DoubleValue(-100.0));
3895 phy->SetAttribute(
"TxMaskOuterBandMaximumRejection",
DoubleValue(-100.0));
3930 bool scheduleTxSta1,
3931 Time ulTimeDifference,
3935 static uint64_t uid = 0;
3985 expectedStateBeforeEnd);
3990 expectedStateAtEnd);
3993 if (expectedSuccessFromSta1 + expectedFailuresFromSta1 + expectedSuccessFromSta2 +
3994 expectedFailuresFromSta2 >
3998 const bool isSuccess = (expectedSuccessFromSta1 > 0) || (expectedSuccessFromSta2 > 0);
4028 expectedSuccessFromSta1,
4029 expectedFailuresFromSta1,
4030 expectedBytesFromSta1);
4035 expectedSuccessFromSta2,
4036 expectedFailuresFromSta2,
4037 expectedBytesFromSta2);
4047 Watt_u rxPowerNonOfdmaRu1,
4048 Watt_u rxPowerNonOfdmaRu2,
4056 const auto nonOfdmaDuration = hePhy->CalculateNonHeDurationForHeTb(txVectorSta2);
4057 NS_ASSERT(nonOfdmaDuration == hePhy->CalculateNonHeDurationForHeTb(txVectorSta1));
4059 std::vector<Watt_u> rxPowerNonOfdma{rxPowerNonOfdmaRu1, rxPowerNonOfdmaRu2};
4060 std::vector<WifiSpectrumBandInfo> nonOfdmaBand{hePhy->GetNonOfdmaBand(txVectorSta1, 1),
4061 hePhy->GetNonOfdmaBand(txVectorSta2, 2)};
4062 std::vector<Watt_u> rxPowerOfdma{rxPowerOfdmaRu1, rxPowerOfdmaRu2};
4063 std::vector<WifiSpectrumBandInfo> ofdmaBand{hePhy->GetRuBandForRx(txVectorSta1, 1),
4064 hePhy->GetRuBandForRx(txVectorSta2, 2)};
4066 for (uint8_t i = 0; i < 2; ++i)
4073 delay + detectionDuration +
4079 rxPowerNonOfdma[i]);
4085 rxPowerNonOfdma[i]);
4109 delay + detectionDuration +
4115 rxPowerNonOfdma[i]);
4121 rxPowerNonOfdma[i]);
4139 if (rxPowerOfdmaRu1 !=
Watt_u{0.0})
4146 const auto rxPowerNonOfdmaSta1Only =
4148 ? rxPowerNonOfdma[0]
4149 : rxPowerNonOfdma[0] / 2;
4152 delay + detectionDuration +
4158 rxPowerNonOfdmaSta1Only);
4164 rxPowerNonOfdmaSta1Only);
4188 int64_t streamNumber = 0;
4227 "Reception of solicited HE TB PPDUs");
4246 "Reception of solicited HE TB PPDUs with delay (< 400ns) between the two signals");
4265 "Dropping of unsolicited HE TB PPDUs");
4277 WifiPhyState::CCA_BUSY);
4285 "Dropping of HE TB PPDUs with channel width differing from TRIGVECTOR");
4297 WifiPhyState::CCA_BUSY,
4306 "Dropping of HE TB PPDUs with UL Length differing from TRIGVECTOR");
4318 WifiPhyState::CCA_BUSY,
4327 "Dropping of HE TB PPDUs with AIDs differing from TRIGVECTOR");
4339 WifiPhyState::CCA_BUSY,
4350 "Reception of solicited HE TB PPDUs with interference on RU 1 during PSDU reception");
4357 bands.push_back(bandInfo);
4361 Watt_u interferencePower{0.1};
4372 WifiPhyState::CCA_BUSY,
4389 "Reception of solicited HE TB PPDUs with interference on RU 2 during PSDU reception");
4395 bands.push_back(bandInfo);
4409 ? WifiPhyState::IDLE
4410 : WifiPhyState::CCA_BUSY,
4427 "Reception of solicited HE TB PPDUs with interference on the full band "
4428 "during PSDU reception");
4434 bands.push_back(bandInfo);
4448 WifiPhyState::CCA_BUSY,
4466 "Reception of solicited HE TB PPDUs with another HE TB PPDU arriving on RU "
4467 "1 during PSDU reception");
4500 WifiPhyState::CCA_BUSY,
4518 "Reception of solicited HE TB PPDUs with another HE TB PPDU arriving on RU "
4519 "2 during PSDU reception");
4550 ? WifiPhyState::IDLE
4551 : WifiPhyState::CCA_BUSY,
4569 "Reception of solicited HE TB PPDUs with an HE SU PPDU arriving during the 400 ns window");
4596 "Reception of solicited HE TB PPDU only on RU 2");
4604 ? WifiPhyState::IDLE
4605 : WifiPhyState::CCA_BUSY);
4626 "Measure power for reception of HE TB PPDU only on RU 2");
4655 "Measure power for reception of HE TB PPDU only on RU 2 with PSD limitation");
4668 auto rxPowerOfdma = rxPower;
4707 "Measure power for reception of HE TB PPDU on both RUs");
4710 const auto rxPowerNonOfdma =
4732 "Reception of an HE TB PPDU from another BSS");
4760 "Reception of solicited HE TB PPDUs with delay (< 400ns) between the two signals and "
4761 "reception of an HE TB PPDU from another BSS between the ends of the two HE TB PPDUs");
4774 WifiPhyState::CCA_BUSY,
4833 void DoRun()
override;
4844 std::size_t payloadSize,
4918 const std::vector<bool>& statusPerMpdu);
4941 :
TestCase(
"PHY padding exclusion test"),
4942 m_countRxSuccessFromSta1(0),
4943 m_countRxSuccessFromSta2(0),
4944 m_countRxFailureFromSta1(0),
4945 m_countRxFailureFromSta2(0),
4946 m_countRxBytesFromSta1(0),
4947 m_countRxBytesFromSta2(0)
4954 std::size_t payloadSize,
4972 txVector.SetRu(ru, txStaId);
4974 txVector.SetNss(1, txStaId);
4981 std::ostringstream addr;
4982 addr <<
"00:00:00:00:00:0" << txStaId;
4986 psdus.insert(std::make_pair(txStaId, psdu));
4993 else if (txStaId == 2)
5002 phy->Send(psdus, txVector);
5028 const std::vector<bool>& )
5030 NS_LOG_FUNCTION(
this << *psdu << psdu->GetAddr2() << rxSignalInfo << txVector);
5031 if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:01"))
5036 else if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:02"))
5047 if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:01"))
5051 else if (psdu->GetAddr2() ==
Mac48Address(
"00:00:00:00:00:02"))
5064 "The number of successfully received packets from STA 1 is not correct!");
5068 "The number of unsuccessfuly received packets from STA 1 is not correct!");
5071 "The number of bytes received from STA 1 is not correct!");
5081 "The number of successfully received packets from STA 2 is not correct!");
5085 "The number of unsuccessfuly received packets from STA 2 is not correct!");
5088 "The number of bytes received from STA 2 is not correct!");
5096 "m_currentEvent for AP was not cleared");
5099 "m_currentEvent for STA 1 was not cleared");
5102 "m_currentEvent for STA 2 was not cleared");
5116 WifiPhyState currentState = phy->GetState()->GetState();
5120 "PHY State " << currentState <<
" does not match expected state "
5143 int64_t streamNumber = 0;
5148 spectrumChannel->AddPropagationLossModel(lossModel);
5151 spectrumChannel->SetPropagationDelayModel(delayModel);
5158 apMac->SetAttribute(
"BeaconGeneration",
BooleanValue(
false));
5159 apDev->SetMac(apMac);
5162 apDev->SetHeConfiguration(heConfiguration);
5187 apMac->SetWifiPhys({
m_phyAp});
5188 apNode->AggregateObject(apMobility);
5189 apNode->AddDevice(apDev);
5209 sta1Node->AggregateObject(sta1Mobility);
5210 sta1Node->AddDevice(sta1Dev);
5230 sta2Node->AggregateObject(sta2Mobility);
5231 sta2Node->AddDevice(sta2Dev);
5239 interfererNode->AddDevice(interfererDev);
5269 trigVector.SetRu(
HeRu::RuSpec(RuType::RU_106_TONE, 1,
false), 1);
5271 trigVector.SetNss(1, 1);
5272 trigVector.SetRu(
HeRu::RuSpec(RuType::RU_106_TONE, 2,
false), 2);
5274 trigVector.SetNss(1, 2);
5276 std::tie(length, ppduDuration) =
5278 trigVector.SetLength(length);
5280 hePhyAp->SetTrigVector(trigVector, ppduDuration);
5287 Time ppduWithPaddingDuration =
5288 expectedPpduDuration + 10 *
NanoSeconds(12800 + 1600 );
5299 ppduWithPaddingDuration);
5306 ppduWithPaddingDuration);
5312 ppduWithPaddingDuration);
5324 WifiPhyState::IDLE);
5342 ppduWithPaddingDuration);
5349 ppduWithPaddingDuration);
5355 ppduWithPaddingDuration);
5363 bands.push_back(bandInfo);
5367 Watt_u interferencePower{0.1};
5387 WifiPhyState::CCA_BUSY);
5419 void DoRun()
override;
5426 void SendMuBar(std::vector<uint16_t> staIds);
5442 void RunOne(
bool setupBa);
5462 const std::vector<bool>& statusPerMpdu);
5487 :
TestCase(
"UL-OFDMA power control test"),
5489 m_txPowerAp(
dBm_u{0}),
5490 m_txPowerStart(
dBm_u{0}),
5491 m_txPowerEnd(
dBm_u{0}),
5493 m_requestedRssiSta1(
dBm_u{0}),
5494 m_requestedRssiSta2(
dBm_u{0}),
5495 m_rssiSta1(
dBm_u{0}),
5496 m_rssiSta2(
dBm_u{0}),
5514 m_apDev->Send(pkt, destination, 0);
5520 NS_ASSERT(!staIds.empty() && staIds.size() <= 2);
5524 muBar.
SetType(TriggerFrameType::MU_BAR_TRIGGER);
5532 RuType ru = (staIds.size() == 1) ? RuType::RU_242_TONE : RuType::RU_106_TONE;
5533 std::size_t index = 1;
5534 int8_t ulTargetRssi = -40;
5535 for (
const auto& staId : staIds)
5548 else if (staId == 2)
5588 bar->AddHeader(muBar);
5591 if (staIds.size() == 1)
5594 if (staIds.front() == aidSta1)
5617 auto nav =
m_apDev->GetPhy()->GetSifs();
5618 const auto staId = staIds.front();
5623 psdu->SetDuration(nav);
5624 psdus.insert(std::make_pair(
SU_STA_ID, psdu));
5626 m_phyAp->Send(psdus, txVector);
5633 const std::vector<bool>& )
5636 const auto rssi = rxSignalInfo.
rssi;
5638 const auto& hdr = psdu->GetHeader(0);
5640 if (hdr.GetAddr2() ==
m_sta1Dev->GetAddress())
5646 "The obtained RSSI from STA 1 at AP is different from the expected one ("
5647 << rssi <<
" vs " <<
m_rssiSta1 <<
", with tolerance of " <<
m_tol <<
")");
5649 else if (psdu->GetAddr2() ==
m_sta2Dev->GetAddress())
5655 "The obtained RSSI from STA 2 at AP is different from the expected one ("
5656 << rssi <<
" vs " <<
m_rssiSta2 <<
", with tolerance of " <<
m_tol <<
")");
5668 m_phyAp->SetReceiveOkCallback(
5681 spectrumChannel->AddPropagationLossModel(lossModel);
5683 spectrumChannel->SetPropagationDelayModel(delayModel);
5688 spectrumPhy.
Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_5GHZ, 0}"));
5692 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
5699 mac.SetType(
"ns3::StaWifiMac");
5700 auto staDevs = wifi.Install(spectrumPhy, mac, staNodes);
5710 mac.SetType(
"ns3::ApWifiMac",
5724 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
5726 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
5727 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
5729 Vector(2.0, 0.0, 0.0));
5730 mobility.SetPositionAllocator(positionAlloc);
5732 mobility.Install(apNode);
5733 mobility.Install(staNodes);
5735 lossModel->SetDefaultLoss(50.0);
5760 int64_t streamNumber = 0;
5765 m_phyAp->AssignStreams(streamNumber);
5766 phySta1->AssignStreams(streamNumber);
5767 phySta2->AssignStreams(streamNumber);
5781 Time relativeStart{};
5800 apMac->SetAttribute(
"BeaconGeneration",
BooleanValue(
false));
5809 std::vector<uint16_t> staIds{1};
5815 std::vector<uint16_t> staIds{2};
5824 std::vector<uint16_t> staIds{1, 2};
SpectrumWifiPhy used for testing OFDMA.
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_ofdmaTestHePhy
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.
void Reset()
Reset data upon end of TX or RX.
TracedCallback< uint64_t > m_phyTxPpduUidTrace
Callback providing UID of the PPDU that is about to be transmitted.
void DoInitialize() override
Initialize() implementation.
Time GetEnergyDuration(Watt_u energy, WifiSpectrumBandInfo band)
Wrapper to InterferenceHelper method.
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.
WifiSpectrumBandInfo GetNonOfdmaBand(const WifiTxVector &txVector, uint16_t staId) const
Get the band used to transmit the non-OFDMA part of an HE TB PPDU.
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,...
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,...
void NotifyTxStart(Time duration, dBm_u txPower) override
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.
uint32_t m_countRxFailureSta1
count RX failure for STA 1
void RxSuccessSta2(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function for STA 2.
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.
MHz_u m_frequency
frequency
MHz_u m_channelWidth
channel width
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 RxSuccessSta1(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function for STA 1.
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 GenerateInterference(Ptr< SpectrumValue > interferencePsd, Time duration)
Generate interference function.
void RxSuccessSta2(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function for STA 2.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
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.
void RxSuccessSta1(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function for STA 1.
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.
MHz_u m_channelWidth
channel width
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 RxSuccessSta3(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function for STA 3.
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 CheckResultsSta1(uint32_t expectedRxSuccess, uint32_t expectedRxFailure, uint32_t expectedRxBytes)
Check the results for STA 1.
Ptr< OfdmaSpectrumWifiPhy > m_phySta3
PHY of 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.
MHz_u m_frequency
frequency
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.
void RxHeTbPpdu(uint64_t uid, uint16_t staId, Watt_u txPower, size_t payloadSize)
Receive HE TB PPDU function.
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.
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 RxSuccess(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function.
void SendHeTbPpdu(uint16_t txStaId, std::size_t index, std::size_t payloadSize, Time txDuration)
Send HE TB PPDU 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.
MHz_u m_channelWidth
channel width
std::shared_ptr< OfdmaTestPhyListener > m_apPhyStateListener
listener for AP PHY state transitions
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 RxSuccess(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive success function.
void DoCheckPhyState(Ptr< OfdmaSpectrumWifiPhy > phy, WifiPhyState expectedState)
Check the PHY state.
uint32_t m_countRxBytesFromSta1
count RX bytes from STA 1
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 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 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.
void CheckOfdmaRxPower(Ptr< OfdmaSpectrumWifiPhy > phy, WifiSpectrumBandInfo band, Watt_u expectedRxPower)
Check the received power for the OFDMA part of the HE TB PPDUs over the given band.
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.
void SetPsdLimit(Ptr< WifiPhy > phy, dBm_per_MHz_u psdLimit)
Set the PSD limit.
Ptr< OfdmaSpectrumWifiPhy > m_phySta1
PHY of STA 1.
~TestUlOfdmaPhyTransmission() override
TestUlOfdmaPhyTransmission()
void CheckRxFromSta1(uint32_t expectedSuccess, uint32_t expectedFailures, uint32_t expectedBytes)
Check the received PSDUs from STA1.
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.
void CheckNonOfdmaRxPower(Ptr< OfdmaSpectrumWifiPhy > phy, WifiSpectrumBandInfo band, Watt_u expectedRxPower)
Check the received power for the non-OFDMA of the HE TB PPDUs over the given band.
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.
void SchedulePowerMeasurementChecks(Time delay, Watt_u rxPowerNonOfdmaRu1, Watt_u rxPowerNonOfdmaRu2, Watt_u rxPowerOfdmaRu1, Watt_u rxPowerOfdmaRu2)
Schedule power measurement related checks.
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.
MHz_u m_frequency
frequency
UL-OFDMA power control test.
dBm_u m_requestedRssiSta2
requested RSSI from STA 2 at AP for HE TB PPDUs
void DoRun() override
Implementation to actually run this TestCase.
Ptr< WifiNetDevice > m_sta2Dev
network device of STA 2
dBm_u m_rssiSta2
expected RSSI from STA 2 at AP for HE TB PPDUs
dBm_u m_txPowerEnd
maximum transmission power for STAs
dBm_u m_txPowerStart
minimum transmission power 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
dBm_u m_rssiSta1
expected RSSI from STA 1 at AP for HE TB PPDUs
Ptr< WifiNetDevice > m_apDev
network device of AP
dBm_u m_requestedRssiSta1
requested RSSI from STA 1 at AP for HE TB PPDUs
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
uint8_t m_bssColor
BSS color.
void ReplaceReceiveOkCallbackOfAp()
Replace the AP's callback on its PHY's ReceiveOkCallback by the ReceiveOkCallbackAtAp method.
dBm_u m_txPowerAp
transmit power of AP
uint8_t m_txPowerLevels
number of transmission power levels for STAs
dB_u m_tol
tolerance between received and expected RSSIs
TestUlOfdmaPowerControl()
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.
void ReceiveOkCallbackAtAp(Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
Receive OK callback function at 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(WifiRu::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'.
static WifiMode GetHeMcs9()
Return MCS 9 from HE MCS values.
MHz_u GetNonOfdmaWidth(WifiRu::RuSpec ru) const
Get the width of the non-OFDMA portion of an HE TB PPDU.
static std::vector< WifiSpectrumBandIndices > ConvertHeRuSubcarriers(MHz_u bandWidth, MHz_u guardBandwidth, const std::vector< MHz_u > ¢erFrequencies, MHz_u totalWidth, Hz_u subcarrierSpacing, SubcarrierRange subcarrierRange, uint8_t bandIndex=0)
static WifiMode GetHeMcs7()
Return MCS 7 from HE MCS values.
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.
static std::pair< uint16_t, Time > ConvertHeTbPpduDurationToLSigLength(Time ppduDuration, const WifiTxVector &txVector, WifiPhyBand band)
Compute the L-SIG length value corresponding to the given HE TB PPDU duration.
@ PSD_HE_PORTION
HE portion of an HE PPDU.
@ PSD_NON_HE_PORTION
Non-HE portion of an HE PPDU.
static std::size_t GetIndexIn80MHzSegment(MHz_u bw, RuType ruType, std::size_t phyIndex)
Get the index of a given RU transmitted in a PPDU within its 80 MHz segment.
static SubcarrierGroup GetSubcarrierGroup(MHz_u bw, RuType ruType, std::size_t phyIndex)
Get the subcarrier group of the RU having the given PHY index among all the RUs of the given type (nu...
static bool GetPrimary80MHzFlag(MHz_u bw, RuType ruType, std::size_t phyIndex, uint8_t p20Index)
Get the primary 80 MHz flag of a given RU transmitted in a PPDU.
static Mac48Address ConvertFrom(const Address &address)
static Mac48Address GetBroadcast()
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
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.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
void Dispose()
Dispose of this Object.
MHz_u GetGuardBandwidth(MHz_u currentChannelWidth) const
Ptr< WifiPhy > m_wifiPhy
Pointer to the owning WifiPhy.
void SetOwner(Ptr< WifiPhy > wifiPhy)
Set the WifiPhy owning this PHY entity.
static uint64_t m_globalPpduUid
Global counter of the PPDU UID.
AttributeValue implementation for Pointer.
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Make it easy to create and manage PHY objects for the spectrum model.
void SetChannel(const Ptr< SpectrumChannel > channel)
void SetDevice(const Ptr< WifiNetDevice > device) override
Sets the device this PHY is associated with.
void StartRx(Ptr< SpectrumSignalParameters > rxParams, Ptr< const WifiSpectrumPhyInterface > interface)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
void DoInitialize() override
Initialize() implementation.
MHz_u GetGuardBandwidth(MHz_u currentChannelWidth) const override
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
Attach a SpectrumChannel to use for a given frequency range.
void DoDispose() override
Destructor implementation.
void StartTx(Ptr< const WifiPpdu > ppdu) override
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
Forward calls to a chain of Callback.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
helps to create WifiNetDevice objects
static int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the PHY and MAC aspects ...
create MAC layers for a ns3::WifiNetDevice.
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...
Hz_u GetSubcarrierSpacing() const
std::tuple< uint8_t, MHz_u, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying a segment of an operating channel.
static Time GetPreambleDetectionDuration()
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)
virtual WifiSpectrumBandFrequencies ConvertIndicesToFrequencies(const WifiSpectrumBandIndices &indices) const =0
This is a helper function to convert start and stop indices to start and stop frequencies.
std::map< WifiModulationClass, Ptr< PhyEntity > > m_phyEntities
This map holds the supported PHY entities.
void RegisterListener(const std::shared_ptr< WifiPhyListener > &listener)
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.
MHz_u GetChannelWidth() const
void SetOperatingChannel(const WifiPhyOperatingChannel &channel)
If the standard for this object has not been set yet, store the channel settings corresponding to the...
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
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.
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the 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.
uint8_t GetPrimaryChannelIndex(MHz_u primaryChannelWidth) const
If the operating channel width is a multiple of 20 MHz, return the index of the primary channel of th...
std::vector< MHz_u > GetFrequencies() const
Return the center frequency per segment.
static ConstIterator FindFirst(uint8_t number, MHz_u frequency, MHz_u width, WifiStandard standard, WifiPhyBand band, ConstIterator start=m_frequencyChannels.begin())
Find the first frequency segment matching the specified parameters.
This objects implements the PHY state machine of the Wifi device.
static RuSpec FindOverlappingRu(MHz_u bw, RuSpec referenceRu, RuType searchedRuType)
Find the RU allocation of the given RU type overlapping the given reference RU allocation.
static MHz_u GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
static RuType GetRuType(RuSpec ru)
Get the type of a given RU.
static std::size_t GetPhyIndex(RuSpec ru, MHz_u bw, uint8_t p20Index)
Get the RU PHY index.
static Ptr< SpectrumValue > CreateHeMuOfdmTxPowerSpectralDensity(const std::vector< MHz_u > ¢erFrequencies, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, const std::vector< WifiSpectrumBandIndices > &ru)
Create a transmit power spectral density corresponding to the OFDMA part of HE TB PPDUs for a given R...
static Ptr< SpectrumValue > CreateHeOfdmTxPowerSpectralDensity(MHz_u centerFrequency, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=dBr_u{-20}, dBr_u minOuterband=dBr_u{-28}, dBr_u lowestPoint=dBr_u{-40}, const std::vector< bool > &puncturedSubchannels={})
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE) (802....
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
void SetRu(WifiRu::RuSpec ru, uint16_t staId)
Set the RU specification for the STA-ID.
WifiPreamble GetPreambleType() const
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
WifiModulationClass GetModulationClass() const
Get the modulation class specified by this TXVECTOR.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
MHz_u GetChannelWidth() const
WifiRu::RuSpec GetRu(uint16_t staId) const
Get the RU specification for the STA-ID.
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...
#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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > CreateObjectWithAttributes(Args... args)
Allocate an Object on the heap and initialize with a set of attributes.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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.
WifiPhyState
The state of the PHY layer.
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::vector< BandInfo > Bands
Container of BandInfo.
RuType
The different Resource Unit (RU) types.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
std::size_t Count20MHzSubchannels(MHz_u channelWidth)
Return the number of 20 MHz subchannels covering the channel width.
Watt_u DbmToW(dBm_u val)
Convert from dBm to Watts.
uint32_t GetBlockAckSize(BlockAckType type)
Return the total BlockAck size (including FCS trailer).
Hz_u MHzToHz(MHz_u val)
Convert from MHz to Hz.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
std::vector< uint16_t > RuAllocation
9 bits RU_ALLOCATION per 20 MHz
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.
WifiSpectrumBandInfo structure containing info about a spectrum band.
std::vector< WifiSpectrumBandIndices > indices
the start and stop indices for each segment of the band
static const MHz_u DEFAULT_FREQUENCY
static WifiPhyOfdmaTestSuite wifiPhyOfdmaTestSuite
the test suite
static const uint8_t DEFAULT_CHANNEL_NUMBER
static const WifiPhyBand DEFAULT_WIFI_BAND
static const MHz_u DEFAULT_CHANNEL_WIDTH
static const MHz_u DEFAULT_GUARD_WIDTH