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

Test 80+80MHz transmission. More...

+ Inheritance diagram for SpectrumWifiPhy80Plus80Test:
+ Collaboration diagram for SpectrumWifiPhy80Plus80Test:

Public Member Functions

 SpectrumWifiPhy80Plus80Test ()
 
- 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

void CheckResults (bool expectSuccess)
 Verify results.
 
void DoRun () override
 Implementation to actually run this TestCase.
 
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.
 
void GenerateInterference (Ptr< SpectrumValue > interferencePsd, Time duration)
 Generate interference function.
 
void RunOne (const std::vector< uint8_t > &channelNumbers, MHz_u interferenceCenterFrequency, MHz_u interferenceBandWidth, bool expectSuccess)
 Run one function.
 
void RxFailureSta (Ptr< const WifiPsdu > psdu)
 Receive failure function for STA.
 
void RxSuccessSta (Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, const WifiTxVector &txVector, const std::vector< bool > &statusPerMpdu)
 Receive success function for STA.
 
void Send160MhzPpdu ()
 Send 160MHz PPDU function.
 
void StopInterference ()
 Stop interference function.
 
void SwitchChannel (const std::vector< uint8_t > &channelNumbers)
 Switch channel function.
 

Private Attributes

uint32_t m_countRxFailureSta
 count RX failure for STA
 
uint32_t m_countRxSuccessSta
 count RX success for STA
 
Ptr< SpectrumWifiPhym_phyAp
 PHY of AP.
 
Ptr< WaveformGeneratorm_phyInterferer
 PHY of interferer.
 
Ptr< SpectrumWifiPhym_phySta
 PHY of STA.
 

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

Test 80+80MHz transmission.

The test verifies that two non-contiguous segments are handled by the spectrum PHY to transmit 160 MHz PPDUs when the operating channel is configured as 80+80MHz.

The test first considers a contiguous 160 MHz segment and generate interference on the second 80 MHz band to verify reception fails in this scenario. Then, a similar interference is generated when a 80+80MHz operating channel is configured, where the first frequency segment occupies the first 80 MHz band of the previous 160 MHz operating channel. The reception should succeed in that scenario, which demonstrates the second 80 MHz band of the operating channel is no longer occupying that spectrum portion (the interference is hence is the gap between the two frequency segments). Finally, the test also generates interference on each of the frequency segments when the operating channel is 80+80MHz, to demonstrate the frequency segments are positioned as expected.

Definition at line 1229 of file spectrum-wifi-phy-test.cc.

Constructor & Destructor Documentation

◆ SpectrumWifiPhy80Plus80Test()

SpectrumWifiPhy80Plus80Test::SpectrumWifiPhy80Plus80Test ( )

Definition at line 1310 of file spectrum-wifi-phy-test.cc.

Member Function Documentation

◆ CheckResults()

void SpectrumWifiPhy80Plus80Test::CheckResults ( bool expectSuccess)
private

Verify results.

Parameters
expectSuccessflag to indicate whether reception is expected to be successful

Definition at line 1393 of file spectrum-wifi-phy-test.cc.

References m_countRxFailureSta, m_countRxSuccessSta, NS_LOG_FUNCTION, and NS_TEST_ASSERT_MSG_EQ.

Referenced by RunOne().

+ Here is the caller graph for this function:

◆ DoRun()

void SpectrumWifiPhy80Plus80Test::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 1510 of file spectrum-wifi-phy-test.cc.

References ns3::Simulator::Destroy(), and RunOne().

+ Here is the call graph for this function:

◆ DoSetup()

void SpectrumWifiPhy80Plus80Test::DoSetup ( )
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 1403 of file spectrum-wifi-phy-test.cc.

References ns3::CreateObject(), m_phyAp, m_phyInterferer, m_phySta, ns3::MakeCallback(), RxFailureSta(), RxSuccessSta(), and ns3::WIFI_STANDARD_80211ax.

+ Here is the call graph for this function:

◆ DoTeardown()

void SpectrumWifiPhy80Plus80Test::DoTeardown ( )
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 1459 of file spectrum-wifi-phy-test.cc.

References m_phyAp, m_phyInterferer, and m_phySta.

◆ GenerateInterference()

void SpectrumWifiPhy80Plus80Test::GenerateInterference ( Ptr< SpectrumValue > interferencePsd,
Time duration )
private

Generate interference function.

Parameters
interferencePsdthe PSD of the interference to be generated
durationthe duration of the interference

Definition at line 1361 of file spectrum-wifi-phy-test.cc.

References m_phyInterferer, ns3::Simulator::Schedule(), and StopInterference().

Referenced by RunOne().

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

◆ RunOne()

void SpectrumWifiPhy80Plus80Test::RunOne ( const std::vector< uint8_t > & channelNumbers,
MHz_u interferenceCenterFrequency,
MHz_u interferenceBandWidth,
bool expectSuccess )
private

Run one function.

Parameters
channelNumbersthe channel number for each segment of the operating channel
interferenceCenterFrequencythe center frequency of the interference signal to generate
interferenceBandWidththe band width of the interference signal to generate
expectSuccessflag to indicate whether reception is expected to be successful

Definition at line 1470 of file spectrum-wifi-phy-test.cc.

References CheckResults(), ns3::Create(), ns3::BandInfo::fl, GenerateInterference(), m_countRxFailureSta, m_countRxSuccessSta, ns3::MilliSeconds(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), Send160MhzPpdu(), and SwitchChannel().

Referenced by DoRun().

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

◆ RxFailureSta()

void SpectrumWifiPhy80Plus80Test::RxFailureSta ( Ptr< const WifiPsdu > psdu)
private

Receive failure function for STA.

Parameters
psduthe PSDU

Definition at line 1386 of file spectrum-wifi-phy-test.cc.

References m_countRxFailureSta, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ RxSuccessSta()

void SpectrumWifiPhy80Plus80Test::RxSuccessSta ( Ptr< const WifiPsdu > psdu,
RxSignalInfo rxSignalInfo,
const WifiTxVector & txVector,
const std::vector< bool > & statusPerMpdu )
private

Receive success function for STA.

Parameters
psduthe PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorthe transmit vector
statusPerMpdureception status per MPDU

Definition at line 1376 of file spectrum-wifi-phy-test.cc.

References m_countRxSuccessSta, and NS_LOG_FUNCTION.

Referenced by DoSetup().

+ Here is the caller graph for this function:

◆ Send160MhzPpdu()

void SpectrumWifiPhy80Plus80Test::Send160MhzPpdu ( )
private

Send 160MHz PPDU function.

Definition at line 1336 of file spectrum-wifi-phy-test.cc.

References ns3::Create(), ns3::HePhy::GetHeMcs7(), m_phyAp, ns3::NanoSeconds(), NS_LOG_FUNCTION, ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_SU.

Referenced by RunOne().

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

◆ StopInterference()

void SpectrumWifiPhy80Plus80Test::StopInterference ( )
private

Stop interference function.

Definition at line 1370 of file spectrum-wifi-phy-test.cc.

References m_phyInterferer.

Referenced by GenerateInterference().

+ Here is the caller graph for this function:

◆ SwitchChannel()

void SpectrumWifiPhy80Plus80Test::SwitchChannel ( const std::vector< uint8_t > & channelNumbers)
private

Switch channel function.

Parameters
channelNumbersthe channel number for each segment of the operating channel to switch to

Definition at line 1318 of file spectrum-wifi-phy-test.cc.

References ns3::WifiPhyOperatingChannel::FindFirst(), m_phyAp, m_phySta, NS_LOG_FUNCTION, ns3::WIFI_PHY_BAND_5GHZ, and ns3::WIFI_STANDARD_80211ax.

Referenced by RunOne().

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

Member Data Documentation

◆ m_countRxFailureSta

uint32_t SpectrumWifiPhy80Plus80Test::m_countRxFailureSta
private

count RX failure for STA

Definition at line 1307 of file spectrum-wifi-phy-test.cc.

Referenced by CheckResults(), RunOne(), and RxFailureSta().

◆ m_countRxSuccessSta

uint32_t SpectrumWifiPhy80Plus80Test::m_countRxSuccessSta
private

count RX success for STA

Definition at line 1306 of file spectrum-wifi-phy-test.cc.

Referenced by CheckResults(), RunOne(), and RxSuccessSta().

◆ m_phyAp

Ptr<SpectrumWifiPhy> SpectrumWifiPhy80Plus80Test::m_phyAp
private

PHY of AP.

Definition at line 1302 of file spectrum-wifi-phy-test.cc.

Referenced by DoSetup(), DoTeardown(), Send160MhzPpdu(), and SwitchChannel().

◆ m_phyInterferer

Ptr<WaveformGenerator> SpectrumWifiPhy80Plus80Test::m_phyInterferer
private

PHY of interferer.

Definition at line 1304 of file spectrum-wifi-phy-test.cc.

Referenced by DoSetup(), DoTeardown(), GenerateInterference(), and StopInterference().

◆ m_phySta

Ptr<SpectrumWifiPhy> SpectrumWifiPhy80Plus80Test::m_phySta
private

PHY of STA.

Definition at line 1303 of file spectrum-wifi-phy-test.cc.

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


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