Make sure that the ADDBA handshake process is protected. More...
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 |
TestCase & | operator= (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... | |
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 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. | |
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:
See Bug 2470
Definition at line 2161 of file wifi-test.cc.
Bug2470TestCase::Bug2470TestCase | ( | ) |
Definition at line 2248 of file wifi-test.cc.
|
override |
Definition at line 2261 of file wifi-test.cc.
|
private |
Callback when ADDBA state changed.
context | node context |
t | the time the state changed |
recipient | the MAC address of the recipient |
tid | the TID |
state | the state |
Definition at line 2266 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().
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 2466 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.
|
private |
Run subtest for this test suite.
rcvErrorType | type of station (STA or AP) to install the post reception error model on |
Definition at line 2361 of file wifi-test.cc.
References AddbaStateChangedCallback(), ns3::AP, ns3::WifiHelper::AssignStreams(), ns3::Config::Connect(), ns3::NodeContainer::Create(), ns3::CreateObject(), ns3::YansWifiChannelHelper::Default(), ns3::Simulator::Destroy(), ns3::DynamicCast(), 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().
|
private |
Callback when packet is received.
context | node context |
p | the received packet |
channelFreqMhz | the channel frequency in MHz |
txVector | the TX vector |
aMpdu | the A-MPDU info |
signalNoise | the signal noise in dBm |
staId | the STA-ID |
Definition at line 2312 of file wifi-test.cc.
References ns3::WifiMacHeader::IsData(), m_receivedAmpduCount, m_receivedNormalMpduCount, and ns3::MpduInfo::type.
Referenced by RunSubtest().
|
private |
Callback when packet is dropped.
context | node context |
p | the failed packet |
snr | the SNR of the failed packet in linear scale |
Definition at line 2337 of file wifi-test.cc.
References ns3::WifiMacHeader::IsAction(), and m_failedActionCount.
Referenced by RunSubtest().
|
private |
Triggers the arrival of a burst of 1000 Byte-long packets in the source device.
numPackets | number of packets in burst |
sourceDevice | pointer to the source NetDevice |
destination | address of the destination device |
Definition at line 2349 of file wifi-test.cc.
References ns3::Create().
Referenced by RunSubtest().
|
private |
Callback when a frame is transmitted.
rxErrorModel | the post reception error model on the receiver |
context | the context |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Definition at line 2293 of file wifi-test.cc.
References ns3::Simulator::Now(), ns3::Seconds(), and ns3::WIFI_MAC_MGT_ACTION.
Referenced by RunSubtest().
|
private |
Count number of times ADDBA state machine is in established state.
Definition at line 2238 of file wifi-test.cc.
Referenced by AddbaStateChangedCallback(), and DoRun().
|
private |
Count number of times ADDBA state machine is in no_reply state.
Definition at line 2244 of file wifi-test.cc.
Referenced by AddbaStateChangedCallback(), and DoRun().
|
private |
Count number of times ADDBA state machine is in pending state.
Definition at line 2240 of file wifi-test.cc.
Referenced by AddbaStateChangedCallback(), and DoRun().
|
private |
Count number of times ADDBA state machine is in rejected state.
Definition at line 2242 of file wifi-test.cc.
Referenced by AddbaStateChangedCallback(), and DoRun().
|
private |
Count number of times ADDBA state machine is in reset state.
Definition at line 2245 of file wifi-test.cc.
Referenced by AddbaStateChangedCallback(), and DoRun().
|
private |
Count failed ADDBA request/response.
Definition at line 2237 of file wifi-test.cc.
Referenced by DoRun(), and RxErrorCallback().
|
private |
Count received A-MPDU packets on STA.
Definition at line 2236 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
Count received normal MPDU packets on STA.
Definition at line 2235 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().