A Discrete-Event Network Simulator
API
OfdmaAckSequenceTest Class Reference

Test OFDMA acknowledgment sequences. More...

+ Inheritance diagram for OfdmaAckSequenceTest:
+ Collaboration diagram for OfdmaAckSequenceTest:

Classes

struct  FrameInfo
 Information about transmitted frames. More...
 
struct  MuEdcaParameterSet
 MU EDCA Parameter Set. More...
 

Public Member Functions

 OfdmaAckSequenceTest (uint16_t width, WifiAcknowledgment::Method dlType, uint32_t maxAmpduSize, uint16_t txopLimit, uint16_t nPktsPerSta, MuEdcaParameterSet muEdcaParameterSet, WifiOfdmaScenario scenario)
 Constructor. More...
 
 ~OfdmaAckSequenceTest () override
 
void CheckResults (Time sifs, Time slotTime, uint8_t aifsn)
 Check correctness of transmitted frames. More...
 
void L7Receive (std::string context, Ptr< const Packet > p, const Address &addr)
 Function to trace packets received by the server application. More...
 
void TraceCw (uint32_t staIndex, uint32_t cw, uint8_t)
 Function to trace CW value used by the given station after the MU exchange. More...
 
void Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback invoked when FrameExchangeManager passes PSDUs to the PHY. More...
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void DoRun () override
 Implementation to actually run this TestCase. More...
 

Private Attributes

Ptr< WifiNetDevicem_apDevice
 AP's device. More...
 
uint16_t m_channelWidth
 PHY channel bandwidth in MHz. More...
 
std::vector< uint32_t > m_cwValues
 CW used by stations after MU exchange. More...
 
WifiAcknowledgment::Method m_dlMuAckType
 DL MU ack sequence type. More...
 
WifiPreamble m_dlMuPreamble
 expected preamble type for DL MU PPDUs More...
 
Time m_edcaDisabledStartTime
 time when disabling EDCA started More...
 
uint16_t m_flushed
 number of DL packets flushed after DL MU PPDU More...
 
uint32_t m_maxAmpduSize
 maximum A-MPDU size in bytes More...
 
MuEdcaParameterSet m_muEdcaParameterSet
 MU EDCA Parameter Set. More...
 
uint8_t m_muRtsRuAllocation
 B7-B1 of RU Allocation subfield of MU-RTS. More...
 
uint16_t m_nPktsPerSta
 number of packets to send to each station More...
 
uint16_t m_nStations
 number of stations More...
 
uint16_t m_received
 number of packets received by the stations More...
 
WifiOfdmaScenario m_scenario
 OFDMA scenario to test. More...
 
std::vector< PacketSocketAddressm_sockets
 packet socket addresses for STAs More...
 
NetDeviceContainer m_staDevices
 stations' devices More...
 
WifiPreamble m_tbPreamble
 expected preamble type for TB PPDUs More...
 
uint16_t m_txopLimit
 TXOP limit in microseconds. More...
 
std::vector< FrameInfom_txPsdus
 transmitted PSDUs More...
 
bool m_ulPktsGenerated
 whether UL packets for HE TB PPDUs have been generated More...
 

Static Private Attributes

static constexpr uint16_t m_muTimerRes = 8192
 MU timer resolution in usec. 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...
 
TestCaseGetParent () 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...
 

Detailed Description

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 396 of file wifi-mac-ofdma-test.cc.

Constructor & Destructor Documentation

◆ OfdmaAckSequenceTest()

OfdmaAckSequenceTest::OfdmaAckSequenceTest ( uint16_t  width,
WifiAcknowledgment::Method  dlType,
uint32_t  maxAmpduSize,
uint16_t  txopLimit,
uint16_t  nPktsPerSta,
MuEdcaParameterSet  muEdcaParameterSet,
WifiOfdmaScenario  scenario 
)

Constructor.

Parameters
widththe PHY channel bandwidth in MHz
dlTypethe DL MU ack sequence type
maxAmpduSizethe maximum A-MPDU size in bytes
txopLimitthe TXOP limit in microseconds
nPktsPerStanumber of packets to send to/receive from each station
muEdcaParameterSetthe MU EDCA Parameter Set
scenariothe OFDMA scenario to test

Definition at line 497 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.

◆ ~OfdmaAckSequenceTest()

OfdmaAckSequenceTest::~OfdmaAckSequenceTest ( )
override

Definition at line 554 of file wifi-mac-ofdma-test.cc.

Member Function Documentation

◆ CheckResults()

void OfdmaAckSequenceTest::CheckResults ( Time  sifs,
Time  slotTime,
uint8_t  aifsn 
)

Check correctness of transmitted frames.

Parameters
sifsthe SIFS duration
slotTimea slot duration
aifsnthe AIFSN

Definition at line 711 of file wifi-mac-ofdma-test.cc.

References ns3::NetDeviceContainer::Get(), ns3::CtrlBAckResponseHeader::GetAckType(), ns3::WifiMacHeader::GetAddr2(), ns3::WifiNetDevice::GetAddress(), 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, prev, ns3::SU_STA_ID, ns3::WIFI_MAC_CTL_CTS, ns3::WIFI_MAC_QOSDATA_NULL, and ns3::WIFI_PREAMBLE_HE_TB.

Referenced by DoRun().

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

◆ DoRun()

void OfdmaAckSequenceTest::DoRun ( )
overrideprivatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 1975 of file wifi-mac-ofdma-test.cc.

References ns3::AC_BE, ns3::AC_BK, ns3::AC_VI, ns3::AC_VO, CheckResults(), ns3::Config::Connect(), ns3::NodeContainer::Create(), EHT, ns3::NetDeviceContainer::Get(), ns3::WifiNetDevice::GetAddress(), ns3::WifiNetDevice::GetIfIndex(), ns3::WifiNetDevice::GetMac(), ns3::NetDeviceContainer::GetN(), ns3::WifiMac::GetQosTxop(), ns3::WifiPhy::GetSifs(), ns3::WifiPhy::GetSlot(), ns3::WifiMac::GetWifiPhy(), 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, third::mac, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), third::mobility, OfdmaAckSequenceTest::MuEdcaParameterSet::muAifsn, OfdmaAckSequenceTest::MuEdcaParameterSet::muCwMax, OfdmaAckSequenceTest::MuEdcaParameterSet::muCwMin, OfdmaAckSequenceTest::MuEdcaParameterSet::muTimer, NS_ABORT_MSG, third::phy, ns3::Seconds(), brite-generic-example::server, ns3::Config::SetDefault(), ns3::Config::SetGlobal(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), third::ssid, Transmit(), third::wifi, ns3::WIFI_MOD_CLASS_EHT, ns3::WIFI_MOD_CLASS_HE, ns3::WIFI_STANDARD_80211ac, ns3::WIFI_STANDARD_80211ax, ns3::WIFI_STANDARD_80211be, third::wifiApNode, and third::wifiStaNodes.

+ Here is the call graph for this function:

◆ L7Receive()

void OfdmaAckSequenceTest::L7Receive ( std::string  context,
Ptr< const Packet p,
const Address addr 
)

Function to trace packets received by the server application.

Parameters
contextthe context
pthe packet
addrthe address

Definition at line 559 of file wifi-mac-ofdma-test.cc.

References ns3::Packet::GetSize(), m_received, ns3::Now(), and ns3::Seconds().

Referenced by DoRun().

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

◆ TraceCw()

void OfdmaAckSequenceTest::TraceCw ( uint32_t  staIndex,
uint32_t  cw,
uint8_t   
)

Function to trace CW value used by the given station after the MU exchange.

Parameters
staIndexthe index of the given station
cwthe current Contention Window value

Definition at line 568 of file wifi-mac-ofdma-test.cc.

References m_cwValues.

Referenced by Transmit().

+ Here is the caller graph for this function:

◆ Transmit()

Member Data Documentation

◆ m_apDevice

Ptr<WifiNetDevice> OfdmaAckSequenceTest::m_apDevice
private

AP's device.

Definition at line 477 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), DoRun(), and Transmit().

◆ m_channelWidth

uint16_t OfdmaAckSequenceTest::m_channelWidth
private

PHY channel bandwidth in MHz.

Definition at line 479 of file wifi-mac-ofdma-test.cc.

Referenced by OfdmaAckSequenceTest(), CheckResults(), and DoRun().

◆ m_cwValues

std::vector<uint32_t> OfdmaAckSequenceTest::m_cwValues
private

CW used by stations after MU exchange.

Definition at line 494 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and TraceCw().

◆ m_dlMuAckType

WifiAcknowledgment::Method OfdmaAckSequenceTest::m_dlMuAckType
private

DL MU ack sequence type.

Definition at line 482 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_dlMuPreamble

WifiPreamble OfdmaAckSequenceTest::m_dlMuPreamble
private

expected preamble type for DL MU PPDUs

Definition at line 488 of file wifi-mac-ofdma-test.cc.

Referenced by OfdmaAckSequenceTest(), CheckResults(), and Transmit().

◆ m_edcaDisabledStartTime

Time OfdmaAckSequenceTest::m_edcaDisabledStartTime
private

time when disabling EDCA started

Definition at line 493 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and Transmit().

◆ m_flushed

uint16_t OfdmaAckSequenceTest::m_flushed
private

number of DL packets flushed after DL MU PPDU

Definition at line 492 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and Transmit().

◆ m_maxAmpduSize

uint32_t OfdmaAckSequenceTest::m_maxAmpduSize
private

maximum A-MPDU size in bytes

Definition at line 483 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_muEdcaParameterSet

MuEdcaParameterSet OfdmaAckSequenceTest::m_muEdcaParameterSet
private

MU EDCA Parameter Set.

Definition at line 486 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), DoRun(), and Transmit().

◆ m_muRtsRuAllocation

uint8_t OfdmaAckSequenceTest::m_muRtsRuAllocation
private

B7-B1 of RU Allocation subfield of MU-RTS.

Definition at line 480 of file wifi-mac-ofdma-test.cc.

Referenced by OfdmaAckSequenceTest(), and CheckResults().

◆ m_muTimerRes

constexpr uint16_t OfdmaAckSequenceTest::m_muTimerRes = 8192
staticconstexprprivate

MU timer resolution in usec.

Definition at line 464 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_nPktsPerSta

uint16_t OfdmaAckSequenceTest::m_nPktsPerSta
private

number of packets to send to each station

Definition at line 485 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), DoRun(), and Transmit().

◆ m_nStations

uint16_t OfdmaAckSequenceTest::m_nStations
private

number of stations

Definition at line 475 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), DoRun(), and Transmit().

◆ m_received

uint16_t OfdmaAckSequenceTest::m_received
private

number of packets received by the stations

Definition at line 491 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and L7Receive().

◆ m_scenario

WifiOfdmaScenario OfdmaAckSequenceTest::m_scenario
private

OFDMA scenario to test.

Definition at line 487 of file wifi-mac-ofdma-test.cc.

Referenced by OfdmaAckSequenceTest(), and DoRun().

◆ m_sockets

std::vector<PacketSocketAddress> OfdmaAckSequenceTest::m_sockets
private

packet socket addresses for STAs

Definition at line 478 of file wifi-mac-ofdma-test.cc.

Referenced by DoRun(), and Transmit().

◆ m_staDevices

NetDeviceContainer OfdmaAckSequenceTest::m_staDevices
private

stations' devices

Definition at line 476 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), DoRun(), and Transmit().

◆ m_tbPreamble

WifiPreamble OfdmaAckSequenceTest::m_tbPreamble
private

expected preamble type for TB PPDUs

Definition at line 489 of file wifi-mac-ofdma-test.cc.

Referenced by OfdmaAckSequenceTest(), CheckResults(), and Transmit().

◆ m_txopLimit

uint16_t OfdmaAckSequenceTest::m_txopLimit
private

TXOP limit in microseconds.

Definition at line 484 of file wifi-mac-ofdma-test.cc.

Referenced by CheckResults(), and DoRun().

◆ m_txPsdus

std::vector<FrameInfo> OfdmaAckSequenceTest::m_txPsdus
private

transmitted PSDUs

Definition at line 481 of file wifi-mac-ofdma-test.cc.

Referenced by OfdmaAckSequenceTest(), CheckResults(), and Transmit().

◆ m_ulPktsGenerated

bool OfdmaAckSequenceTest::m_ulPktsGenerated
private

whether UL packets for HE TB PPDUs have been generated

Definition at line 490 of file wifi-mac-ofdma-test.cc.

Referenced by Transmit().


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