Test TXOP rules. More...
Inheritance diagram for WifiTxopTest:
Collaboration diagram for WifiTxopTest:Classes | |
| struct | FrameInfo |
| Information about transmitted frames. More... | |
Public Member Functions | |
| WifiTxopTest (bool pifsRecovery) | |
| Constructor. | |
| ~WifiTxopTest () override | |
| void | CheckResults () |
| Check correctness of transmitted frames. | |
| void | L7Receive (std::string context, Ptr< const Packet > p, const Address &addr) |
| Function to trace packets received by the server application. | |
| void | Transmit (std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW) |
| Callback invoked when PHY receives a PSDU to transmit. | |
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 | DoRun () override |
| Implementation to actually run this TestCase. | |
Private Attributes | |
| uint8_t | m_aifsn |
| AIFSN for BE. | |
| NetDeviceContainer | m_apDevices |
| container for AP's NetDevice | |
| uint32_t | m_cwMin |
| CWmin for BE. | |
| uint16_t | m_nStations |
| number of stations | |
| bool | m_pifsRecovery |
| whether to use PIFS recovery | |
| uint16_t | m_received |
| number of packets received by the stations | |
| NetDeviceContainer | m_staDevices |
| container for stations' NetDevices | |
| Time | m_txopLimit |
| TXOP limit. | |
| std::vector< FrameInfo > | m_txPsdus |
| transmitted PSDUs | |
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. | |
| void | AddTestCase (TestCase *testCase, TestDuration 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 TXOP rules.
Definition at line 51 of file wifi-txop-test.cc.
| WifiTxopTest::WifiTxopTest | ( | bool | pifsRecovery | ) |
Constructor.
| pifsRecovery | whether PIFS recovery is used after failure of a non-initial frame |
Definition at line 107 of file wifi-txop-test.cc.
|
override |
Definition at line 116 of file wifi-txop-test.cc.
| void WifiTxopTest::CheckResults | ( | ) |
Check correctness of transmitted frames.
Definition at line 339 of file wifi-txop-test.cc.
References ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::NetDeviceContainer::Get(), m_aifsn, m_apDevices, m_cwMin, m_pifsRecovery, m_received, m_staDevices, m_txopLimit, m_txPsdus, ns3::MicroSeconds(), ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_ASSERT_MSG_GT_OR_EQ, NS_TEST_ASSERT_MSG_LT, NS_TEST_ASSERT_MSG_LT_OR_EQ, and ns3::Seconds().
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
overrideprivatevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 155 of file wifi-txop-test.cc.
References CheckResults(), ns3::Config::Connect(), ns3::Simulator::Destroy(), ns3::PointerValue::Get(), ns3::NetDeviceContainer::Get(), ns3::Txop::GetAifsn(), ns3::Txop::GetMinCw(), ns3::PacketSocketHelper::Install(), L7Receive(), m_aifsn, m_apDevices, m_cwMin, m_nStations, m_pifsRecovery, m_staDevices, m_txopLimit, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Config::SetDefault(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::WifiMac::SetSsid(), ns3::Simulator::Stop(), Transmit(), and ns3::WIFI_STANDARD_80211a.
Here is the call graph for this function:Function to trace packets received by the server application.
| context | the context |
| p | the packet |
| addr | the address |
Definition at line 121 of file wifi-txop-test.cc.
References m_received.
Referenced by DoRun().
Here is the caller graph for this function:| void WifiTxopTest::Transmit | ( | std::string | context, |
| WifiConstPsduMap | psduMap, | ||
| WifiTxVector | txVector, | ||
| double | txPowerW | ||
| ) |
Callback invoked when PHY receives a PSDU to transmit.
| context | the context |
| psduMap | the PSDU map |
| txVector | the TX vector |
| txPowerW | the tx power in Watts |
Definition at line 130 of file wifi-txop-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), m_txPsdus, ns3::MilliSeconds(), ns3::Simulator::Now(), ns3::SU_STA_ID, and ns3::WIFI_PHY_BAND_5GHZ.
Referenced by DoRun().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
AIFSN for BE.
Definition at line 101 of file wifi-txop-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
container for AP's NetDevice
Definition at line 98 of file wifi-txop-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
CWmin for BE.
Definition at line 102 of file wifi-txop-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
|
private |
whether to use PIFS recovery
Definition at line 104 of file wifi-txop-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
number of packets received by the stations
Definition at line 103 of file wifi-txop-test.cc.
Referenced by CheckResults(), and L7Receive().
|
private |
container for stations' NetDevices
Definition at line 97 of file wifi-txop-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
TXOP limit.
Definition at line 100 of file wifi-txop-test.cc.
Referenced by CheckResults(), and DoRun().
|
private |
transmitted PSDUs
Definition at line 99 of file wifi-txop-test.cc.
Referenced by CheckResults(), and Transmit().