A Discrete-Event Network Simulator
lorawan @ (+)
API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GcrUrTest Class Reference

Test the implementation of GCR-UR. More...

#include "wifi-gcr-test.h"

+ Inheritance diagram for GcrUrTest:
+ Collaboration diagram for GcrUrTest:

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
 
- Public Member Functions inherited from GcrTestBase
 GcrTestBase (const std::string &testName, const GcrParameters &params)
 Constructor.
 
 ~GcrTestBase () override=default
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (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< WifiMpdum_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

- 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 GcrTestBase
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.
 
- 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.
 
TestCaseGetParent () 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.
 
- Protected Attributes inherited from GcrTestBase
Ptr< ListErrorModelm_apErrorModel
 error rate model to corrupt frames sent to the AP
 
Ptr< ApWifiMacm_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< PacketSocketClientm_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
 

Detailed Description

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:

  • When the GCR-UR service is used, each groupcast packet is retransmitted 7 times, in different TXOPs
  • When the GCR-UR service is used, all retransmissions of an MPDU have the Retry field in their Frame Control fields set to 1
  • When the GCR-UR service is used, either the initial packet or one of its retransmission is successfully received, unless all packets are corrupted
  • When the GCR-UR service is used and MPDU aggregation is enabled, it is checked each STA receives the expected amount of MPDUs
  • When the GCR-UR service is used and MPDU aggregation is enabled, it is checked received MPDUs are forwarded up in the expected order and the recipient window is correctly flushed

Definition at line 255 of file wifi-gcr-test.h.

Constructor & Destructor Documentation

◆ GcrUrTest()

GcrUrTest::GcrUrTest ( const std::string & testName,
const GcrParameters & commonParams,
const GcrUrParameters & gcrUrParams )

Constructor.

Parameters
testNamethe name of the test
commonParamsthe common GCR parameters for the test to run
gcrUrParamsthe GCR-UR parameters for the test to run

Definition at line 1042 of file wifi-gcr-test.cc.

◆ ~GcrUrTest()

GcrUrTest::~GcrUrTest ( )
overridedefault

Member Function Documentation

◆ CheckResults()

◆ ConfigureGcrManager()

void GcrUrTest::ConfigureGcrManager ( WifiMacHelper & macHelper)
overrideprivatevirtual

Configure the GCR manager for the test.

Parameters
macHelperthe 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().

+ Here is the call graph for this function:

◆ IsUsingAmpduOrSmpdu()

bool GcrUrTest::IsUsingAmpduOrSmpdu ( ) const
overrideprivatevirtual

Function to indicate whether A-MPDU or S-MPDU is currently being used.

Returns
true if A-MPDU or S-MPDU is currently being used, false otherwise

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().

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

◆ PacketGenerated()

void GcrUrTest::PacketGenerated ( std::string context,
Ptr< const Packet > p,
const Address & adr )
overrideprivatevirtual

Callback invoked when a packet is generated by the packet socket client.

Parameters
contextthe context
pthe packet
adrthe 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.

+ Here is the call graph for this function:

◆ Receive()

void GcrUrTest::Receive ( std::string context,
Ptr< const Packet > p,
const Address & adr )
overrideprivatevirtual

Callback invoked when packet is received by the packet socket server.

Parameters
contextthe context
pthe packet
adrthe address

Implements GcrTestBase.

Definition at line 1175 of file wifi-gcr-test.cc.

References ConvertContextToNodeId(), GcrTestBase::m_rxGroupcastPerSta, m_totalTxGroupcasts, and NS_LOG_INFO.

+ Here is the call graph for this function:

◆ Transmit()

void GcrUrTest::Transmit ( std::string context,
WifiConstPsduMap psduMap,
WifiTxVector txVector,
double txPowerW )
overrideprivatevirtual

Callback invoked when a FEM passes PSDUs to the PHY.

Parameters
contextthe context
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe 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().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_currentMpdu

Ptr<WifiMpdu> GcrUrTest::m_currentMpdu
private

current MPDU

Definition at line 305 of file wifi-gcr-test.h.

Referenced by Transmit().

◆ m_currentUid

uint64_t GcrUrTest::m_currentUid
private

current UID

Definition at line 306 of file wifi-gcr-test.h.

Referenced by Transmit().

◆ m_gcrUrParams

GcrUrParameters GcrUrTest::m_gcrUrParams
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().

◆ m_totalTxGroupcasts

std::vector<uint8_t> GcrUrTest::m_totalTxGroupcasts
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().


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