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. More... | |
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. More... | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
void | DoTeardown () override |
Implementation to do any local setup required for this TestCase. More... | |
void | RxDropped (Ptr< const Packet > packet, WifiPhyRxfailureReason reason) |
Function called upon a PSDU dropped by the PHY. More... | |
void | RxFailure (Ptr< const WifiPsdu > psdu) |
Function called upon a PSDU received unsuccessfuly. More... | |
void | RxSuccess (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu) |
Function called upon a PSDU received successfully. More... | |
void | SendPpdu (uint16_t centerFreqMhz, uint16_t bandwidthMhz) |
Function to create a PPDU. More... | |
Private Attributes | |
uint32_t | m_countRxDropped |
count RX drop More... | |
uint32_t | m_countRxFailure |
count RX failure More... | |
uint32_t | m_countRxSuccess |
count RX success More... | |
std::optional< Time > | m_lastRxDropped |
time of last RX drop, if any More... | |
std::optional< Time > | m_lastRxFailed |
time of last RX failure, if any More... | |
std::optional< Time > | m_lastRxSucceeded |
time of last RX success, if any More... | |
Ptr< SpectrumWifiPhy > | m_rxPhy |
RX PHY. More... | |
Ptr< SpectrumWifiPhy > | m_txPhy |
TX PHY. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
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 4215 of file wifi-phy-reception-test.cc.
TestUnsupportedBandwidthReception::TestUnsupportedBandwidthReception | ( | ) |
Definition at line 4288 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 4362 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 4454 of file wifi-phy-reception-test.cc.
References ns3::WifiPhy::AssignStreams(), CheckRx(), m_rxPhy, m_txPhy, ns3::MicroSeconds(), ns3::Seconds(), SendPpdu(), ns3::WifiPhy::SetOperatingChannel(), 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 4410 of file wifi-phy-reception-test.cc.
References ns3::SpectrumWifiPhy::AddChannel(), ns3::Node::AddDevice(), ns3::WifiPhy::ConfigureStandard(), m_rxPhy, m_txPhy, ns3::MakeCallback(), RxDropped(), RxFailure(), RxSuccess(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiNetDevice::SetPhy(), ns3::WifiPhy::SetReceiveErrorCallback(), ns3::WifiPhy::SetReceiveOkCallback(), ns3::ObjectBase::TraceConnectWithoutContext(), 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 4444 of file wifi-phy-reception-test.cc.
References ns3::Object::Dispose(), m_rxPhy, and m_txPhy.
|
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 4353 of file wifi-phy-reception-test.cc.
References m_countRxDropped, m_lastRxDropped, ns3::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 4345 of file wifi-phy-reception-test.cc.
References m_countRxFailure, m_lastRxFailed, ns3::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 4334 of file wifi-phy-reception-test.cc.
References m_countRxSuccess, m_lastRxSucceeded, ns3::Now(), and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Function to create a PPDU.
centerFreqMhz | the center frequency used for the transmission of the PPDU (in MHz) |
bandwidthMhz | the bandwidth used for the transmission of the PPDU (in MHz) |
Definition at line 4301 of file wifi-phy-reception-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::DbmToW(), ns3::WifiPhy::GetOperatingChannel(), ns3::WifiPhy::GetPhyBand(), ns3::WifiPsdu::GetSize(), m_rxPhy, m_txPhy, ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::SpectrumWifiPhy::StartRx(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by DoRun().
|
private |
count RX drop
Definition at line 4278 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxDropped().
|
private |
count RX failure
Definition at line 4277 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxFailure().
|
private |
count RX success
Definition at line 4276 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxSuccess().
|
private |
time of last RX drop, if any
Definition at line 4282 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxDropped().
|
private |
time of last RX failure, if any
Definition at line 4281 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxFailure().
|
private |
time of last RX success, if any
Definition at line 4280 of file wifi-phy-reception-test.cc.
Referenced by CheckRx(), and RxSuccess().
|
private |
RX PHY.
Definition at line 4284 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), and SendPpdu().
|
private |
TX PHY.
Definition at line 4285 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), DoTeardown(), and SendPpdu().