Unsupported Bandwidth Reception Test This test checks whether a PHY receiving a PPDU sent over a channel width larger than the one supported by the PHY is getting dropped at the expected time. More...
Public Member Functions | |
TestUnsupportedBandwidthReception () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckRx (uint32_t expectedCountRxSuccess, uint32_t expectedCountRxFailure, uint32_t expectedCountRxDropped, std::optional< Time > expectedLastRxSucceeded, std::optional< Time > expectedLastRxFailed, std::optional< Time > expectedLastRxDropped) |
Check the reception results. | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
void | DoTeardown () override |
Implementation to do any local setup required for this TestCase. | |
void | RxDropped (Ptr< const Packet > packet, WifiPhyRxfailureReason reason) |
Function called upon a PSDU dropped by the PHY. | |
void | RxFailure (Ptr< const WifiPsdu > psdu) |
Function called upon a PSDU received unsuccessfuly. | |
void | RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Function called upon a PSDU received successfully. | |
void | SendPpdu (MHz_u centerFreq, MHz_u bandwidth) |
Function to create a PPDU. | |
Private Attributes | |
uint32_t | m_countRxDropped |
count RX drop | |
uint32_t | m_countRxFailure |
count RX failure | |
uint32_t | m_countRxSuccess |
count RX success | |
std::optional< Time > | m_lastRxDropped |
time of last RX drop, if any | |
std::optional< Time > | m_lastRxFailed |
time of last RX failure, if any | |
std::optional< Time > | m_lastRxSucceeded |
time of last RX success, if any | |
Ptr< SpectrumWifiPhy > | m_rxPhy |
RX PHY. | |
Ptr< SpectrumWifiPhy > | m_txPhy |
TX PHY. | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Static Public Attributes inherited from ns3::TestCase | |
static constexpr auto | QUICK = Duration::QUICK |
Deprecated test duration simple enums. | |
static constexpr auto | EXTENSIVE = Duration::EXTENSIVE |
static constexpr auto | TAKES_FOREVER = Duration::TAKES_FOREVER |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. | |
void | AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK) |
Add an individual child TestCase to this test suite. | |
TestCase * | GetParent () const |
Get the parent of this TestCase. | |
bool | IsStatusFailure () const |
Check if any tests failed. | |
bool | IsStatusSuccess () const |
Check if all tests passed. | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. | |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
Log the failure of this TestCase. | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. | |
Unsupported Bandwidth Reception Test This test checks whether a PHY receiving a PPDU sent over a channel width larger than the one supported by the PHY is getting dropped at the expected time.
The expected time corresponds to the moment the PHY header indicating the channel width used to transmit the PPDU is received. Since we are considering 802.11ax for this test, this corresponds to the time HE-SIG-A is received.
Definition at line 4177 of file wifi-phy-reception-test.cc.
TestUnsupportedBandwidthReception::TestUnsupportedBandwidthReception | ( | ) |
Definition at line 4250 of file wifi-phy-reception-test.cc.
|
private |
Check the reception results.
expectedCountRxSuccess | the expected number of RX success |
expectedCountRxFailure | the expected number of RX failure |
expectedCountRxDropped | the expected number of RX drop |
expectedLastRxSucceeded | the expected time the last RX success occurred or std::nullopt if the expected number of RX success is not strictly positive |
expectedLastRxFailed | the expected time the last RX failure occurred or std::nullopt if the expected number of RX failure is not strictly positive |
expectedLastRxDropped | the expected time the last RX drop occurred or std::nullopt if the expected number of RX drop is not strictly positive |
Definition at line 4330 of file wifi-phy-reception-test.cc.
References m_countRxDropped, m_countRxFailure, m_countRxSuccess, m_lastRxDropped, m_lastRxFailed, m_lastRxSucceeded, NS_ASSERT, and NS_TEST_ASSERT_MSG_EQ.
Referenced by DoRun().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 4422 of file wifi-phy-reception-test.cc.
References CheckRx(), ns3::Simulator::Destroy(), m_rxPhy, m_txPhy, ns3::MicroSeconds(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), SendPpdu(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and ns3::WIFI_PHY_BAND_5GHZ.
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.
Reimplemented from ns3::TestCase.
Definition at line 4378 of file wifi-phy-reception-test.cc.
References ns3::CreateObject(), m_rxPhy, m_txPhy, ns3::MakeCallback(), RxDropped(), RxFailure(), RxSuccess(), and ns3::WIFI_STANDARD_80211ax.
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test teardown
Reimplemented from ns3::TestCase.
Definition at line 4412 of file wifi-phy-reception-test.cc.
|
private |
Function called upon a PSDU dropped by the PHY.
packet | the packet that was dropped |
reason | the reason the packet was dropped |
Definition at line 4321 of file wifi-phy-reception-test.cc.
References m_countRxDropped, m_lastRxDropped, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_FUNCTION, and ns3::UNSUPPORTED_SETTINGS.
Referenced by DoSetup().
Function called upon a PSDU received unsuccessfuly.
psdu | the PSDU |
Definition at line 4313 of file wifi-phy-reception-test.cc.
References m_countRxFailure, m_lastRxFailed, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Function called upon a PSDU received successfully.
psdu | the PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | the transmit vector |
statusPerMpdu | reception status per MPDU |
Definition at line 4302 of file wifi-phy-reception-test.cc.
References m_countRxSuccess, m_lastRxSucceeded, ns3::Simulator::Now(), and NS_LOG_FUNCTION.
Referenced by DoSetup().
Function to create a PPDU.
centerFreq | the center frequency used for the transmission of the PPDU |
bandwidth | the bandwidth used for the transmission of the PPDU |
Definition at line 4263 of file wifi-phy-reception-test.cc.
References ns3::Create(), ns3::WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity(), ns3::DbmToW(), ns3::HePhy::GetHeMcs0(), m_rxPhy, m_txPhy, ns3::NanoSeconds(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by DoRun().
|
private |
count RX drop
Definition at line 4240 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxDropped().
|
private |
count RX failure
Definition at line 4239 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxFailure().
|
private |
count RX success
Definition at line 4238 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxSuccess().
|
private |
time of last RX drop, if any
Definition at line 4244 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxDropped().
|
private |
time of last RX failure, if any
Definition at line 4243 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxFailure().
|
private |
time of last RX success, if any
Definition at line 4242 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxSuccess().
|
private |
RX PHY.
Definition at line 4246 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), and SendPpdu().
|
private |
TX PHY.
Definition at line 4247 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), and SendPpdu().