Test 80+80MHz transmission. More...
Public Member Functions | |
SpectrumWifiPhy80Plus80Test () | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (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, WifiTxVector txVector, 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< SpectrumWifiPhy > | m_phyAp |
PHY of AP. | |
Ptr< WaveformGenerator > | m_phyInterferer |
PHY of interferer. | |
Ptr< SpectrumWifiPhy > | m_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. | |
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. | |
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.
SpectrumWifiPhy80Plus80Test::SpectrumWifiPhy80Plus80Test | ( | ) |
Definition at line 1310 of file spectrum-wifi-phy-test.cc.
|
private |
Verify results.
expectSuccess | flag 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().
|
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().
|
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.
|
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.
|
private |
Generate interference function.
interferencePsd | the PSD of the interference to be generated |
duration | the 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().
|
private |
Run one function.
channelNumbers | the channel number for each segment of the operating channel |
interferenceCenterFrequency | the center frequency of the interference signal to generate |
interferenceBandWidth | the band width of the interference signal to generate |
expectSuccess | flag 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().
Receive failure function for STA.
psdu | the PSDU |
Definition at line 1386 of file spectrum-wifi-phy-test.cc.
References m_countRxFailureSta, and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
private |
Receive success function for STA.
psdu | the PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | the transmit vector |
statusPerMpdu | reception status per MPDU |
Definition at line 1376 of file spectrum-wifi-phy-test.cc.
References m_countRxSuccessSta, and NS_LOG_FUNCTION.
Referenced by DoSetup().
|
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().
|
private |
Stop interference function.
Definition at line 1370 of file spectrum-wifi-phy-test.cc.
References m_phyInterferer.
Referenced by GenerateInterference().
|
private |
Switch channel function.
channelNumbers | the 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().
|
private |
count RX failure for STA
Definition at line 1307 of file spectrum-wifi-phy-test.cc.
Referenced by CheckResults(), RunOne(), and RxFailureSta().
|
private |
count RX success for STA
Definition at line 1306 of file spectrum-wifi-phy-test.cc.
Referenced by CheckResults(), RunOne(), and RxSuccessSta().
|
private |
PHY of AP.
Definition at line 1302 of file spectrum-wifi-phy-test.cc.
Referenced by DoSetup(), DoTeardown(), Send160MhzPpdu(), and SwitchChannel().
|
private |
PHY of interferer.
Definition at line 1304 of file spectrum-wifi-phy-test.cc.
Referenced by DoSetup(), DoTeardown(), GenerateInterference(), and StopInterference().
|
private |
PHY of STA.
Definition at line 1303 of file spectrum-wifi-phy-test.cc.
Referenced by DoSetup(), DoTeardown(), and SwitchChannel().