Test OFDMA acknowledgment sequences. More...
Classes | |
struct | FrameInfo |
Information about transmitted frames. More... | |
struct | MuEdcaParameterSet |
MU EDCA Parameter Set. More... | |
Public Member Functions | |
OfdmaAckSequenceTest (MHz_u width, WifiAcknowledgment::Method dlType, uint32_t maxAmpduSize, uint16_t txopLimit, uint16_t nPktsPerSta, MuEdcaParameterSet muEdcaParameterSet, WifiOfdmaScenario scenario) | |
Constructor. | |
~OfdmaAckSequenceTest () override | |
void | CheckResults (Time sifs, Time slotTime, uint8_t aifsn) |
Check correctness of transmitted frames. | |
void | L7Receive (std::string context, Ptr< const Packet > p, const Address &addr) |
Function to trace packets received by the server application. | |
void | TraceCw (uint32_t staIndex, uint32_t cw, uint8_t) |
Function to trace CW value used by the given station after the MU exchange. | |
void | Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when FrameExchangeManager passes PSDUs to the PHY. | |
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 | DoRun () override |
Implementation to actually run this TestCase. | |
Private Attributes | |
Ptr< WifiNetDevice > | m_apDevice |
AP's device. | |
MHz_u | m_channelWidth |
PHY channel bandwidth. | |
std::vector< uint32_t > | m_cwValues |
CW used by stations after MU exchange. | |
WifiAcknowledgment::Method | m_dlMuAckType |
DL MU ack sequence type. | |
WifiPreamble | m_dlMuPreamble |
expected preamble type for DL MU PPDUs | |
Time | m_edcaDisabledStartTime |
time when disabling EDCA started | |
uint16_t | m_flushed |
number of DL packets flushed after DL MU PPDU | |
uint32_t | m_maxAmpduSize |
maximum A-MPDU size in bytes | |
MuEdcaParameterSet | m_muEdcaParameterSet |
MU EDCA Parameter Set. | |
uint8_t | m_muRtsRuAllocation |
B7-B1 of RU Allocation subfield of MU-RTS. | |
uint16_t | m_nPktsPerSta |
number of packets to send to each station | |
uint16_t | m_nStations |
number of stations | |
uint16_t | m_received |
number of packets received by the stations | |
WifiOfdmaScenario | m_scenario |
OFDMA scenario to test. | |
std::vector< PacketSocketAddress > | m_sockets |
packet socket addresses for STAs | |
NetDeviceContainer | m_staDevices |
stations' devices | |
WifiPreamble | m_tbPreamble |
expected preamble type for TB PPDUs | |
uint16_t | m_txopLimit |
TXOP limit in microseconds. | |
std::vector< FrameInfo > | m_txPsdus |
transmitted PSDUs | |
bool | m_ulPktsGenerated |
whether UL packets for HE TB PPDUs have been generated | |
Static Private Attributes | |
static constexpr uint16_t | m_muTimerRes = 8192 |
MU timer resolution in usec. | |
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 OFDMA acknowledgment sequences.
Run this test with:
NS_LOG="WifiMacOfdmaTestSuite=info|prefix_time|prefix_node" ./ns3 run "test-runner --suite=wifi-mac-ofdma"
to print the list of transmitted frames only, along with the TX time and the node prefix. Replace 'info' with 'debug' if you want to print the debug messages from the test multi-user scheduler only. Replace 'info' with 'level_debug' if you want to print both the transmitted frames and the debug messages.
Definition at line 384 of file wifi-mac-ofdma-test.cc.
OfdmaAckSequenceTest::OfdmaAckSequenceTest | ( | MHz_u | width, |
WifiAcknowledgment::Method | dlType, | ||
uint32_t | maxAmpduSize, | ||
uint16_t | txopLimit, | ||
uint16_t | nPktsPerSta, | ||
MuEdcaParameterSet | muEdcaParameterSet, | ||
WifiOfdmaScenario | scenario ) |
Constructor.
width | the PHY channel bandwidth in MHz |
dlType | the DL MU ack sequence type |
maxAmpduSize | the maximum A-MPDU size in bytes |
txopLimit | the TXOP limit in microseconds |
nPktsPerSta | number of packets to send to/receive from each station |
muEdcaParameterSet | the MU EDCA Parameter Set |
scenario | the OFDMA scenario to test |
Definition at line 485 of file wifi-mac-ofdma-test.cc.
References EHT, HE, HE_EHT, m_channelWidth, m_dlMuPreamble, m_muRtsRuAllocation, m_scenario, m_tbPreamble, m_txPsdus, NS_ABORT_MSG, ns3::WIFI_PREAMBLE_EHT_MU, ns3::WIFI_PREAMBLE_EHT_TB, ns3::WIFI_PREAMBLE_HE_MU, and ns3::WIFI_PREAMBLE_HE_TB.
|
override |
Definition at line 542 of file wifi-mac-ofdma-test.cc.
Check correctness of transmitted frames.
sifs | the SIFS duration |
slotTime | a slot duration |
aifsn | the AIFSN |
Definition at line 699 of file wifi-mac-ofdma-test.cc.
References ns3::WifiAcknowledgment::DL_MU_AGGREGATE_TF, ns3::WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE, ns3::WifiAcknowledgment::DL_MU_TF_MU_BAR, ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::CtrlBAckResponseHeader::GetAckType(), ns3::WifiMacHeader::GetAddr2(), ns3::Time::GetMicroSeconds(), ns3::CtrlBAckResponseHeader::GetNPerAidTidInfoSubfields(), ns3::CtrlTriggerHeader::GetNUserInfoFields(), ns3::GetPpduMaxTime(), ns3::WifiMacHeader::GetQosTid(), ns3::CtrlBAckResponseHeader::GetTidInfo(), ns3::WifiMacHeader::GetType(), ns3::CtrlTriggerHeader::IsBasic(), ns3::CtrlTriggerHeader::IsBsrp(), ns3::CtrlBAckResponseHeader::IsMultiSta(), ns3::CtrlTriggerHeader::IsMuRts(), m_apDevice, m_channelWidth, m_cwValues, m_dlMuAckType, m_dlMuPreamble, m_edcaDisabledStartTime, m_flushed, m_maxAmpduSize, m_muEdcaParameterSet, m_muRtsRuAllocation, m_muTimerRes, m_nPktsPerSta, m_nStations, m_received, m_staDevices, m_tbPreamble, m_txopLimit, m_txPsdus, OfdmaAckSequenceTest::MuEdcaParameterSet::muAifsn, OfdmaAckSequenceTest::MuEdcaParameterSet::muCwMin, OfdmaAckSequenceTest::MuEdcaParameterSet::muTimer, ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_GT_OR_EQ, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT_OR_EQ, NS_TEST_EXPECT_MSG_LT, NS_TEST_EXPECT_MSG_LT_OR_EQ, NS_TEST_EXPECT_MSG_NE, ns3::SU_STA_ID, ns3::WIFI_MAC_CTL_CTS, ns3::WIFI_MAC_QOSDATA_NULL, and ns3::WIFI_PREAMBLE_HE_TB.
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 1963 of file wifi-mac-ofdma-test.cc.
References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, ns3::WifiHelper::AssignStreams(), CheckResults(), ns3::Config::Connect(), ns3::Create(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DynamicCast(), EHT, ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::RngSeedManager::GetRun(), ns3::RngSeedManager::GetSeed(), HE, ns3::PacketSocketHelper::Install(), L7Receive(), m_apDevice, m_channelWidth, m_dlMuAckType, m_maxAmpduSize, m_muEdcaParameterSet, m_muTimerRes, m_nPktsPerSta, m_nStations, m_scenario, m_sockets, m_staDevices, m_txopLimit, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), OfdmaAckSequenceTest::MuEdcaParameterSet::muAifsn, OfdmaAckSequenceTest::MuEdcaParameterSet::muCwMax, OfdmaAckSequenceTest::MuEdcaParameterSet::muCwMin, OfdmaAckSequenceTest::MuEdcaParameterSet::muTimer, NS_ABORT_MSG, ns3::Simulator::Run(), ns3::Seconds(), ns3::Config::SetDefault(), ns3::Config::SetGlobal(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::Simulator::Stop(), Transmit(), ns3::WIFI_MOD_CLASS_EHT, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_STANDARD_80211ac, ns3::WIFI_STANDARD_80211ax, and ns3::WIFI_STANDARD_80211be.
void OfdmaAckSequenceTest::L7Receive | ( | std::string | context, |
Ptr< const Packet > | p, | ||
const Address & | addr ) |
Function to trace packets received by the server application.
context | the context |
p | the packet |
addr | the address |
Definition at line 547 of file wifi-mac-ofdma-test.cc.
References m_received, ns3::Simulator::Now(), and ns3::Seconds().
Referenced by DoRun().
Function to trace CW value used by the given station after the MU exchange.
staIndex | the index of the given station |
cw | the current Contention Window value |
Definition at line 556 of file wifi-mac-ofdma-test.cc.
References m_cwValues.
Referenced by Transmit().
void OfdmaAckSequenceTest::Transmit | ( | std::string | context, |
WifiConstPsduMap | psduMap, | ||
WifiTxVector | txVector, | ||
double | txPowerW ) |
Callback invoked when FrameExchangeManager passes PSDUs to the PHY.
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Definition at line 567 of file wifi-mac-ofdma-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), ns3::WifiTxVector::GetPreambleType(), ns3::GetSize(), ns3::CtrlTriggerHeader::IsBasic(), ns3::WifiTxVector::IsMu(), ns3::CtrlBAckResponseHeader::IsMultiSta(), m_apDevice, m_dlMuPreamble, m_edcaDisabledStartTime, m_flushed, m_muEdcaParameterSet, m_nPktsPerSta, m_nStations, m_sockets, m_staDevices, m_tbPreamble, m_txPsdus, m_ulPktsGenerated, ns3::MakeCallback(), ns3::MicroSeconds(), OfdmaAckSequenceTest::MuEdcaParameterSet::muAifsn, OfdmaAckSequenceTest::MuEdcaParameterSet::muTimer, ns3::Simulator::Now(), NS_LOG_INFO, ns3::Seconds(), TraceCw(), and ns3::WIFI_PHY_BAND_5GHZ.
Referenced by DoRun().
|
private |
AP's device.
Definition at line 465 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
PHY channel bandwidth.
Definition at line 467 of file wifi-mac-ofdma-test.cc.
Referenced by OfdmaAckSequenceTest(), CheckResults(), and DoRun().
|
private |
CW used by stations after MU exchange.
Definition at line 482 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and TraceCw().
|
private |
DL MU ack sequence type.
Definition at line 470 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
expected preamble type for DL MU PPDUs
Definition at line 476 of file wifi-mac-ofdma-test.cc.
Referenced by OfdmaAckSequenceTest(), CheckResults(), and Transmit().
|
private |
time when disabling EDCA started
Definition at line 481 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and Transmit().
|
private |
number of DL packets flushed after DL MU PPDU
Definition at line 480 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and Transmit().
|
private |
maximum A-MPDU size in bytes
Definition at line 471 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
MU EDCA Parameter Set.
Definition at line 474 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
B7-B1 of RU Allocation subfield of MU-RTS.
Definition at line 468 of file wifi-mac-ofdma-test.cc.
Referenced by OfdmaAckSequenceTest(), and CheckResults().
|
staticconstexprprivate |
MU timer resolution in usec.
Definition at line 452 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
number of packets to send to each station
Definition at line 473 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
number of stations
Definition at line 463 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
number of packets received by the stations
Definition at line 479 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and L7Receive().
|
private |
OFDMA scenario to test.
Definition at line 475 of file wifi-mac-ofdma-test.cc.
Referenced by OfdmaAckSequenceTest(), and DoRun().
|
private |
packet socket addresses for STAs
Definition at line 466 of file wifi-mac-ofdma-test.cc.
Referenced by DoRun(), and Transmit().
|
private |
stations' devices
Definition at line 464 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
expected preamble type for TB PPDUs
Definition at line 477 of file wifi-mac-ofdma-test.cc.
Referenced by OfdmaAckSequenceTest(), CheckResults(), and Transmit().
|
private |
TXOP limit in microseconds.
Definition at line 472 of file wifi-mac-ofdma-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
transmitted PSDUs
Definition at line 469 of file wifi-mac-ofdma-test.cc.
Referenced by OfdmaAckSequenceTest(), CheckResults(), and Transmit().
|
private |
whether UL packets for HE TB PPDUs have been generated
Definition at line 478 of file wifi-mac-ofdma-test.cc.
Referenced by Transmit().