Test transmissions under different primary channel settings. More...
Public Member Functions | |
WifiPrimaryChannelsTest (uint16_t channelWidth, bool useDistinctBssColors) | |
Constructor. More... | |
~WifiPrimaryChannelsTest () override | |
void | CheckAssociation () |
Check that all stations associated with an AP. More... | |
void | CheckReceivedMuPpdus (std::set< uint8_t > txBss, uint16_t 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. More... | |
void | CheckReceivedSuPpdus (std::set< uint8_t > txBss, uint16_t 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. More... | |
void | CheckReceivedTriggerFrames (std::set< uint8_t > txBss, uint16_t 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). More... | |
void | DoSendHeTbPpdu (uint8_t bss, uint16_t 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. More... | |
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. More... | |
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. More... | |
void | SendDlMuPpdu (uint8_t bss, uint16_t 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. More... | |
void | SendDlSuPpdu (uint8_t bss, uint16_t txChannelWidth) |
Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width. More... | |
void | SendHeTbPpdu (uint8_t bss, uint16_t txChannelWidth, HeRu::RuType ruType, std::size_t nRus) |
Have the AP of the given BSS transmit a Basic Trigger Frame. More... | |
void | Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when PHY receives a PSDU to transmit. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. More... | |
Private Attributes | |
NetDeviceContainer | m_apDevices |
container for AP's NetDevice More... | |
uint16_t | m_channelWidth |
operating channel width in MHz More... | |
uint8_t | m_nBss |
number of BSSes More... | |
uint8_t | m_nStationsPerBss |
number of stations per AP More... | |
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 More... | |
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 More... | |
std::vector< NetDeviceContainer > | m_staDevices |
containers for stations' NetDevices More... | |
Time | m_time |
the time when the current action is executed More... | |
Ptr< WifiPsdu > | m_trigger |
Basic Trigger Frame. More... | |
Time | m_triggerTxDuration |
TX duration for Basic Trigger Frame. More... | |
WifiTxVector | m_triggerTxVector |
TX vector for Basic Trigger Frame. More... | |
bool | m_useDistinctBssColors |
true to set distinct BSS colors to BSSes More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
Constructor. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
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 61 of file wifi-primary-channels-test.cc.
WifiPrimaryChannelsTest::WifiPrimaryChannelsTest | ( | uint16_t | channelWidth, |
bool | useDistinctBssColors | ||
) |
Constructor.
channelWidth | the operating channel width (in MHz) |
useDistinctBssColors | whether to set distinct BSS colors to BSSes |
Definition at line 222 of file wifi-primary-channels-test.cc.
|
override |
Definition at line 229 of file wifi-primary-channels-test.cc.
void WifiPrimaryChannelsTest::CheckAssociation | ( | ) |
Check that all stations associated with an AP.
Definition at line 962 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Get(), m_apDevices, m_nBss, m_nStationsPerBss, third::mac, NS_TEST_EXPECT_MSG_EQ, and ns3::SINGLE_LINK_OP_ID.
Referenced by DoRun().
void WifiPrimaryChannelsTest::CheckReceivedMuPpdus | ( | std::set< uint8_t > | txBss, |
uint16_t | 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.
txBss | the set of BSSes that transmitted an SU PPDU |
txChannelWidth | the given transmission channel width in MHz |
ruType | the given RU type |
nRus | the number of RUs |
isDlMu | true for DL MU PPDU, false for HE TB PPDU |
Definition at line 1053 of file wifi-primary-channels-test.cc.
References m_nBss, m_received, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::CheckReceivedSuPpdus | ( | std::set< uint8_t > | txBss, |
uint16_t | 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.
txBss | the set of BSSes that transmitted an SU PPDU |
txChannelWidth | the given transmission channel width in MHz |
Definition at line 975 of file wifi-primary-channels-test.cc.
References m_nBss, m_nStationsPerBss, m_received, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::CheckReceivedTriggerFrames | ( | std::set< uint8_t > | txBss, |
uint16_t | 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).
txBss | the set of BSSes that transmitted a Trigger Frame |
txChannelWidth | the given transmission channel width in MHz |
Definition at line 1176 of file wifi-primary-channels-test.cc.
References m_nBss, m_nStationsPerBss, m_received, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 488 of file wifi-primary-channels-test.cc.
References CheckAssociation(), CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), ns3::Config::Connect(), ns3::NetDeviceContainer::Get(), ns3::WifiNetDevice::GetMac(), ns3::WifiNetDevice::GetPhy(), m_apDevices, m_channelWidth, m_nBss, m_nStationsPerBss, m_staDevices, m_time, m_triggerTxDuration, third::mac, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), ReceiveDl(), ReceiveUl(), SendDlMuPpdu(), SendDlSuPpdu(), SendHeTbPpdu(), ns3::WifiMac::SetSsid(), nlohmann::to_string(), Transmit(), and check-style-clang-format::type.
void WifiPrimaryChannelsTest::DoSendHeTbPpdu | ( | uint8_t | bss, |
uint16_t | 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.
bss | the given BSS |
txChannelWidth | the given transmission channel width in MHz |
ruType | the given RU type |
nRus | the number of RUs |
Definition at line 878 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Get(), ns3::WifiPsdu::GetSize(), ns3::Time::IsZero(), m_apDevices, m_staDevices, 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::WIFI_MAC_QOSDATA, and ns3::WIFI_PREAMBLE_HE_TB.
Referenced by SendHeTbPpdu().
|
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 327 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Add(), ns3::Packet::AddHeader(), openflow-switch::container, ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::WifiPsdu::GetSize(), m_apDevices, m_channelWidth, m_nBss, m_nStationsPerBss, m_processed, m_received, m_staDevices, m_trigger, m_triggerTxDuration, m_triggerTxVector, m_useDistinctBssColors, third::mac, ns3::MicroSeconds(), third::mobility, NS_ABORT_MSG, third::phy, ns3::TupleValue< Args >::Set(), ns3::WifiMacHeader::SetAddr1(), ns3::WifiMacHeader::SetSequenceNumber(), ns3::CtrlTriggerHeader::SetType(), ns3::WifiMacHeader::SetType(), nlohmann::to_string(), third::wifi, ns3::WIFI_MAC_CTL_TRIGGER, ns3::WIFI_PHY_BAND_5GHZ, ns3::WIFI_PREAMBLE_LONG, ns3::WIFI_STANDARD_80211ax, and third::wifiStaNodes.
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.
bss | the BSS the receiving STA belongs to |
station | the receiving station |
psdu | the received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TxVector of the received PSDU |
perMpduStatus | per MPDU reception status |
Definition at line 256 of file wifi-primary-channels-test.cc.
References ns3::WifiPsdu::GetHeader(), ns3::WifiPsdu::GetNMpdus(), ns3::WifiMacHeader::IsQosData(), ns3::WifiMacHeader::IsTrigger(), m_received, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
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.
bss | the BSS the receiving AP belongs to |
psdu | the received PSDU |
rxSignalInfo | the info on the received signal ( |
txVector | TxVector of the received PSDU |
perMpduStatus | per MPDU reception status |
Definition at line 292 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Get(), ns3::WifiMacHeader::GetAddr3(), ns3::WifiPsdu::GetHeader(), ns3::WifiTxVector::GetHeMuUserInfoMap(), ns3::WifiPsdu::GetNMpdus(), ns3::WifiMacHeader::IsQosData(), ns3::WifiTxVector::IsUlMu(), m_apDevices, m_received, NS_LOG_INFO, and NS_TEST_EXPECT_MSG_EQ.
Referenced by DoRun().
void WifiPrimaryChannelsTest::SendDlMuPpdu | ( | uint8_t | bss, |
uint16_t | 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.
bss | the given BSS |
txChannelWidth | the given transmission channel width in MHz |
ruType | the given RU type |
nRus | the number of RUs |
Definition at line 797 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Get(), m_apDevices, m_staDevices, 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().
void WifiPrimaryChannelsTest::SendDlSuPpdu | ( | uint8_t | bss, |
uint16_t | txChannelWidth | ||
) |
Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.
bss | the given BSS |
txChannelWidth | the given transmission channel width in MHz |
Definition at line 765 of file wifi-primary-channels-test.cc.
References ns3::NetDeviceContainer::Get(), m_apDevices, m_staDevices, 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().
void WifiPrimaryChannelsTest::SendHeTbPpdu | ( | uint8_t | bss, |
uint16_t | 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
bss | the given BSS |
txChannelWidth | the given transmission channel width in MHz |
ruType | the given RU type |
nRus | the number of RUs |
Definition at line 854 of file wifi-primary-channels-test.cc.
References DoSendHeTbPpdu(), ns3::NetDeviceContainer::Get(), ns3::WifiPsdu::GetHeader(), m_apDevices, m_trigger, m_triggerTxDuration, m_triggerTxVector, NS_LOG_INFO, and ns3::WifiMacHeader::SetAddr2().
Referenced by DoRun().
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.
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Definition at line 234 of file wifi-primary-channels-test.cc.
References NS_LOG_INFO, and ns3::SU_STA_ID.
Referenced by DoRun().
|
private |
container for AP's NetDevice
Definition at line 211 of file wifi-primary-channels-test.cc.
Referenced by CheckAssociation(), DoRun(), DoSendHeTbPpdu(), DoSetup(), ReceiveUl(), SendDlMuPpdu(), SendDlSuPpdu(), and SendHeTbPpdu().
|
private |
operating channel width in MHz
Definition at line 206 of file wifi-primary-channels-test.cc.
|
private |
number of BSSes
Definition at line 208 of file wifi-primary-channels-test.cc.
Referenced by CheckAssociation(), CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoRun(), and DoSetup().
|
private |
number of stations per AP
Definition at line 209 of file wifi-primary-channels-test.cc.
Referenced by CheckAssociation(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoRun(), and DoSetup().
|
private |
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed
Definition at line 214 of file wifi-primary-channels-test.cc.
Referenced by DoSetup().
|
private |
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received
Definition at line 212 of file wifi-primary-channels-test.cc.
Referenced by CheckReceivedMuPpdus(), CheckReceivedSuPpdus(), CheckReceivedTriggerFrames(), DoSetup(), ReceiveDl(), and ReceiveUl().
|
private |
containers for stations' NetDevices
Definition at line 210 of file wifi-primary-channels-test.cc.
Referenced by DoRun(), DoSendHeTbPpdu(), DoSetup(), SendDlMuPpdu(), and SendDlSuPpdu().
|
private |
the time when the current action is executed
Definition at line 216 of file wifi-primary-channels-test.cc.
Referenced by DoRun().
Basic Trigger Frame.
Definition at line 217 of file wifi-primary-channels-test.cc.
Referenced by DoSetup(), and SendHeTbPpdu().
|
private |
TX duration for Basic Trigger Frame.
Definition at line 219 of file wifi-primary-channels-test.cc.
Referenced by DoRun(), DoSetup(), and SendHeTbPpdu().
|
private |
TX vector for Basic Trigger Frame.
Definition at line 218 of file wifi-primary-channels-test.cc.
Referenced by DoSetup(), and SendHeTbPpdu().
|
private |
true to set distinct BSS colors to BSSes
Definition at line 207 of file wifi-primary-channels-test.cc.
Referenced by DoSetup().