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. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
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. 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... | |
TestCase * | GetParent () 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... | |
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 2143 of file wifi-test.cc.
Bug2470TestCase::Bug2470TestCase | ( | ) |
Definition at line 2230 of file wifi-test.cc.
|
override |
Definition at line 2243 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 2248 of file wifi-test.cc.
References m_addbaEstablishedCount, m_addbaNoReplyCount, m_addbaPendingCount, m_addbaRejectedCount, and m_addbaResetCount.
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 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.
|
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 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().
|
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 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().
|
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 2319 of file wifi-test.cc.
References ns3::Packet::Copy(), ns3::WifiMacHeader::IsAction(), m_failedActionCount, and ns3::Packet::RemoveHeader().
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 2331 of file wifi-test.cc.
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 2275 of file wifi-test.cc.
References ns3::Now(), ns3::Seconds(), ns3::ListErrorModel::SetList(), and ns3::WIFI_MAC_MGT_ACTION.
Referenced by RunSubtest().
|
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().
|
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().
|
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().
|
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().
|
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().
|
private |
Count failed ADDBA request/response.
Definition at line 2219 of file wifi-test.cc.
Referenced by DoRun(), and RxErrorCallback().
|
private |
Count received A-MPDU packets on STA.
Definition at line 2218 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().
|
private |
Count received normal MPDU packets on STA.
Definition at line 2217 of file wifi-test.cc.
Referenced by DoRun(), and RxCallback().