Base class for association tests. More...
#include "wifi-association-test.h"
Classes | |
| struct | BaseParams |
| Configuration parameters common to all subclasses. More... | |
| struct | Events |
| Actions and checks to perform upon the transmission of each frame. More... | |
Public Member Functions | |
| WifiAssociationTestBase (const std::string &name, const BaseParams &baseParams) | |
| Constructor. | |
| ~WifiAssociationTestBase () override=default | |
| Public Member Functions inherited from ns3::TestCase | |
| TestCase (const TestCase &)=delete | |
| Caller graph was not generated because of its size. | |
| virtual | ~TestCase () |
| Destructor. | |
| std::string | GetName () const |
| TestCase & | operator= (const TestCase &)=delete |
Protected Member Functions | |
| virtual void | AssocSeenByAp (ApWifiMac *apMac, uint16_t aid, Mac48Address staAddress) |
| Callback invoked when the given AP detects that the given STA has completed association. | |
| virtual void | AssocSeenBySta (Mac48Address bssid) |
| Callback invoked when a STA completes association with an AP. | |
| virtual void | DisassocSeenByAp (ApWifiMac *apMac, uint16_t aid, Mac48Address staAddress) |
| Callback invoked when the given AP detects that the given STA has disassociated. | |
| virtual void | DisassocSeenBySta (Mac48Address bssid) |
| Callback invoked when a STA transitions to unassociated state. | |
| void | DoSetup () override |
| Implementation to do any local setup required for this TestCase. | |
| Ptr< PacketSocketClient > | GetApplication (WifiDirection dir, std::size_t apId, std::size_t count, std::size_t pktSize, uint8_t priority=0) const |
| virtual void | Transmit (Ptr< WifiMac > mac, uint8_t phyId, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
| Callback invoked when a FEM passes PSDUs to the PHY. | |
| 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. | |
Protected Attributes | |
| Ptr< ApWifiMac > | m_ap1Mac |
| AP 1 wifi MAC. | |
| std::map< WifiDirection, PacketSocketAddress > | m_ap1Sockets |
| packet socket addresses for DL/UL traffic from AP1 | |
| Ptr< ApWifiMac > | m_ap2Mac |
| AP 2 wifi MAC. | |
| std::map< WifiDirection, PacketSocketAddress > | m_ap2Sockets |
| packet socket addresses for DL/UL traffic from AP2 | |
| std::string | m_assocMgrTypeId {"ns3::WifiDefaultAssocManager"} |
| Association Manager type ID. | |
| BaseParams | m_baseParams |
| configuration parameters | |
| bool | m_checkTxPsdus {false} |
| whether TX PSDUs should be checked against the list of events | |
| Time | m_duration {Seconds(0.8)} |
| simulation duration | |
| std::list< Events > | m_events |
| list of events for a test run | |
| std::set< WifiMacType > | m_framesToSkip |
| frames that must not be checked against the list of events | |
| Ptr< StaWifiMac > | m_staMac |
| STA wifi MAC. | |
Private Member Functions | |
| virtual void | StartTraffic () |
| Start the generation of traffic (needs to be overridden). | |
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... | |
Base class for association tests.
Setup one non-AP STA and two APs with a configurable number of links.
Definition at line 80 of file wifi-association-test.h.
| WifiAssociationTestBase::WifiAssociationTestBase | ( | const std::string & | name, |
| const BaseParams & | baseParams ) |
Constructor.
| name | The name of the new TestCase created |
| baseParams | common configuration parameters |
Definition at line 93 of file wifi-association-test.cc.
References ns3::TestCase::TestCase(), and m_baseParams.
Referenced by WifiDisassocAndReassocTest::WifiDisassocAndReassocTest().
|
overridedefault |
References dir.
|
inlineprotectedvirtual |
Callback invoked when the given AP detects that the given STA has completed association.
| apMac | the MAC of the given AP |
| aid | the AID of the associated STA |
| staAddress | the address of the associated STA |
Reimplemented in WifiDisassocAndReassocTest.
Definition at line 159 of file wifi-association-test.h.
Referenced by DoSetup().
|
inlineprotectedvirtual |
Callback invoked when a STA completes association with an AP.
| bssid | the AP address |
Reimplemented in WifiDisassocAndReassocTest.
Definition at line 139 of file wifi-association-test.h.
Referenced by DoSetup().
|
inlineprotectedvirtual |
Callback invoked when the given AP detects that the given STA has disassociated.
| apMac | the MAC of the given AP |
| aid | the AID of the STA that disassociated |
| staAddress | the address of the STA that disassociated |
Reimplemented in WifiDisassocAndReassocTest.
Definition at line 170 of file wifi-association-test.h.
Referenced by DoSetup().
|
inlineprotectedvirtual |
Callback invoked when a STA transitions to unassociated state.
| bssid | the address of the AP the STA was associated with |
Definition at line 148 of file wifi-association-test.h.
Referenced by DoSetup().
|
overrideprotectedvirtual |
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.
Reimplemented in WifiDisassocAndReassocTest.
Definition at line 101 of file wifi-association-test.cc.
References ns3::WifiHelper::AssignStreams(), AssocSeenByAp(), AssocSeenBySta(), ns3::CreateObject(), DisassocSeenByAp(), DisassocSeenBySta(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DOWNLINK, ns3::DynamicCast(), ns3::PacketSocketHelper::Install(), m_ap1Mac, m_ap1Sockets, m_ap2Mac, m_ap2Sockets, m_assocMgrTypeId, m_baseParams, m_duration, m_staMac, ns3::MakeCallback(), nodes, NS_TEST_ASSERT_MSG_NE, ns3::PeekPointer(), ns3::Seconds(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::SplitString(), Transmit(), ns3::UPLINK, and ns3::WIFI_STANDARD_80211be.
Referenced by WifiDisassocAndReassocTest::DoSetup().
|
protected |
| dir | the traffic direction (uplink/downlink) |
| apId | the AP ID (1 or 2) |
| count | the number of packets to generate |
| pktSize | the size of the packets to generate |
| priority | user priority for generated packets |
Definition at line 280 of file wifi-association-test.cc.
References ns3::CreateObject(), dir, m_ap1Sockets, m_ap2Sockets, m_duration, ns3::MicroSeconds(), and ns3::Simulator::Now().
Referenced by WifiDisassocAndReassocTest::InsertEvents().
|
inlineprivatevirtual |
Start the generation of traffic (needs to be overridden).
Definition at line 217 of file wifi-association-test.h.
|
protectedvirtual |
Callback invoked when a FEM passes PSDUs to the PHY.
| mac | the MAC transmitting the PSDUs |
| 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 232 of file wifi-association-test.cc.
References ns3::WifiMacHeader::GetTypeString(), m_checkTxPsdus, m_events, m_framesToSkip, ns3::Simulator::Now(), NS_LOG_INFO, NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, and ns3::Time::US.
Referenced by DoSetup().
AP 1 wifi MAC.
Definition at line 201 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::AssocSeenByAp(), WifiDisassocAndReassocTest::AssocSeenBySta(), WifiDisassocAndReassocTest::CheckAfterDisassoc(), WifiDisassocAndReassocTest::CheckRemoteApInfo(), WifiDisassocAndReassocTest::CheckRemoteStaInfo(), DoSetup(), WifiDisassocAndReassocTest::DoSetup(), WifiDisassocAndReassocTest::InsertEvents(), and WifiDisassocAndReassocTest::StartRoaming().
|
protected |
packet socket addresses for DL/UL traffic from AP1
Definition at line 205 of file wifi-association-test.h.
Referenced by DoSetup(), GetApplication(), and WifiDisassocAndReassocTest::InsertEvents().
AP 2 wifi MAC.
Definition at line 202 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::AssocSeenByAp(), WifiDisassocAndReassocTest::AssocSeenBySta(), WifiDisassocAndReassocTest::CheckRemoteApInfo(), WifiDisassocAndReassocTest::CheckRemoteStaInfo(), DoSetup(), WifiDisassocAndReassocTest::InsertEvents(), and WifiDisassocAndReassocTest::StartRoaming().
|
protected |
packet socket addresses for DL/UL traffic from AP2
Definition at line 207 of file wifi-association-test.h.
Referenced by DoSetup(), and GetApplication().
|
protected |
Association Manager type ID.
Definition at line 200 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::WifiDisassocAndReassocTest(), and DoSetup().
|
protected |
configuration parameters
Definition at line 199 of file wifi-association-test.h.
Referenced by WifiAssociationTestBase(), and DoSetup().
|
protected |
whether TX PSDUs should be checked against the list of events
Definition at line 209 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::AssocSeenByAp(), and Transmit().
simulation duration
Definition at line 204 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::DoRun(), DoSetup(), and GetApplication().
|
protected |
list of events for a test run
Definition at line 197 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::DoRun(), WifiDisassocAndReassocTest::InsertEvents(), and Transmit().
|
protected |
frames that must not be checked against the list of events
Definition at line 211 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::WifiDisassocAndReassocTest(), and Transmit().
|
protected |
STA wifi MAC.
Definition at line 203 of file wifi-association-test.h.
Referenced by WifiDisassocAndReassocTest::AssocSeenBySta(), WifiDisassocAndReassocTest::CheckAfterDisassoc(), WifiDisassocAndReassocTest::CheckRemoteApInfo(), WifiDisassocAndReassocTest::CheckRemoteStaInfo(), DoSetup(), WifiDisassocAndReassocTest::DoSetup(), WifiDisassocAndReassocTest::InsertEvents(), and WifiDisassocAndReassocTest::StartRoaming().