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 ()
 
 ~Bug2470TestCase () override
 
void DoRun () override
 Implementation to actually run this TestCase. More...
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

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 (TypeOfStation rcvErrorType)
 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...
 
void TxCallback (Ptr< ListErrorModel > rxErrorModel, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback when a frame is transmitted. 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 TestCase. More...
 
bool IsStatusFailure () const
 Check if any tests failed. More...
 
bool IsStatusSuccess () 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 () const
 Check if this run should assert on failure. More...
 
bool MustContinueOnFailure () 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 2143 of file wifi-test.cc.

Constructor & Destructor Documentation

◆ Bug2470TestCase()

Bug2470TestCase::Bug2470TestCase ( )

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

◆ ~Bug2470TestCase()

Bug2470TestCase::~Bug2470TestCase ( )
override

Definition at line 2243 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 2248 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 ( )
overridevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

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

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

+ Here is the call graph for this function:

◆ RunSubtest()

void Bug2470TestCase::RunSubtest ( TypeOfStation  rcvErrorType)
private

Run subtest for this test suite.

Parameters
rcvErrorTypetype of station (STA or AP) to install the post reception error model on

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

References AddbaStateChangedCallback(), ns3::AP, third::channel, ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), ns3::WifiMac::GetWifiPhy(), third::mac, ns3::MakeCallback(), ns3::MicroSeconds(), third::mobility, NS_ABORT_MSG, third::phy, RxCallback(), RxErrorCallback(), ns3::Seconds(), SendPacketBurst(), ns3::WifiPhy::SetPostReceptionErrorModel(), ns3::STA, nlohmann::to_string(), TxCallback(), third::wifi, ns3::WIFI_STANDARD_80211n, 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 2294 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 2319 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 2331 of file wifi-test.cc.

Referenced by RunSubtest().

+ Here is the caller graph for this function:

◆ TxCallback()

void Bug2470TestCase::TxCallback ( Ptr< ListErrorModel rxErrorModel,
std::string  context,
WifiConstPsduMap  psduMap,
WifiTxVector  txVector,
double  txPowerW 
)
private

Callback when a frame is transmitted.

Parameters
rxErrorModelthe post reception error model on the receiver
contextthe context
psduMapthe PSDU map
txVectorthe TX vector
txPowerWthe tx power in Watts

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

References ns3::Now(), ns3::Seconds(), ns3::ListErrorModel::SetList(), and ns3::WIFI_MAC_MGT_ACTION.

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 2220 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 2226 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 2222 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 2224 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 2227 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 2219 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 2218 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 2217 of file wifi-test.cc.

Referenced by DoRun(), and RxCallback().


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