From 74508aa6cc1c192f563a3ca68e98e03b03b8481c Mon Sep 17 00:00:00 2001 From: Sebastien Deronne Date: Sat, 23 Apr 2022 16:01:21 +0200 Subject: [PATCH] wifi: Add methods in PHY entities to compute CCA thresholds --- src/wifi/model/non-ht/ofdm-phy.cc | 13 ++++++ src/wifi/model/non-ht/ofdm-phy.h | 1 + src/wifi/model/phy-entity.cc | 8 +++- src/wifi/model/phy-entity.h | 16 +++++-- src/wifi/model/vht/vht-phy.cc | 50 ++++++++++++++++++++++ src/wifi/model/vht/vht-phy.h | 1 + src/wifi/test/wifi-phy-reception-test.cc | 54 ++++++++++++------------ 7 files changed, 113 insertions(+), 30 deletions(-) diff --git a/src/wifi/model/non-ht/ofdm-phy.cc b/src/wifi/model/non-ht/ofdm-phy.cc index a6d7f652f..5b5ab9c00 100644 --- a/src/wifi/model/non-ht/ofdm-phy.cc +++ b/src/wifi/model/non-ht/ofdm-phy.cc @@ -615,6 +615,19 @@ OfdmPhy::GetMeasurementChannelWidth (const Ptr ppdu) const return GetRxChannelWidth (ppdu->GetTxVector ()); } +double +OfdmPhy::GetCcaThreshold (const Ptr ppdu, WifiChannelListType channelType) const +{ + if (ppdu != nullptr && ppdu->GetTxVector ().GetChannelWidth () < 20) + { + //scale CCA sensitivity threshold for BW of 5 and 10 MHz + uint16_t bw = GetRxChannelWidth (ppdu->GetTxVector ()); + double thresholdW = DbmToW (m_wifiPhy->GetCcaSensitivityThreshold ()) * (bw / 20.0); + return WToDbm (thresholdW); + } + return PhyEntity::GetCcaThreshold (ppdu, channelType); +} + } //namespace ns3 namespace { diff --git a/src/wifi/model/non-ht/ofdm-phy.h b/src/wifi/model/non-ht/ofdm-phy.h index 8b6cafb2b..4033bc0ba 100644 --- a/src/wifi/model/non-ht/ofdm-phy.h +++ b/src/wifi/model/non-ht/ofdm-phy.h @@ -80,6 +80,7 @@ public: bool incFlag, uint32_t &totalAmpduSize, double &totalAmpduNumSymbols, uint16_t staId) const override; Ptr BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration) override; + double GetCcaThreshold (const Ptr ppdu, WifiChannelListType channelType) const override; /** * Initialize all OFDM modes (for all variants). diff --git a/src/wifi/model/phy-entity.cc b/src/wifi/model/phy-entity.cc index 9e40626e3..044983329 100644 --- a/src/wifi/model/phy-entity.cc +++ b/src/wifi/model/phy-entity.cc @@ -1038,6 +1038,12 @@ PhyEntity::GetRxChannelWidth (const WifiTxVector& txVector) const return std::min (m_wifiPhy->GetChannelWidth (), txVector.GetChannelWidth ()); } +double +PhyEntity::GetCcaThreshold (const Ptr ppdu, WifiChannelListType /*channelType*/) const +{ + return (ppdu == nullptr) ? m_wifiPhy->GetCcaEdThreshold () : m_wifiPhy->GetCcaSensitivityThreshold (); +} + void PhyEntity::SwitchMaybeToCcaBusy (const Ptr ppdu) { @@ -1047,7 +1053,7 @@ PhyEntity::SwitchMaybeToCcaBusy (const Ptr ppdu) //tracked by the InterferenceHelper class is higher than the CcaBusyThreshold const uint16_t channelWidth = GetMeasurementChannelWidth (ppdu); NS_LOG_FUNCTION (this << channelWidth); - const Time delayUntilCcaEnd = m_wifiPhy->m_interference->GetEnergyDuration (m_wifiPhy->m_ccaEdThresholdW, m_wifiPhy->GetPrimaryBand (channelWidth)); + const Time delayUntilCcaEnd = m_wifiPhy->m_interference->GetEnergyDuration (DbmToW (GetCcaThreshold (ppdu, WIFI_CHANLIST_PRIMARY)), m_wifiPhy->GetPrimaryBand (channelWidth)); if (delayUntilCcaEnd.IsStrictlyPositive ()) { NS_LOG_DEBUG ("Calling SwitchMaybeToCcaBusy for " << delayUntilCcaEnd.As (Time::S)); diff --git a/src/wifi/model/phy-entity.h b/src/wifi/model/phy-entity.h index a5fadfb09..a3aa36e16 100644 --- a/src/wifi/model/phy-entity.h +++ b/src/wifi/model/phy-entity.h @@ -23,6 +23,10 @@ #ifndef PHY_ENTITY_H #define PHY_ENTITY_H +#include +#include +#include +#include #include "wifi-mpdu-type.h" #include "wifi-tx-vector.h" #include "wifi-phy-band.h" @@ -33,9 +37,6 @@ #include "ns3/simple-ref-count.h" #include "ns3/nstime.h" #include "ns3/wifi-spectrum-value-helper.h" -#include -#include -#include /** * \file @@ -460,6 +461,15 @@ public: * \return the total amount of time this PHY will stay busy for the transmission of the PPDU */ virtual Time CalculateTxDuration (WifiConstPsduMap psduMap, const WifiTxVector& txVector, WifiPhyBand band) const; + /** + * Return the CCA threshold in dBm for a given channel type. + * If the channel type is not provided, the default CCA threshold is returned. + * + * \param ppdu the PPDU that is being received + * \param channelType the channel type + * \return the CCA threshold in dBm + */ + virtual double GetCcaThreshold (const Ptr ppdu, WifiChannelListType channelType) const; protected: /** diff --git a/src/wifi/model/vht/vht-phy.cc b/src/wifi/model/vht/vht-phy.cc index efd2fc88f..df9b03467 100644 --- a/src/wifi/model/vht/vht-phy.cc +++ b/src/wifi/model/vht/vht-phy.cc @@ -25,6 +25,8 @@ #include "ns3/wifi-phy.h" //only used for static mode constructor #include "ns3/wifi-utils.h" #include "ns3/interference-helper.h" +#include "ns3/wifi-net-device.h" +#include "vht-configuration.h" #include "ns3/log.h" #include "ns3/assert.h" @@ -67,6 +69,14 @@ const VhtPhy::NesExceptionMap VhtPhy::m_exceptionsMap { { std::make_tuple (160, 7, 8), 12 }, //instead of 9 { std::make_tuple (160, 7, 9), 12 } //instead of 10 }; + +const std::map channelTypeToScalingFactorDbm { + {WIFI_CHANLIST_PRIMARY, 0.0}, + {WIFI_CHANLIST_SECONDARY, 0.0}, + {WIFI_CHANLIST_SECONDARY40, 3.0}, + {WIFI_CHANLIST_SECONDARY80, 6.0} +}; + /* *NS_CHECK_STYLE_ON* */ VhtPhy::VhtPhy (bool buildModeList /* = true */) @@ -524,6 +534,46 @@ VhtPhy::GetMaxPsduSize (void) const return 4692480; } +double +VhtPhy::GetCcaThreshold (const Ptr ppdu, WifiChannelListType channelType) const +{ + if (ppdu != nullptr) + { + const uint16_t ppduBw = ppdu->GetTxVector ().GetChannelWidth (); + switch (channelType) + { + case WIFI_CHANLIST_PRIMARY: + { + //Start of a PPDU for which its power measured within the primary 20 MHz channel is at or above the CCA sensitivy threshold. + return m_wifiPhy->GetCcaSensitivityThreshold (); + } + case WIFI_CHANLIST_SECONDARY: + NS_ASSERT_MSG (ppduBw == 20, "Invalid channel width " << ppduBw); + break; + case WIFI_CHANLIST_SECONDARY40: + NS_ASSERT_MSG (ppduBw <= 40, "Invalid channel width " << ppduBw); + break; + case WIFI_CHANLIST_SECONDARY80: + NS_ASSERT_MSG (ppduBw <= 80, "Invalid channel width " << ppduBw); + break; + default: + NS_ASSERT_MSG (false, "Invalid channel list type"); + } + auto vhtConfiguration = m_wifiPhy->GetDevice ()->GetVhtConfiguration (); + NS_ASSERT (vhtConfiguration); + const auto thresholds = vhtConfiguration->GetSecondaryCcaSensitivityThresholdsPerBw (); + const auto it = thresholds.find (ppduBw); + NS_ASSERT_MSG (it != std::end (thresholds), "Invalid channel width " << ppduBw); + return it->second; + } + else + { + const auto it = channelTypeToScalingFactorDbm.find (channelType); + NS_ASSERT_MSG (it != std::end (channelTypeToScalingFactorDbm), "Invalid channel list type"); + return m_wifiPhy->GetCcaEdThreshold () + it->second; + } +} + } //namespace ns3 namespace { diff --git a/src/wifi/model/vht/vht-phy.h b/src/wifi/model/vht/vht-phy.h index 027cc7b3c..b0b0345fa 100644 --- a/src/wifi/model/vht/vht-phy.h +++ b/src/wifi/model/vht/vht-phy.h @@ -70,6 +70,7 @@ public: Ptr BuildPpdu (const WifiConstPsduMap & psdus, const WifiTxVector& txVector, Time ppduDuration) override; + double GetCcaThreshold (const Ptr ppdu, WifiChannelListType channelType) const override; /** * \return the WifiMode used for the SIG-A field diff --git a/src/wifi/test/wifi-phy-reception-test.cc b/src/wifi/test/wifi-phy-reception-test.cc index aac8d4235..ae497c967 100644 --- a/src/wifi/test/wifi-phy-reception-test.cc +++ b/src/wifi/test/wifi-phy-reception-test.cc @@ -346,23 +346,25 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void) // CASE 7: send two packets with same power within the 4us window and check PHY state: // PHY preamble detection should fail because SNR is too low (around 0 dB, which is lower than the threshold of 4 dB), - // and PHY state should stay IDLE since the total energy is below CCA-ED (-62 dBm). + // and PHY state should be CCA_BUSY since it should detect the start of a valid OFDM transmission at a receive level greater + // than or equal to the minimum modulation and coding rate sensitivity (–82 dBm for 20 MHz channel spacing). Simulator::Schedule (Seconds (7.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm); Simulator::Schedule (Seconds (7.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm); // At 4us, STA PHY STATE should stay IDLE - Simulator::Schedule (Seconds (7.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (7.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure Simulator::Schedule (Seconds (7.1), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount, this, 2, 1); // CASE 8: send two packets with second one 3 dB weaker within the 4us window and check PHY state: PHY preamble detection should fail // PHY preamble detection should fail because SNR is too low (around 3 dB, which is lower than the threshold of 4 dB), - // and PHY state should stay IDLE since the total energy is below CCA-ED (-62 dBm). + // and PHY state should be CCA_BUSY since it should detect the start of a valid OFDM transmission at a receive level greater + // than or equal to the minimum modulation and coding rate sensitivity (–82 dBm for 20 MHz channel spacing). Simulator::Schedule (Seconds (8.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm); Simulator::Schedule (Seconds (8.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithoutFrameCapture::SendPacket, this, rxPowerDbm - 3); // At 4us, STA PHY STATE should stay IDLE - Simulator::Schedule (Seconds (8.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (8.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure Simulator::Schedule (Seconds (8.1), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount, this, 2, 1); @@ -378,9 +380,9 @@ TestThresholdPreambleDetectionWithoutFrameCapture::DoRun (void) // At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX Simulator::Schedule (Seconds (9.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); Simulator::Schedule (Seconds (9.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX); - // Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us. + // Since it takes 152.8us to transmit the packet, PHY should be back to CCA_BUSY at time 152.8us. Simulator::Schedule (Seconds (9.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::RX); - Simulator::Schedule (Seconds (9.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (9.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // In this case, the first packet should be marked as a failure Simulator::Schedule (Seconds (9.1), &TestThresholdPreambleDetectionWithoutFrameCapture::CheckRxPacketCount, this, 2, 2); @@ -825,23 +827,25 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void) // CASE 13: send two packets with same power within the 4us window and check PHY state: // PHY preamble detection should fail because SNR is too low (around 0 dB, which is lower than the threshold of 4 dB), - // and PHY state should stay IDLE since the total energy is below CCA-ED (-62 dBm). + // and PHY state should be CCA_BUSY since it should detect the start of a valid OFDM transmission at a receive level greater + // than or equal to the minimum modulation and coding rate sensitivity (–82 dBm for 20 MHz channel spacing). Simulator::Schedule (Seconds (13.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); Simulator::Schedule (Seconds (13.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); // At 4us, STA PHY STATE should stay IDLE - Simulator::Schedule (Seconds (13.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (13.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure Simulator::Schedule (Seconds (13.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 4); // CASE 14: send two packets with second one 3 dB weaker within the 4us window and check PHY state: PHY preamble detection should fail // PHY preamble detection should fail because SNR is too low (around 3 dB, which is lower than the threshold of 4 dB), - // and PHY state should stay IDLE since the total energy is below CCA-ED (-62 dBm). + // and PHY state should be CCA_BUSY since it should detect the start of a valid OFDM transmission at a receive level greater + // than or equal to the minimum modulation and coding rate sensitivity (–82 dBm for 20 MHz channel spacing). Simulator::Schedule (Seconds (14.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); Simulator::Schedule (Seconds (14.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm - 3); // At 4us, STA PHY STATE should stay IDLE - Simulator::Schedule (Seconds (14.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (14.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure Simulator::Schedule (Seconds (14.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 4); @@ -857,23 +861,24 @@ TestThresholdPreambleDetectionWithFrameCapture::DoRun (void) // At 44us, PHY header should be successfully received and STA PHY STATE should move from CCA_BUSY to RX Simulator::Schedule (Seconds (15.0) + NanoSeconds (43999), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); Simulator::Schedule (Seconds (15.0) + NanoSeconds (44000), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX); - // Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us. + // Since it takes 152.8us to transmit the packet, PHY should be back to CCA_BUSY at time 152.8us. Simulator::Schedule (Seconds (15.0) + NanoSeconds (152799), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::RX); - Simulator::Schedule (Seconds (15.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (15.0) + NanoSeconds (152800), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // In this case, the first packet should be marked as a failure Simulator::Schedule (Seconds (15.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 5); // CASE 16: send two packets with second one 3 dB higher within the 4us window and check PHY state: // PHY preamble detection should switch because a higher packet is received within the 4us window, // but preamble detection should fail because SNR is too low (around 3 dB, which is lower than the threshold of 4 dB). - // PHY state should stay IDLE since the total energy is below CCA-ED (-62 dBm). + // and PHY state should be CCA_BUSY since it should detect the start of a valid OFDM transmission at a receive level greater + // than or equal to the minimum modulation and coding rate sensitivity (–82 dBm for 20 MHz channel spacing). Simulator::Schedule (Seconds (16.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm); Simulator::Schedule (Seconds (16.0) + MicroSeconds (2.0), &TestThresholdPreambleDetectionWithFrameCapture::SendPacket, this, rxPowerDbm + 3); // At 4us, STA PHY STATE should stay IDLE Simulator::Schedule (Seconds (16.0) + MicroSeconds (4.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); - // At 6us, STA PHY STATE should stay IDLE - Simulator::Schedule (Seconds (16.0) + MicroSeconds (6.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::IDLE); + // At 6us, STA PHY STATE should be CCA_BUSY + Simulator::Schedule (Seconds (16.0) + MicroSeconds (6.0), &TestThresholdPreambleDetectionWithFrameCapture::CheckPhyState, this, WifiPhyState::CCA_BUSY); // No more packet should have been successfully received, and since preamble detection did not pass the packet should not have been counted as a failure Simulator::Schedule (Seconds (16.1), &TestThresholdPreambleDetectionWithFrameCapture::CheckRxPacketCount, this, 2, 5); @@ -1276,7 +1281,6 @@ TestPhyHeadersReception::DoCheckPhyState (WifiPhyState expectedState) NS_TEST_ASSERT_MSG_EQ (currentState, expectedState, "PHY State " << currentState << " does not match expected state " << expectedState << " at " << Simulator::Now ()); } - TestPhyHeadersReception::~TestPhyHeadersReception () { m_phy = 0; @@ -1383,9 +1387,8 @@ TestPhyHeadersReception::DoRun (void) Simulator::Schedule (Seconds (5.0) + MicroSeconds (10), &TestPhyHeadersReception::SendPacket, this, rxPowerDbm); // At 10 us, STA PHY STATE should be CCA_BUSY. Simulator::Schedule (Seconds (5.0) + MicroSeconds (10.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); - // At 24us (end of L-SIG), STA PHY STATE should go to IDLE because L-SIG reception failed and the total energy is below CCA-ED. - Simulator::Schedule (Seconds (5.0) + NanoSeconds (23999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); - Simulator::Schedule (Seconds (5.0) + NanoSeconds (24000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE); + // At 24us (end of L-SIG), STA PHY STATE stay CCA_BUSY because L-SIG reception failed and the start of a valid OFDM transmission has been detected + Simulator::Schedule (Seconds (5.0) + NanoSeconds (24000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); // CASE 6: send one packet followed by a second one 3 dB weaker between the end of the 4us preamble detection window // and the start of L-SIG of the first packet: reception should not be aborted since L-SIG can be decoded (SNR high enough). @@ -1399,9 +1402,9 @@ TestPhyHeadersReception::DoRun (void) // At 44 us (end of HE-SIG), STA PHY STATE should move to RX since the PHY header reception should have succeeded. Simulator::Schedule (Seconds (6.0) + NanoSeconds (43999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); Simulator::Schedule (Seconds (6.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX); - // Since it takes 152.8us to transmit the packet, PHY should be back to IDLE at time 152.8us. + // Since it takes 152.8us to transmit the packet, PHY should be back to CCA_BUSY at time 152.8us. Simulator::Schedule (Seconds (6.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX); - Simulator::Schedule (Seconds (6.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (6.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); // CASE 7: send one packet followed by a second one with same power between the end of L-SIG and the start of HE-SIG of the first packet: // PHY header reception should not succeed but PHY should stay in RX state for the duration estimated from L-SIG. @@ -1414,9 +1417,8 @@ TestPhyHeadersReception::DoRun (void) Simulator::Schedule (Seconds (7.0) + MicroSeconds (24.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); // At 44 us (end of HE-SIG), STA PHY STATE should be not have moved to RX since reception of HE-SIG should have failed. Simulator::Schedule (Seconds (7.0) + MicroSeconds (44.0), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); - // STA PHY STATE should move back to IDLE once the duration estimated from L-SIG has elapsed, i.e. at 152.8us. - Simulator::Schedule (Seconds (7.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); - Simulator::Schedule (Seconds (7.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE); + // STA PHY STATE should keep CCA_BUSY once the duration estimated from L-SIG has elapsed, i.e. at 152.8us. + Simulator::Schedule (Seconds (7.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); // CASE 8: send one packet followed by a second one 3 dB weaker between the end of L-SIG and the start of HE-SIG of the first packet: // PHY header reception should succeed. @@ -1430,9 +1432,9 @@ TestPhyHeadersReception::DoRun (void) // At 44 us (end of HE-SIG), STA PHY STATE should move to RX since the PHY header reception should have succeeded. Simulator::Schedule (Seconds (8.0) + NanoSeconds (43999), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); Simulator::Schedule (Seconds (8.0) + NanoSeconds (44000), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX); - // STA PHY STATE should move back to IDLE once the duration estimated from L-SIG has elapsed, i.e. at 152.8us. + // STA PHY STATE should move back to CCA_BUSY once the duration estimated from L-SIG has elapsed, i.e. at 152.8us. Simulator::Schedule (Seconds (8.0) + NanoSeconds (152799), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::RX); - Simulator::Schedule (Seconds (8.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::IDLE); + Simulator::Schedule (Seconds (8.0) + NanoSeconds (152800), &TestPhyHeadersReception::CheckPhyState, this, WifiPhyState::CCA_BUSY); Simulator::Run (); Simulator::Destroy ();