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

Wifi Test. More...

+ Inheritance diagram for TestInterBssConstantObssPdAlgo:
+ Collaboration diagram for TestInterBssConstantObssPdAlgo:

Public Member Functions

 TestInterBssConstantObssPdAlgo (WifiStandard standard)
 Constructor.
 
 ~TestInterBssConstantObssPdAlgo () override
 
void DoRun () override
 Implementation to actually run this TestCase.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

Ptr< ListPositionAllocatorAllocatePositions (meter_u d1, meter_u d2, meter_u d3, meter_u d4, meter_u d5)
 Allocate the node positions.
 
void CheckPhyDropReasons (Ptr< WifiNetDevice > device, std::vector< WifiPhyRxfailureReason > expectedDropReasons)
 Check if the Phy drop reasons for a device are as expected.
 
void CheckPhyState (Ptr< WifiNetDevice > device, WifiPhyState expectedState)
 Check if the Phy State for a device is an expected value.
 
void CheckResults ()
 Check the results.
 
void ClearDropReasons ()
 Clear the drop reasons.
 
void NotifyPhyRxDrop (std::string context, Ptr< const Packet > p, WifiPhyRxfailureReason reason)
 Notify Phy receive drops.
 
void NotifyPhyRxEnd (std::string context, Ptr< const Packet > p)
 Notify Phy receive ends.
 
void NotifyPhyTxBegin (std::string context, Ptr< const Packet > p, double txPowerW)
 Notify Phy transmit begin.
 
void ResetResults ()
 Reset the results.
 
void RunOne ()
 Run one function.
 
void SendOnePacket (Ptr< WifiNetDevice > tx_dev, Ptr< WifiNetDevice > rx_dev, uint32_t payloadSize)
 Send one packet function.
 
void SetExpectedTxPower (dBm_u txPower)
 Set the expected transmit power.
 
void SetupSimulation ()
 Setup the simulation.
 

Private Attributes

NetDeviceContainer m_apDevices
 AP devices.
 
uint8_t m_bssColor1
 color for BSS 1
 
uint8_t m_bssColor2
 color for BSS 2
 
uint8_t m_bssColor3
 color for BSS 3
 
std::vector< WifiPhyRxfailureReasonm_dropReasonsAp1
 drop reasons for AP1
 
std::vector< WifiPhyRxfailureReasonm_dropReasonsAp2
 drop reasons for AP2
 
std::vector< WifiPhyRxfailureReasonm_dropReasonsSta1
 drop reasons for STA1
 
std::vector< WifiPhyRxfailureReasonm_dropReasonsSta2
 drop reasons for STA2
 
dBm_u m_expectedTxPower
 expected transmit power
 
unsigned int m_numAp1PacketsReceived
 number of received packets from AP1
 
unsigned int m_numAp1PacketsSent
 number of sent packets from AP1
 
unsigned int m_numAp2PacketsReceived
 number of received packets from AP2
 
unsigned int m_numAp2PacketsSent
 number of sent packets from AP2
 
unsigned int m_numSta1PacketsReceived
 number of received packets from STA1
 
unsigned int m_numSta1PacketsSent
 number of sent packets from STA1
 
unsigned int m_numSta2PacketsReceived
 number of received packets from STA2
 
unsigned int m_numSta2PacketsSent
 number of sent packets from STA2
 
dBm_u m_obssPdLevel
 OBSS-PD level.
 
dBm_u m_obssRxPower
 forced RX power for OBSS
 
unsigned int m_payloadSize1
 size in bytes of packet payload in BSS 1
 
unsigned int m_payloadSize2
 size in bytes of packet payload in BSS 2
 
unsigned int m_payloadSize3
 size in bytes of packet payload in BSS 3
 
NetDeviceContainer m_staDevices
 STA devices.
 
WifiStandard m_standard
 the standard to use for the test
 
dBm_u m_txPower
 configured transmit power
 

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

Detailed Description

Wifi Test.

This test case tests the transmission of inter-BSS cases and verify behavior of 11ax OBSS_PD spatial reuse.

The topology for this test case is made of three networks, each with one AP and one STA:

AP –d1– STA1 –d2– AP2 –d3– STA2 –d4– AP3 –d5– STA3 TX1 RX1 TX2 RX2 TX3 RX3

Main parameters: OBSS_PD level = -72dbm Received Power by TX1 from TX2 = [-62dbm, -82dbm] Received SINR by RX1 from TX1 > 3dB (enough to pass MCS0 reception) Received SINR by RX2 from TX2 > 3dB (enough to pass MCS0 reception) Received SINR by RX3 from TX3 > 3dB (enough to pass MCS0 reception) TX1/RX1 BSS Color = 1 TX2/RX2 transmission PPDU BSS Color = [2 0] TX3/RX3 BSS color = 3 (BSS 3 only used to test some corner cases) PHY = 11ax, MCS 0, 80MHz

Definition at line 66 of file inter-bss-test-suite.cc.

Constructor & Destructor Documentation

◆ TestInterBssConstantObssPdAlgo()

TestInterBssConstantObssPdAlgo::TestInterBssConstantObssPdAlgo ( WifiStandard standard)

Constructor.

Parameters
standardThe standard to use for the test

Definition at line 206 of file inter-bss-test-suite.cc.

◆ ~TestInterBssConstantObssPdAlgo()

TestInterBssConstantObssPdAlgo::~TestInterBssConstantObssPdAlgo ( )
override

Definition at line 230 of file inter-bss-test-suite.cc.

References ClearDropReasons().

+ Here is the call graph for this function:

Member Function Documentation

◆ AllocatePositions()

Ptr< ListPositionAllocator > TestInterBssConstantObssPdAlgo::AllocatePositions ( meter_u d1,
meter_u d2,
meter_u d3,
meter_u d4,
meter_u d5 )
private

Allocate the node positions.

Parameters
d1distance d1
d2distance d2
d3distance d3
d4distance d4
d5distance d5
Returns
the node positions

Definition at line 236 of file inter-bss-test-suite.cc.

References ns3::CreateObject().

Referenced by RunOne().

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

◆ CheckPhyDropReasons()

void TestInterBssConstantObssPdAlgo::CheckPhyDropReasons ( Ptr< WifiNetDevice > device,
std::vector< WifiPhyRxfailureReason > expectedDropReasons )
private

Check if the Phy drop reasons for a device are as expected.

Parameters
devicethe device to check
expectedDropReasonsthe expected PHY drop reasons

Definition at line 777 of file inter-bss-test-suite.cc.

References m_dropReasonsAp1, m_dropReasonsAp2, m_dropReasonsSta1, m_dropReasonsSta2, ns3::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by SetupSimulation().

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

◆ CheckPhyState()

void TestInterBssConstantObssPdAlgo::CheckPhyState ( Ptr< WifiNetDevice > device,
WifiPhyState expectedState )
private

Check if the Phy State for a device is an expected value.

Parameters
devicethe device to check
expectedStatethe expected PHY state

Definition at line 762 of file inter-bss-test-suite.cc.

References ns3::DynamicCast(), ns3::PointerValue::Get(), ns3::Simulator::Now(), and NS_TEST_ASSERT_MSG_EQ.

Referenced by SetupSimulation().

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

◆ CheckResults()

void TestInterBssConstantObssPdAlgo::CheckResults ( )
private

Check the results.

Definition at line 633 of file inter-bss-test-suite.cc.

References m_numAp1PacketsReceived, m_numAp1PacketsSent, m_numAp2PacketsReceived, m_numAp2PacketsSent, m_numSta1PacketsReceived, m_numSta1PacketsSent, m_numSta2PacketsReceived, m_numSta2PacketsSent, and NS_TEST_ASSERT_MSG_EQ.

Referenced by RunOne().

+ Here is the caller graph for this function:

◆ ClearDropReasons()

void TestInterBssConstantObssPdAlgo::ClearDropReasons ( )
private

Clear the drop reasons.

Definition at line 624 of file inter-bss-test-suite.cc.

References m_dropReasonsAp1, m_dropReasonsAp2, m_dropReasonsSta1, and m_dropReasonsSta2.

Referenced by ~TestInterBssConstantObssPdAlgo(), ResetResults(), and SetupSimulation().

+ Here is the caller graph for this function:

◆ DoRun()

void TestInterBssConstantObssPdAlgo::DoRun ( )
overridevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 934 of file inter-bss-test-suite.cc.

References m_bssColor1, m_bssColor2, m_bssColor3, m_obssPdLevel, m_obssRxPower, and RunOne().

+ Here is the call graph for this function:

◆ NotifyPhyRxDrop()

void TestInterBssConstantObssPdAlgo::NotifyPhyRxDrop ( std::string context,
Ptr< const Packet > p,
WifiPhyRxfailureReason reason )
private

Notify Phy receive drops.

Parameters
contextthe context
pthe packet
reasonthe reason why it was dropped

Definition at line 722 of file inter-bss-test-suite.cc.

References ConvertContextToNodeId(), m_dropReasonsAp1, m_dropReasonsAp2, m_dropReasonsSta1, m_dropReasonsSta2, m_payloadSize1, m_payloadSize2, and pktSize.

Referenced by RunOne().

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

◆ NotifyPhyRxEnd()

void TestInterBssConstantObssPdAlgo::NotifyPhyRxEnd ( std::string context,
Ptr< const Packet > p )
private

Notify Phy receive ends.

Parameters
contextthe context
pthe packet

Definition at line 699 of file inter-bss-test-suite.cc.

References ConvertContextToNodeId(), m_numAp1PacketsReceived, m_numAp2PacketsReceived, m_numSta1PacketsReceived, m_numSta2PacketsReceived, m_payloadSize1, m_payloadSize2, and pktSize.

Referenced by RunOne().

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

◆ NotifyPhyTxBegin()

void TestInterBssConstantObssPdAlgo::NotifyPhyTxBegin ( std::string context,
Ptr< const Packet > p,
double txPowerW )
private

Notify Phy transmit begin.

Parameters
contextthe context
pthe packet
txPowerWthe tx power

Definition at line 662 of file inter-bss-test-suite.cc.

References ConvertContextToNodeId(), m_expectedTxPower, m_numAp1PacketsSent, m_numAp2PacketsSent, m_numSta1PacketsSent, m_numSta2PacketsSent, m_payloadSize1, m_payloadSize2, NS_TEST_EXPECT_MSG_EQ, pktSize, ns3::TestDoubleIsEqual(), and ns3::WToDbm().

Referenced by RunOne().

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

◆ ResetResults()

void TestInterBssConstantObssPdAlgo::ResetResults ( )
private

Reset the results.

Definition at line 609 of file inter-bss-test-suite.cc.

References ClearDropReasons(), m_expectedTxPower, m_numAp1PacketsReceived, m_numAp1PacketsSent, m_numAp2PacketsReceived, m_numAp2PacketsSent, m_numSta1PacketsReceived, m_numSta1PacketsSent, m_numSta2PacketsReceived, m_numSta2PacketsSent, and m_txPower.

Referenced by RunOne().

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

◆ RunOne()

void TestInterBssConstantObssPdAlgo::RunOne ( )
private

Run one function.

Definition at line 817 of file inter-bss-test-suite.cc.

References AllocatePositions(), ns3::WifiHelper::AssignStreams(), CheckResults(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::Object::GetObject(), m_apDevices, m_bssColor1, m_bssColor2, m_bssColor3, m_obssPdLevel, m_obssRxPower, m_staDevices, m_standard, m_txPower, ns3::MakeCallback(), NotifyPhyRxDrop(), NotifyPhyRxEnd(), NotifyPhyTxBegin(), ResetResults(), ns3::Simulator::Run(), ns3::Config::Set(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), and SetupSimulation().

Referenced by DoRun().

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

◆ SendOnePacket()

void TestInterBssConstantObssPdAlgo::SendOnePacket ( Ptr< WifiNetDevice > tx_dev,
Ptr< WifiNetDevice > rx_dev,
uint32_t payloadSize )
private

Send one packet function.

Parameters
tx_devthe transmitting device
rx_devthe receiving device
payloadSizethe payload size

Definition at line 747 of file inter-bss-test-suite.cc.

References ns3::Create().

Referenced by SetupSimulation().

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

◆ SetExpectedTxPower()

void TestInterBssConstantObssPdAlgo::SetExpectedTxPower ( dBm_u txPower)
private

Set the expected transmit power.

Parameters
txPowerthe transmit power

Definition at line 756 of file inter-bss-test-suite.cc.

References m_expectedTxPower.

Referenced by SetupSimulation().

+ Here is the caller graph for this function:

◆ SetupSimulation()

void TestInterBssConstantObssPdAlgo::SetupSimulation ( )
private

Setup the simulation.

Definition at line 253 of file inter-bss-test-suite.cc.

References CheckPhyDropReasons(), CheckPhyState(), ClearDropReasons(), ns3::DynamicCast(), ns3::FILTERED, ns3::NetDeviceContainer::Get(), m_apDevices, m_bssColor1, m_bssColor2, m_obssPdLevel, m_obssRxPower, m_payloadSize1, m_payloadSize2, m_payloadSize3, m_staDevices, m_txPower, ns3::MicroSeconds(), ns3::OBSS_PD_CCA_RESET, ns3::Simulator::Schedule(), ns3::Seconds(), SendOnePacket(), SetExpectedTxPower(), and ns3::Simulator::Stop().

Referenced by RunOne().

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

Member Data Documentation

◆ m_apDevices

NetDeviceContainer TestInterBssConstantObssPdAlgo::m_apDevices
private

AP devices.

Definition at line 192 of file inter-bss-test-suite.cc.

Referenced by RunOne(), and SetupSimulation().

◆ m_bssColor1

uint8_t TestInterBssConstantObssPdAlgo::m_bssColor1
private

color for BSS 1

Definition at line 199 of file inter-bss-test-suite.cc.

Referenced by DoRun(), RunOne(), and SetupSimulation().

◆ m_bssColor2

uint8_t TestInterBssConstantObssPdAlgo::m_bssColor2
private

color for BSS 2

Definition at line 200 of file inter-bss-test-suite.cc.

Referenced by DoRun(), RunOne(), and SetupSimulation().

◆ m_bssColor3

uint8_t TestInterBssConstantObssPdAlgo::m_bssColor3
private

color for BSS 3

Definition at line 201 of file inter-bss-test-suite.cc.

Referenced by DoRun(), and RunOne().

◆ m_dropReasonsAp1

std::vector<WifiPhyRxfailureReason> TestInterBssConstantObssPdAlgo::m_dropReasonsAp1
private

drop reasons for AP1

Definition at line 184 of file inter-bss-test-suite.cc.

Referenced by CheckPhyDropReasons(), ClearDropReasons(), and NotifyPhyRxDrop().

◆ m_dropReasonsAp2

std::vector<WifiPhyRxfailureReason> TestInterBssConstantObssPdAlgo::m_dropReasonsAp2
private

drop reasons for AP2

Definition at line 185 of file inter-bss-test-suite.cc.

Referenced by CheckPhyDropReasons(), ClearDropReasons(), and NotifyPhyRxDrop().

◆ m_dropReasonsSta1

std::vector<WifiPhyRxfailureReason> TestInterBssConstantObssPdAlgo::m_dropReasonsSta1
private

drop reasons for STA1

Definition at line 182 of file inter-bss-test-suite.cc.

Referenced by CheckPhyDropReasons(), ClearDropReasons(), and NotifyPhyRxDrop().

◆ m_dropReasonsSta2

std::vector<WifiPhyRxfailureReason> TestInterBssConstantObssPdAlgo::m_dropReasonsSta2
private

drop reasons for STA2

Definition at line 183 of file inter-bss-test-suite.cc.

Referenced by CheckPhyDropReasons(), ClearDropReasons(), and NotifyPhyRxDrop().

◆ m_expectedTxPower

dBm_u TestInterBssConstantObssPdAlgo::m_expectedTxPower
private

expected transmit power

Definition at line 197 of file inter-bss-test-suite.cc.

Referenced by NotifyPhyTxBegin(), ResetResults(), and SetExpectedTxPower().

◆ m_numAp1PacketsReceived

unsigned int TestInterBssConstantObssPdAlgo::m_numAp1PacketsReceived
private

number of received packets from AP1

Definition at line 179 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyRxEnd(), and ResetResults().

◆ m_numAp1PacketsSent

unsigned int TestInterBssConstantObssPdAlgo::m_numAp1PacketsSent
private

number of sent packets from AP1

Definition at line 174 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyTxBegin(), and ResetResults().

◆ m_numAp2PacketsReceived

unsigned int TestInterBssConstantObssPdAlgo::m_numAp2PacketsReceived
private

number of received packets from AP2

Definition at line 180 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyRxEnd(), and ResetResults().

◆ m_numAp2PacketsSent

unsigned int TestInterBssConstantObssPdAlgo::m_numAp2PacketsSent
private

number of sent packets from AP2

Definition at line 175 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyTxBegin(), and ResetResults().

◆ m_numSta1PacketsReceived

unsigned int TestInterBssConstantObssPdAlgo::m_numSta1PacketsReceived
private

number of received packets from STA1

Definition at line 177 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyRxEnd(), and ResetResults().

◆ m_numSta1PacketsSent

unsigned int TestInterBssConstantObssPdAlgo::m_numSta1PacketsSent
private

number of sent packets from STA1

Definition at line 172 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyTxBegin(), and ResetResults().

◆ m_numSta2PacketsReceived

unsigned int TestInterBssConstantObssPdAlgo::m_numSta2PacketsReceived
private

number of received packets from STA2

Definition at line 178 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyRxEnd(), and ResetResults().

◆ m_numSta2PacketsSent

unsigned int TestInterBssConstantObssPdAlgo::m_numSta2PacketsSent
private

number of sent packets from STA2

Definition at line 173 of file inter-bss-test-suite.cc.

Referenced by CheckResults(), NotifyPhyTxBegin(), and ResetResults().

◆ m_obssPdLevel

dBm_u TestInterBssConstantObssPdAlgo::m_obssPdLevel
private

OBSS-PD level.

Definition at line 195 of file inter-bss-test-suite.cc.

Referenced by DoRun(), RunOne(), and SetupSimulation().

◆ m_obssRxPower

dBm_u TestInterBssConstantObssPdAlgo::m_obssRxPower
private

forced RX power for OBSS

Definition at line 196 of file inter-bss-test-suite.cc.

Referenced by DoRun(), RunOne(), and SetupSimulation().

◆ m_payloadSize1

unsigned int TestInterBssConstantObssPdAlgo::m_payloadSize1
private

size in bytes of packet payload in BSS 1

Definition at line 187 of file inter-bss-test-suite.cc.

Referenced by NotifyPhyRxDrop(), NotifyPhyRxEnd(), NotifyPhyTxBegin(), and SetupSimulation().

◆ m_payloadSize2

unsigned int TestInterBssConstantObssPdAlgo::m_payloadSize2
private

size in bytes of packet payload in BSS 2

Definition at line 188 of file inter-bss-test-suite.cc.

Referenced by NotifyPhyRxDrop(), NotifyPhyRxEnd(), NotifyPhyTxBegin(), and SetupSimulation().

◆ m_payloadSize3

unsigned int TestInterBssConstantObssPdAlgo::m_payloadSize3
private

size in bytes of packet payload in BSS 3

Definition at line 189 of file inter-bss-test-suite.cc.

Referenced by SetupSimulation().

◆ m_staDevices

NetDeviceContainer TestInterBssConstantObssPdAlgo::m_staDevices
private

STA devices.

Definition at line 191 of file inter-bss-test-suite.cc.

Referenced by RunOne(), and SetupSimulation().

◆ m_standard

WifiStandard TestInterBssConstantObssPdAlgo::m_standard
private

the standard to use for the test

Definition at line 203 of file inter-bss-test-suite.cc.

Referenced by RunOne().

◆ m_txPower

dBm_u TestInterBssConstantObssPdAlgo::m_txPower
private

configured transmit power

Definition at line 194 of file inter-bss-test-suite.cc.

Referenced by ResetResults(), RunOne(), and SetupSimulation().


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