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 | |
| Public Member Functions inherited from GcrTestBase | |
| GcrTestBase (const std::string &testName, const GcrParameters ¶ms) | |
| Constructor.   | |
| ~GcrTestBase () override=default | |
| 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 | 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 | |
| Public Types inherited from ns3::TestCase | |
| enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } | 
| How long the test takes to execute.  More... | |
| 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 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.   | |
| 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.   | |
| Protected Attributes inherited from GcrTestBase | |
| 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   | |
| uint64_t | m_rngRun {1} | 
| RNG run value.   | |
| uint32_t | m_rngSeed {1} | 
| RNG seed value.   | |
| 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.   | |
| int64_t | m_streamNo {100} | 
| RNG stream number.   | |
| 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 333 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 1360 of file wifi-gcr-test.cc.
References GcrTestBase::GcrTestBase(), m_firstTxSeq, m_gcrBaParams, m_lastTxSeq, m_nTxBlockAck, m_nTxGcrBar, m_nTxGcrBarsInCurrentTxop, m_nTxGcrBlockAck, and GcrTestBase::m_rngRun.
      
  | 
  overridedefault | 
      
  | 
  overrideprivatevirtual | 
Check results at the end of the test run.
Reimplemented from GcrTestBase.
Definition at line 1657 of file wifi-gcr-test.cc.
References GcrTestBase::CheckResults(), ns3::DynamicCast(), 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, ns3::MicroSeconds(), NS_ASSERT, and NS_TEST_EXPECT_MSG_EQ.
      
  | 
  overrideprivatevirtual | 
Configure the GCR manager for the test.
| macHelper | the wifi mac helper | 
Implements GcrTestBase.
Definition at line 1647 of file wifi-gcr-test.cc.
References 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 1614 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 1376 of file wifi-gcr-test.cc.
References GcrTestBase::m_params, and GcrTestBase::PacketGenerated().
      
  | 
  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 1625 of file wifi-gcr-test.cc.
References ConvertContextToNodeId(), ns3::PacketSocketAddress::ConvertFrom(), GcrTestBase::m_expectedMaxNumMpdusInPsdu, m_lastTxSeq, GcrTestBase::m_params, GcrTestBase::m_rxGroupcastPerSta, GcrTestBase::m_rxUnicastPerSta, GcrTestBase::m_totalTx, ns3::MicroSeconds(), 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 1386 of file wifi-gcr-test.cc.
References ConvertContextToNodeId(), ns3::CtrlBAckRequestHeader::GetStartingSequence(), ns3::CtrlBAckRequestHeader::IsGcr(), ns3::CtrlBAckResponseHeader::IsGcr(), ns3::CtrlBAckResponseHeader::IsPacketReceived(), 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(), ns3::Simulator::Now(), NS_ASSERT, NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, and GcrTestBase::Transmit().
      
  | 
  private | 
sequence number of the first in-flight groupcast MPDU
Definition at line 376 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), and Transmit().
      
  | 
  private | 
GCR-BA parameters for the test to run.
Definition at line 371 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), CheckResults(), and Transmit().
      
  | 
  private | 
sequence number of the last in-flight groupcast MPDU
Definition at line 377 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), Receive(), and Transmit().
      
  | 
  private | 
number of Block Ack Response frames sent to the AP
Definition at line 375 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), CheckResults(), and Transmit().
      
  | 
  private | 
number of GCR Block Ack Request frames sent by the AP
Definition at line 373 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), CheckResults(), and Transmit().
      
  | 
  private | 
number of GCR BAR frames transmitted by the AP in the current TXOP
Definition at line 382 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), 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 380 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 374 of file wifi-gcr-test.h.
Referenced by GcrBaTest(), CheckResults(), and Transmit().