This test verifies that the WifiPhyRxfailureReason distinguishes between two cases: 1) a drop due to transmitting during the signal detection interval, and 2) a drop due to transmitting after the receiver has detected a preamble but is waiting for the end of the preamble. More...
Public Member Functions | |
TestPhyDropDueToTx (Time delay, WifiPhyRxfailureReason expectedReason) | |
Constructor. | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
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. | |
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. | |
Private Member Functions | |
void | CheckDropReason () |
Event scheduled at end of simulation for validation. | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | PhyDropTraceSink (Ptr< const Packet > p, WifiPhyRxfailureReason reason) |
RX dropped function. | |
void | Send (Ptr< WifiPhy > phy) const |
Send function (sends a single packet) | |
Private Attributes | |
Time | m_delay |
delay between transmissions in MicroSeconds | |
WifiPhyRxfailureReason | m_expectedReason |
expected WifiPhyRxfailureReason | |
WifiPhyRxfailureReason | m_observedReason |
observed WifiPhyRxfailureReason | |
Ptr< SpectrumWifiPhy > | m_phyA {nullptr} |
transmit function | |
Ptr< SpectrumWifiPhy > | m_phyB {nullptr} |
transmit/receive function | |
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 |
This test verifies that the WifiPhyRxfailureReason distinguishes between two cases: 1) a drop due to transmitting during the signal detection interval, and 2) a drop due to transmitting after the receiver has detected a preamble but is waiting for the end of the preamble.
2 SpectrumWifiPhy are setup and connected on the same spectrum channel. The test will send a packet over the channel and after a controlled amount of transmit delay (to check both cases) the receiver of the packet will send its own packet. If delay is less than preamble detection period, the signal detection should be aborted by transmission. If delay is greater than preamble detection period, the signal reception should be aborted by transmission.
Definition at line 4850 of file wifi-phy-reception-test.cc.
TestPhyDropDueToTx::TestPhyDropDueToTx | ( | Time | delay, |
WifiPhyRxfailureReason | expectedReason ) |
Constructor.
delay | delay in microseconds to send second packet |
expectedReason | expected failure reason |
Definition at line 4895 of file wifi-phy-reception-test.cc.
|
private |
Event scheduled at end of simulation for validation.
Definition at line 4926 of file wifi-phy-reception-test.cc.
References m_expectedReason, m_observedReason, 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 4996 of file wifi-phy-reception-test.cc.
References CheckDropReason(), ns3::Simulator::Destroy(), m_delay, m_phyA, m_phyB, ns3::NanoSeconds(), NS_LOG_FUNCTION, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Simulator::ScheduleNow(), and Send().
|
overrideprotectedvirtual |
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 4941 of file wifi-phy-reception-test.cc.
References ns3::CreateObject(), m_phyA, m_phyB, ns3::MakeCallback(), NS_LOG_FUNCTION, PhyDropTraceSink(), ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.
|
overrideprotectedvirtual |
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 4989 of file wifi-phy-reception-test.cc.
|
private |
RX dropped function.
p | the packet |
reason | the reason |
Definition at line 4934 of file wifi-phy-reception-test.cc.
References m_observedReason, and NS_LOG_FUNCTION.
Referenced by DoSetup().
Send function (sends a single packet)
phy | the WifiPhy object to send the packet |
Definition at line 4903 of file wifi-phy-reception-test.cc.
References ns3::Create(), ns3::HePhy::GetHeMcs0(), ns3::NanoSeconds(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.
Referenced by DoRun().
|
private |
delay between transmissions in MicroSeconds
Definition at line 4889 of file wifi-phy-reception-test.cc.
Referenced by DoRun().
|
private |
expected WifiPhyRxfailureReason
Definition at line 4891 of file wifi-phy-reception-test.cc.
Referenced by CheckDropReason().
|
private |
observed WifiPhyRxfailureReason
Definition at line 4892 of file wifi-phy-reception-test.cc.
Referenced by CheckDropReason(), and PhyDropTraceSink().
|
private |
transmit function
Definition at line 4886 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().
|
private |
transmit/receive function
Definition at line 4887 of file wifi-phy-reception-test.cc.
Referenced by DoRun(), DoSetup(), and DoTeardown().