A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
TestPhyDropDueToTx Class Reference

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...

+ Inheritance diagram for TestPhyDropDueToTx:
+ Collaboration diagram for TestPhyDropDueToTx:

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
 
TestCaseoperator= (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.
 
TestCaseGetParent () 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< SpectrumWifiPhym_phyA {nullptr}
 transmit function
 
Ptr< SpectrumWifiPhym_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TestPhyDropDueToTx()

TestPhyDropDueToTx::TestPhyDropDueToTx ( Time delay,
WifiPhyRxfailureReason expectedReason )

Constructor.

Parameters
delaydelay in microseconds to send second packet
expectedReasonexpected failure reason

Definition at line 4895 of file wifi-phy-reception-test.cc.

Member Function Documentation

◆ CheckDropReason()

void TestPhyDropDueToTx::CheckDropReason ( )
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().

+ Here is the caller graph for this function:

◆ DoRun()

void TestPhyDropDueToTx::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().

+ Here is the call graph for this function:

◆ DoSetup()

void TestPhyDropDueToTx::DoSetup ( )
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.

+ Here is the call graph for this function:

◆ DoTeardown()

void TestPhyDropDueToTx::DoTeardown ( )
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.

References m_phyA, and m_phyB.

◆ PhyDropTraceSink()

void TestPhyDropDueToTx::PhyDropTraceSink ( Ptr< const Packet > p,
WifiPhyRxfailureReason reason )
private

RX dropped function.

Parameters
pthe packet
reasonthe reason

Definition at line 4934 of file wifi-phy-reception-test.cc.

References m_observedReason, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ Send()

void TestPhyDropDueToTx::Send ( Ptr< WifiPhy > phy) const
private

Send function (sends a single packet)

Parameters
phythe 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_delay

Time TestPhyDropDueToTx::m_delay
private

delay between transmissions in MicroSeconds

Definition at line 4889 of file wifi-phy-reception-test.cc.

Referenced by DoRun().

◆ m_expectedReason

WifiPhyRxfailureReason TestPhyDropDueToTx::m_expectedReason
private

expected WifiPhyRxfailureReason

Definition at line 4891 of file wifi-phy-reception-test.cc.

Referenced by CheckDropReason().

◆ m_observedReason

WifiPhyRxfailureReason TestPhyDropDueToTx::m_observedReason
private

observed WifiPhyRxfailureReason

Definition at line 4892 of file wifi-phy-reception-test.cc.

Referenced by CheckDropReason(), and PhyDropTraceSink().

◆ m_phyA

Ptr<SpectrumWifiPhy> TestPhyDropDueToTx::m_phyA {nullptr}
private

transmit function

Definition at line 4886 of file wifi-phy-reception-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().

◆ m_phyB

Ptr<SpectrumWifiPhy> TestPhyDropDueToTx::m_phyB {nullptr}
private

transmit/receive function

Definition at line 4887 of file wifi-phy-reception-test.cc.

Referenced by DoRun(), DoSetup(), and DoTeardown().


The documentation for this class was generated from the following file: