A Discrete-Event Network Simulator
API
wifi-phy-cca-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
18 */
19
20#include "ns3/constant-obss-pd-algorithm.h"
21#include "ns3/he-phy.h"
22#include "ns3/he-ppdu.h"
23#include "ns3/ht-ppdu.h"
24#include "ns3/interference-helper.h"
25#include "ns3/log.h"
26#include "ns3/multi-model-spectrum-channel.h"
27#include "ns3/nist-error-rate-model.h"
28#include "ns3/non-communicating-net-device.h"
29#include "ns3/ofdm-ppdu.h"
30#include "ns3/pointer.h"
31#include "ns3/rng-seed-manager.h"
32#include "ns3/spectrum-wifi-helper.h"
33#include "ns3/spectrum-wifi-phy.h"
34#include "ns3/test.h"
35#include "ns3/threshold-preamble-detection-model.h"
36#include "ns3/vht-configuration.h"
37#include "ns3/vht-ppdu.h"
38#include "ns3/waveform-generator.h"
39#include "ns3/wifi-mac-header.h"
40#include "ns3/wifi-net-device.h"
41#include "ns3/wifi-phy-listener.h"
42#include "ns3/wifi-psdu.h"
43#include "ns3/wifi-spectrum-value-helper.h"
44#include "ns3/wifi-utils.h"
45
46#include <memory>
47#include <vector>
48
49using namespace ns3;
50
51NS_LOG_COMPONENT_DEFINE("WifiPhyCcaTest");
52
53constexpr uint32_t P20_CENTER_FREQUENCY = 5180; // MHz
61// add small delta to be right after aCCATime, since test checks are scheduled before wifi events
63const std::map<uint16_t, Time> PpduDurations = {{20, NanoSeconds(1009600)},
64 {40, NanoSeconds(533600)},
65 {80, NanoSeconds(275200)}};
66
74{
75 public:
77
78 private:
79 void DoSetup() override;
80 void DoTeardown() override;
81 void DoRun() override;
82
86 void RunOne();
87
103 Ptr<HtPpdu> CreateDummyHtPpdu(uint16_t bandwidth);
109 Ptr<VhtPpdu> CreateDummyVhtPpdu(uint16_t bandwidth);
115 Ptr<HePpdu> CreateDummyHePpdu(uint16_t bandwidth);
116
127 const Ptr<const WifiPpdu> ppdu,
128 WifiChannelListType channelType,
129 double expectedCcaThresholdDbm);
130
135
139
144
146};
147
149 : TestCase("Wi-Fi PHY CCA thresholds test"),
150 m_CcaEdThresholdDbm{-62.0},
151 m_CcaSensitivityDbm{-82.0},
152 m_secondaryCcaSensitivityThresholds{-72.0, -72.0, -69.0},
153 m_obssPdLevel{-82.0}
154{
155}
156
159{
160 Ptr<Packet> pkt = Create<Packet>(1000);
161 WifiMacHeader hdr;
163 hdr.SetQosTid(0);
164 return Create<WifiPsdu>(pkt, hdr);
165}
166
169{
170 WifiTxVector txVector =
171 WifiTxVector(OfdmPhy::GetOfdmRate6Mbps(), 0, WIFI_PREAMBLE_LONG, 800, 1, 1, 0, 20, false);
173 return Create<OfdmPpdu>(psdu, txVector, P20_CENTER_FREQUENCY, WIFI_PHY_BAND_5GHZ, 0);
174}
175
178{
179 WifiTxVector txVector =
180 WifiTxVector(HtPhy::GetHtMcs0(), 0, WIFI_PREAMBLE_HT_MF, 800, 1, 1, 0, bandwidth, false);
182 return Create<HtPpdu>(psdu,
183 txVector,
185 MicroSeconds(100),
187 0);
188}
189
192{
193 WifiTxVector txVector =
194 WifiTxVector(VhtPhy::GetVhtMcs0(), 0, WIFI_PREAMBLE_VHT_SU, 800, 1, 1, 0, bandwidth, false);
196 return Create<VhtPpdu>(psdu,
197 txVector,
199 MicroSeconds(100),
201 0);
202}
203
206{
207 WifiTxVector txVector =
208 WifiTxVector(HePhy::GetHeMcs0(), 0, WIFI_PREAMBLE_HE_SU, 800, 1, 1, 0, bandwidth, false);
210 return Create<HePpdu>(psdu,
211 txVector,
213 MicroSeconds(100),
215 0);
216}
217
218void
220 const Ptr<const WifiPpdu> ppdu,
221 WifiChannelListType channelType,
222 double expectedCcaThresholdDbm)
223{
224 NS_LOG_FUNCTION(this << phy << channelType << expectedCcaThresholdDbm);
225 double actualThresholdDbm = phy->GetCcaThreshold(ppdu, channelType);
226 NS_LOG_INFO((ppdu == nullptr ? "any signal" : "a PPDU")
227 << " in " << channelType << " channel: " << actualThresholdDbm << "dBm");
228 NS_TEST_EXPECT_MSG_EQ_TOL(actualThresholdDbm,
229 expectedCcaThresholdDbm,
230 1e-6,
231 "Actual CCA threshold for "
232 << (ppdu == nullptr ? "any signal" : "a PPDU") << " in "
233 << channelType << " channel " << actualThresholdDbm
234 << "dBm does not match expected threshold "
235 << expectedCcaThresholdDbm << "dBm");
236}
237
238void
240{
241 // WifiHelper::EnableLogComponents ();
242 // LogComponentEnable ("WifiPhyCcaTest", LOG_LEVEL_ALL);
243
244 m_device = CreateObject<WifiNetDevice>();
246 m_vhtConfiguration = CreateObject<VhtConfiguration>();
248
249 m_phy = Create<SpectrumWifiPhy>();
252
253 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
255 20,
261
262 m_obssPdAlgorithm = CreateObject<ConstantObssPdAlgorithm>();
265}
266
267void
269{
270 m_device->Dispose();
271 m_device = nullptr;
272}
273
274void
276{
281
282 // OFDM PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
284 nullptr,
287
288 //-----------------------------------------------------------------------------------------------------------------------------------
289
290 // OFDM PHY: 20 MHz non-HT PPDU in primary channel (20 MHz) if power above CCA sensitivty
291 // threshold
296
297 //-----------------------------------------------------------------------------------------------------------------------------------
298
299 // HT PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
301 nullptr,
304
305 // HT PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
307 nullptr,
310
311 //-----------------------------------------------------------------------------------------------------------------------------------
312
313 // HT PHY: 20 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
314 // threshold
319
320 // HT PHY: 40 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
321 // threshold
326
327 //-----------------------------------------------------------------------------------------------------------------------------------
328
329 // VHT PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
331 nullptr,
334
335 // VHT PHY: any signal in secondary channel (20 MHz) if power above CCA-ED threshold
337 nullptr,
340
341 // VHT PHY: any signal in secondary40 channel (40 MHz) if power above CCA-ED threshold + 3dB
343 nullptr,
346
347 // VHT PHY: any signal in secondary80 channel (80 MHz) if power above CCA-ED threshold + 6dB
349 nullptr,
352
353 //-----------------------------------------------------------------------------------------------------------------------------------
354
355 // VHT PHY: 20 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
356 // threshold
361
362 // VHT PHY: 40 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
363 // threshold
368
369 // VHT PHY: 80 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
370 // threshold
375
376 // VHT PHY: 160 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA
377 // sensitivty threshold
382
383 //-----------------------------------------------------------------------------------------------------------------------------------
384
385 // VHT PHY: 20 MHz VHT PPDU in secondary channel (20 MHz) if power above the CCA sensitivity
386 // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
391
392 // VHT PHY: 20 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity
393 // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
398
399 // VHT PHY: 40 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity
400 // threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz
405
406 // VHT PHY: 20 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity
407 // threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
412
413 // VHT PHY: 40 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity
414 // threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz
419
420 // VHT PHY: 80 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity
421 // threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz
426
427 //-----------------------------------------------------------------------------------------------------------------------------------
428
429 // HE PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
431 nullptr,
434
435 // HE PHY: any signal in secondary channel (20 MHz) if power above CCA-ED threshold
437 nullptr,
440
441 // HE PHY: any signal in secondary40 channel (40 MHz) if power above CCA-ED threshold + 3dB
443 nullptr,
446
447 // HE PHY: any signal in secondary80 channel (80 MHz) if power above CCA-ED threshold + 6dB
449 nullptr,
452
453 //-----------------------------------------------------------------------------------------------------------------------------------
454
455 // HE PHY: 20 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
456 // threshold
461
462 // HE PHY: 40 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
463 // threshold
468
469 // HE PHY: 80 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
470 // threshold
475
476 // HE PHY: 160 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty
477 // threshold
482
483 //-----------------------------------------------------------------------------------------------------------------------------------
484
485 // HE PHY: 20 MHz HE PPDU in secondary channel (20 MHz) if power above the max between the CCA
486 // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
487 // and the OBSS-PD level
492
493 // HE PHY: 20 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the CCA
494 // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
495 // and the OBSS-PD level
500
501 // HE PHY: 40 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the CCA
502 // sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz
503 // and the OBSS-PD level plus 3 dB
509
510 // HE PHY: 20 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA
511 // sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
512 // and the OBSS-PD level
517
518 // HE PHY: 40 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA
519 // sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz
520 // and the OBSS-PD level plus 3 dB
526
527 // HE PHY: 80 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA
528 // sensitivity threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz
529 // and the OBSS-PD level plus 6 dB
535}
536
537void
539{
540 // default attributes
541 m_CcaEdThresholdDbm = -62.0;
542 m_CcaSensitivityDbm = -82.0;
543 m_secondaryCcaSensitivityThresholds = std::make_tuple(-72.0, -72.0, -69.0);
544 m_obssPdLevel = -82.0;
545 RunOne();
546
547 // default attributes with OBSS-PD level set to -80 dBm
548 m_CcaEdThresholdDbm = -62.0;
549 m_CcaSensitivityDbm = -82.0;
550 m_secondaryCcaSensitivityThresholds = std::make_tuple(-72.0, -72.0, -69.0);
551 m_obssPdLevel = -80.0;
552 RunOne();
553
554 // default attributes with OBSS-PD level set to -70 dBm
555 m_CcaEdThresholdDbm = -62.0;
556 m_CcaSensitivityDbm = -82.0;
557 m_secondaryCcaSensitivityThresholds = std::make_tuple(-72.0, -72.0, -69.0);
558 m_obssPdLevel = -70.0;
559 RunOne();
560
561 // CCA-ED set to -65 dBm
562 m_CcaEdThresholdDbm = -65.0;
563 m_CcaSensitivityDbm = -82.0;
564 m_secondaryCcaSensitivityThresholds = std::make_tuple(-72.0, -72.0, -69.0);
565 m_obssPdLevel = -82.0;
566 RunOne();
567
568 // CCA sensitivity for signals in primary set to -75 dBm
569 m_CcaEdThresholdDbm = -62.0;
570 m_CcaSensitivityDbm = -75.0;
571 m_secondaryCcaSensitivityThresholds = std::make_tuple(-72.0, -72.0, -69.0);
572 m_obssPdLevel = -82.0;
573 RunOne();
574
575 // custom CCA sensitivities for signals not in primary
576 m_CcaEdThresholdDbm = -62.0;
577 m_CcaSensitivityDbm = -72.0;
578 m_secondaryCcaSensitivityThresholds = std::make_tuple(-70.0, -70.0, -70.0);
579 m_obssPdLevel = -82.0;
580 RunOne();
581
582 // custom CCA sensitivities for signals not in primary with OBSS-PD level set to -80 dBm
583 m_CcaEdThresholdDbm = -62.0;
584 m_CcaSensitivityDbm = -72.0;
585 m_secondaryCcaSensitivityThresholds = std::make_tuple(-70.0, -70.0, -70.0);
586 m_obssPdLevel = -80.0;
587 RunOne();
588
589 // custom CCA sensitivities for signals not in primary with OBSS-PD level set to -70 dBm
590 m_CcaEdThresholdDbm = -62.0;
591 m_CcaSensitivityDbm = -72.0;
592 m_secondaryCcaSensitivityThresholds = std::make_tuple(-70.0, -70.0, -70.0);
593 m_obssPdLevel = -70.0;
594 RunOne();
595
596 Simulator::Destroy();
597}
598
606{
607 public:
609
610 void NotifyRxStart(Time duration) override
611 {
612 NS_LOG_FUNCTION(this << duration);
613 }
614
615 void NotifyRxEndOk() override
616 {
617 NS_LOG_FUNCTION(this);
618 }
619
620 void NotifyRxEndError() override
621 {
622 NS_LOG_FUNCTION(this);
623 }
624
625 void NotifyTxStart(Time duration, double txPowerDbm) override
626 {
627 NS_LOG_FUNCTION(this << duration << txPowerDbm);
628 }
629
631 WifiChannelListType channelType,
632 const std::vector<Time>& per20MhzDurations) override
633 {
634 NS_LOG_FUNCTION(this << duration << channelType << per20MhzDurations.size());
635 m_endCcaBusy = Simulator::Now() + duration;
636 m_lastCcaBusyChannelType = channelType;
637 m_lastPer20MhzCcaBusyDurations = per20MhzDurations;
639 }
640
641 void NotifySwitchingStart(Time duration) override
642 {
643 }
644
645 void NotifySleep() override
646 {
647 }
648
649 void NotifyOff() override
650 {
651 }
652
653 void NotifyWakeup() override
654 {
655 }
656
657 void NotifyOn() override
658 {
659 }
660
664 void Reset()
665 {
666 m_notifications = 0;
670 }
671
672 std::size_t m_notifications{0};
676 std::vector<Time>
678};
679
687{
688 public:
690
691 private:
692 void DoSetup() override;
693 void DoRun() override;
694 void DoTeardown() override;
695
702 void SendHeSuPpdu(double txPowerDbm, uint16_t frequency, uint16_t bandwidth);
703
712 void StartSignal(Ptr<WaveformGenerator> signalGenerator,
713 double txPowerDbm,
714 uint16_t frequency,
715 uint16_t bandwidth,
716 Time duration);
721 void StopSignal(Ptr<WaveformGenerator> signalGenerator);
722
727 void CheckPhyState(WifiPhyState expectedState);
729 void DoCheckPhyState(WifiPhyState expectedState);
730
737 void CheckLastCcaBusyNotification(Time expectedEndTime,
738 WifiChannelListType expectedChannelType,
739 const std::vector<Time>& expectedPer20MhzDurations);
740
746 void LogScenario(const std::string& log) const;
747
752 {
753 double power{0.0};
756 uint16_t centerFreq{0};
757 uint16_t bandwidth{0};
758 };
759
764 {
765 double power{0.0};
767 uint16_t centerFreq{0};
768 uint16_t bandwidth{0};
769 };
770
775 {
778 };
779
784 {
789 std::vector<Time> expectedPer20MhzDurations{};
790 };
791
800 void ScheduleTest(Time delay,
801 const std::vector<TxSignalInfo>& generatedSignals,
802 const std::vector<TxPpduInfo>& generatedPpdus,
803 const std::vector<StateCheckPoint>& stateCheckpoints,
804 const std::vector<CcaCheckPoint>& ccaCheckpoints);
805
809 void Reset();
810
814 void RunOne();
815
818
819 std::vector<Ptr<WaveformGenerator>> m_signalGenerators;
820 std::size_t
822
823 std::unique_ptr<CcaTestPhyListener>
825
826 uint16_t m_frequency;
827 uint16_t m_channelWidth;
828};
829
831 : TestCase("Wi-Fi PHY CCA indication test"),
832 m_numSignalGenerators(2),
833 m_frequency(P20_CENTER_FREQUENCY),
834 m_channelWidth(20)
835{
836}
837
838void
840 double txPowerDbm,
841 uint16_t frequency,
842 uint16_t bandwidth,
843 Time duration)
844{
845 NS_LOG_FUNCTION(this << signalGenerator << txPowerDbm << frequency << bandwidth << duration);
846
847 BandInfo bandInfo;
848 bandInfo.fc = frequency * 1e6;
849 bandInfo.fl = bandInfo.fc - ((bandwidth / 2) * 1e6);
850 bandInfo.fh = bandInfo.fc + ((bandwidth / 2) * 1e6);
851 Bands bands;
852 bands.push_back(bandInfo);
853
854 Ptr<SpectrumModel> spectrumSignal = Create<SpectrumModel>(bands);
855 Ptr<SpectrumValue> signalPsd = Create<SpectrumValue>(spectrumSignal);
856 *signalPsd = DbmToW(txPowerDbm) / (bandwidth * 1e6);
857
858 signalGenerator->SetTxPowerSpectralDensity(signalPsd);
859 signalGenerator->SetPeriod(duration);
860 signalGenerator->Start();
861 Simulator::Schedule(duration, &WifiPhyCcaIndicationTest::StopSignal, this, signalGenerator);
862}
863
864void
866{
867 NS_LOG_FUNCTION(this << signalGenerator);
868 signalGenerator->Stop();
869}
870
871void
872WifiPhyCcaIndicationTest::SendHeSuPpdu(double txPowerDbm, uint16_t frequency, uint16_t bandwidth)
873{
874 NS_LOG_FUNCTION(this << txPowerDbm);
875
876 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
877 frequency,
878 bandwidth,
882 WifiPhy::ChannelTuple{channelNum, bandwidth, WIFI_PHY_BAND_5GHZ, 0});
883
884 WifiTxVector txVector =
885 WifiTxVector(HePhy::GetHeMcs0(), 0, WIFI_PREAMBLE_HE_SU, 800, 1, 1, 0, bandwidth, false);
886
887 Ptr<Packet> pkt = Create<Packet>(1000);
888 WifiMacHeader hdr;
890 hdr.SetQosTid(0);
891 Ptr<WifiPsdu> psdu = Create<WifiPsdu>(pkt, hdr);
892
893 m_txPhy->SetTxPowerStart(txPowerDbm);
894 m_txPhy->SetTxPowerEnd(txPowerDbm);
895
896 m_txPhy->Send(psdu, txVector);
897}
898
899void
901{
902 // This is needed to make sure PHY state will be checked as the last event if a state change
903 // occurred at the exact same time as the check
904 Simulator::ScheduleNow(&WifiPhyCcaIndicationTest::DoCheckPhyState, this, expectedState);
905}
906
907void
909{
910 WifiPhyState currentState;
911 PointerValue ptr;
912 m_rxPhy->GetAttribute("State", ptr);
913 Ptr<WifiPhyStateHelper> state = DynamicCast<WifiPhyStateHelper>(ptr.Get<WifiPhyStateHelper>());
914 currentState = state->GetState();
915 NS_TEST_ASSERT_MSG_EQ(currentState,
916 expectedState,
917 "PHY State " << currentState << " does not match expected state "
918 << expectedState << " at " << Simulator::Now());
919}
920
921void
923 Time expectedEndTime,
924 WifiChannelListType expectedChannelType,
925 const std::vector<Time>& expectedPer20MhzDurations)
926{
928 expectedEndTime,
929 "PHY CCA end time " << m_rxPhyStateListener->m_endCcaBusy
930 << " does not match expected time " << expectedEndTime
931 << " at " << Simulator::Now());
932 NS_TEST_ASSERT_MSG_EQ(m_rxPhyStateListener->m_lastCcaBusyChannelType,
933 expectedChannelType,
934 "PHY CCA-BUSY for " << m_rxPhyStateListener->m_lastCcaBusyChannelType
935 << " does not match expected channel type "
936 << expectedChannelType << " at " << Simulator::Now());
937 NS_TEST_ASSERT_MSG_EQ(m_rxPhyStateListener->m_lastPer20MhzCcaBusyDurations.size(),
938 expectedPer20MhzDurations.size(),
939 "PHY CCA-BUSY per-20 MHz durations does not match expected vector"
940 << " at " << Simulator::Now());
941 for (std::size_t i = 0; i < expectedPer20MhzDurations.size(); ++i)
942 {
943 NS_TEST_ASSERT_MSG_EQ(m_rxPhyStateListener->m_lastPer20MhzCcaBusyDurations.at(i),
944 expectedPer20MhzDurations.at(i),
945 "PHY CCA-BUSY per-20 MHz duration at index "
946 << i << " does not match expected duration at "
947 << Simulator::Now());
948 }
949}
950
951void
952WifiPhyCcaIndicationTest::LogScenario(const std::string& log) const
953{
954 NS_LOG_INFO(log);
955}
956
957void
959 const std::vector<TxSignalInfo>& generatedSignals,
960 const std::vector<TxPpduInfo>& generatedPpdus,
961 const std::vector<StateCheckPoint>& stateCheckpoints,
962 const std::vector<CcaCheckPoint>& ccaCheckpoints)
963{
964 for (const auto& generatedPpdu : generatedPpdus)
965 {
966 Simulator::Schedule(delay + generatedPpdu.startTime,
968 this,
969 generatedPpdu.power,
970 generatedPpdu.centerFreq,
971 generatedPpdu.bandwidth);
972 }
973
974 std::size_t index = 0;
975 for (const auto& generatedSignal : generatedSignals)
976 {
977 Simulator::Schedule(delay + generatedSignal.startTime,
979 this,
980 m_signalGenerators.at(index++),
981 generatedSignal.power,
982 generatedSignal.centerFreq,
983 generatedSignal.bandwidth,
984 generatedSignal.duration);
985 }
986
987 for (const auto& checkpoint : ccaCheckpoints)
988 {
989 Simulator::Schedule(delay + checkpoint.timePoint,
991 this,
992 Simulator::Now() + delay + checkpoint.expectedCcaEndTime,
993 checkpoint.expectedChannelListType,
994 checkpoint.expectedPer20MhzDurations);
995 }
996
997 for (const auto& checkpoint : stateCheckpoints)
998 {
999 Simulator::Schedule(delay + checkpoint.timePoint,
1001 this,
1002 checkpoint.expectedPhyState);
1003 }
1004
1005 Simulator::Schedule(delay + Seconds(0.5), &WifiPhyCcaIndicationTest::Reset, this);
1006}
1007
1008void
1010{
1011 m_rxPhyStateListener->Reset();
1012}
1013
1014void
1016{
1017 // WifiHelper::EnableLogComponents ();
1018 // LogComponentEnable ("WifiPhyCcaTest", LOG_LEVEL_ALL);
1019
1020 Ptr<MultiModelSpectrumChannel> spectrumChannel = CreateObject<MultiModelSpectrumChannel>();
1021
1022 Ptr<Node> rxNode = CreateObject<Node>();
1023 Ptr<WifiNetDevice> rxDev = CreateObject<WifiNetDevice>();
1025 Ptr<VhtConfiguration> vhtConfiguration = CreateObject<VhtConfiguration>();
1026 rxDev->SetVhtConfiguration(vhtConfiguration);
1027 m_rxPhy = CreateObject<SpectrumWifiPhy>();
1029 m_rxPhyStateListener = std::make_unique<CcaTestPhyListener>();
1032 Ptr<InterferenceHelper> rxInterferenceHelper = CreateObject<InterferenceHelper>();
1033 m_rxPhy->SetInterferenceHelper(rxInterferenceHelper);
1034 Ptr<ErrorRateModel> rxErrorModel = CreateObject<NistErrorRateModel>();
1035 m_rxPhy->SetErrorRateModel(rxErrorModel);
1036 Ptr<ThresholdPreambleDetectionModel> preambleDetectionModel =
1037 CreateObject<ThresholdPreambleDetectionModel>();
1038 m_rxPhy->SetPreambleDetectionModel(preambleDetectionModel);
1039 m_rxPhy->SetChannel(spectrumChannel);
1040 m_rxPhy->SetDevice(rxDev);
1041 rxDev->SetPhy(m_rxPhy);
1042 rxNode->AddDevice(rxDev);
1043
1044 Ptr<Node> txNode = CreateObject<Node>();
1045 Ptr<WifiNetDevice> txDev = CreateObject<WifiNetDevice>();
1046 m_txPhy = CreateObject<SpectrumWifiPhy>();
1049 m_txPhy->SetAttribute("ChannelSwitchDelay", TimeValue(Seconds(0)));
1050 Ptr<InterferenceHelper> txInterferenceHelper = CreateObject<InterferenceHelper>();
1051 m_txPhy->SetInterferenceHelper(txInterferenceHelper);
1052 Ptr<ErrorRateModel> txErrorModel = CreateObject<NistErrorRateModel>();
1053 m_txPhy->SetErrorRateModel(txErrorModel);
1054 m_txPhy->SetChannel(spectrumChannel);
1055 m_txPhy->SetDevice(txDev);
1056 txDev->SetPhy(m_txPhy);
1057 txNode->AddDevice(txDev);
1058
1059 for (std::size_t i = 0; i < m_numSignalGenerators; ++i)
1060 {
1061 Ptr<Node> signalGeneratorNode = CreateObject<Node>();
1062 Ptr<NonCommunicatingNetDevice> signalGeneratorDev =
1063 CreateObject<NonCommunicatingNetDevice>();
1064 Ptr<WaveformGenerator> signalGenerator = CreateObject<WaveformGenerator>();
1065 signalGenerator->SetDevice(signalGeneratorDev);
1066 signalGenerator->SetChannel(spectrumChannel);
1067 signalGenerator->SetDutyCycle(1);
1068 signalGeneratorNode->AddDevice(signalGeneratorDev);
1069 m_signalGenerators.push_back(signalGenerator);
1070 }
1071}
1072
1073void
1075{
1076 RngSeedManager::SetSeed(1);
1077 RngSeedManager::SetRun(1);
1078 int64_t streamNumber = 0;
1079 m_rxPhy->AssignStreams(streamNumber);
1080 m_txPhy->AssignStreams(streamNumber);
1081
1082 auto channelNum = std::get<0>(*WifiPhyOperatingChannel::FindFirst(0,
1087
1092
1093 std::vector<Time> expectedPer20MhzCcaBusyDurations{};
1094 Time delay = Seconds(0.0);
1095 Simulator::Schedule(delay, &WifiPhyCcaIndicationTest::Reset, this);
1096 delay += Seconds(1.0);
1097
1098 //----------------------------------------------------------------------------------------------------------------------------------
1099 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a signal below the
1100 // energy detection threshold occupies P20
1101 Simulator::Schedule(delay,
1103 this,
1104 "Reception of a signal that occupies P20 below ED threshold");
1105 ScheduleTest(delay,
1106 {{-65.0, MicroSeconds(0), MicroSeconds(100), P20_CENTER_FREQUENCY, 20}},
1107 {},
1108 {
1109 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1110 {MicroSeconds(100) - smallDelta,
1111 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1112 {MicroSeconds(100) + smallDelta,
1113 WifiPhyState::IDLE} // IDLE just after the transmission ends
1114 },
1115 {});
1116 delay += Seconds(1.0);
1117
1118 //----------------------------------------------------------------------------------------------------------------------------------
1119 // Verify PHY state is CCA-BUSY as long as a 20 MHz signal above the energy detection threshold
1120 // occupies P20
1121 Simulator::Schedule(delay,
1123 this,
1124 "Reception of signal that occupies P20 above ED threshold");
1125 ScheduleTest(delay,
1126 {{-60.0, MicroSeconds(0), MicroSeconds(100), P20_CENTER_FREQUENCY, 20}},
1127 {},
1128 {
1129 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1130 {MicroSeconds(100) - smallDelta,
1131 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
1132 {MicroSeconds(100) + smallDelta,
1133 WifiPhyState::IDLE} // IDLE just after the transmission ends
1134 },
1135 {{MicroSeconds(100) - smallDelta,
1136 MicroSeconds(100),
1138 ((m_channelWidth > 20)
1139 ? ((m_channelWidth > 40)
1140 ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(100),
1141 MicroSeconds(0),
1142 MicroSeconds(0),
1143 MicroSeconds(0),
1144 MicroSeconds(0),
1145 MicroSeconds(0),
1146 MicroSeconds(0),
1147 MicroSeconds(0)}
1148 : std::vector<Time>{MicroSeconds(100),
1149 MicroSeconds(0),
1150 MicroSeconds(0),
1151 MicroSeconds(0)})
1152 : std::vector<Time>{MicroSeconds(100), MicroSeconds(0)})
1153 : std::vector<Time>{})}});
1154 delay += Seconds(1.0);
1155
1156 //----------------------------------------------------------------------------------------------------------------------------------
1157 // Verify PHY state is CCA-BUSY as long as the sum of 20 MHz signals occupying P20 is above the
1158 // energy detection threshold
1159 Simulator::Schedule(delay,
1161 this,
1162 "Reception of two 20 MHz signals that occupies P20 below ED threshold with "
1163 "sum above ED threshold");
1165 delay,
1166 {{-64.0, MicroSeconds(0), MicroSeconds(100), P20_CENTER_FREQUENCY, 20},
1167 {-65.0, MicroSeconds(50), MicroSeconds(200), P20_CENTER_FREQUENCY, 20}},
1168 {},
1169 {
1170 {MicroSeconds(50) + aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1171 {MicroSeconds(100) - smallDelta,
1172 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
1173 {MicroSeconds(100) + smallDelta,
1174 WifiPhyState::IDLE} // IDLE just after the transmission ends
1175 },
1176 {{MicroSeconds(100) - smallDelta,
1177 MicroSeconds(100),
1179 ((m_channelWidth > 20)
1180 ? ((m_channelWidth > 40)
1181 ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(50),
1182 MicroSeconds(0),
1183 MicroSeconds(0),
1184 MicroSeconds(0),
1185 MicroSeconds(0),
1186 MicroSeconds(0),
1187 MicroSeconds(0),
1188 MicroSeconds(0)}
1189 : std::vector<Time>{MicroSeconds(50),
1190 MicroSeconds(0),
1191 MicroSeconds(0),
1192 MicroSeconds(0)})
1193 : std::vector<Time>{MicroSeconds(50), MicroSeconds(0)})
1194 : std::vector<Time>{})}});
1195 delay += Seconds(1.0);
1196
1197 //----------------------------------------------------------------------------------------------------------------------------------
1198 // Verify PHY state stays IDLE when a 20 MHz HE SU PPDU with received power below the
1199 // corresponding CCA sensitivity threshold occupies P20
1200 Simulator::Schedule(
1201 delay,
1203 this,
1204 "Reception of a 20 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1205 ScheduleTest(delay,
1206 {},
1207 {{-85.0, MicroSeconds(0), P20_CENTER_FREQUENCY, 20}},
1208 {
1209 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1210 {PpduDurations.at(20) - smallDelta,
1211 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1212 {PpduDurations.at(20) + smallDelta,
1213 WifiPhyState::IDLE} // IDLE just after the transmission ends
1214 },
1215 {});
1216 delay += Seconds(1.0);
1217
1218 //----------------------------------------------------------------------------------------------------------------------------------
1219 // Verify PHY state transitions to CCA-BUSY when an HE SU PPDU with received power above the CCA
1220 // sensitivity threshold occupies P20. The per20Bitmap should indicate idle on the primary 20
1221 // MHz subchannel because received power is below -72 dBm (27.3.20.6.5).
1222 Simulator::Schedule(
1223 delay,
1225 this,
1226 "Reception of a 20 MHz HE PPDU that occupies P20 above CCA sensitivity threshold");
1228 delay,
1229 {},
1230 {{-80.0, MicroSeconds(0), P20_CENTER_FREQUENCY, 20}},
1231 {
1232 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1233 {PpduDurations.at(20) - smallDelta,
1234 WifiPhyState::RX}, // RX just before the transmission ends
1235 {PpduDurations.at(20) + smallDelta,
1236 WifiPhyState::IDLE} // IDLE just after the transmission ends
1237 },
1238 {{aCcaTime,
1239 MicroSeconds(16),
1241 ((m_channelWidth > 20)
1242 ? ((m_channelWidth > 40)
1243 ? ((m_channelWidth > 80)
1244 ? std::vector<Time>{Seconds(0),
1245 Seconds(0),
1246 Seconds(0),
1247 Seconds(0),
1248 Seconds(0),
1249 Seconds(0),
1250 Seconds(0),
1251 Seconds(0)}
1252 : std::vector<Time>{Seconds(0), Seconds(0), Seconds(0), Seconds(0)})
1253 : std::vector<Time>{Seconds(0), Seconds(0)})
1254 : std::vector<Time>{})}});
1255 delay += Seconds(1.0);
1256
1257 //----------------------------------------------------------------------------------------------------------------------------------
1258 // Verify PHY state stays IDLE when a 40 MHz HE SU PPDU with received power below the CCA
1259 // sensitivity threshold occupies P40
1260 Simulator::Schedule(
1261 delay,
1263 this,
1264 "Reception of a 40 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1265 ScheduleTest(delay,
1266 {},
1267 {{-80.0, MicroSeconds(0), P40_CENTER_FREQUENCY, 40}},
1268 {
1269 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1270 {PpduDurations.at(40) - smallDelta,
1271 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1272 {PpduDurations.at(40) + smallDelta,
1273 WifiPhyState::IDLE} // IDLE just after the transmission ends
1274 },
1275 {});
1276 delay += Seconds(1.0);
1277
1278 //----------------------------------------------------------------------------------------------------------------------------------
1279 // Verify PHY state transitions to CCA-BUSY when an HE SU PPDU with received power above the CCA
1280 // sensitivity threshold occupies P40. The per20Bitmap should indicate idle on the primary 20
1281 // MHz subchannel because received power is below -72 dBm (27.3.20.6.5).
1282 Simulator::Schedule(
1283 delay,
1285 this,
1286 "Reception of a 40 MHz HE PPDU that occupies P40 above CCA sensitivity threshold");
1288 delay,
1289 {},
1290 {{-75.0, MicroSeconds(0), P40_CENTER_FREQUENCY, 40}},
1291 {
1292 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1293 {PpduDurations.at(40) - smallDelta,
1294 (m_channelWidth > 20)
1296 : WifiPhyState::CCA_BUSY}, // RX or IDLE just before the transmission ends
1297 {PpduDurations.at(40) + smallDelta,
1298 WifiPhyState::IDLE} // IDLE just after the transmission ends
1299 },
1300 {{aCcaTime,
1301 MicroSeconds(16),
1303 ((m_channelWidth > 20)
1304 ? ((m_channelWidth > 40)
1305 ? ((m_channelWidth > 80)
1306 ? std::vector<Time>{Seconds(0),
1307 Seconds(0),
1308 Seconds(0),
1309 Seconds(0),
1310 Seconds(0),
1311 Seconds(0),
1312 Seconds(0),
1313 Seconds(0)}
1314 : std::vector<Time>{Seconds(0), Seconds(0), Seconds(0), Seconds(0)})
1315 : std::vector<Time>{Seconds(0), Seconds(0)})
1316 : std::vector<Time>{})}});
1317 delay += Seconds(1.0);
1318
1319 if (m_channelWidth > 20)
1320 {
1321 //----------------------------------------------------------------------------------------------------------------------------------
1322 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a 20 MHz signal
1323 // below the energy detection threshold occupies S20
1324 Simulator::Schedule(delay,
1326 this,
1327 "Reception of a 20 MHz signal that occupies S20 below ED threshold");
1328 ScheduleTest(delay,
1329 {{-65.0, MicroSeconds(0), MicroSeconds(100), S20_CENTER_FREQUENCY, 20}},
1330 {},
1331 {
1332 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1333 {MicroSeconds(100) - smallDelta,
1334 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1335 {MicroSeconds(100) + smallDelta,
1336 WifiPhyState::IDLE} // IDLE just after the transmission ends
1337 },
1338 {});
1339 delay += Seconds(1.0);
1340
1341 //----------------------------------------------------------------------------------------------------------------------------------
1342 // Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 20 MHz signal
1343 // above the energy detection threshold occupies S20
1344 Simulator::Schedule(delay,
1346 this,
1347 "Reception of a 20 MHz signal that occupies S20 above ED threshold");
1349 delay,
1350 {{-60.0, MicroSeconds(0), MicroSeconds(100), S20_CENTER_FREQUENCY, 20}},
1351 {},
1352 {
1353 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1354 {MicroSeconds(100) - smallDelta,
1355 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1356 {MicroSeconds(100) + smallDelta,
1357 WifiPhyState::IDLE} // IDLE just after the transmission ends
1358 },
1359 {{MicroSeconds(100) - smallDelta,
1360 MicroSeconds(100),
1362 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1363 MicroSeconds(100),
1364 MicroSeconds(0),
1365 MicroSeconds(0),
1366 MicroSeconds(0),
1367 MicroSeconds(0),
1368 MicroSeconds(0),
1369 MicroSeconds(0)}
1370 : std::vector<Time>{MicroSeconds(0),
1371 MicroSeconds(100),
1372 MicroSeconds(0),
1373 MicroSeconds(0)})
1374 : std::vector<Time>{MicroSeconds(0), MicroSeconds(100)})}});
1375 delay += Seconds(1.0);
1376
1377 //----------------------------------------------------------------------------------------------------------------------------------
1378 // Verify PHY state is CCA-BUSY as long as a 40 MHz signal above the energy detection
1379 // threshold occupies P40
1380 Simulator::Schedule(delay,
1382 this,
1383 "Reception of a 40 MHz signal that occupies P40 above ED threshold");
1385 delay,
1386 {{-55.0, MicroSeconds(0), MicroSeconds(100), P40_CENTER_FREQUENCY, 40}},
1387 {},
1388 {
1389 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1390 {MicroSeconds(100) - smallDelta,
1391 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
1392 {MicroSeconds(100) + smallDelta,
1393 WifiPhyState::IDLE} // IDLE just after the transmission ends
1394 },
1395 {{MicroSeconds(100) - smallDelta,
1396 MicroSeconds(100),
1398 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(100),
1399 MicroSeconds(100),
1400 MicroSeconds(0),
1401 MicroSeconds(0),
1402 MicroSeconds(0),
1403 MicroSeconds(0),
1404 MicroSeconds(0),
1405 MicroSeconds(0)}
1406 : std::vector<Time>{MicroSeconds(100),
1407 MicroSeconds(100),
1408 MicroSeconds(0),
1409 MicroSeconds(0)})
1410 : std::vector<Time>{MicroSeconds(100), MicroSeconds(100)})}});
1411 delay += Seconds(1.0);
1412
1413 //----------------------------------------------------------------------------------------------------------------------------------
1414 // Verify PHY notifies CCA-BUSY for the primary channel while the secondary channel was
1415 // already in CCA-BUSY state
1416 Simulator::Schedule(delay,
1418 this,
1419 "Reception of a signal that occupies S20 followed by the reception of "
1420 "another signal that occupies P20");
1422 delay,
1423 {{-60.0, MicroSeconds(0), MicroSeconds(100), S20_CENTER_FREQUENCY, 20},
1424 {-60.0, MicroSeconds(50), MicroSeconds(100), P20_CENTER_FREQUENCY, 20}},
1425 {},
1426 {
1427 {aCcaTime, WifiPhyState::IDLE}, // state of primary stays idle after aCCATime
1428 {MicroSeconds(50) + aCcaTime,
1429 WifiPhyState::CCA_BUSY}, // state of primary is CCA-BUSY after aCCATime that
1430 // followed the second transmission
1431 {MicroSeconds(50) + MicroSeconds(100) - smallDelta,
1432 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
1433 {MicroSeconds(50) + MicroSeconds(100) + smallDelta,
1434 WifiPhyState::IDLE} // IDLE just after the transmission ends
1435 },
1436 {{aCcaTime, // notification upon reception of the first signal
1437 MicroSeconds(100),
1439 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1440 MicroSeconds(100),
1441 MicroSeconds(0),
1442 MicroSeconds(0),
1443 MicroSeconds(0),
1444 MicroSeconds(0),
1445 MicroSeconds(0),
1446 MicroSeconds(0)}
1447 : std::vector<Time>{MicroSeconds(0),
1448 MicroSeconds(100),
1449 MicroSeconds(0),
1450 MicroSeconds(0)})
1451 : std::vector<Time>{MicroSeconds(0), MicroSeconds(100)})},
1452 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
1453 MicroSeconds(50) + MicroSeconds(100),
1455 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(100),
1456 MicroSeconds(50),
1457 MicroSeconds(0),
1458 MicroSeconds(0),
1459 MicroSeconds(0),
1460 MicroSeconds(0),
1461 MicroSeconds(0),
1462 MicroSeconds(0)}
1463 : std::vector<Time>{MicroSeconds(100),
1464 MicroSeconds(50),
1465 MicroSeconds(0),
1466 MicroSeconds(0)})
1467 : std::vector<Time>{MicroSeconds(100), MicroSeconds(50)})}});
1468 delay += Seconds(1.0);
1469
1470 //----------------------------------------------------------------------------------------------------------------------------------
1471 // Verify PHY updates per-20 MHz CCA durations if a signal arrives on the secondary channel
1472 // while primary is CCA-BUSY
1473 Simulator::Schedule(delay,
1475 this,
1476 "Reception of a signal that occupies P20 followed by the reception of "
1477 "another signal that occupies S20");
1479 delay,
1480 {{-60.0, MicroSeconds(0), MicroSeconds(100), P20_CENTER_FREQUENCY, 20},
1481 {-60.0, MicroSeconds(50), MicroSeconds(100), S20_CENTER_FREQUENCY, 20}},
1482 {},
1483 {
1484 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1485 {MicroSeconds(50) + aCcaTime,
1486 WifiPhyState::CCA_BUSY}, // state of primary is still CCA-BUSY after aCCATime that
1487 // followed the second transmission
1488 {MicroSeconds(100) - smallDelta,
1489 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the first transmission ends
1490 {MicroSeconds(100) + smallDelta,
1491 WifiPhyState::IDLE} // IDLE just after the first transmission ends
1492 },
1493 {{aCcaTime, // notification upon reception of the first signal
1494 MicroSeconds(100),
1496 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(100),
1497 MicroSeconds(0),
1498 MicroSeconds(0),
1499 MicroSeconds(0),
1500 MicroSeconds(0),
1501 MicroSeconds(0),
1502 MicroSeconds(0),
1503 MicroSeconds(0)}
1504 : std::vector<Time>{MicroSeconds(100),
1505 MicroSeconds(0),
1506 MicroSeconds(0),
1507 MicroSeconds(0)})
1508 : std::vector<Time>{MicroSeconds(100), MicroSeconds(0)})},
1509 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
1510 MicroSeconds(100),
1512 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(50),
1513 MicroSeconds(100),
1514 MicroSeconds(0),
1515 MicroSeconds(0),
1516 MicroSeconds(0),
1517 MicroSeconds(0),
1518 MicroSeconds(0),
1519 MicroSeconds(0)}
1520 : std::vector<Time>{MicroSeconds(50),
1521 MicroSeconds(100),
1522 MicroSeconds(0),
1523 MicroSeconds(0)})
1524 : std::vector<Time>{MicroSeconds(50), MicroSeconds(100)})}});
1525 delay += Seconds(1.0);
1526
1527 //----------------------------------------------------------------------------------------------------------------------------------
1528 // Verify PHY state stays IDLE when a 20 MHz HE SU PPDU with received power below the CCA
1529 // sensitivity threshold occupies S40
1530 Simulator::Schedule(
1531 delay,
1533 this,
1534 "Reception of a 20 MHz HE PPDU that occupies S20 below CCA sensitivity threshold");
1535 ScheduleTest(delay,
1536 {},
1537 {{-75.0, MicroSeconds(0), S20_CENTER_FREQUENCY, 20}},
1538 {
1539 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1540 {PpduDurations.at(20) - smallDelta,
1541 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1542 {PpduDurations.at(20) + smallDelta,
1543 WifiPhyState::IDLE} // IDLE just after the transmission ends
1544 },
1545 {});
1546 delay += Seconds(1.0);
1547
1548 //----------------------------------------------------------------------------------------------------------------------------------
1549 // Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 20 MHz HE SU PPDU
1550 // with received power above the CCA sensitivity threshold occupies S20
1551 Simulator::Schedule(
1552 delay,
1554 this,
1555 "Reception of a 20 MHz HE PPDU that occupies S20 above CCA sensitivity threshold");
1556 ScheduleTest(delay,
1557 {},
1558 {{-70.0, MicroSeconds(0), S20_CENTER_FREQUENCY, 20}},
1559 {
1560 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1561 {PpduDurations.at(20) - smallDelta,
1562 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1563 {PpduDurations.at(20) + smallDelta,
1564 WifiPhyState::IDLE} // IDLE just after the transmission ends
1565 },
1566 {{aCcaTime,
1567 PpduDurations.at(20),
1569 ((m_channelWidth > 40)
1570 ? ((m_channelWidth > 80) ? std::vector<Time>{NanoSeconds(0),
1571 PpduDurations.at(20),
1572 NanoSeconds(0),
1573 NanoSeconds(0),
1574 NanoSeconds(0),
1575 NanoSeconds(0),
1576 NanoSeconds(0),
1577 NanoSeconds(0)}
1578 : std::vector<Time>{NanoSeconds(0),
1579 PpduDurations.at(20),
1580 NanoSeconds(0),
1581 NanoSeconds(0)})
1582 : std::vector<Time>{NanoSeconds(0), PpduDurations.at(20)})}});
1583 delay += Seconds(1.0);
1584
1585 //----------------------------------------------------------------------------------------------------------------------------------
1586 // Verify PHY state stays IDLE but CCA-BUSY indication is still reported as long as a signal
1587 // above the energy detection threshold occupies the S20 while a 40 MHz PPDU below the CCA
1588 // sensitivity threshold is received on P40.
1589 Simulator::Schedule(
1590 delay,
1592 this,
1593 "Reception of a 20 MHz signal that occupies S20 above ED threshold followed by a 40 "
1594 "MHz HE PPDU that occupies P40 below CCA sensitivity threshold");
1596 delay,
1597 {{-60.0,
1598 MicroSeconds(0),
1599 MicroSeconds(100),
1601 20}}, // signal on S20 above threshold
1602 {{-80.0, MicroSeconds(50), P40_CENTER_FREQUENCY, 40}}, // PPDU on P40 below threshold
1603 {
1604 {MicroSeconds(50) + aCcaTime, WifiPhyState::IDLE}, // PHY state stays IDLE
1605 },
1606 {{MicroSeconds(50) - smallDelta,
1607 MicroSeconds(100),
1609 ((m_channelWidth > 20)
1610 ? ((m_channelWidth > 40)
1611 ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1612 MicroSeconds(100),
1613 MicroSeconds(0),
1614 MicroSeconds(0),
1615 MicroSeconds(0),
1616 MicroSeconds(0),
1617 MicroSeconds(0),
1618 MicroSeconds(0)}
1619 : std::vector<Time>{MicroSeconds(0),
1620 MicroSeconds(100),
1621 MicroSeconds(0),
1622 MicroSeconds(0)})
1623 : std::vector<Time>{MicroSeconds(0), MicroSeconds(100)})
1624 : std::vector<Time>{})},
1625 {MicroSeconds(100) - smallDelta,
1626 MicroSeconds(100),
1628 ((m_channelWidth > 40) ? ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1629 MicroSeconds(46),
1630 MicroSeconds(0),
1631 MicroSeconds(0),
1632 MicroSeconds(0),
1633 MicroSeconds(0),
1634 MicroSeconds(0),
1635 MicroSeconds(0)}
1636 : std::vector<Time>{MicroSeconds(0),
1637 MicroSeconds(46),
1638 MicroSeconds(0),
1639 MicroSeconds(0)})
1640 : std::vector<Time>{MicroSeconds(0), MicroSeconds(46)})}});
1641 delay += Seconds(1.0);
1642 }
1643
1644 if (m_channelWidth > 40)
1645 {
1646 //----------------------------------------------------------------------------------------------------------------------------------
1647 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a signal below
1648 // the energy detection threshold occupies S40
1649 Simulator::Schedule(delay,
1651 this,
1652 "Reception of a 20 MHz signal that occupies the first subchannel of "
1653 "S40 below ED threshold");
1654 ScheduleTest(delay,
1655 {{-65.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY - 10, 20}},
1656 {},
1657 {
1658 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1659 {MicroSeconds(100) - smallDelta,
1660 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1661 {MicroSeconds(100) + smallDelta,
1662 WifiPhyState::IDLE} // IDLE just after the transmission ends
1663 },
1664 {});
1665 delay += Seconds(1.0);
1666
1667 //----------------------------------------------------------------------------------------------------------------------------------
1668 // Verify PHY notifies CCA-BUSY for the S40 as long as a signal above the energy detection
1669 // threshold occupies the first 20 MHz subchannel of the S40: 27.3.20.6.4: Any signal within
1670 // the secondary 40 MHz channel at or above a threshold of –59 dBm within a period of
1671 // aCCATime after the signal arrives at the receiver’s antenna(s).
1672 Simulator::Schedule(delay,
1674 this,
1675 "Reception of a 20 MHz signal that occupies the first subchannel of "
1676 "S40 above ED threshold");
1677 ScheduleTest(delay,
1678 {{-55.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY - 10, 20}},
1679 {},
1680 {
1681 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1682 {MicroSeconds(100) - smallDelta,
1683 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1684 {MicroSeconds(100) + smallDelta,
1685 WifiPhyState::IDLE} // IDLE just after the transmission ends
1686 },
1687 {{MicroSeconds(100) - smallDelta,
1688 MicroSeconds(100),
1690 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1691 MicroSeconds(0),
1692 MicroSeconds(100),
1693 MicroSeconds(0),
1694 MicroSeconds(0),
1695 MicroSeconds(0),
1696 MicroSeconds(0),
1697 MicroSeconds(0)}
1698 : std::vector<Time>{MicroSeconds(0),
1699 MicroSeconds(0),
1700 MicroSeconds(100),
1701 MicroSeconds(0)})}});
1702 delay += Seconds(1.0);
1703
1704 //----------------------------------------------------------------------------------------------------------------------------------
1705 // Verify PHY state stays IDLE for the S40 if a signal below the energy detection threshold
1706 // occupies the second 20 MHz subchannel of the S40
1707 Simulator::Schedule(delay,
1709 this,
1710 "Reception of a 20 MHz signal that occupies the second subchannel of "
1711 "S40 below ED threshold");
1712 ScheduleTest(delay,
1713 {{-65.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY + 10, 20}},
1714 {},
1715 {
1716 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1717 {MicroSeconds(100) - smallDelta,
1718 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1719 {MicroSeconds(100) + smallDelta,
1720 WifiPhyState::IDLE} // IDLE just after the transmission ends
1721 },
1722 {});
1723 delay += Seconds(1.0);
1724
1725 //----------------------------------------------------------------------------------------------------------------------------------
1726 // Verify PHY notifies CCA-BUSY for the S40 as long as a signal above the energy detection
1727 // threshold occupies the second 20 MHz subchannel of the S40: 27.3.20.6.4: Any signal
1728 // within the secondary 40 MHz channel at or above a threshold of –59 dBm within a period of
1729 // aCCATime after the signal arrives at the receiver’s antenna(s).
1730 Simulator::Schedule(delay,
1732 this,
1733 "Reception of a 20 MHz signal that occupies the second subchannel of "
1734 "S40 above ED threshold");
1735 ScheduleTest(delay,
1736 {{-55.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY + 10, 20}},
1737 {},
1738 {
1739 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1740 {MicroSeconds(100) - smallDelta,
1741 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1742 {MicroSeconds(100) + smallDelta,
1743 WifiPhyState::IDLE} // IDLE just after the transmission ends
1744 },
1745 {{MicroSeconds(100) - smallDelta,
1746 MicroSeconds(100),
1748 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1749 MicroSeconds(0),
1750 MicroSeconds(0),
1751 MicroSeconds(100),
1752 MicroSeconds(0),
1753 MicroSeconds(0),
1754 MicroSeconds(0),
1755 MicroSeconds(0)}
1756 : std::vector<Time>{MicroSeconds(0),
1757 MicroSeconds(0),
1758 MicroSeconds(0),
1759 MicroSeconds(100)})}});
1760 delay += Seconds(1.0);
1761
1762 //----------------------------------------------------------------------------------------------------------------------------------
1763 // Verify PHY state stays IDLE for the S40 if a signal below the energy detection threshold
1764 // occupies S40
1765 Simulator::Schedule(delay,
1767 this,
1768 "Reception of a 40 MHz signal that occupies S40 below ED threshold");
1769 ScheduleTest(delay,
1770 {{-60.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY, 40}},
1771 {},
1772 {
1773 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1774 {MicroSeconds(100) - smallDelta,
1775 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1776 {MicroSeconds(100) + smallDelta,
1777 WifiPhyState::IDLE} // IDLE just after the transmission ends
1778 },
1779 {});
1780 delay += Seconds(1.0);
1781
1782 //----------------------------------------------------------------------------------------------------------------------------------
1783 // Verify PHY notifies CCA-BUSY for the S40 as long as a signal above the energy detection
1784 // threshold occupies S40: 27.3.20.6.4: Any signal within the secondary 40 MHz channel at or
1785 // above a threshold of –59 dBm within a period of aCCATime after the signal arrives at the
1786 // receiver’s antenna(s).
1787 Simulator::Schedule(delay,
1789 this,
1790 "Reception of a 20 MHz signal that occupies the second subchannel of "
1791 "S40 above ED threshold");
1792 ScheduleTest(delay,
1793 {{-55.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY, 40}},
1794 {},
1795 {
1796 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1797 {MicroSeconds(100) - smallDelta,
1798 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1799 {MicroSeconds(100) + smallDelta,
1800 WifiPhyState::IDLE} // IDLE just after the transmission ends
1801 },
1802 {{MicroSeconds(100) - smallDelta,
1803 MicroSeconds(100),
1805 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1806 MicroSeconds(0),
1807 MicroSeconds(100),
1808 MicroSeconds(100),
1809 MicroSeconds(0),
1810 MicroSeconds(0),
1811 MicroSeconds(0),
1812 MicroSeconds(0)}
1813 : std::vector<Time>{MicroSeconds(0),
1814 MicroSeconds(0),
1815 MicroSeconds(100),
1816 MicroSeconds(100)})}});
1817 delay += Seconds(1.0);
1818
1819 //----------------------------------------------------------------------------------------------------------------------------------
1820 // Verify PHY state is CCA-BUSY as long as a 80 MHz signal above the energy detection
1821 // threshold occupies P80
1822 Simulator::Schedule(delay,
1824 this,
1825 "Reception of a 80 MHz signal that occupies P80 above ED threshold");
1826 ScheduleTest(delay,
1827 {{-55.0, MicroSeconds(0), MicroSeconds(100), P80_CENTER_FREQUENCY, 80}},
1828 {},
1829 {
1830 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
1831 {MicroSeconds(100) - smallDelta,
1832 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
1833 {MicroSeconds(100) + smallDelta,
1834 WifiPhyState::IDLE} // IDLE just after the transmission ends
1835 },
1836 {{MicroSeconds(100) - smallDelta,
1837 MicroSeconds(100),
1839 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(100),
1840 MicroSeconds(100),
1841 MicroSeconds(100),
1842 MicroSeconds(100),
1843 MicroSeconds(0),
1844 MicroSeconds(0),
1845 MicroSeconds(0),
1846 MicroSeconds(0)}
1847 : std::vector<Time>{MicroSeconds(100),
1848 MicroSeconds(100),
1849 MicroSeconds(100),
1850 MicroSeconds(100)})}});
1851 delay += Seconds(1.0);
1852
1853 //----------------------------------------------------------------------------------------------------------------------------------
1854 // Verify PHY notifies CCA-BUSY for the P20 channel while the S40 channel was already in
1855 // CCA-BUSY state
1856 Simulator::Schedule(delay,
1858 this,
1859 "Reception of a 20 MHz signal that occupies S40 followed by the "
1860 "reception of another 20 MHz signal that occupies P20");
1862 delay,
1863 {{-55.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY - 10, 20},
1864 {-55.0, MicroSeconds(50), MicroSeconds(100), P20_CENTER_FREQUENCY, 20}},
1865 {},
1866 {
1867 {aCcaTime, WifiPhyState::IDLE}, // state of primary stays idle after aCCATime
1868 {MicroSeconds(50) + aCcaTime,
1869 WifiPhyState::CCA_BUSY}, // state of primary is CCA-BUSY after aCCATime that
1870 // followed the second transmission
1871 {MicroSeconds(50) + MicroSeconds(100) - smallDelta,
1872 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
1873 {MicroSeconds(50) + MicroSeconds(100) + smallDelta,
1874 WifiPhyState::IDLE} // IDLE just after the transmission ends
1875 },
1876 {{aCcaTime, // notification upon reception of the first signal
1877 MicroSeconds(100),
1879 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1880 MicroSeconds(0),
1881 MicroSeconds(100),
1882 MicroSeconds(0),
1883 MicroSeconds(0),
1884 MicroSeconds(0),
1885 MicroSeconds(0),
1886 MicroSeconds(0)}
1887 : std::vector<Time>{MicroSeconds(0),
1888 MicroSeconds(0),
1889 MicroSeconds(100),
1890 MicroSeconds(0)})},
1891 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
1892 MicroSeconds(50) + MicroSeconds(100),
1894 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(100),
1895 MicroSeconds(0),
1896 MicroSeconds(50),
1897 MicroSeconds(0),
1898 MicroSeconds(0),
1899 MicroSeconds(0),
1900 MicroSeconds(0),
1901 MicroSeconds(0)}
1902 : std::vector<Time>{MicroSeconds(100),
1903 MicroSeconds(0),
1904 MicroSeconds(50),
1905 MicroSeconds(0)})}});
1906 delay += Seconds(1.0);
1907
1908 //----------------------------------------------------------------------------------------------------------------------------------
1909 // Verify PHY state stays IDLE but notifies CCA-BUSY for the S20 channel while the S40
1910 // channel was already in CCA-BUSY state
1911 Simulator::Schedule(delay,
1913 this,
1914 "Reception of a signal that occupies S40 followed by the reception of "
1915 "another signal that occupies S20");
1917 delay,
1918 {{-55.0, MicroSeconds(0), MicroSeconds(100), S40_CENTER_FREQUENCY - 10, 20},
1919 {-55.0, MicroSeconds(50), MicroSeconds(100), S20_CENTER_FREQUENCY, 20}},
1920 {},
1921 {
1922 {aCcaTime, WifiPhyState::IDLE}, // state of primary stays idle after aCCATime
1923 {MicroSeconds(50) + aCcaTime, WifiPhyState::IDLE}, // state of primary stays IDLE
1924 {MicroSeconds(50) + MicroSeconds(100) - smallDelta,
1925 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1926 {MicroSeconds(50) + MicroSeconds(100) + smallDelta,
1927 WifiPhyState::IDLE} // IDLE just after the transmission ends
1928 },
1929 {{aCcaTime, // notification upon reception of the first signal
1930 MicroSeconds(100),
1932 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1933 MicroSeconds(0),
1934 MicroSeconds(100),
1935 MicroSeconds(0),
1936 MicroSeconds(0),
1937 MicroSeconds(0),
1938 MicroSeconds(0),
1939 MicroSeconds(0)}
1940 : std::vector<Time>{MicroSeconds(0),
1941 MicroSeconds(0),
1942 MicroSeconds(100),
1943 MicroSeconds(0)})},
1944 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
1945 MicroSeconds(50) + MicroSeconds(100),
1947 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
1948 MicroSeconds(100),
1949 MicroSeconds(50),
1950 MicroSeconds(0),
1951 MicroSeconds(0),
1952 MicroSeconds(0),
1953 MicroSeconds(0),
1954 MicroSeconds(0)}
1955 : std::vector<Time>{MicroSeconds(0),
1956 MicroSeconds(100),
1957 MicroSeconds(50),
1958 MicroSeconds(0)})}});
1959 delay += Seconds(1.0);
1960
1961 //----------------------------------------------------------------------------------------------------------------------------------
1962 // Verify PHY state stays IDLE when a 40 MHz HE SU PPDU with received power below the CCA
1963 // sensitivity threshold occupies S40
1964 Simulator::Schedule(
1965 delay,
1967 this,
1968 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
1969 ScheduleTest(delay,
1970 {},
1971 {{-75.0, MicroSeconds(0), S40_CENTER_FREQUENCY, 40}},
1972 {
1973 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1974 {PpduDurations.at(20) - smallDelta,
1975 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1976 {PpduDurations.at(20) + smallDelta,
1977 WifiPhyState::IDLE} // IDLE just after the transmission ends
1978 },
1979 {});
1980 delay += Seconds(1.0);
1981
1982 //----------------------------------------------------------------------------------------------------------------------------------
1983 // Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 40 MHz HE SU PPDU
1984 // with received power above the CCA sensitivity threshold occupies S40
1985 Simulator::Schedule(
1986 delay,
1988 this,
1989 "Reception of a 40 MHz HE PPDU that occupies S40 above CCA sensitivity threshold");
1990 ScheduleTest(delay,
1991 {},
1992 {{-70.0, MicroSeconds(0), S40_CENTER_FREQUENCY, 40}},
1993 {
1994 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
1995 {PpduDurations.at(40) - smallDelta,
1996 WifiPhyState::IDLE}, // IDLE just before the transmission ends
1997 {PpduDurations.at(40) + smallDelta,
1998 WifiPhyState::IDLE} // IDLE just after the transmission ends
1999 },
2000 {{aCcaTime,
2001 PpduDurations.at(40),
2003 ((m_channelWidth > 80) ? std::vector<Time>{NanoSeconds(0),
2004 NanoSeconds(0),
2005 PpduDurations.at(40),
2006 PpduDurations.at(40),
2007 NanoSeconds(0),
2008 NanoSeconds(0),
2009 NanoSeconds(0),
2010 NanoSeconds(0)}
2011 : std::vector<Time>{NanoSeconds(0),
2012 NanoSeconds(0),
2013 PpduDurations.at(40),
2014 PpduDurations.at(40)})}});
2015 delay += Seconds(1.0);
2016
2017 //----------------------------------------------------------------------------------------------------------------------------------
2018 // Verify PHY state stays IDLE but CCA-BUSY indication is still reported as long as a signal
2019 // above the energy detection threshold occupies the S40 while a 80 MHz PPDU below the CCA
2020 // sensitivity threshold is received on P80.
2021 Simulator::Schedule(
2022 delay,
2024 this,
2025 "Reception of a 40 MHz signal that occupies S40 above ED threshold followed by a 80 "
2026 "MHz HE PPDU that occupies P80 below CCA sensitivity threshold");
2028 delay,
2029 {{-55.0,
2030 MicroSeconds(0),
2031 MicroSeconds(100),
2033 40}}, // signal on S40 above threshold
2034 {{-80.0, MicroSeconds(50), P80_CENTER_FREQUENCY, 80}}, // PPDU on P80 below threshold
2035 {
2036 {MicroSeconds(50) + aCcaTime, WifiPhyState::IDLE}, // PHY state stays IDLE
2037 },
2038 {{MicroSeconds(50) - smallDelta,
2039 MicroSeconds(100),
2041 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
2042 MicroSeconds(0),
2043 MicroSeconds(100),
2044 MicroSeconds(100),
2045 MicroSeconds(0),
2046 MicroSeconds(0),
2047 MicroSeconds(0),
2048 MicroSeconds(0)}
2049 : std::vector<Time>{MicroSeconds(0),
2050 MicroSeconds(0),
2051 MicroSeconds(100),
2052 MicroSeconds(100)})},
2053 {MicroSeconds(100) - smallDelta,
2054 MicroSeconds(100),
2056 ((m_channelWidth > 80) ? std::vector<Time>{MicroSeconds(0),
2057 MicroSeconds(0),
2058 MicroSeconds(46),
2059 MicroSeconds(46),
2060 MicroSeconds(0),
2061 MicroSeconds(0),
2062 MicroSeconds(0),
2063 MicroSeconds(0)}
2064 : std::vector<Time>{MicroSeconds(0),
2065 MicroSeconds(0),
2066 MicroSeconds(46),
2067 MicroSeconds(46)})}});
2068 delay += Seconds(1.0);
2069 }
2070 else // 20 or 40 MHz receiver
2071 {
2072 //----------------------------------------------------------------------------------------------------------------------------------
2073 // Verify PHY notifies CCA-BUSY when a 80 MHz HE SU PPDU with received power above the CCA
2074 // sensitivity threshold occupies P40 The per20Bitmap should indicate idle for all
2075 // subchannels because received power is below -62 dBm (27.3.20.6.5).
2076 Simulator::Schedule(delay,
2078 this,
2079 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA "
2080 "sensitivity threshold");
2081 ScheduleTest(delay,
2082 {},
2083 {{-70.0, MicroSeconds(0), P80_CENTER_FREQUENCY, 80}},
2084 {
2085 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA_BUSY after aCCATime
2086 {PpduDurations.at(80) - smallDelta,
2087 WifiPhyState::CCA_BUSY}, // CCA_BUSY just before the transmission ends
2088 {PpduDurations.at(80) + smallDelta,
2089 WifiPhyState::IDLE} // IDLE just after the transmission ends
2090 },
2091 {{aCcaTime,
2092 MicroSeconds(16),
2094 ((m_channelWidth > 20)
2095 ? ((m_channelWidth > 40)
2096 ? ((m_channelWidth > 80) ? std::vector<Time>{Seconds(0),
2097 Seconds(0),
2098 Seconds(0),
2099 Seconds(0),
2100 Seconds(0),
2101 Seconds(0),
2102 Seconds(0),
2103 Seconds(0)}
2104 : std::vector<Time>{Seconds(0),
2105 Seconds(0),
2106 Seconds(0),
2107 Seconds(0)})
2108 : std::vector<Time>{Seconds(0), Seconds(0)})
2109 : std::vector<Time>{})},
2110 {PpduDurations.at(80) - smallDelta,
2111 PpduDurations.at(80),
2113 ((m_channelWidth > 20)
2114 ? ((m_channelWidth > 40)
2115 ? ((m_channelWidth > 80) ? std::vector<Time>{Seconds(0),
2116 Seconds(0),
2117 Seconds(0),
2118 Seconds(0),
2119 Seconds(0),
2120 Seconds(0),
2121 Seconds(0),
2122 Seconds(0)}
2123 : std::vector<Time>{Seconds(0),
2124 Seconds(0),
2125 Seconds(0),
2126 Seconds(0)})
2127 : std::vector<Time>{Seconds(0), Seconds(0)})
2128 : std::vector<Time>{})}});
2129 delay += Seconds(1.0);
2130
2131 //----------------------------------------------------------------------------------------------------------------------------------
2132 // Verify PHY notifies CCA-BUSY when a 80 MHz HE SU PPDU with received power above the CCA
2133 // sensitivity threshold occupies P40 The per20Bitmap should indicate CCA_BUSY for all
2134 // subchannels because received power is above -62 dBm (27.3.20.6.5).
2135 Simulator::Schedule(delay,
2137 this,
2138 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA "
2139 "sensitivity threshold");
2141 delay,
2142 {},
2143 {{-55.0, MicroSeconds(0), P80_CENTER_FREQUENCY, 80}},
2144 {
2145 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA_BUSY after aCCATime
2146 {PpduDurations.at(80) - smallDelta,
2147 WifiPhyState::CCA_BUSY}, // CCA_BUSY just before the transmission ends
2148 {PpduDurations.at(80) + smallDelta,
2149 WifiPhyState::IDLE} // IDLE just after the transmission ends
2150 },
2151 {{aCcaTime,
2152 MicroSeconds(16),
2154 ((m_channelWidth > 20)
2155 ? ((m_channelWidth > 40)
2156 ? ((m_channelWidth > 80) ? std::vector<Time>{NanoSeconds(271200),
2157 NanoSeconds(271200),
2158 NanoSeconds(271200),
2159 NanoSeconds(271200),
2160 NanoSeconds(0),
2161 NanoSeconds(0),
2162 NanoSeconds(0),
2163 NanoSeconds(0)}
2164 : std::vector<Time>{NanoSeconds(271200),
2165 NanoSeconds(271200),
2166 NanoSeconds(271200),
2167 NanoSeconds(271200)})
2168 : std::vector<Time>{NanoSeconds(271200), NanoSeconds(271200)})
2169 : std::vector<Time>{})},
2170 {PpduDurations.at(80) - smallDelta,
2171 PpduDurations.at(80),
2173 ((m_channelWidth > 20)
2174 ? ((m_channelWidth > 40)
2175 ? ((m_channelWidth > 80) ? std::vector<Time>{NanoSeconds(243200),
2176 NanoSeconds(243200),
2177 NanoSeconds(243200),
2178 NanoSeconds(243200),
2179 NanoSeconds(0),
2180 NanoSeconds(0),
2181 NanoSeconds(0),
2182 NanoSeconds(0)}
2183 : std::vector<Time>{NanoSeconds(243200),
2184 NanoSeconds(243200),
2185 NanoSeconds(243200),
2186 NanoSeconds(243200)})
2187 : std::vector<Time>{NanoSeconds(243200), NanoSeconds(243200)})
2188 : std::vector<Time>{})}});
2189 delay += Seconds(1.0);
2190
2191 //----------------------------------------------------------------------------------------------------------------------------------
2192 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a signal not
2193 // occupying the operational channel is being received
2194 Simulator::Schedule(
2195 delay,
2197 this,
2198 "Reception of a 40 MHz HE PPDU that does not occupy the operational channel");
2199 ScheduleTest(delay,
2200 {},
2201 {{-50.0, MicroSeconds(0), S40_CENTER_FREQUENCY, 40}},
2202 {
2203 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2204 {PpduDurations.at(20) - smallDelta,
2205 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2206 {PpduDurations.at(20) + smallDelta,
2207 WifiPhyState::IDLE} // IDLE just after the transmission ends
2208 },
2209 {});
2210 delay += Seconds(1.0);
2211 }
2212
2213 if (m_channelWidth > 80)
2214 {
2215 //----------------------------------------------------------------------------------------------------------------------------------
2216 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2217 // energy detection threshold occupies the first 20 MHz subchannel of the S80
2218 Simulator::Schedule(delay,
2220 this,
2221 "Reception of a 20 MHz signal that occupies the first subchannel of "
2222 "S80 below ED threshold");
2223 ScheduleTest(delay,
2224 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 30, 20}},
2225 {},
2226 {
2227 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2228 {MicroSeconds(100) - smallDelta,
2229 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2230 {MicroSeconds(100) + smallDelta,
2231 WifiPhyState::IDLE} // IDLE just after the transmission ends
2232 },
2233 {});
2234 delay += Seconds(1.0);
2235
2236 //----------------------------------------------------------------------------------------------------------------------------------
2237 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2238 // energy detection threshold occupies the first 20 MHz subchannel of the S80 27.3.20.6.4:
2239 // Any signal within the secondary 80 MHz channel at or above –56 dBm.
2240 Simulator::Schedule(delay,
2242 this,
2243 "Reception of a 20 MHz signal that occupies the first subchannel of "
2244 "S80 above ED threshold");
2245 ScheduleTest(delay,
2246 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 30, 20}},
2247 {},
2248 {
2249 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2250 {MicroSeconds(100) - smallDelta,
2251 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2252 {MicroSeconds(100) + smallDelta,
2253 WifiPhyState::IDLE} // IDLE just after the transmission ends
2254 },
2255 {{MicroSeconds(100) - smallDelta,
2256 MicroSeconds(100),
2258 std::vector<Time>{MicroSeconds(0),
2259 MicroSeconds(0),
2260 MicroSeconds(0),
2261 MicroSeconds(0),
2262 MicroSeconds(100),
2263 MicroSeconds(0),
2264 MicroSeconds(0),
2265 MicroSeconds(0)}}});
2266 delay += Seconds(1.0);
2267
2268 //----------------------------------------------------------------------------------------------------------------------------------
2269 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2270 // energy detection threshold occupies the second 20 MHz subchannel of the S80
2271 Simulator::Schedule(delay,
2273 this,
2274 "Reception of a 20 MHz signal that occupies the second subchannel of "
2275 "S80 below ED threshold");
2276 ScheduleTest(delay,
2277 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 10, 20}},
2278 {},
2279 {
2280 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2281 {MicroSeconds(100) - smallDelta,
2282 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2283 {MicroSeconds(100) + smallDelta,
2284 WifiPhyState::IDLE} // IDLE just after the transmission ends
2285 },
2286 {});
2287 delay += Seconds(1.0);
2288
2289 //----------------------------------------------------------------------------------------------------------------------------------
2290 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2291 // energy detection threshold occupies the second 20 MHz subchannel of the S80 27.3.20.6.4:
2292 // Any signal within the secondary 80 MHz channel at or above –56 dBm.
2293 Simulator::Schedule(delay,
2295 this,
2296 "Reception of a 20 MHz signal that occupies the second subchannel of "
2297 "S80 above ED threshold");
2298 ScheduleTest(delay,
2299 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 10, 20}},
2300 {},
2301 {
2302 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2303 {MicroSeconds(100) - smallDelta,
2304 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2305 {MicroSeconds(100) + smallDelta,
2306 WifiPhyState::IDLE} // IDLE just after the transmission ends
2307 },
2308 {{MicroSeconds(100) - smallDelta,
2309 MicroSeconds(100),
2311 std::vector<Time>{MicroSeconds(0),
2312 MicroSeconds(0),
2313 MicroSeconds(0),
2314 MicroSeconds(0),
2315 MicroSeconds(0),
2316 MicroSeconds(100),
2317 MicroSeconds(0),
2318 MicroSeconds(0)}}});
2319 delay += Seconds(1.0);
2320
2321 //----------------------------------------------------------------------------------------------------------------------------------
2322 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2323 // energy detection threshold occupies the third 20 MHz subchannel of the S80
2324 Simulator::Schedule(delay,
2326 this,
2327 "Reception of a 20 MHz signal that occupies the third subchannel of "
2328 "S80 below ED threshold");
2329 ScheduleTest(delay,
2330 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 10, 20}},
2331 {},
2332 {
2333 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2334 {MicroSeconds(100) - smallDelta,
2335 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2336 {MicroSeconds(100) + smallDelta,
2337 WifiPhyState::IDLE} // IDLE just after the transmission ends
2338 },
2339 {});
2340 delay += Seconds(1.0);
2341
2342 //----------------------------------------------------------------------------------------------------------------------------------
2343 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2344 // energy detection threshold occupies the third 20 MHz subchannel of the S80 27.3.20.6.4:
2345 // Any signal within the secondary 80 MHz channel at or above –56 dBm.
2346 Simulator::Schedule(delay,
2348 this,
2349 "Reception of a 20 MHz signal that occupies the third subchannel of "
2350 "S80 above ED threshold");
2351 ScheduleTest(delay,
2352 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 10, 20}},
2353 {},
2354 {
2355 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2356 {MicroSeconds(100) - smallDelta,
2357 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2358 {MicroSeconds(100) + smallDelta,
2359 WifiPhyState::IDLE} // IDLE just after the transmission ends
2360 },
2361 {{MicroSeconds(100) - smallDelta,
2362 MicroSeconds(100),
2364 std::vector<Time>{MicroSeconds(0),
2365 MicroSeconds(0),
2366 MicroSeconds(0),
2367 MicroSeconds(0),
2368 MicroSeconds(0),
2369 MicroSeconds(0),
2370 MicroSeconds(100),
2371 MicroSeconds(0)}}});
2372 delay += Seconds(1.0);
2373
2374 //----------------------------------------------------------------------------------------------------------------------------------
2375 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2376 // energy detection threshold occupies the fourth 20 MHz subchannel of the S80
2377 Simulator::Schedule(delay,
2379 this,
2380 "Reception of a 20 MHz signal that occupies the fourth subchannel of "
2381 "S80 below ED threshold");
2382 ScheduleTest(delay,
2383 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 30, 20}},
2384 {},
2385 {
2386 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2387 {MicroSeconds(100) - smallDelta,
2388 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2389 {MicroSeconds(100) + smallDelta,
2390 WifiPhyState::IDLE} // IDLE just after the transmission ends
2391 },
2392 {});
2393 delay += Seconds(1.0);
2394
2395 //----------------------------------------------------------------------------------------------------------------------------------
2396 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2397 // energy detection threshold occupies the fourth 20 MHz subchannel of the S80 27.3.20.6.4:
2398 // Any signal within the secondary 80 MHz channel at or above –56 dBm.
2399 Simulator::Schedule(delay,
2401 this,
2402 "Reception of a 20 MHz signal that occupies the fourth subchannel of "
2403 "S80 above ED threshold");
2404 ScheduleTest(delay,
2405 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 30, 20}},
2406 {},
2407 {
2408 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2409 {MicroSeconds(100) - smallDelta,
2410 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2411 {MicroSeconds(100) + smallDelta,
2412 WifiPhyState::IDLE} // IDLE just after the transmission ends
2413 },
2414 {{MicroSeconds(100) - smallDelta,
2415 MicroSeconds(100),
2417 std::vector<Time>{MicroSeconds(0),
2418 MicroSeconds(0),
2419 MicroSeconds(0),
2420 MicroSeconds(0),
2421 MicroSeconds(0),
2422 MicroSeconds(0),
2423 MicroSeconds(0),
2424 MicroSeconds(100)}}});
2425 delay += Seconds(1.0);
2426
2427 //----------------------------------------------------------------------------------------------------------------------------------
2428 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2429 // energy detection threshold occupies the first and second 20 MHz subchannels of the S80
2430 Simulator::Schedule(delay,
2432 this,
2433 "Reception of a 40 MHz signal that occupies the first and second "
2434 "subchannels of S80 below ED threshold");
2435 ScheduleTest(delay,
2436 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 20, 40}},
2437 {},
2438 {
2439 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2440 {MicroSeconds(100) - smallDelta,
2441 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2442 {MicroSeconds(100) + smallDelta,
2443 WifiPhyState::IDLE} // IDLE just after the transmission ends
2444 },
2445 {});
2446 delay += Seconds(1.0);
2447
2448 //----------------------------------------------------------------------------------------------------------------------------------
2449 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2450 // energy detection threshold occupies the first and second 20 MHz subchannels of the S80
2451 // 27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
2452 Simulator::Schedule(delay,
2454 this,
2455 "Reception of a 40 MHz signal that occupies the first and second "
2456 "subchannels of S80 above ED threshold");
2457 ScheduleTest(delay,
2458 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 20, 40}},
2459 {},
2460 {
2461 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2462 {MicroSeconds(100) - smallDelta,
2463 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2464 {MicroSeconds(100) + smallDelta,
2465 WifiPhyState::IDLE} // IDLE just after the transmission ends
2466 },
2467 {{MicroSeconds(100) - smallDelta,
2468 MicroSeconds(100),
2470 std::vector<Time>{MicroSeconds(0),
2471 MicroSeconds(0),
2472 MicroSeconds(0),
2473 MicroSeconds(0),
2474 MicroSeconds(100),
2475 MicroSeconds(100),
2476 MicroSeconds(0),
2477 MicroSeconds(0)}}});
2478 delay += Seconds(1.0);
2479
2480 //----------------------------------------------------------------------------------------------------------------------------------
2481 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2482 // energy detection threshold occupies the third and fourth 20 MHz subchannels of the S80
2483 Simulator::Schedule(delay,
2485 this,
2486 "Reception of a 40 MHz signal that occupies the third and fourth "
2487 "subchannels of S80 below ED threshold");
2488 ScheduleTest(delay,
2489 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 20, 40}},
2490 {},
2491 {
2492 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2493 {MicroSeconds(100) - smallDelta,
2494 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2495 {MicroSeconds(100) + smallDelta,
2496 WifiPhyState::IDLE} // IDLE just after the transmission ends
2497 },
2498 {});
2499 delay += Seconds(1.0);
2500
2501 //----------------------------------------------------------------------------------------------------------------------------------
2502 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2503 // energy detection threshold occupies the third and fourth 20 MHz subchannels of the S80
2504 // 27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
2505 Simulator::Schedule(delay,
2507 this,
2508 "Reception of a 40 MHz signal that occupies the third and fourth "
2509 "subchannels of S80 above ED threshold");
2510 ScheduleTest(delay,
2511 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 20, 40}},
2512 {},
2513 {
2514 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2515 {MicroSeconds(100) - smallDelta,
2516 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2517 {MicroSeconds(100) + smallDelta,
2518 WifiPhyState::IDLE} // IDLE just after the transmission ends
2519 },
2520 {{MicroSeconds(100) - smallDelta,
2521 MicroSeconds(100),
2523 std::vector<Time>{MicroSeconds(0),
2524 MicroSeconds(0),
2525 MicroSeconds(0),
2526 MicroSeconds(0),
2527 MicroSeconds(0),
2528 MicroSeconds(0),
2529 MicroSeconds(100),
2530 MicroSeconds(100)}}});
2531 delay += Seconds(1.0);
2532
2533 //----------------------------------------------------------------------------------------------------------------------------------
2534 // Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the
2535 // energy detection threshold occupies the S80
2536 Simulator::Schedule(delay,
2538 this,
2539 "Reception of a 80 MHz signal that occupies S80 below ED threshold");
2540 ScheduleTest(delay,
2541 {{-65.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY, 80}},
2542 {},
2543 {
2544 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2545 {MicroSeconds(100) - smallDelta,
2546 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2547 {MicroSeconds(100) + smallDelta,
2548 WifiPhyState::IDLE} // IDLE just after the transmission ends
2549 },
2550 {});
2551 delay += Seconds(1.0);
2552
2553 //----------------------------------------------------------------------------------------------------------------------------------
2554 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the
2555 // energy detection threshold occupies the S80 27.3.20.6.4: Any signal within the secondary
2556 // 80 MHz channel at or above –56 dBm.
2557 Simulator::Schedule(delay,
2559 this,
2560 "Reception of a 80 MHz signal that occupies S80 above ED threshold");
2561 ScheduleTest(delay,
2562 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY, 80}},
2563 {},
2564 {
2565 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2566 {MicroSeconds(100) - smallDelta,
2567 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2568 {MicroSeconds(100) + smallDelta,
2569 WifiPhyState::IDLE} // IDLE just after the transmission ends
2570 },
2571 {{MicroSeconds(100) - smallDelta,
2572 MicroSeconds(100),
2574 std::vector<Time>{MicroSeconds(0),
2575 MicroSeconds(0),
2576 MicroSeconds(0),
2577 MicroSeconds(0),
2578 MicroSeconds(100),
2579 MicroSeconds(100),
2580 MicroSeconds(100),
2581 MicroSeconds(100)}}});
2582 delay += Seconds(1.0);
2583
2584 //----------------------------------------------------------------------------------------------------------------------------------
2585 // Verify PHY state stays IDLE as long as a 160 MHz signal below the energy detection
2586 // threshold occupies the whole band
2587 Simulator::Schedule(
2588 delay,
2590 this,
2591 "Reception of a 160 MHz signal that occupies the whole band below ED threshold");
2592 ScheduleTest(delay,
2593 {{-55.0, MicroSeconds(0), MicroSeconds(100), P160_CENTER_FREQUENCY, 160}},
2594 {},
2595 {
2596 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2597 {MicroSeconds(100) - smallDelta,
2598 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2599 {MicroSeconds(100) + smallDelta,
2600 WifiPhyState::IDLE} // IDLE just after the transmission ends
2601 },
2602 {});
2603
2604 delay += Seconds(1.0);
2605
2606 //----------------------------------------------------------------------------------------------------------------------------------
2607 // Verify PHY state is CCA-BUSY as long as a 160 MHz signal above the energy detection
2608 // threshold occupies the whole band
2609 Simulator::Schedule(
2610 delay,
2612 this,
2613 "Reception of a 160 MHz signal that occupies the whole band above ED threshold");
2614 ScheduleTest(delay,
2615 {{-50.0, MicroSeconds(0), MicroSeconds(100), P160_CENTER_FREQUENCY, 160}},
2616 {},
2617 {
2618 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
2619 {MicroSeconds(100) - smallDelta,
2620 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
2621 {MicroSeconds(100) + smallDelta,
2622 WifiPhyState::IDLE} // IDLE just after the transmission ends
2623 },
2624 {{MicroSeconds(100) - smallDelta,
2625 MicroSeconds(100),
2627 std::vector<Time>{MicroSeconds(100),
2628 MicroSeconds(100),
2629 MicroSeconds(100),
2630 MicroSeconds(100),
2631 MicroSeconds(100),
2632 MicroSeconds(100),
2633 MicroSeconds(100),
2634 MicroSeconds(100)}}});
2635 delay += Seconds(1.0);
2636
2637 //----------------------------------------------------------------------------------------------------------------------------------
2638 // Verify PHY notifies CCA-BUSY for the P20 channel while the S80 channel was already in
2639 // CCA-BUSY state
2640 Simulator::Schedule(delay,
2642 this,
2643 "Reception of a 20 MHz signal that occupies S80 followed by the "
2644 "reception of another 20 MHz signal that occupies P20");
2646 delay,
2647 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 10, 20},
2648 {-55.0, MicroSeconds(50), MicroSeconds(100), P20_CENTER_FREQUENCY, 20}},
2649 {},
2650 {
2651 {aCcaTime, WifiPhyState::IDLE}, // state of primary stays idle after aCCATime
2652 {MicroSeconds(50) + aCcaTime,
2653 WifiPhyState::CCA_BUSY}, // state of primary is CCA-BUSY after aCCATime that
2654 // followed the second transmission
2655 {MicroSeconds(50) + MicroSeconds(100) - smallDelta,
2656 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
2657 {MicroSeconds(50) + MicroSeconds(100) + smallDelta,
2658 WifiPhyState::IDLE} // IDLE just after the transmission ends
2659 },
2660 {{aCcaTime, // notification upon reception of the first signal
2661 MicroSeconds(100),
2663 std::vector<Time>{MicroSeconds(0),
2664 MicroSeconds(0),
2665 MicroSeconds(0),
2666 MicroSeconds(0),
2667 MicroSeconds(0),
2668 MicroSeconds(0),
2669 MicroSeconds(100),
2670 MicroSeconds(0)}},
2671 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
2672 MicroSeconds(50) + MicroSeconds(100),
2674 std::vector<Time>{MicroSeconds(100),
2675 MicroSeconds(0),
2676 MicroSeconds(00),
2677 MicroSeconds(0),
2678 MicroSeconds(0),
2679 MicroSeconds(0),
2680 MicroSeconds(50),
2681 MicroSeconds(0)}}});
2682 delay += Seconds(1.0);
2683
2684 //----------------------------------------------------------------------------------------------------------------------------------
2685 // Verify PHY state stays IDLE but notifies CCA-BUSY for the S40 channel while the S80
2686 // channel was already in CCA-BUSY state
2687 Simulator::Schedule(delay,
2689 this,
2690 "Reception of a signal that occupies S80 followed by the reception of "
2691 "another signal that occupies S40");
2693 delay,
2694 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 30, 20},
2695 {-55.0, MicroSeconds(50), MicroSeconds(100), S40_CENTER_FREQUENCY - 10, 20}},
2696 {},
2697 {
2698 {aCcaTime, WifiPhyState::IDLE}, // state of primary stays idle after aCCATime
2699 {MicroSeconds(50) + aCcaTime, WifiPhyState::IDLE}, // state of primary stays IDLE
2700 {MicroSeconds(50) + MicroSeconds(100) - smallDelta,
2701 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2702 {MicroSeconds(50) + MicroSeconds(100) + smallDelta,
2703 WifiPhyState::IDLE} // IDLE just after the transmission ends
2704 },
2705 {{aCcaTime, // notification upon reception of the first signal
2706 MicroSeconds(100),
2708 std::vector<Time>{MicroSeconds(0),
2709 MicroSeconds(0),
2710 MicroSeconds(0),
2711 MicroSeconds(0),
2712 MicroSeconds(0),
2713 MicroSeconds(0),
2714 MicroSeconds(0),
2715 MicroSeconds(100)}},
2716 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
2717 MicroSeconds(50) + MicroSeconds(100),
2719 std::vector<Time>{MicroSeconds(0),
2720 MicroSeconds(0),
2721 MicroSeconds(100),
2722 MicroSeconds(0),
2723 MicroSeconds(0),
2724 MicroSeconds(0),
2725 MicroSeconds(0),
2726 MicroSeconds(50)}}});
2727 delay += Seconds(1.0);
2728
2729 //----------------------------------------------------------------------------------------------------------------------------------
2730 // Verify PHY state stays IDLE but notifies CCA-BUSY for the S20 channel while the S80
2731 // channel was already in CCA-BUSY state
2732 Simulator::Schedule(delay,
2734 this,
2735 "Reception of a signal that occupies S80 followed by the reception of "
2736 "another signal that occupies S20");
2738 delay,
2739 {{-55.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY - 30, 20},
2740 {-55.0, MicroSeconds(50), MicroSeconds(100), S20_CENTER_FREQUENCY, 20}},
2741 {},
2742 {
2743 {aCcaTime, WifiPhyState::IDLE}, // state of primary stays idle after aCCATime
2744 {MicroSeconds(50) + aCcaTime, WifiPhyState::IDLE}, // state of primary stays IDLE
2745 {MicroSeconds(50) + MicroSeconds(100) - smallDelta,
2746 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2747 {MicroSeconds(50) + MicroSeconds(100) + smallDelta,
2748 WifiPhyState::IDLE} // IDLE just after the transmission ends
2749 },
2750 {{aCcaTime, // notification upon reception of the first signal
2751 MicroSeconds(100),
2753 std::vector<Time>{MicroSeconds(0),
2754 MicroSeconds(0),
2755 MicroSeconds(0),
2756 MicroSeconds(0),
2757 MicroSeconds(100),
2758 MicroSeconds(0),
2759 MicroSeconds(0),
2760 MicroSeconds(0)}},
2761 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
2762 MicroSeconds(50) + MicroSeconds(100),
2764 std::vector<Time>{MicroSeconds(0),
2765 MicroSeconds(100),
2766 MicroSeconds(0),
2767 MicroSeconds(0),
2768 MicroSeconds(50),
2769 MicroSeconds(0),
2770 MicroSeconds(0),
2771 MicroSeconds(0)}}});
2772 delay += Seconds(1.0);
2773
2774 //----------------------------------------------------------------------------------------------------------------------------------
2775 // Verify PHY state stays IDLE when a 80 MHz HE SU PPDU with received power below the CCA
2776 // sensitivity threshold occupies S80
2777 Simulator::Schedule(
2778 delay,
2780 this,
2781 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
2782 ScheduleTest(delay,
2783 {},
2784 {{-70.0, MicroSeconds(0), S80_CENTER_FREQUENCY, 80}},
2785 {
2786 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2787 {PpduDurations.at(20) - smallDelta,
2788 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2789 {PpduDurations.at(20) + smallDelta,
2790 WifiPhyState::IDLE} // IDLE just after the transmission ends
2791 },
2792 {});
2793 delay += Seconds(1.0);
2794
2795 //----------------------------------------------------------------------------------------------------------------------------------
2796 // Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 80 MHz HE SU PPDU
2797 // with received power above the CCA sensitivity threshold occupies S80
2798 Simulator::Schedule(
2799 delay,
2801 this,
2802 "Reception of a 80 MHz HE PPDU that occupies S80 above CCA sensitivity threshold");
2803 ScheduleTest(delay,
2804 {},
2805 {{-65.0, MicroSeconds(0), S80_CENTER_FREQUENCY, 80}},
2806 {
2807 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2808 {PpduDurations.at(80) - smallDelta,
2809 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2810 {PpduDurations.at(80) + smallDelta,
2811 WifiPhyState::IDLE} // IDLE just after the transmission ends
2812 },
2813 {{aCcaTime,
2814 PpduDurations.at(80),
2816 std::vector<Time>{NanoSeconds(0),
2817 NanoSeconds(0),
2818 NanoSeconds(0),
2819 NanoSeconds(0),
2820 PpduDurations.at(80),
2821 PpduDurations.at(80),
2822 PpduDurations.at(80),
2823 PpduDurations.at(80)}}});
2824 delay += Seconds(1.0);
2825
2826 //----------------------------------------------------------------------------------------------------------------------------------
2827 // Verify PHY state stays IDLE and CCA-BUSY indication is reported if only the per20bitmap
2828 // parameter changes
2829 Simulator::Schedule(delay,
2831 this,
2832 "Reception of a 20 MHz signal that generates a per20bitmap parameter "
2833 "change when previous CCA indication reports IDLE");
2834 ScheduleTest(delay,
2835 {{-60.0, MicroSeconds(0), MicroSeconds(100), S80_CENTER_FREQUENCY + 30, 20}},
2836 {},
2837 {
2838 {aCcaTime, WifiPhyState::IDLE}, // IDLE after aCCATime
2839 {MicroSeconds(100) - smallDelta,
2840 WifiPhyState::IDLE}, // IDLE just before the transmission ends
2841 {MicroSeconds(100) + smallDelta,
2842 WifiPhyState::IDLE} // IDLE just after the transmission ends
2843 },
2844 {{aCcaTime,
2845 Seconds(0),
2847 std::vector<Time>{MicroSeconds(0),
2848 MicroSeconds(0),
2849 MicroSeconds(0),
2850 MicroSeconds(0),
2851 MicroSeconds(0),
2852 MicroSeconds(0),
2853 MicroSeconds(0),
2854 MicroSeconds(100)}}});
2855 delay += Seconds(1.0);
2856
2857 //----------------------------------------------------------------------------------------------------------------------------------
2858 // Verify PHY state stays CCA_BUSY and CCA-BUSY indication is reported if only the
2859 // per20bitmap parameter changes
2860 Simulator::Schedule(
2861 delay,
2863 this,
2864 "Reception of a 20 MHz signal that generates a per20bitmap parameter change when "
2865 "previous CCA indication reports BUSY for the primary channel");
2867 delay,
2868 {{-50.0, MicroSeconds(0), MicroSeconds(100), P80_CENTER_FREQUENCY, 80},
2869 {-60.0, MicroSeconds(50), MicroSeconds(200), S80_CENTER_FREQUENCY + 30, 20}},
2870 {},
2871 {
2872 {aCcaTime, WifiPhyState::CCA_BUSY}, // CCA-BUSY after aCCATime
2873 {MicroSeconds(100) - smallDelta,
2874 WifiPhyState::CCA_BUSY}, // CCA-BUSY just before the transmission ends
2875 {MicroSeconds(100) + smallDelta,
2876 WifiPhyState::IDLE} // IDLE just after the transmission ends
2877 },
2878 {{aCcaTime,
2879 MicroSeconds(100),
2881 std::vector<Time>{MicroSeconds(100),
2882 MicroSeconds(100),
2883 MicroSeconds(100),
2884 MicroSeconds(100),
2885 MicroSeconds(0),
2886 MicroSeconds(0),
2887 MicroSeconds(0),
2888 MicroSeconds(0)}},
2889 {MicroSeconds(50) + aCcaTime, // notification upon reception of the second signal
2890 MicroSeconds(100),
2892 std::vector<Time>{MicroSeconds(50),
2893 MicroSeconds(50),
2894 MicroSeconds(50),
2895 MicroSeconds(50),
2896 MicroSeconds(0),
2897 MicroSeconds(0),
2898 MicroSeconds(0),
2899 MicroSeconds(200)}}});
2900 delay += Seconds(1.0);
2901 }
2902
2903 Simulator::Run();
2904}
2905
2906void
2908{
2909 m_frequency = 5180;
2910 m_channelWidth = 20;
2911 RunOne();
2912
2913 m_frequency = 5190;
2914 m_channelWidth = 40;
2915 RunOne();
2916
2917 m_frequency = 5210;
2918 m_channelWidth = 80;
2919 RunOne();
2920
2921 m_frequency = 5250;
2922 m_channelWidth = 160;
2923 RunOne();
2924
2925 Simulator::Destroy();
2926}
2927
2928void
2930{
2931 m_rxPhy->Dispose();
2932 m_rxPhy = nullptr;
2933 m_txPhy->Dispose();
2934 m_txPhy = nullptr;
2935 for (auto& signalGenerator : m_signalGenerators)
2936 {
2937 signalGenerator->Dispose();
2938 signalGenerator = nullptr;
2939 }
2940}
2941
2949{
2950 public:
2952};
2953
2955 : TestSuite("wifi-phy-cca", UNIT)
2956{
2957 AddTestCase(new WifiPhyCcaThresholdsTest, TestCase::QUICK);
2958 AddTestCase(new WifiPhyCcaIndicationTest, TestCase::QUICK);
2959}
2960
#define max(a, b)
Definition: 80211b.c:43
PHY listener for CCA tests.
void NotifyOn() override
Notify listeners that we went to switch on.
WifiChannelListType m_lastCcaBusyChannelType
Channel type indication for the last CCA-BUSY notification.
void NotifyRxEndError() override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
void NotifyCcaBusyStart(Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations) override
void NotifySleep() override
Notify listeners that we went to sleep.
void NotifyRxEndOk() override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
void NotifyTxStart(Time duration, double txPowerDbm) override
CcaTestPhyListener()=default
void NotifyOff() override
Notify listeners that we went to switch off.
std::size_t m_notifications
Number of CCA notifications.
void NotifyRxStart(Time duration) override
Time m_endCcaBusy
End of the CCA-BUSY duration.
void Reset()
Reset function.
void NotifyWakeup() override
Notify listeners that we woke up.
std::vector< Time > m_lastPer20MhzCcaBusyDurations
End of the CCA-BUSY durations per 20 MHz.
void NotifySwitchingStart(Time duration) override
Wifi Phy Threshold Test base class.
std::size_t m_numSignalGenerators
The number of non-wifi signals generators needed for the test.
void CheckPhyState(WifiPhyState expectedState)
Check the PHY state.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void CheckLastCcaBusyNotification(Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector< Time > &expectedPer20MhzDurations)
Check the last CCA-BUSY notification.
std::unique_ptr< CcaTestPhyListener > m_rxPhyStateListener
Listener for PHY state transitions.
void SendHeSuPpdu(double txPowerDbm, uint16_t frequency, uint16_t bandwidth)
Send an HE SU PPDU.
void StartSignal(Ptr< WaveformGenerator > signalGenerator, double txPowerDbm, uint16_t frequency, uint16_t bandwidth, Time duration)
Start to generate a signal.
void RunOne()
Run one function.
void DoCheckPhyState(WifiPhyState expectedState)
Check the PHY state.
std::vector< Ptr< WaveformGenerator > > m_signalGenerators
Generators of non-wifi signals.
void ScheduleTest(Time delay, const std::vector< TxSignalInfo > &generatedSignals, const std::vector< TxPpduInfo > &generatedPpdus, const std::vector< StateCheckPoint > &stateCheckpoints, const std::vector< CcaCheckPoint > &ccaCheckpoints)
Schedule test to perform.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint16_t m_frequency
Operating frequency in MHz.
void DoRun() override
Implementation to actually run this TestCase.
void LogScenario(const std::string &log) const
Log scenario description.
void Reset()
Reset function.
Ptr< SpectrumWifiPhy > m_rxPhy
PHY object of the receiver.
Ptr< SpectrumWifiPhy > m_txPhy
PHY object of the transmitter.
void StopSignal(Ptr< WaveformGenerator > signalGenerator)
Stop to generate a signal.
uint16_t m_channelWidth
Operating channel width in MHz.
Wi-Fi PHY CCA Test Suite.
PHY CCA thresholds test.
Ptr< OfdmPpdu > CreateDummyNonHtPpdu()
Create a non-HT PPDU.
Ptr< WifiNetDevice > m_device
The WifiNetDevice.
Ptr< HePpdu > CreateDummyHePpdu(uint16_t bandwidth)
Create a HE PPDU.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
double m_CcaSensitivityDbm
The current CCA sensitivity threshold for signals that occupy the primary 20 MHz channel (in dBm)
Ptr< HtPpdu > CreateDummyHtPpdu(uint16_t bandwidth)
Create a HT PPDU.
Ptr< SpectrumWifiPhy > m_phy
The spectrum PHY.
Ptr< ObssPdAlgorithm > m_obssPdAlgorithm
The OBSS-PD algorithm.
void VerifyCcaThreshold(const Ptr< PhyEntity > phy, const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType, double expectedCcaThresholdDbm)
Function to verify the CCA threshold that is being reported by a given PHY entity upon reception of a...
Ptr< WifiPsdu > CreateDummyPsdu()
Create a dummy PSDU whose payload is 1000 bytes.
VhtConfiguration::SecondaryCcaSensitivityThresholds m_secondaryCcaSensitivityThresholds
The current CCA sensitivity thresholds for signals that do not occupy the primary 20 MHz channel (in ...
Ptr< VhtPpdu > CreateDummyVhtPpdu(uint16_t bandwidth)
Create a VHT PPDU.
void RunOne()
Run tests for given CCA attributes.
Ptr< VhtConfiguration > m_vhtConfiguration
The VHT configuration.
double m_CcaEdThresholdDbm
The current CCA-ED threshold for a 20 MHz subchannel (in dBm)
void DoRun() override
Implementation to actually run this TestCase.
double m_obssPdLevel
The current OBSS-PD level (in dBm)
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:138
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:258
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:298
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:259
void Dispose()
Dispose of this Object.
Definition: object.cc:219
void SetObssPdLevel(double level)
virtual void ConnectWifiNetDevice(const Ptr< WifiNetDevice > device)
Connect the WifiNetDevice and setup eventual callbacks.
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Ptr< T > Get() const
Definition: pointer.h:205
void SetChannel(const Ptr< SpectrumChannel > channel)
Set the SpectrumChannel this SpectrumWifiPhy is to be connected to.
void CreateWifiSpectrumPhyInterface(Ptr< NetDevice > device)
Method to encapsulate the creation of the WifiSpectrumPhyInterface object (used to bind the WifiSpect...
encapsulates test code
Definition: test.h:1060
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:305
A suite of tests to run.
Definition: test.h:1256
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
AttributeValue implementation for Time.
Definition: nstime.h:1425
std::tuple< double, double, double > SecondaryCcaSensitivityThresholds
Tuple identifying CCA sensitivity thresholds for secondary channels.
void SetSecondaryCcaSensitivityThresholds(const SecondaryCcaSensitivityThresholds &thresholds)
Sets the CCA sensitivity thresholds for PPDUs that do not occupy the primary channel.
void SetDevice(Ptr< NetDevice > d) override
Set the associated NetDevice instance.
void SetChannel(Ptr< SpectrumChannel > c) override
Set the channel attached to this device.
virtual void Start()
Start the waveform generator.
void SetTxPowerSpectralDensity(Ptr< SpectrumValue > txs)
Set the Power Spectral Density used for outgoing waveforms.
void SetDutyCycle(double value)
void SetPeriod(Time period)
Set the period according to which the WaveformGenerator switches on and off.
virtual void Stop()
Stop the waveform generator.
Implements the IEEE 802.11 MAC header.
void SetType(WifiMacType type, bool resetToDsFromDs=true)
Set Type/Subtype values with the correct values depending on the given type.
void SetQosTid(uint8_t tid)
Set the TID for the QoS header.
void SetVhtConfiguration(Ptr< VhtConfiguration > vhtConfiguration)
void SetStandard(WifiStandard standard)
Set the Wifi standard.
void SetPhy(const Ptr< WifiPhy > phy)
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
Definition: wifi-phy.cc:606
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.
Definition: wifi-phy.cc:1635
void SetCcaEdThreshold(double threshold)
Sets the CCA energy detection threshold (dBm).
Definition: wifi-phy.cc:460
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
Definition: wifi-phy.cc:614
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:895
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
Definition: wifi-phy.cc:1004
void SetCcaSensitivityThreshold(double threshold)
Sets the CCA sensitivity threshold (dBm).
Definition: wifi-phy.cc:473
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:685
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:575
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:510
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:634
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:429
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Definition: wifi-phy.h:869
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:497
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: wifi-phy.cc:2124
receive notifications about PHY events.
This objects implements the PHY state machine of the Wifi device.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#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.
Definition: log.h:275
Time Now()
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:296
#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.
Definition: test.h:144
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Definition: test.h:510
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1362
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1374
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1338
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
@ WIFI_STANDARD_80211ax
@ WIFI_PREAMBLE_LONG
@ WIFI_PREAMBLE_HE_SU
@ WIFI_PREAMBLE_VHT_SU
@ WIFI_PREAMBLE_HT_MF
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ WIFI_CHANLIST_PRIMARY
@ WIFI_CHANLIST_SECONDARY40
@ WIFI_CHANLIST_SECONDARY
@ WIFI_CHANLIST_SECONDARY80
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< BandInfo > Bands
Container of BandInfo.
double DbmToW(double dBm)
Convert from dBm to Watts.
Definition: wifi-utils.cc:40
@ WIFI_MAC_QOSDATA
phy
Definition: third.py:82
structure that holds information to perform CCA check
Time expectedCcaEndTime
expected CCA_BUSY end time
Time timePoint
time at which the check will performed
std::vector< Time > expectedPer20MhzDurations
expected per-20 MHz CCA duration
WifiChannelListType expectedChannelListType
expected channel list type
structure that holds information to perform PHY state check
WifiPhyState expectedPhyState
expected PHY state
Time timePoint
time at which the check will performed
structure that holds information to generate PPDUs
uint16_t centerFreq
center frequency to use in MHz
Time startTime
time at which transmission will be started
uint16_t bandwidth
bandwidth to use in MHz
double power
transmit power to use in dBm
structure that holds information to generate signals
uint16_t centerFreq
center frequency to use in MHz
double power
transmit power to use in dBm
uint16_t bandwidth
bandwidth to use in MHz
Time startTime
time at which transmission will be started
Time duration
the duration of the transmission
The building block of a SpectrumModel.
double fc
center frequency
double fl
lower limit of subband
double fh
upper limit of subband
constexpr uint32_t P40_CENTER_FREQUENCY
constexpr uint32_t P20_CENTER_FREQUENCY
const Time aCcaTime
const std::map< uint16_t, Time > PpduDurations
static WifiPhyCcaTestSuite WifiPhyCcaTestSuite
the test suite
constexpr uint32_t P160_CENTER_FREQUENCY
constexpr uint32_t P80_CENTER_FREQUENCY
constexpr uint32_t S40_CENTER_FREQUENCY
const Time smallDelta
constexpr uint32_t S80_CENTER_FREQUENCY
constexpr uint32_t S20_CENTER_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.