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

Test transmissions under different primary channel settings. More...

+ Inheritance diagram for WifiPrimaryChannelsTest:
+ Collaboration diagram for WifiPrimaryChannelsTest:

Public Member Functions

 WifiPrimaryChannelsTest (MHz_u channelWidth, bool useDistinctBssColors)
 Constructor.
 
 ~WifiPrimaryChannelsTest () override
 
void CheckAssociation ()
 Check that all stations associated with an AP.
 
void CheckReceivedMuPpdus (std::set< uint8_t > txBss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus, bool isDlMu)
 Check that (i) all stations/APs belonging to the given BSSes received the DL/UL MU PPDUs transmitted over the given channel width and RU width; and (ii) stations/APs belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission addressed to/from stations with the same AID was performed on a channel adjacent to the one they operate on, otherwise.
 
void CheckReceivedSuPpdus (std::set< uint8_t > txBss, MHz_u txChannelWidth)
 Check that (i) all stations belonging to the given BSSes received the SU PPDUs transmitted over the given channel width; and (ii) all stations belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission was performed on a channel adjacent to the one they operate on, otherwise.
 
void CheckReceivedTriggerFrames (std::set< uint8_t > txBss, MHz_u txChannelWidth)
 Check that (i) all stations belonging to the given BSSes received the transmitted Trigger Frame; and (ii) all stations belonging to the other BSSes did not receive any frame Trigger Frame (given that a Trigger Frame is transmitted on the primary20 channel and all the primary20 channels are distinct).
 
void DoSendHeTbPpdu (uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
 Have the STAs of the given BSS transmit an HE TB PPDU using the given transmission channel width and RU type.
 
void ReceiveDl (uint8_t bss, uint8_t station, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
 Callback invoked when a station receives a DL PPDU.
 
void ReceiveUl (uint8_t bss, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
 Callback invoked when an AP receives an UL PPDU.
 
void SendDlMuPpdu (uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
 Have the AP of the given BSS transmit a MU PPDU using the given transmission channel width and RU type.
 
void SendDlSuPpdu (uint8_t bss, MHz_u txChannelWidth)
 Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.
 
void SendHeTbPpdu (uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
 Have the AP of the given BSS transmit a Basic Trigger Frame.
 
void Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when PHY receives a PSDU to transmit.
 
- 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 DoRun () override
 Implementation to actually run this TestCase.
 
void DoSetup () override
 Implementation to do any local setup required for this TestCase.
 

Private Attributes

NetDeviceContainer m_apDevices
 container for AP's NetDevice
 
MHz_u m_channelWidth
 operating channel width
 
uint8_t m_nBss
 number of BSSes
 
uint8_t m_nStationsPerBss
 number of stations per AP
 
std::vector< std::bitset< 74 > > m_processed
 whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed
 
std::vector< std::bitset< 74 > > m_received
 whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received
 
std::vector< NetDeviceContainerm_staDevices
 containers for stations' NetDevices
 
Time m_time
 the time when the current action is executed
 
Ptr< WifiPsdum_trigger
 Basic Trigger Frame.
 
Time m_triggerTxDuration
 TX duration for Basic Trigger Frame.
 
WifiTxVector m_triggerTxVector
 TX vector for Basic Trigger Frame.
 
bool m_useDistinctBssColors
 true to set distinct BSS colors to BSSes
 

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 transmissions under different primary channel settings.

This test can be repeated for different widths of the operating channel. We configure as many BSSes as the number of distinct 20 MHz subchannels in the operating channel, so that each BSS is assigned a distinct primary20 channel. For each BSS, we test the transmission of SU PPDUs, DL MU PPDUs and HE TB PPDUs of all the widths (20 MHz, 40 MHz, etc.) allowed by the operating channel. Transmissions of a given type take place simultaneously in BSSes that do not operate on adjacent primary channels of the considered width (so that transmissions do not interfere with each other). It is also possible to select whether BSSes should be assigned (distinct) BSS colors or not.

Definition at line 51 of file wifi-primary-channels-test.cc.

Constructor & Destructor Documentation

◆ WifiPrimaryChannelsTest()

WifiPrimaryChannelsTest::WifiPrimaryChannelsTest ( MHz_u channelWidth,
bool useDistinctBssColors )

Constructor.

Parameters
channelWidththe operating channel width
useDistinctBssColorswhether to set distinct BSS colors to BSSes

Definition at line 209 of file wifi-primary-channels-test.cc.

◆ ~WifiPrimaryChannelsTest()

WifiPrimaryChannelsTest::~WifiPrimaryChannelsTest ( )
override

Definition at line 216 of file wifi-primary-channels-test.cc.

Member Function Documentation

◆ CheckAssociation()

void WifiPrimaryChannelsTest::CheckAssociation ( )

Check that all stations associated with an AP.

Definition at line 952 of file wifi-primary-channels-test.cc.

References ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), m_apDevices, m_nBss, m_nStationsPerBss, NS_TEST_EXPECT_MSG_EQ, and ns3::SINGLE_LINK_OP_ID.

Referenced by DoRun().

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

◆ CheckReceivedMuPpdus()

void WifiPrimaryChannelsTest::CheckReceivedMuPpdus ( std::set< uint8_t > txBss,
MHz_u txChannelWidth,
HeRu::RuType ruType,
std::size_t nRus,
bool isDlMu )

Check that (i) all stations/APs belonging to the given BSSes received the DL/UL MU PPDUs transmitted over the given channel width and RU width; and (ii) stations/APs belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission addressed to/from stations with the same AID was performed on a channel adjacent to the one they operate on, otherwise.

Parameters
txBssthe set of BSSes that transmitted an SU PPDU
txChannelWidththe given transmission channel width
ruTypethe given RU type
nRusthe number of RUs
isDlMutrue for DL MU PPDU, false for HE TB PPDU

Definition at line 1043 of file wifi-primary-channels-test.cc.

References m_nBss, m_nStationsPerBss, m_processed, m_received, m_useDistinctBssColors, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckReceivedSuPpdus()

void WifiPrimaryChannelsTest::CheckReceivedSuPpdus ( std::set< uint8_t > txBss,
MHz_u txChannelWidth )

Check that (i) all stations belonging to the given BSSes received the SU PPDUs transmitted over the given channel width; and (ii) all stations belonging to the other BSSes did not receive any frame if BSS Color is set (due to BSS Color filtering) or if no transmission was performed on a channel adjacent to the one they operate on, otherwise.

Parameters
txBssthe set of BSSes that transmitted an SU PPDU
txChannelWidththe given transmission channel width

Definition at line 965 of file wifi-primary-channels-test.cc.

References m_nBss, m_nStationsPerBss, m_processed, m_received, m_useDistinctBssColors, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ CheckReceivedTriggerFrames()

void WifiPrimaryChannelsTest::CheckReceivedTriggerFrames ( std::set< uint8_t > txBss,
MHz_u txChannelWidth )

Check that (i) all stations belonging to the given BSSes received the transmitted Trigger Frame; and (ii) all stations belonging to the other BSSes did not receive any frame Trigger Frame (given that a Trigger Frame is transmitted on the primary20 channel and all the primary20 channels are distinct).

Parameters
txBssthe set of BSSes that transmitted a Trigger Frame
txChannelWidththe given transmission channel width

Definition at line 1166 of file wifi-primary-channels-test.cc.

References m_nBss, m_nStationsPerBss, m_processed, m_received, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ DoRun()

void WifiPrimaryChannelsTest::DoRun ( )
overrideprivatevirtual

◆ DoSendHeTbPpdu()

void WifiPrimaryChannelsTest::DoSendHeTbPpdu ( uint8_t bss,
MHz_u txChannelWidth,
HeRu::RuType ruType,
std::size_t nRus )

Have the STAs of the given BSS transmit an HE TB PPDU using the given transmission channel width and RU type.

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width
ruTypethe given RU type
nRusthe number of RUs

Definition at line 868 of file wifi-primary-channels-test.cc.

References ns3::WifiPhy::CalculateTxDuration(), ns3::HePhy::ConvertHeTbPpduDurationToLSigLength(), ns3::Create(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HePhy::GetHeMcs8(), ns3::Time::IsZero(), m_apDevices, m_staDevices, ns3::NanoSeconds(), NS_LOG_INFO, ns3::Seconds(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiTxVector::SetLength(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::StaticCast(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by SendHeTbPpdu().

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

◆ DoSetup()

◆ ReceiveDl()

void WifiPrimaryChannelsTest::ReceiveDl ( uint8_t bss,
uint8_t station,
Ptr< const WifiPsdu > psdu,
RxSignalInfo rxSignalInfo,
WifiTxVector txVector,
std::vector< bool > perMpduStatus )

Callback invoked when a station receives a DL PPDU.

Parameters
bssthe BSS the receiving STA belongs to
stationthe receiving station
psduthe received PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorTxVector of the received PSDU
perMpduStatusper MPDU reception status

Definition at line 243 of file wifi-primary-channels-test.cc.

References ns3::DynamicCast(), ns3::WifiMacHeader::GetAddr1(), ns3::Mac48Address::GetBroadcast(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsTrigger(), m_processed, m_received, m_staDevices, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

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

◆ ReceiveUl()

void WifiPrimaryChannelsTest::ReceiveUl ( uint8_t bss,
Ptr< const WifiPsdu > psdu,
RxSignalInfo rxSignalInfo,
WifiTxVector txVector,
std::vector< bool > perMpduStatus )

Callback invoked when an AP receives an UL PPDU.

Parameters
bssthe BSS the receiving AP belongs to
psduthe received PSDU
rxSignalInfothe info on the received signal (
See also
RxSignalInfo)
Parameters
txVectorTxVector of the received PSDU
perMpduStatusper MPDU reception status

Definition at line 279 of file wifi-primary-channels-test.cc.

References ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::WifiTxVector::GetHeMuUserInfoMap(), ns3::WifiTxVector::IsUlMu(), m_apDevices, m_processed, m_received, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.

Referenced by DoRun().

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

◆ SendDlMuPpdu()

void WifiPrimaryChannelsTest::SendDlMuPpdu ( uint8_t bss,
MHz_u txChannelWidth,
HeRu::RuType ruType,
std::size_t nRus )

Have the AP of the given BSS transmit a MU PPDU using the given transmission channel width and RU type.

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width
ruTypethe given RU type
nRusthe number of RUs

Definition at line 787 of file wifi-primary-channels-test.cc.

References ns3::Create(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HeRu::GetEqualizedRuAllocation(), ns3::HePhy::GetHeMcs8(), ns3::VhtPhy::GetVhtMcs5(), m_apDevices, m_staDevices, ns3::NanoSeconds(), NS_LOG_INFO, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiTxVector::SetHeMuUserInfo(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiTxVector::SetRuAllocation(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiTxVector::SetSigBMode(), ns3::WifiMacHeader::SetType(), ns3::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_MU.

Referenced by DoRun().

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

◆ SendDlSuPpdu()

void WifiPrimaryChannelsTest::SendDlSuPpdu ( uint8_t bss,
MHz_u txChannelWidth )

Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width

Definition at line 755 of file wifi-primary-channels-test.cc.

References ns3::Create(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HePhy::GetHeMcs8(), m_apDevices, m_staDevices, ns3::NanoSeconds(), NS_LOG_INFO, ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetAddr2(), ns3::WifiMacHeader::SetAddr3(), ns3::WifiMacHeader::SetQosTid(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::WifiMacHeader::SetType(), ns3::SU_STA_ID, 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:

◆ SendHeTbPpdu()

void WifiPrimaryChannelsTest::SendHeTbPpdu ( uint8_t bss,
MHz_u txChannelWidth,
HeRu::RuType ruType,
std::size_t nRus )

Have the AP of the given BSS transmit a Basic Trigger Frame.

This method calls DoSendHeTbPpdu to actually have STAs transmit HE TB PPDUs using the given transmission channel width and RU type

Parameters
bssthe given BSS
txChannelWidththe given transmission channel width
ruTypethe given RU type
nRusthe number of RUs

Definition at line 844 of file wifi-primary-channels-test.cc.

References DoSendHeTbPpdu(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::WifiPsdu::GetHeader(), m_apDevices, m_trigger, m_triggerTxDuration, m_triggerTxVector, NS_LOG_INFO, ns3::Simulator::Schedule(), and ns3::WifiMacHeader::SetAddr2().

Referenced by DoRun().

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

◆ Transmit()

void WifiPrimaryChannelsTest::Transmit ( std::string context,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )

Callback invoked when PHY receives a PSDU to transmit.

Used to print transmitted PSDUs for debug purposes.

Parameters
contextthe context
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

Definition at line 221 of file wifi-primary-channels-test.cc.

References NS_LOG_INFO, and ns3::SU_STA_ID.

Referenced by DoRun().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_apDevices

NetDeviceContainer WifiPrimaryChannelsTest::m_apDevices
private

container for AP's NetDevice

Definition at line 198 of file wifi-primary-channels-test.cc.

Referenced by CheckAssociation(), DoRun(), DoSendHeTbPpdu(), DoSetup(), ReceiveUl(), SendDlMuPpdu(), SendDlSuPpdu(), and SendHeTbPpdu().

◆ m_channelWidth

MHz_u WifiPrimaryChannelsTest::m_channelWidth
private

operating channel width

Definition at line 193 of file wifi-primary-channels-test.cc.

Referenced by DoRun(), and DoSetup().

◆ m_nBss

uint8_t WifiPrimaryChannelsTest::m_nBss
private

◆ m_nStationsPerBss

uint8_t WifiPrimaryChannelsTest::m_nStationsPerBss
private

◆ m_processed

std::vector<std::bitset<74> > WifiPrimaryChannelsTest::m_processed
private

whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed

Definition at line 201 of file wifi-primary-channels-test.cc.

Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoSetup(), ReceiveDl(), and ReceiveUl().

◆ m_received

std::vector<std::bitset<74> > WifiPrimaryChannelsTest::m_received
private

whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received

Definition at line 199 of file wifi-primary-channels-test.cc.

Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoSetup(), ReceiveDl(), and ReceiveUl().

◆ m_staDevices

std::vector<NetDeviceContainer> WifiPrimaryChannelsTest::m_staDevices
private

containers for stations' NetDevices

Definition at line 197 of file wifi-primary-channels-test.cc.

Referenced by DoRun(), DoSendHeTbPpdu(), DoSetup(), ReceiveDl(), SendDlMuPpdu(), and SendDlSuPpdu().

◆ m_time

Time WifiPrimaryChannelsTest::m_time
private

the time when the current action is executed

Definition at line 203 of file wifi-primary-channels-test.cc.

Referenced by DoRun().

◆ m_trigger

Ptr<WifiPsdu> WifiPrimaryChannelsTest::m_trigger
private

Basic Trigger Frame.

Definition at line 204 of file wifi-primary-channels-test.cc.

Referenced by DoSetup(), and SendHeTbPpdu().

◆ m_triggerTxDuration

Time WifiPrimaryChannelsTest::m_triggerTxDuration
private

TX duration for Basic Trigger Frame.

Definition at line 206 of file wifi-primary-channels-test.cc.

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

◆ m_triggerTxVector

WifiTxVector WifiPrimaryChannelsTest::m_triggerTxVector
private

TX vector for Basic Trigger Frame.

Definition at line 205 of file wifi-primary-channels-test.cc.

Referenced by DoSetup(), and SendHeTbPpdu().

◆ m_useDistinctBssColors

bool WifiPrimaryChannelsTest::m_useDistinctBssColors
private

true to set distinct BSS colors to BSSes

Definition at line 194 of file wifi-primary-channels-test.cc.

Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), and DoSetup().


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