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...
 
using TestDuration = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto 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 4868 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 4913 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 4937 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 5007 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 4952 of file wifi-phy-reception-test.cc.

References ns3::SpectrumWifiPhy::AddChannel(), ns3::WifiPhy::ConfigureStandard(), m_phyA, m_phyB, ns3::MakeCallback(), NS_LOG_FUNCTION, PhyDropTraceSink(), ns3::SpectrumWifiPhy::SetDevice(), ns3::WifiPhy::SetErrorRateModel(), ns3::WifiPhy::SetInterferenceHelper(), ns3::WifiPhy::SetOperatingChannel(), ns3::WifiPhy::SetTxPowerEnd(), ns3::WifiPhy::SetTxPowerStart(), ns3::ObjectBase::TraceConnectWithoutContext(), 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 5000 of file wifi-phy-reception-test.cc.

References ns3::Object::Dispose(), m_phyA, and m_phyB.

+ Here is the call graph for this function:

◆ PhyDropTraceSink()

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

RX dropped function.

Parameters
pthe packet
reasonthe reason

Definition at line 4945 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 4921 of file wifi-phy-reception-test.cc.

References ns3::HePhy::GetHeMcs0(), 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 4907 of file wifi-phy-reception-test.cc.

Referenced by DoRun().

◆ m_expectedReason

WifiPhyRxfailureReason TestPhyDropDueToTx::m_expectedReason
private

expected WifiPhyRxfailureReason

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

Referenced by CheckDropReason().

◆ m_observedReason

WifiPhyRxfailureReason TestPhyDropDueToTx::m_observedReason
private

observed WifiPhyRxfailureReason

Definition at line 4910 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 4904 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 4905 of file wifi-phy-reception-test.cc.

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


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