A Discrete-Event Network Simulator
API
wifi-phy-cca-test.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2022
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Sébastien Deronne <sebastien.deronne@gmail.com>
19 */
20
21#include <memory>
22#include <vector>
23#include "ns3/pointer.h"
24#include "ns3/log.h"
25#include "ns3/test.h"
26#include "ns3/rng-seed-manager.h"
27#include "ns3/spectrum-wifi-helper.h"
28#include "ns3/spectrum-wifi-phy.h"
29#include "ns3/interference-helper.h"
30#include "ns3/nist-error-rate-model.h"
31#include "ns3/wifi-mac-header.h"
32#include "ns3/wifi-spectrum-value-helper.h"
33#include "ns3/multi-model-spectrum-channel.h"
34#include "ns3/wifi-net-device.h"
35#include "ns3/wifi-phy-listener.h"
36#include "ns3/wifi-utils.h"
37#include "ns3/wifi-psdu.h"
38#include "ns3/ofdm-ppdu.h"
39#include "ns3/ht-ppdu.h"
40#include "ns3/vht-ppdu.h"
41#include "ns3/he-ppdu.h"
42#include "ns3/he-phy.h"
43#include "ns3/waveform-generator.h"
44#include "ns3/non-communicating-net-device.h"
45#include "ns3/threshold-preamble-detection-model.h"
46#include "ns3/constant-obss-pd-algorithm.h"
47#include "ns3/vht-configuration.h"
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 =
64{
65 {20, NanoSeconds (1009600)},
66 {40, NanoSeconds (533600)},
67 {80, NanoSeconds (275200)}
68};
69
77{
78public:
80
81private:
82 void DoSetup (void) override;
83 void DoTeardown (void) override;
84 void DoRun (void) override;
85
89 void RunOne (void);
90
106 Ptr<HtPpdu> CreateDummyHtPpdu (uint16_t bandwidth);
112 Ptr<VhtPpdu> CreateDummyVhtPpdu (uint16_t bandwidth);
118 Ptr<HePpdu> CreateDummyHePpdu (uint16_t bandwidth);
119
127 void VerifyCcaThreshold (const Ptr<PhyEntity> phy, const Ptr<const WifiPpdu> ppdu, WifiChannelListType channelType, double expectedCcaThresholdDbm);
128
133
136
138
140};
141
143 : TestCase ("Wi-Fi PHY CCA thresholds test"),
144 m_CcaEdThresholdDbm {-62.0},
145 m_CcaSensitivityDbm {-82.0},
146 m_secondaryCcaSensitivityThresholds {-72.0, -72.0, -69.0},
147 m_obssPdLevel {-82.0}
148{
149}
150
153{
154 Ptr<Packet> pkt = Create<Packet> (1000);
155 WifiMacHeader hdr;
157 hdr.SetQosTid (0);
158 return Create<WifiPsdu> (pkt, hdr);
159}
160
163{
164 WifiTxVector txVector = WifiTxVector (OfdmPhy::GetOfdmRate6Mbps (), 0, WIFI_PREAMBLE_LONG, 800, 1, 1, 0, 20, false);
166 return Create<OfdmPpdu> (psdu, txVector, P20_CENTER_FREQUENCY, WIFI_PHY_BAND_5GHZ, 0);
167}
168
171{
172 WifiTxVector txVector = WifiTxVector (HtPhy::GetHtMcs0 (), 0, WIFI_PREAMBLE_HT_MF, 800, 1, 1, 0, bandwidth, false);
174 return Create<HtPpdu> (psdu, txVector, P20_CENTER_FREQUENCY, MicroSeconds (100), WIFI_PHY_BAND_5GHZ, 0);
175}
176
179{
180 WifiTxVector txVector = WifiTxVector (VhtPhy::GetVhtMcs0 (), 0, WIFI_PREAMBLE_VHT_SU, 800, 1, 1, 0, bandwidth, false);
182 return Create<VhtPpdu> (psdu, txVector, P20_CENTER_FREQUENCY, MicroSeconds (100), WIFI_PHY_BAND_5GHZ, 0);
183}
184
187{
188 WifiTxVector txVector = WifiTxVector (HePhy::GetHeMcs0 (), 0, WIFI_PREAMBLE_HE_SU, 800, 1, 1, 0, bandwidth, false);
190 return Create<HePpdu> (psdu, txVector, P20_CENTER_FREQUENCY, MicroSeconds (100), WIFI_PHY_BAND_5GHZ, 0);
191}
192
193void
194WifiPhyCcaThresholdsTest::VerifyCcaThreshold (const Ptr<PhyEntity> phy, const Ptr<const WifiPpdu> ppdu, WifiChannelListType channelType, double expectedCcaThresholdDbm)
195{
196 NS_LOG_FUNCTION (this << phy << channelType << expectedCcaThresholdDbm);
197 double actualThresholdDbm = phy->GetCcaThreshold (ppdu, channelType);
198 NS_LOG_INFO ((ppdu == nullptr ? "any signal" : "a PPDU") << " in " << channelType << " channel: " << actualThresholdDbm << "dBm");
199 NS_TEST_EXPECT_MSG_EQ_TOL (actualThresholdDbm, expectedCcaThresholdDbm, 1e-6, "Actual CCA threshold for " << (ppdu == nullptr ? "any signal" : "a PPDU") << " in " << channelType << " channel " << actualThresholdDbm << "dBm does not match expected threshold " << expectedCcaThresholdDbm << "dBm");
200}
201
202void
204{
205 //WifiHelper::EnableLogComponents ();
206 //LogComponentEnable ("WifiPhyCcaTest", LOG_LEVEL_ALL);
207
208 m_device = CreateObject<WifiNetDevice> ();
210 m_vhtConfiguration = CreateObject<VhtConfiguration> ();
212
213 m_phy = Create<SpectrumWifiPhy> ();
216
217 auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, P20_CENTER_FREQUENCY, 20, WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ));
221
222 m_obssPdAlgorithm = CreateObject<ConstantObssPdAlgorithm> ();
225}
226
227void
229{
230 m_device->Dispose ();
231 m_device = 0;
232}
233
234void
236{
241
242 //OFDM PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
244
245 //-----------------------------------------------------------------------------------------------------------------------------------
246
247 //OFDM PHY: 20 MHz non-HT PPDU in primary channel (20 MHz) if power above CCA sensitivty threshold
249
250 //-----------------------------------------------------------------------------------------------------------------------------------
251
252 //HT PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
254
255 //HT PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
257
258 //-----------------------------------------------------------------------------------------------------------------------------------
259
260 //HT PHY: 20 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
262
263 //HT PHY: 40 MHz HT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
265
266 //-----------------------------------------------------------------------------------------------------------------------------------
267
268 //VHT PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
270
271 //VHT PHY: any signal in secondary channel (20 MHz) if power above CCA-ED threshold
273
274 //VHT PHY: any signal in secondary40 channel (40 MHz) if power above CCA-ED threshold + 3dB
276
277 //VHT PHY: any signal in secondary80 channel (80 MHz) if power above CCA-ED threshold + 6dB
279
280 //-----------------------------------------------------------------------------------------------------------------------------------
281
282 //VHT PHY: 20 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
284
285 //VHT PHY: 40 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
287
288 //VHT PHY: 80 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
290
291 //VHT PHY: 160 MHz VHT PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
293
294 //-----------------------------------------------------------------------------------------------------------------------------------
295
296 //VHT PHY: 20 MHz VHT PPDU in secondary channel (20 MHz) if power above the CCA sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
298
299 //VHT PHY: 20 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
301
302 //VHT PHY: 40 MHz VHT PPDU in secondary40 channel (40 MHz) if power above the CCA sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz
304
305 //VHT PHY: 20 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity threshold corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz
307
308 //VHT PHY: 40 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity threshold corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz
310
311 //VHT PHY: 80 MHz VHT PPDU in secondary80 channel (80 MHz) if power above the CCA sensitivity threshold corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz
313
314 //-----------------------------------------------------------------------------------------------------------------------------------
315
316 //HE PHY: any signal in primary channel (20 MHz) if power above CCA-ED threshold
318
319 //HE PHY: any signal in secondary channel (20 MHz) if power above CCA-ED threshold
321
322 //HE PHY: any signal in secondary40 channel (40 MHz) if power above CCA-ED threshold + 3dB
324
325 //HE PHY: any signal in secondary80 channel (80 MHz) if power above CCA-ED threshold + 6dB
327
328 //-----------------------------------------------------------------------------------------------------------------------------------
329
330 //HE PHY: 20 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
332
333 //HE PHY: 40 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
335
336 //HE PHY: 80 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
338
339 //HE PHY: 160 MHz HE PPDU in primary channel (20 MHz) if power in primary above CCA sensitivty threshold
341
342 //-----------------------------------------------------------------------------------------------------------------------------------
343
344 //HE PHY: 20 MHz HE PPDU in secondary channel (20 MHz) if power above the max between the CCA sensitivity threshold
345 //corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz and the OBSS-PD level
348
349
350 //HE PHY: 20 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the CCA sensitivity threshold
351 //corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz and the OBSS-PD level
354
355 //HE PHY: 40 MHz HE PPDU in secondary40 channel (40 MHz) if power above the max between the CCA sensitivity threshold
356 //corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz and the OBSS-PD level plus 3 dB
359
360
361 //HE PHY: 20 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA sensitivity threshold
362 //corresponding to a 20 MHz PPDU that does not occupy the primary 20 MHz and the OBSS-PD level
365
366
367 //HE PHY: 40 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA sensitivity threshold
368 //corresponding to a 40 MHz PPDU that does not occupy the primary 20 MHz and the OBSS-PD level plus 3 dB
371
372 //HE PHY: 80 MHz HE PPDU in secondary80 channel (80 MHz) if power above the max between the CCA sensitivity threshold
373 //corresponding to a 80 MHz PPDU that does not occupy the primary 20 MHz and the OBSS-PD level plus 6 dB
376}
377
378void
380{
381 //default attributes
382 m_CcaEdThresholdDbm = -62.0;
383 m_CcaSensitivityDbm = -82.0;
384 m_secondaryCcaSensitivityThresholds = std::make_tuple (-72.0, -72.0, -69.0);
385 m_obssPdLevel = -82.0;
386 RunOne ();
387
388 //default attributes with OBSS-PD level set to -80 dBm
389 m_CcaEdThresholdDbm = -62.0;
390 m_CcaSensitivityDbm = -82.0;
391 m_secondaryCcaSensitivityThresholds = std::make_tuple (-72.0, -72.0, -69.0);
392 m_obssPdLevel = -80.0;
393 RunOne ();
394
395 //default attributes with OBSS-PD level set to -70 dBm
396 m_CcaEdThresholdDbm = -62.0;
397 m_CcaSensitivityDbm = -82.0;
398 m_secondaryCcaSensitivityThresholds = std::make_tuple (-72.0, -72.0, -69.0);
399 m_obssPdLevel = -70.0;
400 RunOne ();
401
402 //CCA-ED set to -65 dBm
403 m_CcaEdThresholdDbm = -65.0;
404 m_CcaSensitivityDbm = -82.0;
405 m_secondaryCcaSensitivityThresholds = std::make_tuple (-72.0, -72.0, -69.0);
406 m_obssPdLevel = -82.0;
407 RunOne ();
408
409 //CCA sensitivity for signals in primary set to -75 dBm
410 m_CcaEdThresholdDbm = -62.0;
411 m_CcaSensitivityDbm = -75.0;
412 m_secondaryCcaSensitivityThresholds = std::make_tuple (-72.0, -72.0, -69.0);
413 m_obssPdLevel = -82.0;
414 RunOne ();
415
416 //custom CCA sensitivities for signals not in primary
417 m_CcaEdThresholdDbm = -62.0;
418 m_CcaSensitivityDbm = -72.0;
419 m_secondaryCcaSensitivityThresholds = std::make_tuple (-70.0, -70.0, -70.0);
420 m_obssPdLevel = -82.0;
421 RunOne ();
422
423 //custom CCA sensitivities for signals not in primary with OBSS-PD level set to -80 dBm
424 m_CcaEdThresholdDbm = -62.0;
425 m_CcaSensitivityDbm = -72.0;
426 m_secondaryCcaSensitivityThresholds = std::make_tuple (-70.0, -70.0, -70.0);
427 m_obssPdLevel = -80.0;
428 RunOne ();
429
430 //custom CCA sensitivities for signals not in primary with OBSS-PD level set to -70 dBm
431 m_CcaEdThresholdDbm = -62.0;
432 m_CcaSensitivityDbm = -72.0;
433 m_secondaryCcaSensitivityThresholds = std::make_tuple (-70.0, -70.0, -70.0);
434 m_obssPdLevel = -70.0;
435 RunOne ();
436
437 Simulator::Destroy ();
438}
439
440
448{
449public:
450 CcaTestPhyListener () = default;
451
452 void NotifyRxStart (Time duration) override
453 {
454 NS_LOG_FUNCTION (this << duration);
455 }
456
457 void NotifyRxEndOk (void) override
458 {
459 NS_LOG_FUNCTION (this);
460 }
461
462 void NotifyRxEndError (void) override
463 {
464 NS_LOG_FUNCTION (this);
465 }
466
467 void NotifyTxStart (Time duration, double txPowerDbm) override
468 {
469 NS_LOG_FUNCTION (this << duration << txPowerDbm);
470 }
471
472 void NotifyCcaBusyStart (Time duration,
473 WifiChannelListType channelType,
474 const std::vector<Time>& per20MhzDurations) override
475 {
476 NS_LOG_FUNCTION (this << duration << channelType << per20MhzDurations.size ());
477 m_endCcaBusy = Simulator::Now () + duration;
478 m_lastCcaBusyChannelType = channelType;
479 m_lastPer20MhzCcaBusyDurations = per20MhzDurations;
481 }
482
483 void NotifySwitchingStart (Time duration) override
484 {
485 }
486
487 void NotifySleep (void) override
488 {
489 }
490
491 void NotifyOff (void) override
492 {
493 }
494
495 void NotifyWakeup (void) override
496 {
497 }
498
499 void NotifyOn (void) override
500 {
501 }
502
506 void Reset (void)
507 {
508 m_notifications = 0;
509 m_endCcaBusy = Seconds (0);
512 }
513
514 std::size_t m_notifications {0};
517 std::vector<Time> m_lastPer20MhzCcaBusyDurations {};
518};
519
520
528{
529public:
531
532private:
533 void DoSetup (void) override;
534 void DoRun (void) override;
535 void DoTeardown (void) override;
536
543 void SendHeSuPpdu (double txPowerDbm, uint16_t frequency, uint16_t bandwidth);
544
553 void StartSignal (Ptr<WaveformGenerator> signalGenerator, double txPowerDbm, uint16_t frequency, uint16_t bandwidth, Time duration);
558 void StopSignal (Ptr<WaveformGenerator> signalGenerator);
559
564 void CheckPhyState (WifiPhyState expectedState);
566 void DoCheckPhyState (WifiPhyState expectedState);
567
574 void CheckLastCcaBusyNotification (Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector<Time>& expectedPer20MhzDurations);
575
581 void LogScenario (const std::string& log) const;
582
587 {
588 double power {0.0};
591 uint16_t centerFreq {0};
592 uint16_t bandwidth {0};
593 };
594
599 {
600 double power {0.0};
602 uint16_t centerFreq {0};
603 uint16_t bandwidth {0};
604 };
605
610 {
613 };
614
619 {
623 std::vector<Time> expectedPer20MhzDurations {};
624 };
625
634 void ScheduleTest (Time delay,
635 const std::vector<TxSignalInfo>& generatedSignals,
636 const std::vector<TxPpduInfo>& generatedPpdus,
637 const std::vector<StateCheckPoint>& stateCheckpoints,
638 const std::vector<CcaCheckPoint>& ccaCheckpoints);
639
643 void Reset ();
644
648 void RunOne ();
649
652
653 std::vector<Ptr<WaveformGenerator>> m_signalGenerators;
655
656 std::unique_ptr<CcaTestPhyListener> m_rxPhyStateListener;
657
658 uint16_t m_frequency;
659 uint16_t m_channelWidth;
660};
661
663 : TestCase ("Wi-Fi PHY CCA indication test"),
664 m_numSignalGenerators (2),
665 m_frequency (P20_CENTER_FREQUENCY),
666 m_channelWidth (20)
667{
668}
669
670void
671WifiPhyCcaIndicationTest::StartSignal (Ptr<WaveformGenerator> signalGenerator, double txPowerDbm, uint16_t frequency, uint16_t bandwidth, Time duration)
672{
673 NS_LOG_FUNCTION (this << signalGenerator << txPowerDbm << frequency << bandwidth << duration);
674
675 BandInfo bandInfo;
676 bandInfo.fc = frequency * 1e6;
677 bandInfo.fl = bandInfo.fc - ((bandwidth / 2) * 1e6);
678 bandInfo.fh = bandInfo.fc + ((bandwidth / 2) * 1e6);
679 Bands bands;
680 bands.push_back (bandInfo);
681
682 Ptr<SpectrumModel> spectrumSignal = Create<SpectrumModel> (bands);
683 Ptr<SpectrumValue> signalPsd = Create<SpectrumValue> (spectrumSignal);
684 *signalPsd = DbmToW (txPowerDbm) / (bandwidth * 1e6);
685
686 signalGenerator->SetTxPowerSpectralDensity (signalPsd);
687 signalGenerator->SetPeriod (duration);
688 signalGenerator->Start ();
689 Simulator::Schedule (duration, &WifiPhyCcaIndicationTest::StopSignal, this, signalGenerator);
690}
691
692void
694{
695 NS_LOG_FUNCTION (this << signalGenerator);
696 signalGenerator->Stop();
697}
698
699void
700WifiPhyCcaIndicationTest::SendHeSuPpdu (double txPowerDbm, uint16_t frequency, uint16_t bandwidth)
701{
702 NS_LOG_FUNCTION (this << txPowerDbm);
703
704 auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, frequency, bandwidth, WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ));
706
707 WifiTxVector txVector = WifiTxVector (HePhy::GetHeMcs0 (), 0, WIFI_PREAMBLE_HE_SU, 800, 1, 1, 0, bandwidth, false);
708
709 Ptr<Packet> pkt = Create<Packet> (1000);
710 WifiMacHeader hdr;
712 hdr.SetQosTid (0);
713 Ptr<WifiPsdu> psdu = Create<WifiPsdu> (pkt, hdr);
714
715 m_txPhy->SetTxPowerStart (txPowerDbm);
716 m_txPhy->SetTxPowerEnd (txPowerDbm);
717
718 m_txPhy->Send (psdu, txVector);
719}
720
721void
723{
724 //This is needed to make sure PHY state will be checked as the last event if a state change occurred at the exact same time as the check
725 Simulator::ScheduleNow (&WifiPhyCcaIndicationTest::DoCheckPhyState, this, expectedState);
726}
727
728void
730{
731 WifiPhyState currentState;
732 PointerValue ptr;
733 m_rxPhy->GetAttribute ("State", ptr);
734 Ptr <WifiPhyStateHelper> state = DynamicCast <WifiPhyStateHelper> (ptr.Get<WifiPhyStateHelper> ());
735 currentState = state->GetState ();
736 NS_TEST_ASSERT_MSG_EQ (currentState, expectedState, "PHY State " << currentState << " does not match expected state " << expectedState << " at " << Simulator::Now ());
737}
738
739void
740WifiPhyCcaIndicationTest::CheckLastCcaBusyNotification (Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector<Time>& expectedPer20MhzDurations)
741{
742 NS_TEST_ASSERT_MSG_EQ (m_rxPhyStateListener->m_endCcaBusy, expectedEndTime,
743 "PHY CCA end time " << m_rxPhyStateListener->m_endCcaBusy <<
744 " does not match expected time " << expectedEndTime <<
745 " at " << Simulator::Now ());
746 NS_TEST_ASSERT_MSG_EQ (m_rxPhyStateListener->m_lastCcaBusyChannelType, expectedChannelType,
747 "PHY CCA-BUSY for " << m_rxPhyStateListener->m_lastCcaBusyChannelType <<
748 " does not match expected channel type " << expectedChannelType <<
749 " at " << Simulator::Now ());
750 NS_TEST_ASSERT_MSG_EQ (m_rxPhyStateListener->m_lastPer20MhzCcaBusyDurations.size (), expectedPer20MhzDurations.size (),
751 "PHY CCA-BUSY per-20 MHz durations does not match expected vector" <<
752 " at " << Simulator::Now ());
753 for (std::size_t i = 0; i < expectedPer20MhzDurations.size (); ++i)
754 {
755 NS_TEST_ASSERT_MSG_EQ (m_rxPhyStateListener->m_lastPer20MhzCcaBusyDurations.at (i), expectedPer20MhzDurations.at (i),
756 "PHY CCA-BUSY per-20 MHz duration at index " << i <<
757 " does not match expected duration at " << Simulator::Now ());
758 }
759}
760
761void
762WifiPhyCcaIndicationTest::LogScenario (const std::string& log) const
763{
764 NS_LOG_INFO (log);
765}
766
767void
769 const std::vector<TxSignalInfo>& generatedSignals,
770 const std::vector<TxPpduInfo>& generatedPpdus,
771 const std::vector<StateCheckPoint>& stateCheckpoints,
772 const std::vector<CcaCheckPoint>& ccaCheckpoints)
773{
774 for (const auto& generatedPpdu : generatedPpdus)
775 {
776 Simulator::Schedule (delay + generatedPpdu.startTime,
778 generatedPpdu.power,
779 generatedPpdu.centerFreq,
780 generatedPpdu.bandwidth);
781 }
782
783 std::size_t index = 0;
784 for (const auto& generatedSignal : generatedSignals)
785 {
786 Simulator::Schedule (delay + generatedSignal.startTime,
788 m_signalGenerators.at (index++),
789 generatedSignal.power,
790 generatedSignal.centerFreq,
791 generatedSignal.bandwidth,
792 generatedSignal.duration);
793 }
794
795 for (const auto& checkpoint : ccaCheckpoints)
796 {
797 Simulator::Schedule (delay + checkpoint.timePoint,
799 Simulator::Now () + delay + checkpoint.expectedCcaEndTime,
800 checkpoint.expectedChannelListType,
801 checkpoint.expectedPer20MhzDurations);
802 }
803
804 for (const auto& checkpoint : stateCheckpoints)
805 {
806 Simulator::Schedule (delay + checkpoint.timePoint, &WifiPhyCcaIndicationTest::CheckPhyState, this, checkpoint.expectedPhyState);
807 }
808
809 Simulator::Schedule (delay + Seconds (0.5), &WifiPhyCcaIndicationTest::Reset, this);
810}
811
812void
814{
815 m_rxPhyStateListener->Reset ();
816}
817
818void
820{
821 //WifiHelper::EnableLogComponents ();
822 //LogComponentEnable ("WifiPhyCcaTest", LOG_LEVEL_ALL);
823
824 Ptr<MultiModelSpectrumChannel> spectrumChannel = CreateObject<MultiModelSpectrumChannel> ();
825
826 Ptr<Node> rxNode = CreateObject<Node> ();
827 Ptr<WifiNetDevice> rxDev = CreateObject<WifiNetDevice> ();
829 Ptr<VhtConfiguration> vhtConfiguration = CreateObject<VhtConfiguration> ();
830 rxDev->SetVhtConfiguration (vhtConfiguration);
831 m_rxPhy = CreateObject<SpectrumWifiPhy> ();
833 m_rxPhyStateListener = std::make_unique<CcaTestPhyListener> ();
836 Ptr<InterferenceHelper> rxInterferenceHelper = CreateObject<InterferenceHelper> ();
837 m_rxPhy->SetInterferenceHelper (rxInterferenceHelper);
838 Ptr<ErrorRateModel> rxErrorModel = CreateObject<NistErrorRateModel> ();
839 m_rxPhy->SetErrorRateModel (rxErrorModel);
840 Ptr<ThresholdPreambleDetectionModel> preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel> ();
841 m_rxPhy->SetPreambleDetectionModel (preambleDetectionModel);
842 m_rxPhy->SetChannel (spectrumChannel);
843 m_rxPhy->SetDevice (rxDev);
844 rxDev->SetPhy (m_rxPhy);
845 rxNode->AddDevice (rxDev);
846
847 Ptr<Node> txNode = CreateObject<Node> ();
848 Ptr<WifiNetDevice> txDev = CreateObject<WifiNetDevice> ();
849 m_txPhy = CreateObject<SpectrumWifiPhy> ();
852 m_txPhy->SetAttribute ("ChannelSwitchDelay", TimeValue (Seconds (0)));
853 Ptr<InterferenceHelper> txInterferenceHelper = CreateObject<InterferenceHelper> ();
854 m_txPhy->SetInterferenceHelper (txInterferenceHelper);
855 Ptr<ErrorRateModel> txErrorModel = CreateObject<NistErrorRateModel> ();
856 m_txPhy->SetErrorRateModel (txErrorModel);
857 m_txPhy->SetChannel (spectrumChannel);
858 m_txPhy->SetDevice (txDev);
859 txDev->SetPhy (m_txPhy);
860 txNode->AddDevice (txDev);
861
862 for (std::size_t i = 0; i < m_numSignalGenerators; ++i)
863 {
864 Ptr<Node> signalGeneratorNode = CreateObject<Node> ();
865 Ptr<NonCommunicatingNetDevice> signalGeneratorDev = CreateObject<NonCommunicatingNetDevice> ();
866 Ptr<WaveformGenerator> signalGenerator = CreateObject<WaveformGenerator> ();
867 signalGenerator->SetDevice (signalGeneratorDev);
868 signalGenerator->SetChannel (spectrumChannel);
869 signalGenerator->SetDutyCycle (1);
870 signalGeneratorNode->AddDevice (signalGeneratorDev);
871 m_signalGenerators.push_back (signalGenerator);
872 }
873}
874
875void
877{
878 RngSeedManager::SetSeed (1);
879 RngSeedManager::SetRun (1);
880 int64_t streamNumber = 0;
881 m_rxPhy->AssignStreams (streamNumber);
882 m_txPhy->AssignStreams (streamNumber);
883
884 auto channelNum = std::get<0> (*WifiPhyOperatingChannel::FindFirst (0, m_frequency, m_channelWidth, WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ));
885
888
889 std::vector<Time> expectedPer20MhzCcaBusyDurations {};
890 Time delay = Seconds (0.0);
891 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::Reset, this);
892 delay += Seconds (1.0);
893
894 //----------------------------------------------------------------------------------------------------------------------------------
895 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a signal below the energy detection threshold occupies P20
896 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
897 "Reception of a signal that occupies P20 below ED threshold");
898 ScheduleTest (delay,
899 {{-65.0, MicroSeconds (0), MicroSeconds (100), P20_CENTER_FREQUENCY, 20}},
900 {},
901 {
902 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
903 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
904 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
905 },
906 {});
907 delay += Seconds (1.0);
908
909 //----------------------------------------------------------------------------------------------------------------------------------
910 //Verify PHY state is CCA-BUSY as long as a 20 MHz signal above the energy detection threshold occupies P20
911 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
912 "Reception of signal that occupies P20 above ED threshold");
913 ScheduleTest (delay,
914 {{-60.0, MicroSeconds (0), MicroSeconds (100), P20_CENTER_FREQUENCY, 20}},
915 {},
916 {
917 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
918 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
919 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
920 },
921 {
922 {MicroSeconds (100) - smallDelta,
923 MicroSeconds (100),
925 ((m_channelWidth > 20) ?
926 ((m_channelWidth > 40) ?
927 ((m_channelWidth > 80) ?
928 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
929 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}) :
930 std::vector<Time> {MicroSeconds (100), MicroSeconds (0)}) :
931 std::vector<Time> {})}
932 });
933 delay += Seconds (1.0);
934
935 //----------------------------------------------------------------------------------------------------------------------------------
936 //Verify PHY state is CCA-BUSY as long as the sum of 20 MHz signals occupying P20 is above the energy detection threshold
937 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
938 "Reception of two 20 MHz signals that occupies P20 below ED threshold with sum above ED threshold");
939 ScheduleTest (delay,
940 {{-64.0, MicroSeconds (0), MicroSeconds (100), P20_CENTER_FREQUENCY, 20},
941 {-65.0, MicroSeconds (50), MicroSeconds (200), P20_CENTER_FREQUENCY, 20}},
942 {},
943 {
944 {MicroSeconds (50) + aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
945 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
946 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
947 },
948 {
949 {MicroSeconds (100) - smallDelta,
950 MicroSeconds (100),
952 ((m_channelWidth > 20) ?
953 ((m_channelWidth > 40) ?
954 ((m_channelWidth > 80) ?
955 std::vector<Time> {MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
956 std::vector<Time> {MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}) :
957 std::vector<Time> {MicroSeconds (50), MicroSeconds (0)}) :
958 std::vector<Time> {})}
959 });
960 delay += Seconds (1.0);
961
962 //----------------------------------------------------------------------------------------------------------------------------------
963 //Verify PHY state stays IDLE when a 20 MHz HE SU PPDU with received power below the corresponding CCA sensitivity threshold occupies P20
964 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
965 "Reception of a 20 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
966 ScheduleTest (delay,
967 {},
968 {{-85.0, MicroSeconds (0), P20_CENTER_FREQUENCY, 20}},
969 {
970 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
971 {PpduDurations.at (20) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
972 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
973 },
974 {});
975 delay += Seconds (1.0);
976
977 //----------------------------------------------------------------------------------------------------------------------------------
978 //Verify PHY state transitions to CCA-BUSY when an HE SU PPDU with received power above the CCA sensitivity threshold occupies P20.
979 //The per20Bitmap should indicate idle on the primary 20 MHz subchannel because received power is below -72 dBm (27.3.20.6.5).
980 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
981 "Reception of a 20 MHz HE PPDU that occupies P20 above CCA sensitivity threshold");
982 ScheduleTest (delay,
983 {},
984 {{-80.0, MicroSeconds (0), P20_CENTER_FREQUENCY, 20}},
985 {
986 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
987 {PpduDurations.at (20) - smallDelta, WifiPhyState::RX}, //RX just before the transmission ends
988 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
989 },
990 {
991 {aCcaTime,
992 MicroSeconds (16),
994 ((m_channelWidth > 20) ?
995 ((m_channelWidth > 40) ?
996 ((m_channelWidth > 80) ?
997 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0)} :
998 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0)}) :
999 std::vector<Time> {Seconds (0), Seconds (0)}) :
1000 std::vector<Time> {})}
1001 });
1002 delay += Seconds (1.0);
1003
1004 //----------------------------------------------------------------------------------------------------------------------------------
1005 //Verify PHY state stays IDLE when a 40 MHz HE SU PPDU with received power below the CCA sensitivity threshold occupies P40
1006 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1007 "Reception of a 40 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1008 ScheduleTest (delay,
1009 {},
1010 {{-80.0, MicroSeconds (0), P40_CENTER_FREQUENCY, 40}},
1011 {
1012 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1013 {PpduDurations.at (40) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1014 {PpduDurations.at (40) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1015 },
1016 {});
1017 delay += Seconds (1.0);
1018
1019 //----------------------------------------------------------------------------------------------------------------------------------
1020 //Verify PHY state transitions to CCA-BUSY when an HE SU PPDU with received power above the CCA sensitivity threshold occupies P40.
1021 //The per20Bitmap should indicate idle on the primary 20 MHz subchannel because received power is below -72 dBm (27.3.20.6.5).
1022 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1023 "Reception of a 40 MHz HE PPDU that occupies P40 above CCA sensitivity threshold");
1024 ScheduleTest (delay,
1025 {},
1026 {{-75.0, MicroSeconds (0), P40_CENTER_FREQUENCY, 40}},
1027 {
1028 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
1029 {PpduDurations.at (40) - smallDelta, (m_channelWidth > 20) ? WifiPhyState::RX : WifiPhyState::CCA_BUSY}, //RX or IDLE just before the transmission ends
1030 {PpduDurations.at (40) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1031 },
1032 {
1033 {aCcaTime,
1034 MicroSeconds (16),
1036 ((m_channelWidth > 20) ?
1037 ((m_channelWidth > 40) ?
1038 ((m_channelWidth > 80) ?
1039 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0)} :
1040 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0)}) :
1041 std::vector<Time> {Seconds (0), Seconds (0)}) :
1042 std::vector<Time> {})}
1043 });
1044 delay += Seconds (1.0);
1045
1046 if (m_channelWidth > 20)
1047 {
1048 //----------------------------------------------------------------------------------------------------------------------------------
1049 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a 20 MHz signal below the energy detection threshold occupies S20
1050 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1051 "Reception of a 20 MHz signal that occupies S20 below ED threshold");
1052 ScheduleTest (delay,
1053 {{-65.0, MicroSeconds (0), MicroSeconds (100), S20_CENTER_FREQUENCY, 20}},
1054 {},
1055 {
1056 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1057 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1058 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1059 },
1060 {});
1061 delay += Seconds (1.0);
1062
1063 //----------------------------------------------------------------------------------------------------------------------------------
1064 //Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 20 MHz signal above the energy detection threshold occupies S20
1065 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1066 "Reception of a 20 MHz signal that occupies S20 above ED threshold");
1067 ScheduleTest (delay,
1068 {{-60.0, MicroSeconds (0), MicroSeconds (100), S20_CENTER_FREQUENCY, 20}},
1069 {},
1070 {
1071 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1072 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1073 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1074 },
1075 {
1076 {MicroSeconds (100) - smallDelta,
1077 MicroSeconds (100),
1079 ((m_channelWidth > 40) ?
1080 ((m_channelWidth > 80) ?
1081 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1082 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}) :
1083 std::vector<Time> {MicroSeconds (0), MicroSeconds (100)})}
1084 });
1085 delay += Seconds (1.0);
1086
1087 //----------------------------------------------------------------------------------------------------------------------------------
1088 //Verify PHY state is CCA-BUSY as long as a 40 MHz signal above the energy detection threshold occupies P40
1089 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1090 "Reception of a 40 MHz signal that occupies P40 above ED threshold");
1091 ScheduleTest (delay,
1092 {{-55.0, MicroSeconds (0), MicroSeconds (100), P40_CENTER_FREQUENCY, 40}},
1093 {},
1094 {
1095 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
1096 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
1097 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1098 },
1099 {
1100 {MicroSeconds (100) - smallDelta,
1101 MicroSeconds (100),
1103 ((m_channelWidth > 40) ?
1104 ((m_channelWidth > 80) ?
1105 std::vector<Time> {MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1106 std::vector<Time> {MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}) :
1107 std::vector<Time> {MicroSeconds (100), MicroSeconds (100)})}
1108 });
1109 delay += Seconds (1.0);
1110
1111 //----------------------------------------------------------------------------------------------------------------------------------
1112 //Verify PHY notifies CCA-BUSY for the primary channel while the secondary channel was already in CCA-BUSY state
1113 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1114 "Reception of a signal that occupies S20 followed by the reception of another signal that occupies P20");
1115 ScheduleTest (delay,
1116 {{-60.0, MicroSeconds (0), MicroSeconds (100), S20_CENTER_FREQUENCY, 20},
1117 {-60.0, MicroSeconds (50), MicroSeconds (100), P20_CENTER_FREQUENCY, 20}},
1118 {},
1119 {
1120 {aCcaTime, WifiPhyState::IDLE}, //state of primary stays idle after aCCATime
1121 {MicroSeconds (50) + aCcaTime, WifiPhyState::CCA_BUSY}, //state of primary is CCA-BUSY after aCCATime that followed the second transmission
1122 {MicroSeconds (50) + MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
1123 {MicroSeconds (50) + MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1124 },
1125 {
1126 {aCcaTime, //notification upon reception of the first signal
1127 MicroSeconds (100),
1129 ((m_channelWidth > 40) ?
1130 ((m_channelWidth > 80) ?
1131 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1132 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}) :
1133 std::vector<Time> {MicroSeconds (0), MicroSeconds (100)})},
1134 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1135 MicroSeconds (50) + MicroSeconds (100),
1137 ((m_channelWidth > 40) ?
1138 ((m_channelWidth > 80) ?
1139 std::vector<Time> {MicroSeconds (100), MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1140 std::vector<Time> {MicroSeconds (100), MicroSeconds (50), MicroSeconds (0), MicroSeconds (0)}) :
1141 std::vector<Time> {MicroSeconds (100), MicroSeconds (50)})}
1142 });
1143 delay += Seconds (1.0);
1144
1145 //----------------------------------------------------------------------------------------------------------------------------------
1146 //Verify PHY updates per-20 MHz CCA durations if a signal arrives on the secondary channel while primary is CCA-BUSY
1147 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1148 "Reception of a signal that occupies P20 followed by the reception of another signal that occupies S20");
1149 ScheduleTest (delay,
1150 {{-60.0, MicroSeconds (0), MicroSeconds (100), P20_CENTER_FREQUENCY, 20},
1151 {-60.0, MicroSeconds (50), MicroSeconds (100), S20_CENTER_FREQUENCY, 20}},
1152 {},
1153 {
1154 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
1155 {MicroSeconds (50) + aCcaTime, WifiPhyState::CCA_BUSY}, //state of primary is still CCA-BUSY after aCCATime that followed the second transmission
1156 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the first transmission ends
1157 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the first transmission ends
1158 },
1159 {
1160 {aCcaTime, //notification upon reception of the first signal
1161 MicroSeconds (100),
1163 ((m_channelWidth > 40) ?
1164 ((m_channelWidth > 80) ?
1165 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1166 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}) :
1167 std::vector<Time> {MicroSeconds (100), MicroSeconds (0)})},
1168 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1169 MicroSeconds (100),
1171 ((m_channelWidth > 40) ?
1172 ((m_channelWidth > 80) ?
1173 std::vector<Time> {MicroSeconds (50), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1174 std::vector<Time> {MicroSeconds (50), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}) :
1175 std::vector<Time> {MicroSeconds (50), MicroSeconds (100)})}
1176 });
1177 delay += Seconds (1.0);
1178
1179 //----------------------------------------------------------------------------------------------------------------------------------
1180 //Verify PHY state stays IDLE when a 20 MHz HE SU PPDU with received power below the CCA sensitivity threshold occupies S40
1181 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1182 "Reception of a 20 MHz HE PPDU that occupies S20 below CCA sensitivity threshold");
1183 ScheduleTest (delay,
1184 {},
1185 {{-75.0, MicroSeconds (0), S20_CENTER_FREQUENCY, 20}},
1186 {
1187 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1188 {PpduDurations.at (20) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1189 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1190 },
1191 {});
1192 delay += Seconds (1.0);
1193
1194 //----------------------------------------------------------------------------------------------------------------------------------
1195 //Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 20 MHz HE SU PPDU with received power above the CCA sensitivity threshold occupies S20
1196 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1197 "Reception of a 20 MHz HE PPDU that occupies S20 above CCA sensitivity threshold");
1198 ScheduleTest (delay,
1199 {},
1200 {{-70.0, MicroSeconds (0), S20_CENTER_FREQUENCY, 20}},
1201 {
1202 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1203 {PpduDurations.at (20) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1204 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1205 },
1206 {
1207 {aCcaTime,
1208 PpduDurations.at (20),
1210 ((m_channelWidth > 40) ?
1211 ((m_channelWidth > 80) ?
1212 std::vector<Time> {NanoSeconds (0), PpduDurations.at (20), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0)} :
1213 std::vector<Time> {NanoSeconds (0), PpduDurations.at (20), NanoSeconds (0), NanoSeconds (0)}) :
1214 std::vector<Time> {NanoSeconds (0), PpduDurations.at (20)})}
1215 });
1216 delay += Seconds (1.0);
1217
1218 //----------------------------------------------------------------------------------------------------------------------------------
1219 //Verify PHY state stays IDLE but CCA-BUSY indication is still reported as long as a signal above the energy detection threshold
1220 //occupies the S20 while a 40 MHz PPDU below the CCA sensitivity threshold is received on P40.
1221 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1222 "Reception of a 20 MHz signal that occupies S20 above ED threshold followed by a 40 MHz HE PPDU that occupies P40 below CCA sensitivity threshold");
1223 ScheduleTest (delay,
1224 {{-60.0, MicroSeconds (0), MicroSeconds (100), S20_CENTER_FREQUENCY, 20}}, //signal on S20 above threshold
1225 {{-80.0, MicroSeconds (50), P40_CENTER_FREQUENCY, 40}}, //PPDU on P40 below threshold
1226 {
1227 {MicroSeconds (50) + aCcaTime, WifiPhyState::IDLE}, //PHY state stays IDLE
1228 },
1229 {
1230 {MicroSeconds (50) - smallDelta,
1231 MicroSeconds (100),
1233 ((m_channelWidth > 20) ?
1234 ((m_channelWidth > 40) ?
1235 ((m_channelWidth > 80) ?
1236 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1237 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}) :
1238 std::vector<Time> {MicroSeconds (0), MicroSeconds (100)}) :
1239 std::vector<Time> {})},
1240 {MicroSeconds (100) - smallDelta,
1241 MicroSeconds (100),
1243 ((m_channelWidth > 40) ?
1244 ((m_channelWidth > 80) ?
1245 std::vector<Time> {MicroSeconds (0), MicroSeconds (46), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1246 std::vector<Time> {MicroSeconds (0), MicroSeconds (46), MicroSeconds (0), MicroSeconds (0)}) :
1247 std::vector<Time> {MicroSeconds (0), MicroSeconds (46)})}
1248 });
1249 delay += Seconds (1.0);
1250 }
1251
1252 if (m_channelWidth > 40)
1253 {
1254 //----------------------------------------------------------------------------------------------------------------------------------
1255 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a signal below the energy detection threshold occupies S40
1256 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1257 "Reception of a 20 MHz signal that occupies the first subchannel of S40 below ED threshold");
1258 ScheduleTest (delay,
1259 {{-65.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY - 10, 20}},
1260 {},
1261 {
1262 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1263 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1264 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1265 },
1266 {});
1267 delay += Seconds (1.0);
1268
1269 //----------------------------------------------------------------------------------------------------------------------------------
1270 //Verify PHY notifies CCA-BUSY for the S40 as long as a signal above the energy detection threshold occupies the first 20 MHz subchannel of the S40:
1271 //27.3.20.6.4: Any signal within the secondary 40 MHz channel at or above a threshold of –59 dBm within a period of aCCATime after the signal arrives at the receiver’s antenna(s).
1272 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1273 "Reception of a 20 MHz signal that occupies the first subchannel of S40 above ED threshold");
1274 ScheduleTest (delay,
1275 {{-55.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY - 10, 20}},
1276 {},
1277 {
1278 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1279 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1280 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1281 },
1282 {
1283 {MicroSeconds (100) - smallDelta,
1284 MicroSeconds (100),
1286 ((m_channelWidth > 80) ?
1287 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1288 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0)})}
1289 });
1290 delay += Seconds (1.0);
1291
1292 //----------------------------------------------------------------------------------------------------------------------------------
1293 //Verify PHY state stays IDLE for the S40 if a signal below the energy detection threshold occupies the second 20 MHz subchannel of the S40
1294 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1295 "Reception of a 20 MHz signal that occupies the second subchannel of S40 below ED threshold");
1296 ScheduleTest (delay,
1297 {{-65.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY + 10, 20}},
1298 {},
1299 {
1300 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1301 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1302 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1303 },
1304 {});
1305 delay += Seconds (1.0);
1306
1307 //----------------------------------------------------------------------------------------------------------------------------------
1308 //Verify PHY notifies CCA-BUSY for the S40 as long as a signal above the energy detection threshold occupies the second 20 MHz subchannel of the S40:
1309 //27.3.20.6.4: Any signal within the secondary 40 MHz channel at or above a threshold of –59 dBm within a period of aCCATime after the signal arrives at the receiver’s antenna(s).
1310 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1311 "Reception of a 20 MHz signal that occupies the second subchannel of S40 above ED threshold");
1312 ScheduleTest (delay,
1313 {{-55.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY + 10, 20}},
1314 {},
1315 {
1316 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1317 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1318 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1319 },
1320 {
1321 {MicroSeconds (100) - smallDelta,
1322 MicroSeconds (100),
1324 ((m_channelWidth > 80) ?
1325 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1326 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100)})}
1327 });
1328 delay += Seconds (1.0);
1329
1330 //----------------------------------------------------------------------------------------------------------------------------------
1331 //Verify PHY state stays IDLE for the S40 if a signal below the energy detection threshold occupies S40
1332 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1333 "Reception of a 40 MHz signal that occupies S40 below ED threshold");
1334 ScheduleTest (delay,
1335 {{-60.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY, 40}},
1336 {},
1337 {
1338 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1339 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1340 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1341 },
1342 {});
1343 delay += Seconds (1.0);
1344
1345 //----------------------------------------------------------------------------------------------------------------------------------
1346 //Verify PHY notifies CCA-BUSY for the S40 as long as a signal above the energy detection threshold occupies S40:
1347 //27.3.20.6.4: Any signal within the secondary 40 MHz channel at or above a threshold of –59 dBm within a period of aCCATime after the signal arrives at the receiver’s antenna(s).
1348 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1349 "Reception of a 20 MHz signal that occupies the second subchannel of S40 above ED threshold");
1350 ScheduleTest (delay,
1351 {{-55.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY, 40}},
1352 {},
1353 {
1354 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1355 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1356 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1357 },
1358 {
1359 {MicroSeconds (100) - smallDelta,
1360 MicroSeconds (100),
1362 ((m_channelWidth > 80) ?
1363 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1364 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100)})}
1365 });
1366 delay += Seconds (1.0);
1367
1368 //----------------------------------------------------------------------------------------------------------------------------------
1369 //Verify PHY state is CCA-BUSY as long as a 80 MHz signal above the energy detection threshold occupies P80
1370 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1371 "Reception of a 80 MHz signal that occupies P80 above ED threshold");
1372 ScheduleTest (delay,
1373 {{-55.0, MicroSeconds (0), MicroSeconds (100), P80_CENTER_FREQUENCY, 80}},
1374 {},
1375 {
1376 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
1377 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
1378 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1379 },
1380 {
1381 {MicroSeconds (100) - smallDelta,
1382 MicroSeconds (100),
1384 ((m_channelWidth > 80) ?
1385 std::vector<Time> {MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1386 std::vector<Time> {MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100)})}
1387 });
1388 delay += Seconds (1.0);
1389
1390 //----------------------------------------------------------------------------------------------------------------------------------
1391 //Verify PHY notifies CCA-BUSY for the P20 channel while the S40 channel was already in CCA-BUSY state
1392 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1393 "Reception of a 20 MHz signal that occupies S40 followed by the reception of another 20 MHz signal that occupies P20");
1394 ScheduleTest (delay,
1395 {{-55.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY - 10, 20},
1396 {-55.0, MicroSeconds (50), MicroSeconds (100), P20_CENTER_FREQUENCY, 20}},
1397 {},
1398 {
1399 {aCcaTime, WifiPhyState::IDLE}, //state of primary stays idle after aCCATime
1400 {MicroSeconds (50) + aCcaTime, WifiPhyState::CCA_BUSY}, //state of primary is CCA-BUSY after aCCATime that followed the second transmission
1401 {MicroSeconds (50) + MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
1402 {MicroSeconds (50) + MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1403 },
1404 {
1405 {aCcaTime, //notification upon reception of the first signal
1406 MicroSeconds (100),
1408 ((m_channelWidth > 80) ?
1409 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1410 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0)})},
1411 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1412 MicroSeconds (50) + MicroSeconds (100),
1414 ((m_channelWidth > 80) ?
1415 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1416 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (50), MicroSeconds (0)})}
1417 });
1418 delay += Seconds (1.0);
1419
1420 //----------------------------------------------------------------------------------------------------------------------------------
1421 //Verify PHY state stays IDLE but notifies CCA-BUSY for the S20 channel while the S40 channel was already in CCA-BUSY state
1422 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1423 "Reception of a signal that occupies S40 followed by the reception of another signal that occupies S20");
1424 ScheduleTest (delay,
1425 {{-55.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY - 10, 20},
1426 {-55.0, MicroSeconds (50), MicroSeconds (100), S20_CENTER_FREQUENCY, 20}},
1427 {},
1428 {
1429 {aCcaTime, WifiPhyState::IDLE}, //state of primary stays idle after aCCATime
1430 {MicroSeconds (50) + aCcaTime, WifiPhyState::IDLE}, //state of primary stays IDLE
1431 {MicroSeconds (50) + MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1432 {MicroSeconds (50) + MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1433 },
1434 {
1435 {aCcaTime, //notification upon reception of the first signal
1436 MicroSeconds (100),
1438 ((m_channelWidth > 80) ?
1439 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1440 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0)})},
1441 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1442 MicroSeconds (50) + MicroSeconds (100),
1444 ((m_channelWidth > 80) ?
1445 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1446 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (50), MicroSeconds (0)})}
1447 });
1448 delay += Seconds (1.0);
1449
1450 //----------------------------------------------------------------------------------------------------------------------------------
1451 //Verify PHY state stays IDLE when a 40 MHz HE SU PPDU with received power below the CCA sensitivity threshold occupies S40
1452 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1453 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
1454 ScheduleTest (delay,
1455 {},
1456 {{-75.0, MicroSeconds (0), S40_CENTER_FREQUENCY, 40}},
1457 {
1458 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1459 {PpduDurations.at (20) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1460 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1461 },
1462 {});
1463 delay += Seconds (1.0);
1464
1465 //----------------------------------------------------------------------------------------------------------------------------------
1466 //Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 40 MHz HE SU PPDU with received power above the CCA sensitivity threshold occupies S40
1467 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1468 "Reception of a 40 MHz HE PPDU that occupies S40 above CCA sensitivity threshold");
1469 ScheduleTest (delay,
1470 {},
1471 {{-70.0, MicroSeconds (0), S40_CENTER_FREQUENCY, 40}},
1472 {
1473 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1474 {PpduDurations.at (40) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1475 {PpduDurations.at (40) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1476 },
1477 {
1478 {aCcaTime,
1479 PpduDurations.at (40),
1481 ((m_channelWidth > 80) ?
1482 std::vector<Time> {NanoSeconds (0), NanoSeconds (0), PpduDurations.at (40), PpduDurations.at (40), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0)} :
1483 std::vector<Time> {NanoSeconds (0), NanoSeconds (0), PpduDurations.at (40), PpduDurations.at (40)})}
1484 });
1485 delay += Seconds (1.0);
1486
1487 //----------------------------------------------------------------------------------------------------------------------------------
1488 //Verify PHY state stays IDLE but CCA-BUSY indication is still reported as long as a signal above the energy detection threshold
1489 //occupies the S40 while a 80 MHz PPDU below the CCA sensitivity threshold is received on P80.
1490 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1491 "Reception of a 40 MHz signal that occupies S40 above ED threshold followed by a 80 MHz HE PPDU that occupies P80 below CCA sensitivity threshold");
1492 ScheduleTest (delay,
1493 {{-55.0, MicroSeconds (0), MicroSeconds (100), S40_CENTER_FREQUENCY, 40}}, //signal on S40 above threshold
1494 {{-80.0, MicroSeconds (50), P80_CENTER_FREQUENCY, 80}}, //PPDU on P80 below threshold
1495 {
1496 {MicroSeconds (50) + aCcaTime, WifiPhyState::IDLE}, //PHY state stays IDLE
1497 },
1498 {
1499 {MicroSeconds (50) - smallDelta,
1500 MicroSeconds (100),
1502 ((m_channelWidth > 80) ?
1503 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1504 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100)})},
1505 {MicroSeconds (100) - smallDelta,
1506 MicroSeconds (100),
1508 ((m_channelWidth > 80) ?
1509 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (46), MicroSeconds (46), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)} :
1510 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (46), MicroSeconds (46)})}
1511 });
1512 delay += Seconds (1.0);
1513 }
1514 else // 20 or 40 MHz receiver
1515 {
1516 //----------------------------------------------------------------------------------------------------------------------------------
1517 //Verify PHY notifies CCA-BUSY when a 80 MHz HE SU PPDU with received power above the CCA sensitivity threshold occupies P40
1518 //The per20Bitmap should indicate idle for all subchannels because received power is below -62 dBm (27.3.20.6.5).
1519 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1520 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA sensitivity threshold");
1521 ScheduleTest (delay,
1522 {},
1523 {{-70.0, MicroSeconds (0), P80_CENTER_FREQUENCY, 80}},
1524 {
1525 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA_BUSY after aCCATime
1526 {PpduDurations.at (80) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA_BUSY just before the transmission ends
1527 {PpduDurations.at (80) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1528 },
1529 {
1530 {aCcaTime,
1531 MicroSeconds (16),
1533 ((m_channelWidth > 20) ?
1534 ((m_channelWidth > 40) ?
1535 ((m_channelWidth > 80) ?
1536 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0)} :
1537 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0)}) :
1538 std::vector<Time> {Seconds (0), Seconds (0)}) :
1539 std::vector<Time> {})},
1540 {PpduDurations.at (80) - smallDelta,
1541 PpduDurations.at (80),
1543 ((m_channelWidth > 20) ?
1544 ((m_channelWidth > 40) ?
1545 ((m_channelWidth > 80) ?
1546 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0), Seconds (0)} :
1547 std::vector<Time> {Seconds (0), Seconds (0), Seconds (0), Seconds (0)}) :
1548 std::vector<Time> {Seconds (0), Seconds (0)}) :
1549 std::vector<Time> {})}
1550 });
1551 delay += Seconds (1.0);
1552
1553 //----------------------------------------------------------------------------------------------------------------------------------
1554 //Verify PHY notifies CCA-BUSY when a 80 MHz HE SU PPDU with received power above the CCA sensitivity threshold occupies P40
1555 //The per20Bitmap should indicate CCA_BUSY for all subchannels because received power is above -62 dBm (27.3.20.6.5).
1556 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1557 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA sensitivity threshold");
1558 ScheduleTest (delay,
1559 {},
1560 {{-55.0, MicroSeconds (0), P80_CENTER_FREQUENCY, 80}},
1561 {
1562 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA_BUSY after aCCATime
1563 {PpduDurations.at (80) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA_BUSY just before the transmission ends
1564 {PpduDurations.at (80) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1565 },
1566 {
1567 {aCcaTime,
1568 MicroSeconds (16),
1570 ((m_channelWidth > 20) ?
1571 ((m_channelWidth > 40) ?
1572 ((m_channelWidth > 80) ?
1573 std::vector<Time> {NanoSeconds (271200), NanoSeconds (271200), NanoSeconds (271200), NanoSeconds (271200), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0)} :
1574 std::vector<Time> {NanoSeconds (271200), NanoSeconds (271200), NanoSeconds (271200), NanoSeconds (271200)}) :
1575 std::vector<Time> {NanoSeconds (271200), NanoSeconds (271200)}) :
1576 std::vector<Time> {})},
1577 {PpduDurations.at (80) - smallDelta,
1578 PpduDurations.at (80),
1580 ((m_channelWidth > 20) ?
1581 ((m_channelWidth > 40) ?
1582 ((m_channelWidth > 80) ?
1583 std::vector<Time> {NanoSeconds (243200), NanoSeconds (243200), NanoSeconds (243200), NanoSeconds (243200), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0)} :
1584 std::vector<Time> {NanoSeconds (243200), NanoSeconds (243200), NanoSeconds (243200), NanoSeconds (243200)}) :
1585 std::vector<Time> {NanoSeconds (243200), NanoSeconds (243200)}) :
1586 std::vector<Time> {})}
1587 });
1588 delay += Seconds (1.0);
1589
1590 //----------------------------------------------------------------------------------------------------------------------------------
1591 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported when a signal not occupying the operational channel is being received
1592 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1593 "Reception of a 40 MHz HE PPDU that does not occupy the operational channel");
1594 ScheduleTest (delay,
1595 {},
1596 {{-50.0, MicroSeconds (0), S40_CENTER_FREQUENCY, 40}},
1597 {
1598 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1599 {PpduDurations.at (20) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1600 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1601 },
1602 {});
1603 delay += Seconds (1.0);
1604 }
1605
1606 if (m_channelWidth > 80)
1607 {
1608 //----------------------------------------------------------------------------------------------------------------------------------
1609 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the first 20 MHz subchannel of the S80
1610 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1611 "Reception of a 20 MHz signal that occupies the first subchannel of S80 below ED threshold");
1612 ScheduleTest (delay,
1613 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 30, 20}},
1614 {},
1615 {
1616 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1617 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1618 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1619 },
1620 {});
1621 delay += Seconds (1.0);
1622
1623 //----------------------------------------------------------------------------------------------------------------------------------
1624 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the first 20 MHz subchannel of the S80
1625 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1626 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1627 "Reception of a 20 MHz signal that occupies the first subchannel of S80 above ED threshold");
1628 ScheduleTest (delay,
1629 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 30, 20}},
1630 {},
1631 {
1632 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1633 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1634 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1635 },
1636 {
1637 {MicroSeconds (100) - smallDelta,
1638 MicroSeconds (100),
1640 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}}
1641 });
1642 delay += Seconds (1.0);
1643
1644 //----------------------------------------------------------------------------------------------------------------------------------
1645 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the second 20 MHz subchannel of the S80
1646 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1647 "Reception of a 20 MHz signal that occupies the second subchannel of S80 below ED threshold");
1648 ScheduleTest (delay,
1649 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 10, 20}},
1650 {},
1651 {
1652 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1653 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1654 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1655 },
1656 {});
1657 delay += Seconds (1.0);
1658
1659 //----------------------------------------------------------------------------------------------------------------------------------
1660 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the second 20 MHz subchannel of the S80
1661 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1662 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1663 "Reception of a 20 MHz signal that occupies the second subchannel of S80 above ED threshold");
1664 ScheduleTest (delay,
1665 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 10, 20}},
1666 {},
1667 {
1668 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1669 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1670 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1671 },
1672 {
1673 {MicroSeconds (100) - smallDelta,
1674 MicroSeconds (100),
1676 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}}
1677 });
1678 delay += Seconds (1.0);
1679
1680 //----------------------------------------------------------------------------------------------------------------------------------
1681 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the third 20 MHz subchannel of the S80
1682 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1683 "Reception of a 20 MHz signal that occupies the third subchannel of S80 below ED threshold");
1684 ScheduleTest (delay,
1685 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 10, 20}},
1686 {},
1687 {
1688 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1689 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1690 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1691 },
1692 {});
1693 delay += Seconds (1.0);
1694
1695 //----------------------------------------------------------------------------------------------------------------------------------
1696 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the third 20 MHz subchannel of the S80
1697 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1698 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1699 "Reception of a 20 MHz signal that occupies the third subchannel of S80 above ED threshold");
1700 ScheduleTest (delay,
1701 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 10, 20}},
1702 {},
1703 {
1704 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1705 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1706 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1707 },
1708 {
1709 {MicroSeconds (100) - smallDelta,
1710 MicroSeconds (100),
1712 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0)}}
1713 });
1714 delay += Seconds (1.0);
1715
1716 //----------------------------------------------------------------------------------------------------------------------------------
1717 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the fourth 20 MHz subchannel of the S80
1718 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1719 "Reception of a 20 MHz signal that occupies the fourth subchannel of S80 below ED threshold");
1720 ScheduleTest (delay,
1721 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 30, 20}},
1722 {},
1723 {
1724 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1725 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1726 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1727 },
1728 {});
1729 delay += Seconds (1.0);
1730
1731 //----------------------------------------------------------------------------------------------------------------------------------
1732 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the fourth 20 MHz subchannel of the S80
1733 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1734 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1735 "Reception of a 20 MHz signal that occupies the fourth subchannel of S80 above ED threshold");
1736 ScheduleTest (delay,
1737 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 30, 20}},
1738 {},
1739 {
1740 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1741 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1742 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1743 },
1744 {
1745 {MicroSeconds (100) - smallDelta,
1746 MicroSeconds (100),
1748 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100)}}
1749 });
1750 delay += Seconds (1.0);
1751
1752 //----------------------------------------------------------------------------------------------------------------------------------
1753 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the first and second 20 MHz subchannels of the S80
1754 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1755 "Reception of a 40 MHz signal that occupies the first and second subchannels of S80 below ED threshold");
1756 ScheduleTest (delay,
1757 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 20, 40}},
1758 {},
1759 {
1760 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1761 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1762 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1763 },
1764 {});
1765 delay += Seconds (1.0);
1766
1767 //----------------------------------------------------------------------------------------------------------------------------------
1768 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the first and second 20 MHz subchannels of the S80
1769 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1770 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1771 "Reception of a 40 MHz signal that occupies the first and second subchannels of S80 above ED threshold");
1772 ScheduleTest (delay,
1773 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 20, 40}},
1774 {},
1775 {
1776 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1777 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1778 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1779 },
1780 {
1781 {MicroSeconds (100) - smallDelta,
1782 MicroSeconds (100),
1784 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0)}}
1785 });
1786 delay += Seconds (1.0);
1787
1788 //----------------------------------------------------------------------------------------------------------------------------------
1789 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the third and fourth 20 MHz subchannels of the S80
1790 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1791 "Reception of a 40 MHz signal that occupies the third and fourth subchannels of S80 below ED threshold");
1792 ScheduleTest (delay,
1793 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 20, 40}},
1794 {},
1795 {
1796 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1797 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1798 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1799 },
1800 {});
1801 delay += Seconds (1.0);
1802
1803 //----------------------------------------------------------------------------------------------------------------------------------
1804 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the third and fourth 20 MHz subchannels of the S80
1805 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1806 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1807 "Reception of a 40 MHz signal that occupies the third and fourth subchannels of S80 above ED threshold");
1808 ScheduleTest (delay,
1809 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 20, 40}},
1810 {},
1811 {
1812 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1813 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1814 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1815 },
1816 {
1817 {MicroSeconds (100) - smallDelta,
1818 MicroSeconds (100),
1820 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100)}}
1821 });
1822 delay += Seconds (1.0);
1823
1824 //----------------------------------------------------------------------------------------------------------------------------------
1825 //Verify PHY state stays IDLE and no CCA-BUSY indication is reported if a signal below the energy detection threshold occupies the S80
1826 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1827 "Reception of a 80 MHz signal that occupies S80 below ED threshold");
1828 ScheduleTest (delay,
1829 {{-65.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY, 80}},
1830 {},
1831 {
1832 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1833 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1834 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1835 },
1836 {});
1837 delay += Seconds (1.0);
1838
1839 //----------------------------------------------------------------------------------------------------------------------------------
1840 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if a signal above the energy detection threshold occupies the S80
1841 //27.3.20.6.4: Any signal within the secondary 80 MHz channel at or above –56 dBm.
1842 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1843 "Reception of a 80 MHz signal that occupies S80 above ED threshold");
1844 ScheduleTest (delay,
1845 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY, 80}},
1846 {},
1847 {
1848 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1849 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1850 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1851 },
1852 {
1853 {MicroSeconds (100) - smallDelta,
1854 MicroSeconds (100),
1856 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100)}}
1857 });
1858 delay += Seconds (1.0);
1859
1860 //----------------------------------------------------------------------------------------------------------------------------------
1861 //Verify PHY state stays IDLE as long as a 160 MHz signal below the energy detection threshold occupies the whole band
1862 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1863 "Reception of a 160 MHz signal that occupies the whole band below ED threshold");
1864 ScheduleTest (delay,
1865 {{-55.0, MicroSeconds (0), MicroSeconds (100), P160_CENTER_FREQUENCY, 160}},
1866 {},
1867 {
1868 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1869 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1870 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1871 },
1872 {});
1873
1874 delay += Seconds (1.0);
1875
1876 //----------------------------------------------------------------------------------------------------------------------------------
1877 //Verify PHY state is CCA-BUSY as long as a 160 MHz signal above the energy detection threshold occupies the whole band
1878 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1879 "Reception of a 160 MHz signal that occupies the whole band above ED threshold");
1880 ScheduleTest (delay,
1881 {{-50.0, MicroSeconds (0), MicroSeconds (100), P160_CENTER_FREQUENCY, 160}},
1882 {},
1883 {
1884 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
1885 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
1886 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1887 },
1888 {
1889 {MicroSeconds (100) - smallDelta,
1890 MicroSeconds (100),
1892 std::vector<Time> {MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100)}}
1893 });
1894 delay += Seconds (1.0);
1895
1896 //----------------------------------------------------------------------------------------------------------------------------------
1897 //Verify PHY notifies CCA-BUSY for the P20 channel while the S80 channel was already in CCA-BUSY state
1898 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1899 "Reception of a 20 MHz signal that occupies S80 followed by the reception of another 20 MHz signal that occupies P20");
1900 ScheduleTest (delay,
1901 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 10, 20},
1902 {-55.0, MicroSeconds (50), MicroSeconds (100), P20_CENTER_FREQUENCY, 20}},
1903 {},
1904 {
1905 {aCcaTime, WifiPhyState::IDLE}, //state of primary stays idle after aCCATime
1906 {MicroSeconds (50) + aCcaTime, WifiPhyState::CCA_BUSY}, //state of primary is CCA-BUSY after aCCATime that followed the second transmission
1907 {MicroSeconds (50) + MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
1908 {MicroSeconds (50) + MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1909 },
1910 {
1911 {aCcaTime, //notification upon reception of the first signal
1912 MicroSeconds (100),
1914 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0)}},
1915 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1916 MicroSeconds (50) + MicroSeconds (100),
1918 std::vector<Time> {MicroSeconds (100), MicroSeconds (0), MicroSeconds (00), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (50), MicroSeconds (0)}}
1919 });
1920 delay += Seconds (1.0);
1921
1922 //----------------------------------------------------------------------------------------------------------------------------------
1923 //Verify PHY state stays IDLE but notifies CCA-BUSY for the S40 channel while the S80 channel was already in CCA-BUSY state
1924 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1925 "Reception of a signal that occupies S80 followed by the reception of another signal that occupies S40");
1926 ScheduleTest (delay,
1927 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 30, 20},
1928 {-55.0, MicroSeconds (50), MicroSeconds (100), S40_CENTER_FREQUENCY - 10, 20}},
1929 {},
1930 {
1931 {aCcaTime, WifiPhyState::IDLE}, //state of primary stays idle after aCCATime
1932 {MicroSeconds (50) + aCcaTime, WifiPhyState::IDLE}, //state of primary stays IDLE
1933 {MicroSeconds (50) + MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1934 {MicroSeconds (50) + MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1935 },
1936 {
1937 {aCcaTime, //notification upon reception of the first signal
1938 MicroSeconds (100),
1940 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100)}},
1941 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1942 MicroSeconds (50) + MicroSeconds (100),
1944 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (50)}}
1945 });
1946 delay += Seconds (1.0);
1947
1948 //----------------------------------------------------------------------------------------------------------------------------------
1949 //Verify PHY state stays IDLE but notifies CCA-BUSY for the S20 channel while the S80 channel was already in CCA-BUSY state
1950 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1951 "Reception of a signal that occupies S80 followed by the reception of another signal that occupies S20");
1952 ScheduleTest (delay,
1953 {{-55.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY - 30, 20},
1954 {-55.0, MicroSeconds (50), MicroSeconds (100), S20_CENTER_FREQUENCY, 20}},
1955 {},
1956 {
1957 {aCcaTime, WifiPhyState::IDLE}, //state of primary stays idle after aCCATime
1958 {MicroSeconds (50) + aCcaTime, WifiPhyState::IDLE}, //state of primary stays IDLE
1959 {MicroSeconds (50) + MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1960 {MicroSeconds (50) + MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1961 },
1962 {
1963 {aCcaTime, //notification upon reception of the first signal
1964 MicroSeconds (100),
1966 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}},
1967 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
1968 MicroSeconds (50) + MicroSeconds (100),
1970 std::vector<Time> {MicroSeconds (0), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}}
1971 });
1972 delay += Seconds (1.0);
1973
1974 //----------------------------------------------------------------------------------------------------------------------------------
1975 //Verify PHY state stays IDLE when a 80 MHz HE SU PPDU with received power below the CCA sensitivity threshold occupies S80
1976 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1977 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
1978 ScheduleTest (delay,
1979 {},
1980 {{-70.0, MicroSeconds (0), S80_CENTER_FREQUENCY, 80}},
1981 {
1982 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1983 {PpduDurations.at (20) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1984 {PpduDurations.at (20) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
1985 },
1986 {});
1987 delay += Seconds (1.0);
1988
1989 //----------------------------------------------------------------------------------------------------------------------------------
1990 //Verify PHY state stays IDLE but CCA-BUSY indication is reported when a 80 MHz HE SU PPDU with received power above the CCA sensitivity threshold occupies S80
1991 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
1992 "Reception of a 80 MHz HE PPDU that occupies S80 above CCA sensitivity threshold");
1993 ScheduleTest (delay,
1994 {},
1995 {{-65.0, MicroSeconds (0), S80_CENTER_FREQUENCY, 80}},
1996 {
1997 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
1998 {PpduDurations.at (80) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
1999 {PpduDurations.at (80) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
2000 },
2001 {
2002 {aCcaTime,
2003 PpduDurations.at (80),
2005 std::vector<Time> {NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), NanoSeconds (0), PpduDurations.at (80), PpduDurations.at (80), PpduDurations.at (80), PpduDurations.at (80)}}
2006 });
2007 delay += Seconds (1.0);
2008
2009 //----------------------------------------------------------------------------------------------------------------------------------
2010 //Verify PHY state stays IDLE and CCA-BUSY indication is reported if only the per20bitmap parameter changes
2011 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
2012 "Reception of a 20 MHz signal that generates a per20bitmap parameter change when previous CCA indication reports IDLE");
2013 ScheduleTest (delay,
2014 {{-60.0, MicroSeconds (0), MicroSeconds (100), S80_CENTER_FREQUENCY + 30, 20}},
2015 {},
2016 {
2017 {aCcaTime, WifiPhyState::IDLE}, //IDLE after aCCATime
2018 {MicroSeconds (100) - smallDelta, WifiPhyState::IDLE}, //IDLE just before the transmission ends
2019 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
2020 },
2021 {
2022 {aCcaTime,
2023 Seconds (0),
2025 std::vector<Time> {MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (100)}}
2026 });
2027 delay += Seconds (1.0);
2028
2029 //----------------------------------------------------------------------------------------------------------------------------------
2030 //Verify PHY state stays CCA_BUSY and CCA-BUSY indication is reported if only the per20bitmap parameter changes
2031 Simulator::Schedule (delay, &WifiPhyCcaIndicationTest::LogScenario, this,
2032 "Reception of a 20 MHz signal that generates a per20bitmap parameter change when previous CCA indication reports BUSY for the primary channel");
2033 ScheduleTest (delay,
2034 {{-50.0, MicroSeconds (0), MicroSeconds (100), P80_CENTER_FREQUENCY, 80},
2035 {-60.0, MicroSeconds (50), MicroSeconds (200), S80_CENTER_FREQUENCY + 30, 20}},
2036 {},
2037 {
2038 {aCcaTime, WifiPhyState::CCA_BUSY}, //CCA-BUSY after aCCATime
2039 {MicroSeconds (100) - smallDelta, WifiPhyState::CCA_BUSY}, //CCA-BUSY just before the transmission ends
2040 {MicroSeconds (100) + smallDelta, WifiPhyState::IDLE} //IDLE just after the transmission ends
2041 },
2042 {
2043 {aCcaTime,
2044 MicroSeconds (100),
2046 std::vector<Time> {MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (100), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0)}},
2047 {MicroSeconds (50) + aCcaTime, //notification upon reception of the second signal
2048 MicroSeconds (100),
2050 std::vector<Time> {MicroSeconds (50), MicroSeconds (50), MicroSeconds (50), MicroSeconds (50), MicroSeconds (0), MicroSeconds (0), MicroSeconds (0), MicroSeconds (200)}}
2051 });
2052 delay += Seconds (1.0);
2053 }
2054
2055 Simulator::Run ();
2056}
2057
2058void
2060{
2061 m_frequency = 5180;
2062 m_channelWidth = 20;
2063 RunOne ();
2064
2065 m_frequency = 5190;
2066 m_channelWidth = 40;
2067 RunOne ();
2068
2069 m_frequency = 5210;
2070 m_channelWidth = 80;
2071 RunOne ();
2072
2073 m_frequency = 5250;
2074 m_channelWidth = 160;
2075 RunOne ();
2076
2077 Simulator::Destroy ();
2078}
2079
2080void
2082{
2083 m_rxPhy->Dispose ();
2084 m_rxPhy = nullptr;
2085 m_txPhy->Dispose ();
2086 m_txPhy = nullptr;
2087 for (auto& signalGenerator : m_signalGenerators)
2088 {
2089 signalGenerator->Dispose ();
2090 signalGenerator = nullptr;
2091 }
2092}
2093
2094
2102{
2103public:
2105};
2106
2108 : TestSuite ("wifi-phy-cca", UNIT)
2109{
2110 AddTestCase (new WifiPhyCcaThresholdsTest, TestCase::QUICK);
2111 AddTestCase (new WifiPhyCcaIndicationTest, TestCase::QUICK);
2112}
2113
#define max(a, b)
Definition: 80211b.c:43
void Run(ObjectFactory &factory, uint32_t pop, uint32_t total, uint32_t runs, Ptr< RandomVariableStream > eventStream, bool calRev)
Perform the runs for a single scheduler type.
PHY listener for CCA tests.
void NotifySleep(void) override
Notify listeners that we went to sleep.
void NotifyRxEndOk(void) override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
WifiChannelListType m_lastCcaBusyChannelType
Channel type indication for the last CCA-BUSY notification.
void NotifyRxEndError(void) 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 NotifyOn(void) override
Notify listeners that we went to switch on.
void Reset(void)
Reset function.
void NotifyTxStart(Time duration, double txPowerDbm) override
CcaTestPhyListener()=default
void NotifyWakeup(void) override
Notify listeners that we woke up.
std::size_t m_notifications
Number of CCA notifications.
void NotifyRxStart(Time duration) override
Time m_endCcaBusy
End of the CCA-BUSY duration.
void NotifyOff(void) override
Notify listeners that we went to switch off.
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 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 DoSetup(void) override
Implementation to do any local setup required for this TestCase.
void DoTeardown(void) override
Implementation to do any local setup required for this TestCase.
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.
uint16_t m_frequency
Operating frequency in MHz.
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.
void DoRun(void) override
Implementation to actually run this TestCase.
Wi-Fi PHY CCA Test Suite.
PHY CCA thresholds test.
Ptr< WifiNetDevice > m_device
The WifiNetDevice.
void DoSetup(void) override
Implementation to do any local setup required for this TestCase.
Ptr< HePpdu > CreateDummyHePpdu(uint16_t bandwidth)
Create a HE PPDU.
Ptr< WifiPsdu > CreateDummyPsdu(void)
Create a dummy PSDU whose payload is 1000 bytes.
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...
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(void)
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)
Ptr< OfdmPpdu > CreateDummyNonHtPpdu(void)
Create a non-HT PPDU.
double m_obssPdLevel
The current OBSS-PD level (in dBm)
void DoTeardown(void) override
Implementation to do any local setup required for this TestCase.
void DoRun(void) override
Implementation to actually run this TestCase.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:130
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:256
void GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:294
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition: object.cc:252
void Dispose(void)
Dispose of this Object.
Definition: object.cc:214
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(void) const
Definition: pointer.h:201
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:994
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
A suite of tests to run.
Definition: test.h:1188
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
AttributeValue implementation for Time.
Definition: nstime.h:1309
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 SetChannel(Ptr< SpectrumChannel > c)
Set the channel attached to this device.
void SetDevice(Ptr< NetDevice > d)
Set the associated NetDevice instance.
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:600
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:1568
void SetCcaEdThreshold(double threshold)
Sets the CCA energy detection threshold (dBm).
Definition: wifi-phy.cc:454
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
Definition: wifi-phy.cc:608
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
Definition: wifi-phy.cc:883
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:993
void SetCcaSensitivityThreshold(double threshold)
Sets the CCA sensitivity threshold (dBm).
Definition: wifi-phy.cc:467
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
Definition: wifi-phy.cc:678
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
Definition: wifi-phy.cc:569
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
Definition: wifi-phy.cc:504
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
Definition: wifi-phy.cc:628
void RegisterListener(WifiPhyListener *listener)
Definition: wifi-phy.cc:423
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
Definition: wifi-phy.h:839
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
Definition: wifi-phy.cc:491
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:2038
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:206
#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:282
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
#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:141
#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:491
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1261
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1269
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1245
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:37
@ WIFI_MAC_QOSDATA
phy
Definition: third.py:84
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.