A Discrete-Event Network Simulator
API
Bug2470TestCase Class Reference

Make sure that the ADDBA handshake process is protected. More...

+ Inheritance diagram for Bug2470TestCase:
+ Collaboration diagram for Bug2470TestCase:

Public Member Functions

 Bug2470TestCase ()
 
virtual ~Bug2470TestCase ()
 
void DoRun (void) override
 Implementation to actually run this TestCase. More...
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

void AddbaStateChangedCallback (std::string context, Time t, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
 Callback when ADDBA state changed. More...
 
void RunSubtest (PointerValue apErrorModel, PointerValue staErrorModel)
 Run subtest for this test suite. More...
 
void RxCallback (std::string context, Ptr< const Packet > p, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId)
 Callback when packet is received. More...
 
void RxErrorCallback (std::string context, Ptr< const Packet > p, double snr)
 Callback when packet is dropped. More...
 
void SendPacketBurst (uint32_t numPackets, Ptr< NetDevice > sourceDevice, Address &destination) const
 Triggers the arrival of a burst of 1000 Byte-long packets in the source device. More...
 

Private Attributes

uint16_t m_addbaEstablishedCount
 Count number of times ADDBA state machine is in established state. More...
 
uint16_t m_addbaNoReplyCount
 Count number of times ADDBA state machine is in no_reply state. More...
 
uint16_t m_addbaPendingCount
 Count number of times ADDBA state machine is in pending state. More...
 
uint16_t m_addbaRejectedCount
 Count number of times ADDBA state machine is in rejected state. More...
 
uint16_t m_addbaResetCount
 Count number of times ADDBA state machine is in reset state. More...
 
uint16_t m_failedActionCount
 Count failed ADDBA request/response. More...
 
uint16_t m_receivedAmpduCount
 Count received A-MPDU packets on STA. More...
 
uint16_t m_receivedNormalMpduCount
 Count received normal MPDU packets on STA. 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 TestCsse. More...
 
bool IsStatusFailure (void) const
 Check if any tests failed. More...
 
bool IsStatusSuccess (void) 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 (void) const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure (void) 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

Make sure that the ADDBA handshake process is protected.

The scenario considers an access point and a station. It utilizes ReceiveListErrorModel to drop by force ADDBA request on STA or ADDBA response on AP. The AP sends 5 packets of each 1000 bytes (thus generating BA agreement), 2 times during the test at 0.5s and 0.8s. We only drop the first ADDBA request/response of the first BA negotiation. Therefore, we expect that the packets still in queue after the failed BA agreement will be sent with normal MPDU, and packets queued after that should be sent with A-MPDU.

This test consider 2 cases:

  1. ADDBA request packets are blocked on receive at STA, triggering transmission failure at AP
  2. ADDBA response packets are blocked on receive at AP, STA stops retransmission of ADDBA response

See Bug 2470

Definition at line 2016 of file wifi-test.cc.

Constructor & Destructor Documentation

◆ Bug2470TestCase()

Bug2470TestCase::Bug2470TestCase ( )

Definition at line 2075 of file wifi-test.cc.

◆ ~Bug2470TestCase()

Bug2470TestCase::~Bug2470TestCase ( )
virtual

Definition at line 2088 of file wifi-test.cc.

Member Function Documentation

◆ AddbaStateChangedCallback()

void Bug2470TestCase::AddbaStateChangedCallback ( std::string  context,
Time  t,
Mac48Address  recipient,
uint8_t  tid,
OriginatorBlockAckAgreement::State  state 
)
private

Callback when ADDBA state changed.

Parameters
contextnode context
tthe time the state changed
recipientthe MAC address of the recipient
tidthe TID
statethe state

Definition at line 2093 of file wifi-test.cc.

References m_addbaEstablishedCount, m_addbaNoReplyCount, m_addbaPendingCount, m_addbaRejectedCount, and m_addbaResetCount.

Referenced by RunSubtest().

+ Here is the caller graph for this function:

◆ DoRun()

void Bug2470TestCase::DoRun ( void  )
overridevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 2218 of file wifi-test.cc.

References m_addbaEstablishedCount, m_addbaNoReplyCount, m_addbaPendingCount, m_addbaRejectedCount, m_addbaResetCount, m_failedActionCount, m_receivedAmpduCount, m_receivedNormalMpduCount, NS_TEST_ASSERT_MSG_EQ, RunSubtest(), and ns3::ReceiveListErrorModel::SetList().

+ Here is the call graph for this function:

◆ RunSubtest()

void Bug2470TestCase::RunSubtest ( PointerValue  apErrorModel,
PointerValue  staErrorModel 
)
private

Run subtest for this test suite.

Parameters
apErrorModelErrorModel used for AP
staErrorModelErrorModel used for STA

Definition at line 2158 of file wifi-test.cc.

References ns3::ListPositionAllocator::Add(), AddbaStateChangedCallback(), third::channel, ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), third::mac, ns3::MakeCallback(), ns3::MicroSeconds(), third::mobility, third::phy, RxCallback(), RxErrorCallback(), ns3::Seconds(), SendPacketBurst(), third::wifi, ns3::WIFI_STANDARD_80211n_5GHZ, and third::wifiApNode.

Referenced by DoRun().

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

◆ RxCallback()

void Bug2470TestCase::RxCallback ( std::string  context,
Ptr< const Packet p,
uint16_t  channelFreqMhz,
WifiTxVector  txVector,
MpduInfo  aMpdu,
SignalNoiseDbm  signalNoise,
uint16_t  staId 
)
private

Callback when packet is received.

Parameters
contextnode context
pthe received packet
channelFreqMhzthe channel frequency in MHz
txVectorthe TX vector
aMpduthe A-MPDU info
signalNoisethe signal noise in dBm
staIdthe STA-ID

Definition at line 2116 of file wifi-test.cc.

References ns3::Packet::Copy(), ns3::WifiMacHeader::IsData(), m_receivedAmpduCount, m_receivedNormalMpduCount, ns3::NORMAL_MPDU, ns3::Packet::RemoveHeader(), and ns3::MpduInfo::type.

Referenced by RunSubtest().

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

◆ RxErrorCallback()

void Bug2470TestCase::RxErrorCallback ( std::string  context,
Ptr< const Packet p,
double  snr 
)
private

Callback when packet is dropped.

Parameters
contextnode context
pthe failed packet
snrthe SNR of the failed packet in linear scale

Definition at line 2135 of file wifi-test.cc.

References ns3::Packet::Copy(), ns3::WifiMacHeader::IsAction(), m_failedActionCount, and ns3::Packet::RemoveHeader().

Referenced by RunSubtest().

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

◆ SendPacketBurst()

void Bug2470TestCase::SendPacketBurst ( uint32_t  numPackets,
Ptr< NetDevice sourceDevice,
Address destination 
) const
private

Triggers the arrival of a burst of 1000 Byte-long packets in the source device.

Parameters
numPacketsnumber of packets in burst
sourceDevicepointer to the source NetDevice
destinationaddress of the destination device

Definition at line 2147 of file wifi-test.cc.

References ns3::NetDevice::Send().

Referenced by RunSubtest().

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

Member Data Documentation

◆ m_addbaEstablishedCount

uint16_t Bug2470TestCase::m_addbaEstablishedCount
private

Count number of times ADDBA state machine is in established state.

Definition at line 2068 of file wifi-test.cc.

Referenced by AddbaStateChangedCallback(), and DoRun().

◆ m_addbaNoReplyCount

uint16_t Bug2470TestCase::m_addbaNoReplyCount
private

Count number of times ADDBA state machine is in no_reply state.

Definition at line 2071 of file wifi-test.cc.

Referenced by AddbaStateChangedCallback(), and DoRun().

◆ m_addbaPendingCount

uint16_t Bug2470TestCase::m_addbaPendingCount
private

Count number of times ADDBA state machine is in pending state.

Definition at line 2069 of file wifi-test.cc.

Referenced by AddbaStateChangedCallback(), and DoRun().

◆ m_addbaRejectedCount

uint16_t Bug2470TestCase::m_addbaRejectedCount
private

Count number of times ADDBA state machine is in rejected state.

Definition at line 2070 of file wifi-test.cc.

Referenced by AddbaStateChangedCallback(), and DoRun().

◆ m_addbaResetCount

uint16_t Bug2470TestCase::m_addbaResetCount
private

Count number of times ADDBA state machine is in reset state.

Definition at line 2072 of file wifi-test.cc.

Referenced by AddbaStateChangedCallback(), and DoRun().

◆ m_failedActionCount

uint16_t Bug2470TestCase::m_failedActionCount
private

Count failed ADDBA request/response.

Definition at line 2067 of file wifi-test.cc.

Referenced by DoRun(), and RxErrorCallback().

◆ m_receivedAmpduCount

uint16_t Bug2470TestCase::m_receivedAmpduCount
private

Count received A-MPDU packets on STA.

Definition at line 2066 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().

◆ m_receivedNormalMpduCount

uint16_t Bug2470TestCase::m_receivedNormalMpduCount
private

Count received normal MPDU packets on STA.

Definition at line 2065 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().


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