A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
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.
 
- 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 AddbaStateChangedCallback (std::string context, Time t, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
 Callback when ADDBA state changed.
 
void RunSubtest (TypeOfStation rcvErrorType)
 Run subtest for this test suite.
 
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.
 
void RxErrorCallback (std::string context, Ptr< const Packet > p, double snr)
 Callback when packet is dropped.
 
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.
 
void TxCallback (Ptr< ListErrorModel > rxErrorModel, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
 Callback when a frame is transmitted.
 

Private Attributes

uint16_t m_addbaEstablishedCount
 Count number of times ADDBA state machine is in established state.
 
uint16_t m_addbaNoReplyCount
 Count number of times ADDBA state machine is in no_reply state.
 
uint16_t m_addbaPendingCount
 Count number of times ADDBA state machine is in pending state.
 
uint16_t m_addbaRejectedCount
 Count number of times ADDBA state machine is in rejected state.
 
uint16_t m_addbaResetCount
 Count number of times ADDBA state machine is in reset state.
 
uint16_t m_failedActionCount
 Count failed ADDBA request/response.
 
uint16_t m_receivedAmpduCount
 Count received A-MPDU packets on STA.
 
uint16_t m_receivedNormalMpduCount
 Count received normal MPDU packets on STA.
 

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...
 
using instead = Duration
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto QUICK = Duration::QUICK
 
static constexpr auto TAKES_FOREVER
 
- 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.
 

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 ns3::OriginatorBlockAckAgreement::ESTABLISHED, m_addbaEstablishedCount, m_addbaNoReplyCount, m_addbaPendingCount, m_addbaRejectedCount, m_addbaResetCount, ns3::OriginatorBlockAckAgreement::NO_REPLY, ns3::OriginatorBlockAckAgreement::PENDING, ns3::OriginatorBlockAckAgreement::REJECTED, and ns3::OriginatorBlockAckAgreement::RESET.

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, ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Default(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::MakeCallback(), ns3::MicroSeconds(), NS_ABORT_MSG, ns3::Simulator::Run(), RxCallback(), RxErrorCallback(), ns3::Simulator::Schedule(), ns3::Seconds(), SendPacketBurst(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::STA, ns3::Simulator::Stop(), TxCallback(), and ns3::WIFI_STANDARD_80211n.

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::WifiMacHeader::IsData(), m_receivedAmpduCount, m_receivedNormalMpduCount, 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::WifiMacHeader::IsAction(), and m_failedActionCount.

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::Simulator::Now(), ns3::Seconds(), 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: