Test retransmit procedure. More...
Classes | |
struct | Events |
Actions and checks to perform upon the transmission of each frame. More... | |
struct | Params |
Parameters for this test. More... | |
Public Member Functions | |
WifiRetransmitTest (const Params ¶ms) | |
Constructor. | |
void | Transmit (uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
Callback invoked when PHY receives a PSDU to transmit. | |
![]() | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
void | CheckValues (const std::map< uint16_t, uint32_t > &seqNoRetryCountMap, std::size_t qsrc, uint8_t linkId, std::optional< std::size_t > qsrcOther) |
Check the retry count of the MPDUs stored in the STA MAC queue, the CW and the QSRC of the given link upon transmitting a PSDU. | |
void | DoRun () override |
Implementation to actually run this TestCase. | |
void | DoSetup () override |
Implementation to do any local setup required for this TestCase. | |
Ptr< PacketSocketClient > | GetApplication (std::size_t count, std::size_t pktSize) const |
void | SetEvents () |
Set the list of events to expect in this test run. | |
Private Attributes | |
NetDeviceContainer | m_apDevice |
container for AP's NetDevice | |
Ptr< ListErrorModel > | m_apErrorModel |
error model to install on the AP | |
bool | m_baEstablished {false} |
whether BA agreement has been established | |
std::list< Events >::const_iterator | m_eventIt |
iterator over the list of events | |
std::list< Events > | m_events |
list of events for a test run | |
const uint32_t | m_frameRetryLimit {4} |
frame retry limit | |
bool | m_incrRetryCountUnderBa |
whether retry count is incremented under block ack | |
std::size_t | m_nLinks |
number of links for the devices | |
bool | m_pifsRecovery |
whether to use PIFS recovery | |
const std::size_t | m_pktSize {1000} |
size in bytes of generated packets | |
Ptr< StaWifiMac > | m_staMac |
MAC of the non-AP STA. | |
const Time | m_txopLimit {MicroSeconds(4768)} |
TXOP limit. | |
PacketSocketAddress | m_ulSocket |
packet socket address for UL traffic | |
bool | m_useBarAfterBaTimeout |
whether to send a BAR after a missed BlockAck | |
bool | m_useRts |
whether RTS is used to protect frame transmissions | |
Additional Inherited Members | |
![]() | |
enum class | Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
![]() | |
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 |
![]() | |
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. | |
Test retransmit procedure.
Retransmit procedures are tested for all the combinations of the following options:
Two data frames are generated at a non-AP STA. The first transmission attempt fails, thus retry count (if the IncrementRetryCountUnderBa attribute is set to true) and QSRC are incremented. Two more data frames are generated, thus the second attempt (performed in a second TXOP) includes four data frames. Two of the four data frames (one generated in the first round and one generated in the second round) are corrupted, but the transmission is successful, thus the retry counts are left unchanged and the QSRC is reset. Then, we keep transmitting the two remaining MPDUs until the retry count of the MPDU generated in the first round reaches the retry limit and hence it is discarded (if the IncrementRetryCountUnderBa attribute is set to true). A BlockAckReq is then transmitted to advance the recipient window. Such BlockAckReq is dropped multiple times; every time, the retry count of the remaining MPDU is unchanged and the QSRC increases. When the QSRC exceeds the frame retry limit, the QSRC is reset to 0 and the remaining data frame is not dropped.
Note that the above attempts are all performed in the second TXOP because failures occur on non-initial PPDUs, hence PIFS recovery or backoff procedure is invoked. This test verifies that QSRC is unchanged in the former case and incremented in the latter case.
In case of multi-link devices, the first TXOP is carried out on link 0 and the second TXOP on link 1. It is checked that QSRC and CW are updated on the link on which the TXOP is carried out.
Definition at line 70 of file wifi-retransmit-test.cc.
WifiRetransmitTest::WifiRetransmitTest | ( | const Params & | params | ) |
Constructor.
params | parameters for the Wi-Fi TXOP test |
Definition at line 167 of file wifi-retransmit-test.cc.
|
private |
Check the retry count of the MPDUs stored in the STA MAC queue, the CW and the QSRC of the given link upon transmitting a PSDU.
seqNoRetryCountMap | (sequence number, retry count) pair for the MPDUs that are expected to be in the STA MAC queue |
qsrc | the expected QSRC for the BE AC |
linkId | the ID of the given link |
qsrcOther | the expected QSRC for the BE AC on the other link, in case of MLDs |
Definition at line 297 of file wifi-retransmit-test.cc.
References ns3::AC_BE, ns3::Mac48Address::ConvertFrom(), ns3::NetDeviceContainer::Get(), m_apDevice, m_eventIt, m_events, m_nLinks, m_staMac, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, ns3::WIFI_QOSDATA_QUEUE, and ns3::WIFI_UNICAST.
Referenced by SetEvents().
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 649 of file wifi-retransmit-test.cc.
References ns3::Node::AddApplication(), ns3::Simulator::Destroy(), GetApplication(), m_eventIt, m_events, m_pktSize, m_staMac, ns3::MilliSeconds(), NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), and ns3::Simulator::Stop().
|
overrideprivatevirtual |
Implementation to do any local setup required for this TestCase.
Subclasses should override this method to perform any costly per-test setup before DoRun is invoked.
Reimplemented from ns3::TestCase.
Definition at line 182 of file wifi-retransmit-test.cc.
References ns3::AC_BE, ns3::WifiHelper::AssignStreams(), ns3::Config::ConnectWithoutContext(), ns3::CreateObject(), ns3::DynamicCast(), ns3::NetDeviceContainer::Get(), ns3::HePhy::GetHeMcs8(), ns3::PacketSocketHelper::Install(), m_apDevice, m_apErrorModel, m_baEstablished, m_frameRetryLimit, m_incrRetryCountUnderBa, m_nLinks, m_pifsRecovery, m_pktSize, m_staMac, m_txopLimit, m_ulSocket, m_useBarAfterBaTimeout, m_useRts, ns3::MakeCallback(), ns3::Seconds(), ns3::Config::SetDefault(), SetEvents(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::StaticCast(), Transmit(), ns3::WIFI_STANDARD_80211ax, and ns3::WIFI_STANDARD_80211be.
|
private |
count | the number of packets to generate |
pktSize | the size of the packets to generate |
Definition at line 666 of file wifi-retransmit-test.cc.
References ns3::CreateObject(), m_ulSocket, ns3::MicroSeconds(), pktSize, and ns3::Seconds().
Referenced by DoRun(), and SetEvents().
|
private |
Set the list of events to expect in this test run.
Definition at line 404 of file wifi-retransmit-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), CheckValues(), GetApplication(), m_apErrorModel, m_eventIt, m_events, m_frameRetryLimit, m_incrRetryCountUnderBa, m_nLinks, m_pifsRecovery, m_pktSize, m_staMac, m_useBarAfterBaTimeout, m_useRts, ns3::PeekPointer(), ns3::Simulator::Schedule(), ns3::ListErrorModel::SetList(), ns3::WIFI_MAC_CTL_BACKREQ, ns3::WIFI_MAC_CTL_BACKRESP, ns3::WIFI_MAC_CTL_CTS, ns3::WIFI_MAC_CTL_RTS, and ns3::WIFI_MAC_QOSDATA.
Referenced by DoSetup().
void WifiRetransmitTest::Transmit | ( | uint8_t | phyId, |
WifiConstPsduMap | psduMap, | ||
WifiTxVector | txVector, | ||
double | txPowerW ) |
Callback invoked when PHY receives a PSDU to transmit.
phyId | the ID of the PHY transmitting the PSDUs |
psduMap | the PSDU map |
txVector | the TX vector |
txPowerW | the tx power in Watts |
Definition at line 357 of file wifi-retransmit-test.cc.
References m_baEstablished, m_eventIt, m_events, NS_LOG_INFO, NS_TEST_EXPECT_MSG_EQ, and ns3::PeekPointer().
Referenced by DoSetup().
|
private |
container for AP's NetDevice
Definition at line 157 of file wifi-retransmit-test.cc.
Referenced by CheckValues(), and DoSetup().
|
private |
error model to install on the AP
Definition at line 163 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and SetEvents().
|
private |
whether BA agreement has been established
Definition at line 160 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and Transmit().
|
private |
iterator over the list of events
Definition at line 162 of file wifi-retransmit-test.cc.
Referenced by CheckValues(), DoRun(), SetEvents(), and Transmit().
|
private |
list of events for a test run
Definition at line 161 of file wifi-retransmit-test.cc.
Referenced by CheckValues(), DoRun(), SetEvents(), and Transmit().
|
private |
frame retry limit
Definition at line 158 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and SetEvents().
|
private |
whether retry count is incremented under block ack
Definition at line 152 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and SetEvents().
|
private |
number of links for the devices
Definition at line 150 of file wifi-retransmit-test.cc.
Referenced by CheckValues(), DoSetup(), and SetEvents().
|
private |
whether to use PIFS recovery
Definition at line 154 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and SetEvents().
|
private |
size in bytes of generated packets
Definition at line 159 of file wifi-retransmit-test.cc.
Referenced by DoRun(), DoSetup(), and SetEvents().
|
private |
MAC of the non-AP STA.
Definition at line 156 of file wifi-retransmit-test.cc.
Referenced by CheckValues(), DoRun(), DoSetup(), and SetEvents().
|
private |
|
private |
packet socket address for UL traffic
Definition at line 164 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and GetApplication().
|
private |
whether to send a BAR after a missed BlockAck
Definition at line 153 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and SetEvents().
|
private |
whether RTS is used to protect frame transmissions
Definition at line 151 of file wifi-retransmit-test.cc.
Referenced by DoSetup(), and SetEvents().