Test the implementation of GCR-UR. More...
#include "wifi-gcr-test.h"
Classes | |
struct | GcrUrParameters |
Parameters for GCR-UR tests. More... | |
Public Member Functions | |
GcrUrTest (const std::string &testName, const GcrParameters &commonParams, const GcrUrParameters &gcrUrParams) | |
Constructor. | |
~GcrUrTest () override=default | |
![]() | |
GcrTestBase (const std::string &testName, const GcrParameters ¶ms) | |
Constructor. | |
~GcrTestBase () override=default | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckResults () override |
Check results at the end of the test run. | |
void | ConfigureGcrManager (WifiMacHelper &macHelper) override |
Configure the GCR manager for the test. | |
bool | IsUsingAmpduOrSmpdu () const override |
Function to indicate whether A-MPDU or S-MPDU is currently being used. | |
void | PacketGenerated (std::string context, Ptr< const Packet > p, const Address &adr) override |
Callback invoked when a packet is generated by the packet socket client. | |
void | Receive (std::string context, Ptr< const Packet > p, const Address &adr) override |
Callback invoked when packet is received by the packet socket server. | |
void | Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) override |
Callback invoked when a FEM passes PSDUs to the PHY. | |
Private Attributes | |
Ptr< WifiMpdu > | m_currentMpdu |
current MPDU | |
uint64_t | m_currentUid |
current UID | |
GcrUrParameters | m_gcrUrParams |
GCR-UR parameters for the test to run. | |
std::vector< uint8_t > | m_totalTxGroupcasts |
total number of groupcast frames transmitted by the AP (including retries) per original groupcast frame | |
Additional Inherited Members | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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 |
![]() | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
virtual void | NotifyTxopTerminated (Time startTime, Time duration, uint8_t linkId) |
Callback invoked when a TXOP is terminated. | |
virtual void | PhyRx (std::string context, Ptr< const Packet > p, double snr, WifiMode mode, WifiPreamble preamble) |
Callback invoked when a packet is successfully received by the PHY. | |
![]() | |
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. | |
![]() | |
Ptr< ListErrorModel > | m_apErrorModel |
error rate model to corrupt frames sent to the AP | |
Ptr< ApWifiMac > | m_apWifiMac |
AP wifi MAC. | |
std::vector< Ptr< ListErrorModel > > | m_errorModels |
error rate models to corrupt packets (per STA) | |
uint16_t | m_expectedMaxNumMpdusInPsdu |
expected maximum number of MPDUs in PSDUs | |
bool | m_expectGcrUsed |
flag whether GCR is expected to be used during the test | |
Ptr< PacketSocketClient > | m_groupcastClient |
the packet socket client | |
uint8_t | m_nTxAddbaReq |
number of transmitted ADDBA Request frames | |
uint8_t | m_nTxAddbaResp |
number of transmitted ADDBA Response frames | |
uint8_t | m_nTxApCts |
number of CTS-to-self frames sent by the AP | |
uint8_t | m_nTxApRts |
number of RTS frames sent by the AP | |
uint8_t | m_nTxCtsInCurrentTxop |
number of CTS-to-self frames transmitted by the AP in the current TXOP | |
uint8_t | m_nTxDelba |
number of transmitted DELBA frames | |
uint8_t | m_nTxGcrAddbaReq |
number of transmitted GCR ADDBA Request frames | |
uint8_t | m_nTxGcrAddbaResp |
number of transmitted GCR ADDBA Response frames | |
uint8_t | m_nTxGcrDelba |
number of transmitted GCR DELBA frames | |
uint8_t | m_nTxGroupcastInCurrentTxop |
number of groupcast frames transmitted by the AP (including retries) in the current TXOP | |
uint8_t | m_nTxRtsInCurrentTxop |
number of RTS frames transmitted by the AP in the current TXOP | |
uint16_t | m_packets |
Number of generated groupcast packets by the application. | |
GcrParameters | m_params |
parameters for the test to run | |
std::vector< uint16_t > | m_phyRxPerSta |
count number of PSDUs successfully received by PHY of each STA | |
std::vector< std::vector< uint16_t > > | m_rxGroupcastPerSta |
count groupcast packets received by the packet socket server of each STA and store TX attempt number for each received packet | |
std::vector< uint16_t > | m_rxUnicastPerSta |
count unicast packets received by the packet socket server of each STA | |
std::vector< Ptr< StaWifiMac > > | m_stasWifiMac |
STAs wifi MAC. | |
std::string | m_testName |
name of the test | |
uint8_t | m_totalTx |
total number of groupcast frames transmitted by the AP | |
std::vector< uint8_t > | m_txCtsPerSta |
count number of CTS responses frames sent by each STA | |
Test the implementation of GCR-UR.
GCR-UR tests consider an AP and multiple STAs (with different capabilities) using GCR-UR with up to 7 retries. Besides what is verified in the base class, it is checked that:
Definition at line 255 of file wifi-gcr-test.h.
GcrUrTest::GcrUrTest | ( | const std::string & | testName, |
const GcrParameters & | commonParams, | ||
const GcrUrParameters & | gcrUrParams ) |
Constructor.
testName | the name of the test |
commonParams | the common GCR parameters for the test to run |
gcrUrParams | the GCR-UR parameters for the test to run |
Definition at line 1042 of file wifi-gcr-test.cc.
|
overridedefault |
|
overrideprivatevirtual |
Check results at the end of the test run.
Reimplemented from GcrTestBase.
Definition at line 1220 of file wifi-gcr-test.cc.
References GcrTestBase::CheckResults(), GcrTestBase::GcrParameters::expectedDroppedGroupcastMpdus, GcrUrTest::GcrUrParameters::expectedSkippedRetries, GcrTestBase::m_expectedMaxNumMpdusInPsdu, GcrTestBase::m_expectGcrUsed, m_gcrUrParams, GcrTestBase::m_params, GcrTestBase::m_phyRxPerSta, GcrTestBase::m_rxGroupcastPerSta, m_totalTxGroupcasts, GcrTestBase::GcrParameters::maxNumMpdusInPsdu, GcrTestBase::GcrParameters::mpdusToCorruptPerPsdu, GcrUrTest::GcrUrParameters::nGcrRetries, NS_ASSERT, NS_TEST_EXPECT_MSG_EQ, GcrTestBase::GcrParameters::numGroupcastPackets, GcrUrTest::GcrUrParameters::packetsPauzeAggregation, GcrUrTest::GcrUrParameters::packetsResumeAggregation, GcrTestBase::GcrParameters::stas, and ns3::WIFI_STANDARD_80211n.
|
overrideprivatevirtual |
Configure the GCR manager for the test.
macHelper | the wifi mac helper |
Implements GcrTestBase.
Definition at line 1184 of file wifi-gcr-test.cc.
References GcrTestBase::GcrParameters::gcrProtectionMode, m_gcrUrParams, GcrTestBase::m_params, GcrUrTest::GcrUrParameters::nGcrRetries, and ns3::WifiMacHelper::SetGcrManager().
|
overrideprivatevirtual |
Function to indicate whether A-MPDU or S-MPDU is currently being used.
Reimplemented from GcrTestBase.
Definition at line 1196 of file wifi-gcr-test.cc.
References GcrTestBase::IsUsingAmpduOrSmpdu(), m_gcrUrParams, GcrTestBase::m_params, m_totalTxGroupcasts, GcrTestBase::GcrParameters::maxNumMpdusInPsdu, GcrUrTest::GcrUrParameters::packetsPauzeAggregation, GcrUrTest::GcrUrParameters::packetsResumeAggregation, and GcrTestBase::GcrParameters::stas.
Referenced by Transmit().
|
overrideprivatevirtual |
Callback invoked when a packet is generated by the packet socket client.
context | the context |
p | the packet |
adr | the address |
Reimplemented from GcrTestBase.
Definition at line 1052 of file wifi-gcr-test.cc.
References m_gcrUrParams, GcrTestBase::m_groupcastClient, GcrTestBase::m_packets, ns3::MilliSeconds(), GcrTestBase::PacketGenerated(), GcrUrTest::GcrUrParameters::packetsPauzeAggregation, and GcrUrTest::GcrUrParameters::packetsResumeAggregation.
|
overrideprivatevirtual |
Callback invoked when packet is received by the packet socket server.
context | the context |
p | the packet |
adr | the address |
Implements GcrTestBase.
Definition at line 1175 of file wifi-gcr-test.cc.
References ConvertContextToNodeId(), GcrTestBase::m_rxGroupcastPerSta, m_totalTxGroupcasts, and NS_LOG_INFO.
|
overrideprivatevirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Reimplemented from GcrTestBase.
Definition at line 1074 of file wifi-gcr-test.cc.
References ConvertContextToNodeId(), IsUsingAmpduOrSmpdu(), m_currentMpdu, m_currentUid, GcrTestBase::m_expectedMaxNumMpdusInPsdu, GcrTestBase::m_expectGcrUsed, m_gcrUrParams, GcrTestBase::m_nTxCtsInCurrentTxop, GcrTestBase::m_nTxGroupcastInCurrentTxop, GcrTestBase::m_nTxRtsInCurrentTxop, GcrTestBase::m_params, m_totalTxGroupcasts, GcrTestBase::GcrParameters::maxNumMpdusInPsdu, NS_ASSERT, NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, GcrTestBase::GcrParameters::numGroupcastPackets, GcrUrTest::GcrUrParameters::packetsPauzeAggregation, GcrUrTest::GcrUrParameters::packetsResumeAggregation, and GcrTestBase::Transmit().
|
private |
|
private |
GCR-UR parameters for the test to run.
Definition at line 299 of file wifi-gcr-test.h.
Referenced by CheckResults(), ConfigureGcrManager(), IsUsingAmpduOrSmpdu(), PacketGenerated(), and Transmit().
|
private |
total number of groupcast frames transmitted by the AP (including retries) per original groupcast frame
Definition at line 302 of file wifi-gcr-test.h.
Referenced by CheckResults(), IsUsingAmpduOrSmpdu(), Receive(), and Transmit().