Test the implementation of GCR Block Ack. More...
#include "wifi-gcr-test.h"
Classes | |
struct | GcrBaParameters |
Parameters for GCR-BA tests. More... | |
Public Member Functions | |
GcrBaTest (const std::string &testName, const GcrParameters &commonParams, const GcrBaParameters &gcrBaParams) | |
Constructor. | |
~GcrBaTest () 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. | |
void | NotifyTxopTerminated (Time startTime, Time duration, uint8_t linkId) override |
Callback invoked when a TXOP is terminated. | |
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 | |
uint16_t | m_firstTxSeq |
sequence number of the first in-flight groupcast MPDU | |
GcrBaParameters | m_gcrBaParams |
GCR-BA parameters for the test to run. | |
int | m_lastTxSeq |
sequence number of the last in-flight groupcast MPDU | |
uint8_t | m_nTxBlockAck |
number of Block Ack Response frames sent to the AP | |
uint8_t | m_nTxGcrBar |
number of GCR Block Ack Request frames sent by the AP | |
uint8_t | m_nTxGcrBarsInCurrentTxop |
number of GCR BAR frames transmitted by the AP in the current TXOP | |
std::vector< uint8_t > | m_nTxGcrBarsPerTxop |
number of GCR BAR frames transmitted by the AP per TXOP (only takes into account TXOPs with BARs transmitted) | |
uint8_t | m_nTxGcrBlockAck |
number of GCR Block Ack Response frames sent to the AP | |
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 bool | IsUsingAmpduOrSmpdu () const |
Function to indicate whether A-MPDU or S-MPDU is currently being used. | |
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 Block Ack.
GCR-BA tests consider an AP and multiple STAs (with different capabilities) using GCR-BA. During tests, besides frames that can be corrupted by the base class, transmitted MPDUs can be corrupted, either for all STAs or for a particular STA. These tests eventually corrupt Block Ack Requests and Block Acks frames.
Besides what is verified in the base class, it is checked that:
Definition at line 330 of file wifi-gcr-test.h.
GcrBaTest::GcrBaTest | ( | const std::string & | testName, |
const GcrParameters & | commonParams, | ||
const GcrBaParameters & | gcrBaParams ) |
Constructor.
testName | the name of the test |
commonParams | the common GCR parameters for the test to run |
gcrBaParams | the GCR-BA parameters for the test to run |
Definition at line 1364 of file wifi-gcr-test.cc.
|
overridedefault |
|
overrideprivatevirtual |
Check results at the end of the test run.
Reimplemented from GcrTestBase.
Definition at line 1660 of file wifi-gcr-test.cc.
References GcrBaTest::GcrBaParameters::barsToCorrupt, GcrBaTest::GcrBaParameters::blockAcksToCorrupt, GcrTestBase::CheckResults(), ns3::DynamicCast(), GcrTestBase::GcrParameters::expectedDroppedGroupcastMpdus, GcrBaTest::GcrBaParameters::expectedNTxBarsPerTxop, ns3::Time::IsZero(), GcrTestBase::m_apWifiMac, GcrTestBase::m_expectedMaxNumMpdusInPsdu, GcrTestBase::m_expectGcrUsed, m_gcrBaParams, m_nTxBlockAck, m_nTxGcrBar, m_nTxGcrBarsPerTxop, m_nTxGcrBlockAck, GcrTestBase::m_params, GcrTestBase::m_rxGroupcastPerSta, GcrTestBase::m_totalTx, GcrTestBase::GcrParameters::maxNumMpdusInPsdu, ns3::MicroSeconds(), GcrTestBase::GcrParameters::mpdusToCorruptPerPsdu, NS_ASSERT, NS_TEST_EXPECT_MSG_EQ, GcrTestBase::GcrParameters::numGroupcastPackets, GcrTestBase::GcrParameters::numUnicastPackets, GcrTestBase::GcrParameters::stas, and GcrTestBase::GcrParameters::txopLimit.
|
overrideprivatevirtual |
Configure the GCR manager for the test.
macHelper | the wifi mac helper |
Implements GcrTestBase.
Definition at line 1650 of file wifi-gcr-test.cc.
References GcrTestBase::GcrParameters::gcrProtectionMode, GcrTestBase::m_params, and ns3::WifiMacHelper::SetGcrManager().
|
overrideprivatevirtual |
Callback invoked when a TXOP is terminated.
startTime | the time TXOP started |
duration | the duration of the TXOP |
linkId | the ID of the link that gained TXOP |
Reimplemented from GcrTestBase.
Definition at line 1617 of file wifi-gcr-test.cc.
References m_nTxGcrBarsInCurrentTxop, m_nTxGcrBarsPerTxop, and GcrTestBase::NotifyTxopTerminated().
|
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 1379 of file wifi-gcr-test.cc.
References GcrTestBase::GcrParameters::ctsFramesToCorrupt, GcrTestBase::m_params, GcrTestBase::PacketGenerated(), and GcrTestBase::GcrParameters::rtsFramesToCorrupt.
|
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 1628 of file wifi-gcr-test.cc.
References ConvertContextToNodeId(), ns3::PacketSocketAddress::ConvertFrom(), ns3::Time::IsZero(), GcrTestBase::m_expectedMaxNumMpdusInPsdu, m_lastTxSeq, GcrTestBase::m_params, GcrTestBase::m_rxGroupcastPerSta, GcrTestBase::m_rxUnicastPerSta, GcrTestBase::m_totalTx, ns3::MicroSeconds(), NS_LOG_INFO, GcrTestBase::GcrParameters::stas, and GcrTestBase::GcrParameters::txopLimit.
|
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 1389 of file wifi-gcr-test.cc.
References GcrBaTest::GcrBaParameters::barsToCorrupt, GcrBaTest::GcrBaParameters::blockAcksToCorrupt, ConvertContextToNodeId(), GcrTestBase::GcrParameters::expectedDroppedGroupcastMpdus, ns3::CtrlBAckRequestHeader::GetStartingSequence(), ns3::CtrlBAckRequestHeader::IsGcr(), ns3::CtrlBAckResponseHeader::IsGcr(), ns3::CtrlBAckResponseHeader::IsPacketReceived(), ns3::Time::IsZero(), GcrTestBase::m_apErrorModel, GcrTestBase::m_errorModels, GcrTestBase::m_expectedMaxNumMpdusInPsdu, GcrTestBase::m_expectGcrUsed, m_firstTxSeq, m_gcrBaParams, m_lastTxSeq, m_nTxBlockAck, m_nTxGcrBar, m_nTxGcrBarsInCurrentTxop, m_nTxGcrBlockAck, GcrTestBase::m_params, GcrTestBase::m_rxGroupcastPerSta, GcrTestBase::m_stasWifiMac, GcrTestBase::m_totalTx, ns3::MicroSeconds(), GcrTestBase::GcrParameters::mpdusToCorruptPerPsdu, ns3::Simulator::Now(), NS_ASSERT, NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, GcrTestBase::GcrParameters::numGroupcastPackets, GcrTestBase::GcrParameters::numUnicastPackets, ns3::ListErrorModel::SetList(), GcrTestBase::GcrParameters::startGroupcast, GcrTestBase::GcrParameters::startUnicast, GcrTestBase::GcrParameters::stas, GcrTestBase::Transmit(), and GcrTestBase::GcrParameters::txopLimit.
|
private |
sequence number of the first in-flight groupcast MPDU
Definition at line 373 of file wifi-gcr-test.h.
Referenced by Transmit().
|
private |
GCR-BA parameters for the test to run.
Definition at line 368 of file wifi-gcr-test.h.
Referenced by CheckResults(), and Transmit().
|
private |
sequence number of the last in-flight groupcast MPDU
Definition at line 374 of file wifi-gcr-test.h.
Referenced by Receive(), and Transmit().
|
private |
number of Block Ack Response frames sent to the AP
Definition at line 372 of file wifi-gcr-test.h.
Referenced by CheckResults(), and Transmit().
|
private |
number of GCR Block Ack Request frames sent by the AP
Definition at line 370 of file wifi-gcr-test.h.
Referenced by CheckResults(), and Transmit().
|
private |
number of GCR BAR frames transmitted by the AP in the current TXOP
Definition at line 379 of file wifi-gcr-test.h.
Referenced by NotifyTxopTerminated(), and Transmit().
|
private |
number of GCR BAR frames transmitted by the AP per TXOP (only takes into account TXOPs with BARs transmitted)
Definition at line 377 of file wifi-gcr-test.h.
Referenced by CheckResults(), and NotifyTxopTerminated().
|
private |
number of GCR Block Ack Response frames sent to the AP
Definition at line 371 of file wifi-gcr-test.h.
Referenced by CheckResults(), and Transmit().