Test TXOP rules. More...
Inheritance diagram for WifiTxopTest:
Collaboration diagram for WifiTxopTest:Classes | |
| struct | FrameInfo |
| Information about transmitted frames. More... | |
| struct | Params |
| Parameters for this test. More... | |
Public Member Functions | |
| WifiTxopTest (const Params ¶ms) | |
| Constructor. | |
| 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 Types | |
| enum | TrafficDirection : uint8_t { DOWNLINK = 0 , UPLINK } |
| Enumeration for traffic directions. More... | |
Private Member Functions | |
| void | DoRun () override |
| Implementation to actually run this TestCase. | |
| Ptr< PacketSocketClient > | GetApplication (TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const |
Private Attributes | |
| bool | m_apCorrupted |
| whether the frame to be corrupted by the AP has been corrupted | |
| NetDeviceContainer | m_apDevices |
| container for AP's NetDevice | |
| Ptr< ListErrorModel > | m_apErrorModel |
| error model to install on the AP | |
| Time | m_apTxopLimit |
| TXOP limit for AP (AC BE) | |
| std::vector< PacketSocketAddress > | m_dlSockets |
| packet socket address for DL traffic | |
| bool | m_lengthBasedRtsCtsThresh |
| if true, use length based RTS/CTS threshold; if false, use TX duration based RTS/CTS threshold | |
| WifiMode | m_mode |
| wifi mode used to transmit data frames | |
| bool | m_nonHt |
| use 802.11a standard if true, 802.11ax standard otherwise | |
| uint16_t | m_nStations |
| number of stations | |
| std::size_t | m_payloadSizeRtsOff |
| size in bytes of packets not protected by RTS | |
| std::size_t | m_payloadSizeRtsOn |
| size in bytes of packets protected by RTS | |
| bool | m_pifsRecovery |
| whether PIFS recovery is used after failure of a non-initial frame | |
| bool | m_protectedIfResponded |
| whether a station is assumed to be protected if replied to a frame requiring acknowledgment | |
| bool | m_protectSingleExchange |
| whether the Duration/ID field in frames establishing protection only covers the immediate frame exchange instead of rest of the TXOP limit | |
| uint16_t | m_received |
| number of packets received by the stations | |
| Time | m_singleExchangeProtectionSurplus |
| whether the NAV duration should be extended by a PIFS after the frame exchange when protection only covers the immediate frame exchange instead of rest of the TXOP limit | |
| bool | m_singleRtsPerTxop |
| whether protection mechanism is used no more than once per TXOP | |
| uint8_t | m_staAifsn |
| AIFSN for STAs (AC BE) | |
| bool | m_staCorrupted |
| whether the frame to be corrupted by the STA has been corrupted | |
| uint32_t | m_staCwMax |
| CWmax for STAs (AC BE) | |
| uint32_t | m_staCwMin |
| CWmin for STAs (AC BE) | |
| NetDeviceContainer | m_staDevices |
| container for stations' NetDevices | |
| Ptr< ListErrorModel > | m_staErrorModel |
| error model to install on a STA | |
| Time | m_startTime |
| time when data frame exchanges start | |
| Time | m_staTxopLimit |
| TXOP limit for STAs (AC BE) | |
| std::vector< FrameInfo > | m_txPsdus |
| transmitted PSDUs | |
| std::vector< PacketSocketAddress > | m_ulSockets |
| packet socket address for UL traffic | |
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... | |
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. | |
Test TXOP rules.
A BSS consisting of an AP and 3 non-AP STAs is considered in this test. Both non-HT (802.11a) and HE devices are tested. Two TXOPs are simulated in this test:
Definition at line 61 of file wifi-txop-test.cc.
|
private |
Enumeration for traffic directions.
| Enumerator | |
|---|---|
| DOWNLINK | |
| UPLINK | |
Definition at line 118 of file wifi-txop-test.cc.
| WifiTxopTest::WifiTxopTest | ( | const Params & | params | ) |
Constructor.
| params | parameters for the Wi-Fi TXOP test |
Definition at line 176 of file wifi-txop-test.cc.
References ns3::TestCase::TestCase(), ns3::CreateObject(), m_apCorrupted, m_apErrorModel, m_apTxopLimit, m_lengthBasedRtsCtsThresh, m_mode, m_nonHt, m_nStations, m_payloadSizeRtsOff, m_payloadSizeRtsOn, m_pifsRecovery, m_protectedIfResponded, m_protectSingleExchange, m_received, m_singleExchangeProtectionSurplus, m_singleRtsPerTxop, m_staAifsn, m_staCorrupted, m_staCwMax, m_staCwMin, m_staErrorModel, m_startTime, m_staTxopLimit, ns3::MicroSeconds(), and ns3::MilliSeconds().
Here is the call graph for this function:| void WifiTxopTest::CheckResults | ( | ) |
Check correctness of transmitted frames.
Definition at line 527 of file wifi-txop-test.cc.
References ns3::AC_BE, ns3::WifiPhy::CalculatePhyPreambleAndHeaderDuration(), ns3::DynamicCast(), ns3::GetEstimatedAckTxTime(), ns3::WifiRemoteStationManager::GetTypeId(), ns3::TypeId::AttributeInformation::initialValue, ns3::TypeId::LookupAttributeByName(), m_apDevices, m_apTxopLimit, m_lengthBasedRtsCtsThresh, m_nonHt, m_pifsRecovery, m_protectedIfResponded, m_protectSingleExchange, m_received, m_singleExchangeProtectionSurplus, m_singleRtsPerTxop, m_staAifsn, m_staCwMax, m_staCwMin, m_staDevices, m_staTxopLimit, m_txPsdus, ns3::MicroSeconds(), ns3::NanoSeconds(), NS_TEST_ASSERT_MSG_EQ, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_GT, NS_TEST_EXPECT_MSG_GT_OR_EQ, NS_TEST_EXPECT_MSG_LT, NS_TEST_EXPECT_MSG_LT_OR_EQ, and ns3::SINGLE_LINK_OP_ID.
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 291 of file wifi-txop-test.cc.
References ns3::AC_BE, ns3::Node::AddApplication(), ns3::WifiHelper::AssignStreams(), ns3::NodeList::Begin(), CheckResults(), ns3::Config::Connect(), ns3::CreateObject(), ns3::Simulator::Destroy(), DOWNLINK, ns3::DynamicCast(), ns3::NodeList::End(), GetApplication(), ns3::PacketSocketHelper::Install(), L7Receive(), m_apDevices, m_apErrorModel, m_apTxopLimit, m_dlSockets, m_lengthBasedRtsCtsThresh, m_mode, m_nonHt, m_nStations, m_payloadSizeRtsOff, m_payloadSizeRtsOn, m_pifsRecovery, m_protectedIfResponded, m_protectSingleExchange, m_singleExchangeProtectionSurplus, m_singleRtsPerTxop, m_staAifsn, m_staCwMax, m_staCwMin, m_staDevices, m_staErrorModel, m_startTime, m_staTxopLimit, m_ulSockets, ns3::MakeCallback(), ns3::MicroSeconds(), ns3::MilliSeconds(), NS_LOG_FUNCTION, NS_TEST_ASSERT_MSG_NE, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Config::SetDefault(), ns3::PacketSocketAddress::SetProtocol(), ns3::RngSeedManager::SetRun(), ns3::RngSeedManager::SetSeed(), ns3::PacketSocketAddress::SetSingleDevice(), ns3::WifiMac::SetSsid(), ns3::Simulator::Stop(), Transmit(), UPLINK, ns3::WIFI_STANDARD_80211a, and ns3::WIFI_STANDARD_80211ax.
Here is the call graph for this function:
|
private |
| dir | the traffic direction (downlink/uplink) |
| staId | the index (starting at 0) of the non-AP STA generating/receiving packets |
| count | the number of packets to generate |
| pktSize | the size of the packets to generate |
Definition at line 510 of file wifi-txop-test.cc.
References ns3::CreateObject(), dir, DOWNLINK, m_dlSockets, m_ulSockets, ns3::MicroSeconds(), pktSize, and ns3::Seconds().
Referenced by DoRun(), and Transmit().
Here is the call graph for this function:
Here is the caller 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 212 of file wifi-txop-test.cc.
References m_payloadSizeRtsOff, and 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 221 of file wifi-txop-test.cc.
References ns3::WifiPhy::CalculateTxDuration(), DOWNLINK, GetApplication(), m_apCorrupted, m_apDevices, m_apErrorModel, m_nonHt, m_payloadSizeRtsOn, m_staCorrupted, m_staDevices, m_staErrorModel, m_startTime, m_txPsdus, ns3::Simulator::Now(), NS_LOG_INFO, 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 |
whether the frame to be corrupted by the AP has been corrupted
Definition at line 170 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), and Transmit().
|
private |
container for AP's NetDevice
Definition at line 149 of file wifi-txop-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
error model to install on the AP
Definition at line 168 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), DoRun(), and Transmit().
|
private |
TXOP limit for AP (AC BE)
Definition at line 151 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
packet socket address for DL traffic
Definition at line 172 of file wifi-txop-test.cc.
Referenced by DoRun(), and GetApplication().
|
private |
if true, use length based RTS/CTS threshold; if false, use TX duration based RTS/CTS threshold
Definition at line 164 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
wifi mode used to transmit data frames
Definition at line 161 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), and DoRun().
|
private |
use 802.11a standard if true, 802.11ax standard otherwise
Definition at line 157 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), DoRun(), and Transmit().
|
private |
number of stations
Definition at line 147 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), and DoRun().
|
private |
size in bytes of packets not protected by RTS
Definition at line 159 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), DoRun(), and L7Receive().
|
private |
size in bytes of packets protected by RTS
Definition at line 158 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), DoRun(), and Transmit().
|
private |
whether PIFS recovery is used after failure of a non-initial frame
Definition at line 162 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
whether a station is assumed to be protected if replied to a frame requiring acknowledgment
Definition at line 165 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
whether the Duration/ID field in frames establishing protection only covers the immediate frame exchange instead of rest of the TXOP limit
Definition at line 166 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
number of packets received by the stations
Definition at line 156 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and L7Receive().
|
private |
whether the NAV duration should be extended by a PIFS after the frame exchange when protection only covers the immediate frame exchange instead of rest of the TXOP limit
Definition at line 167 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
whether protection mechanism is used no more than once per TXOP
Definition at line 163 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
AIFSN for STAs (AC BE)
Definition at line 152 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
whether the frame to be corrupted by the STA has been corrupted
Definition at line 171 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), and Transmit().
|
private |
CWmax for STAs (AC BE)
Definition at line 154 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
CWmin for STAs (AC BE)
Definition at line 153 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
container for stations' NetDevices
Definition at line 148 of file wifi-txop-test.cc.
Referenced by CheckResults(), DoRun(), and Transmit().
|
private |
error model to install on a STA
Definition at line 169 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), DoRun(), and Transmit().
|
private |
time when data frame exchanges start
Definition at line 160 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), DoRun(), and Transmit().
|
private |
TXOP limit for STAs (AC BE)
Definition at line 155 of file wifi-txop-test.cc.
Referenced by WifiTxopTest(), CheckResults(), and DoRun().
|
private |
transmitted PSDUs
Definition at line 150 of file wifi-txop-test.cc.
Referenced by CheckResults(), and Transmit().
|
private |
packet socket address for UL traffic
Definition at line 173 of file wifi-txop-test.cc.
Referenced by DoRun(), and GetApplication().