9#include "ns3/ap-wifi-mac.h"
10#include "ns3/boolean.h"
11#include "ns3/config.h"
12#include "ns3/he-phy.h"
14#include "ns3/mobility-helper.h"
15#include "ns3/multi-model-spectrum-channel.h"
16#include "ns3/node-list.h"
17#include "ns3/packet-socket-client.h"
18#include "ns3/packet-socket-helper.h"
19#include "ns3/packet-socket-server.h"
20#include "ns3/packet.h"
21#include "ns3/pointer.h"
22#include "ns3/qos-txop.h"
23#include "ns3/qos-utils.h"
24#include "ns3/rng-seed-manager.h"
25#include "ns3/spectrum-wifi-helper.h"
26#include "ns3/string.h"
28#include "ns3/wifi-mac-header.h"
29#include "ns3/wifi-net-device.h"
30#include "ns3/wifi-ns3-constants.h"
31#include "ns3/wifi-ppdu.h"
32#include "ns3/wifi-psdu.h"
116 void DoRun()
override;
136 std::size_t pktSize)
const;
178 :
TestCase(
"Check correct operation within TXOPs with parameters: nonHt=" +
179 std::to_string(params.nonHt) +
180 " pifsRecovery=" +
std::to_string(params.pifsRecovery) +
181 " singleRtsPerTxop=" +
std::to_string(params.singleRtsPerTxop) +
182 " lengthBasedRtsCtsThresh=" +
std::to_string(params.lengthBasedRtsCtsThresh) +
183 " protectedIfResponded=" +
std::to_string(params.protectedIfResponded) +
184 " protectSingleExchange=" +
std::to_string(params.protectSingleExchange) +
185 " singleExchangeProtectionBuffer=" +
186 std::to_string(params.singleExchangeProtectionBuffer.GetMicroSeconds()) +
"us"),
227 bool corrupted{
false};
231 if (
const auto& hdr = psduMap.begin()->second->GetHeader(0);
237 m_apErrorModel->SetList({psduMap.begin()->second->GetPacket()->GetUid()});
241 if (
const auto& hdr = psduMap.begin()->second->GetHeader(0);
251 m_staErrorModel->SetList({psduMap.begin()->second->GetPacket()->GetUid()});
263 if (
const auto& hdr = psduMap.begin()->second->GetHeader(0);
264 hdr.IsQosData() && hdr.GetAddr1() ==
m_staDevices.Get(2)->GetAddress() &&
265 hdr.GetSequenceNumber() == (
m_nonHt ? 0 : 1))
283 NS_LOG_INFO(psduMap.begin()->second->GetHeader(0).GetTypeString()
284 <<
" seq " << psduMap.begin()->second->GetHeader(0).GetSequenceNumber() <<
" to "
285 << psduMap.begin()->second->GetAddr1() <<
" TX duration "
287 <<
" duration/ID " << psduMap.begin()->second->GetHeader(0).GetDuration()
288 << (corrupted ?
" CORRUPTED" :
"") << std::endl);
299 int64_t streamNumber = 100;
302 wifiApNode.Create(1);
309 spectrumChannel->AddPropagationLossModel(lossModel);
311 spectrumChannel->SetPropagationDelayModel(delayModel);
314 phy.SetChannel(spectrumChannel);
316 phy.Set(
"ChannelSettings",
StringValue(
"{0, 20, BAND_5GHZ, 0}"));
341 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
348 mac.SetType(
"ns3::StaWifiMac",
365 "EnableBeaconJitter",
386 dev->GetMac()->SetSsid(
Ssid(
"wifi-txop-ssid"));
394 Ssid(
"wifi-txop-ssid"));
400 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
401 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
402 positionAlloc->Add(Vector(0.0, 1.0, 0.0));
403 positionAlloc->Add(Vector(-1.0, 0.0, 0.0));
404 mobility.SetPositionAllocator(positionAlloc);
406 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
407 mobility.Install(wifiApNode);
408 mobility.Install(wifiStaNodes);
411 packetSocket.
Install(wifiApNode);
412 packetSocket.
Install(wifiStaNodes);
424 server->SetLocal(srvAddr);
425 (*nodeIt)->AddApplication(server);
426 server->SetStartTime(
Time{0});
427 server->SetStopTime(
Seconds(1));
472 dev->GetMac()->GetWifiPhy()->SetPostReceptionErrorModel(
m_apErrorModel);
476 dev->GetMac()->GetWifiPhy()->SetPostReceptionErrorModel(
m_staErrorModel);
496 Config::Connect(
"/NodeList/*/ApplicationList/*/$ns3::PacketSocketServer/Rx",
499 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
514 std::size_t pktSize)
const
521 client->SetStartTime(
Time{0});
522 client->SetStopTime(
Seconds(1));
536 "Unexpected AIFSN for STA " << i);
539 "Unexpected CWmin for STA " << i);
542 "Unexpected CWmax for STA " << i);
545 "Unexpected TXOP limit for STA " << i);
552 "Unexpected TXOP limit for AP");
560 Time sifs = apDev->GetPhy()->GetSifs();
561 Time slot = apDev->GetPhy()->GetSlot();
570 auto RoundDurationId = [](
Time t) {
571 return MicroSeconds(ceil(
static_cast<double>(t.GetNanoSeconds()) / 1000));
610 "Unexpected number of transmitted frames");
618 "Expected a frame sent by the AP to the first station");
623 "PSDU size expected not to exceed length based RTS/CTS threshold");
629 rtsCtsTxDurationThresh,
630 "PSDU duration expected not to exceed duration based RTS/CTS threshold");
638 ?
"Duration/ID of the first frame must cover the whole TXOP"
639 :
"Duration/ID of the first frame must be set to remaining time to "
640 "complete DATA+ACK sequence"));
648 tEnd + sifs + tolerance,
649 "Ack in response to the first frame sent too late");
652 apDev->GetMac()->GetAddress(),
653 "Expected a Normal Ack sent to the AP");
657 "Duration/ID of the Ack must be derived from that of the first frame");
672 eifsNoDifs + sifs + aifsn * slot,
673 "Less than AIFS elapsed between AckTimeout and the next TXOP start");
676 eifsNoDifs + sifs + aifsn * slot + (2 * (cwMin + 1) - 1) * slot,
677 "More than AIFS+BO elapsed between AckTimeout and the next TXOP start");
680 "Expected to retransmit a QoS data frame");
683 "Expected to retransmit a frame to the first station");
688 "PSDU size expected not to exceed length based RTS/CTS threshold");
694 rtsCtsTxDurationThresh,
695 "PSDU duration expected not to exceed duration based RTS/CTS threshold");
703 ?
"Duration/ID of the retransmitted frame must cover the whole TXOP"
704 :
"Duration/ID of the retransmitted frame must be set to remaining time to "
705 "complete DATA+ACK sequence"));
713 tEnd + sifs + tolerance,
714 "Ack in response to the first frame sent too late");
717 apDev->GetMac()->GetAddress(),
718 "Expected a Normal Ack sent to the AP");
722 "Duration/ID of the Ack must be derived from that of the previous frame");
733 "Expected a frame sent by the AP to the second station");
738 "PSDU size expected not to exceed length based RTS/CTS threshold");
744 rtsCtsTxDurationThresh,
745 "PSDU duration expected not to exceed duration based RTS/CTS threshold");
755 ?
"Duration/ID of the second frame does not cover the remaining TXOP"
756 :
"Duration/ID of the second frame must be set to remaining time to "
757 "complete DATA+ACK sequence"));
764 auto ackTxVector = apStationManager->GetAckTxVector(staAddress,
m_txPsdus[4].txVector);
773 "Second frame must have been sent after a PIFS");
780 "Less than AIFS elapsed between AckTimeout and the next transmission");
783 sifs + aifsn * slot + (2 * (cwMin + 1) - 1) * slot,
784 "More than AIFS+BO elapsed between AckTimeout and the next TXOP start");
789 "Expected a frame sent by the AP to the second station");
794 "PSDU size expected not to exceed length based RTS/CTS threshold");
800 rtsCtsTxDurationThresh,
801 "PSDU duration expected not to exceed duration based RTS/CTS threshold");
810 ?
"Duration/ID of the second frame does not cover the remaining TXOP"
811 :
"Duration/ID of the second frame must be set to remaining time to "
812 "complete DATA+ACK sequence"));
820 "Ack in response to the second frame sent too early");
822 tEnd + sifs + tolerance,
823 "Ack in response to the second frame sent too late");
826 apDev->GetMac()->GetAddress(),
827 "Expected a Normal Ack sent to the AP");
831 "Duration/ID of the Ack must be derived from that of the previous frame");
842 "Expected a frame sent by the AP to the third station");
847 "PSDU size expected not to exceed length based RTS/CTS threshold");
853 rtsCtsTxDurationThresh,
854 "PSDU duration expected not to exceed duration based RTS/CTS threshold");
863 ?
"Duration/ID of the third frame does not cover the remaining TXOP"
864 :
"Duration/ID of the third frame must be set to remaining time to "
865 "complete DATA+ACK sequence"));
873 tEnd + sifs + tolerance,
874 "Ack in response to the third frame sent too late");
877 apDev->GetMac()->GetAddress(),
878 "Expected a Normal Ack sent to the AP");
882 "Duration/ID of the Ack must be derived from that of the previous frame");
894 tEnd + sifs + tolerance,
895 "RTS before fourth frame sent too late");
900 "Expected an RTS frame sent by the AP to the second station");
909 ?
"Duration/ID of the RTS before the fourth frame does not cover the remaining "
911 :
"Duration/ID of the RTS before the fourth frame must be set to remaining time "
912 "to complete CTS+DATA+ACK sequence"));
920 "CTS in response to RTS before the fourth frame sent too early");
922 tEnd + sifs + tolerance,
923 "CTS in response to RTS before the fourth frame sent too late");
926 apDev->GetMac()->GetAddress(),
927 "Expected a CTS frame sent to the AP");
931 "Duration/ID of the CTS frame must be derived from that of the RTS frame");
952 "Expected a frame sent by the AP to the second station");
957 "PSDU size expected to exceed length based RTS/CTS threshold");
962 rtsCtsTxDurationThresh,
963 "PSDU duration expected to exceed duration based RTS/CTS threshold");
972 ?
"Duration/ID of the fourth frame does not cover the remaining TXOP"
973 :
"Duration/ID of the fourth frame must be set to remaining time to "
974 "complete DATA+(Block)ACK sequence"));
976 std::string ack(
m_nonHt ?
"Normal Ack" :
"Block Ack");
984 ack <<
" in response to the fourth QoS data frame sent too early");
986 tEnd + sifs + tolerance,
987 ack <<
" in response to the fourth QoS data frame sent too late");
991 "Expected a " << ack);
993 apDev->GetMac()->GetAddress(),
994 "Expected a " << ack <<
" sent to the AP");
998 "Duration/ID of the " << ack <<
" must be derived from that of the previous frame");
1011 "Duration/ID must be set to 0 for CF-End frames");
1023 "Less than AIFS elapsed between two TXOPs");
1026 "More than AIFS+BO elapsed between two TXOPs");
1029 apDev->GetMac()->GetAddress(),
1030 "Expected a frame sent by the first station to the AP");
1035 "PSDU size expected not to exceed length based RTS/CTS threshold");
1041 rtsCtsTxDurationThresh,
1042 "PSDU duration expected not to exceed duration based RTS/CTS threshold");
1050 ?
"Duration/ID of the frame sent by the first station does not "
1051 "cover the remaining TXOP"
1052 :
"Duration/ID of the frame sent by the first station must be set "
1053 "to remaining time to "
1054 "complete DATA+ACK sequence"));
1065 "Expected a Normal Ack sent to the first station");
1068 RoundDurationId(
m_txPsdus[11].header.GetDuration() - sifs -
m_txPsdus[12].txDuration),
1069 "Duration/ID of the Ack must be derived from that of the previous frame");
1082 "Duration/ID must be set to 0 for CF-End frames");
1118 "Expected an RTS frame sent by the AP to the first station");
1126 ?
"Duration/ID of the first RTS frame must cover the whole TXOP"
1127 :
"Duration/ID of the first RTS frame must be set to remaining time "
1128 "to complete CTS+DATA+(Block)ACK sequence"));
1136 "CTS in response to the first RTS frame sent too early");
1138 tEnd + sifs + tolerance,
1139 "CTS in response to the first RTS frame sent too late");
1142 apDev->GetMac()->GetAddress(),
1143 "Expected a CTS frame sent to the AP");
1146 RoundDurationId(
m_txPsdus[13].header.GetDuration() - sifs -
m_txPsdus[14].txDuration),
1147 "Duration/ID of the CTS frame must be derived from that of the RTS frame");
1158 "Expected a frame sent by the AP to the first station");
1163 "PSDU size expected to exceed length based RTS/CTS threshold");
1168 rtsCtsTxDurationThresh,
1169 "PSDU duration expected to exceed duration based RTS/CTS threshold");
1178 ?
"Duration/ID of the first QoS data frame does not cover the remaining TXOP"
1179 :
"Duration/ID of the first QoS data frame must be set to remaining time to "
1180 "complete DATA+(Block)ACK sequence"));
1188 ack <<
" in response to the first QoS data frame sent too early");
1190 tEnd + sifs + tolerance,
1191 ack <<
" in response to the first QoS data frame sent too late");
1195 "Expected a " << ack);
1197 apDev->GetMac()->GetAddress(),
1198 "Expected a " << ack <<
" sent to the AP");
1201 RoundDurationId(
m_txPsdus[15].header.GetDuration() - sifs -
m_txPsdus[16].txDuration),
1202 "Duration/ID of the " << ack <<
" must be derived from that of the previous frame");
1204 std::size_t idx = 16;
1219 "Expected an RTS frame sent by the AP to the second station");
1228 ?
"Duration/ID of the second RTS frame must cover the whole TXOP"
1229 :
"Duration/ID of the second RTS frame must be set to remaining time to complete "
1230 "CTS+DATA+(Block)ACK sequence"));
1238 "CTS in response to the second RTS frame sent too early");
1240 tEnd + sifs + tolerance,
1241 "CTS in response to the second RTS frame sent too late");
1244 apDev->GetMac()->GetAddress(),
1245 "Expected a CTS frame sent to the AP");
1247 m_txPsdus[idx + 1].header.GetDuration(),
1248 RoundDurationId(
m_txPsdus[idx].header.GetDuration() - sifs -
1250 "Duration/ID of the CTS frame must be derived from that of the RTS frame");
1265 "Expected a frame sent by the AP to the second station");
1270 "PSDU size expected to exceed length based RTS/CTS threshold");
1275 rtsCtsTxDurationThresh,
1276 "PSDU duration expected to exceed duration based RTS/CTS threshold");
1285 ?
"Duration/ID of the second QoS data frame does not cover the remaining TXOP"
1286 :
"Duration/ID of the second QoS data frame must be set to remaining time to "
1287 "complete DATA+(Block)ACK sequence"));
1295 ack <<
" in response to the second QoS data frame sent too early");
1297 tEnd + sifs + tolerance,
1298 ack <<
" in response to the second QoS data frame sent too late");
1302 "Expected a " << ack);
1304 apDev->GetMac()->GetAddress(),
1305 "Expected a " << ack <<
" sent to the AP");
1307 m_txPsdus[idx + 1].header.GetDuration(),
1308 RoundDurationId(
m_txPsdus[idx].header.GetDuration() - sifs -
m_txPsdus[idx + 1].txDuration),
1309 "Duration/ID of the " << ack <<
" must be derived from that of the previous frame");
1325 "Expected an RTS frame sent by the AP to the third station");
1334 ?
"Duration/ID of the third RTS frame must cover the whole TXOP"
1335 :
"Duration/ID of the third RTS frame must be set to remaining time to complete "
1336 "CTS+DATA+(Block)ACK sequence"));
1344 "CTS in response to the third RTS frame sent too early");
1346 tEnd + sifs + tolerance,
1347 "CTS in response to the third RTS frame sent too late");
1350 apDev->GetMac()->GetAddress(),
1351 "Expected a CTS frame sent to the AP");
1353 m_txPsdus[idx + 1].header.GetDuration(),
1354 RoundDurationId(
m_txPsdus[idx].header.GetDuration() - sifs -
1356 "Duration/ID of the CTS frame must be derived from that of the RTS frame");
1370 "Expected a frame sent by the AP to the third station");
1375 "PSDU size expected to exceed length based RTS/CTS threshold");
1380 rtsCtsTxDurationThresh,
1381 "PSDU duration expected to exceed duration based RTS/CTS threshold");
1390 ?
"Duration/ID of the third QoS data frame does not cover the remaining TXOP"
1391 :
"Duration/ID of the third QoS data frame must be set to remaining time to "
1392 "complete DATA+(Block)ACK sequence"));
1400 ack <<
" in response to the third QoS data frame sent too early");
1402 tEnd + sifs + tolerance,
1403 ack <<
" in response to the third QoS data frame sent too late");
1407 "Expected a " << ack);
1409 apDev->GetMac()->GetAddress(),
1410 "Expected a " << ack <<
" sent to the AP");
1412 m_txPsdus[idx + 1].header.GetDuration(),
1413 RoundDurationId(
m_txPsdus[idx].header.GetDuration() - sifs -
m_txPsdus[idx + 1].txDuration),
1414 "Duration/ID of the " << ack <<
" must be derived from that of the previous frame");
1430 "Duration/ID must be set to 0 for CF-End frames");
1455 for (
const auto nonHt : {
true,
false})
1457 for (
const auto pifsRecovery : {
true,
false})
1459 for (
const auto singleRtsPerTxop : {
true,
false})
1461 for (
const auto lengthBasedRtsCtsThresh : {
true,
false})
1463 for (
const auto protectedIfResponded : {
true,
false})
1465 for (
const auto protectSingleExchange : {
false,
true})
1467 for (
const auto& singleExchangeProtectionBuffer :
1470 if (!protectSingleExchange &&
1471 singleExchangeProtectionBuffer.IsStrictlyPositive())
1477 .pifsRecovery = pifsRecovery,
1478 .singleRtsPerTxop = singleRtsPerTxop,
1479 .lengthBasedRtsCtsThresh = lengthBasedRtsCtsThresh,
1480 .protectedIfResponded = protectedIfResponded,
1481 .protectSingleExchange = protectSingleExchange,
1482 .singleExchangeProtectionBuffer =
1483 singleExchangeProtectionBuffer,
void L7Receive(std::string context, Ptr< const Packet > p, const Address &addr)
Function to trace packets received by the server application.
bool m_pifsRecovery
whether PIFS recovery is used after failure of a non-initial frame
std::vector< PacketSocketAddress > m_dlSockets
packet socket address for DL traffic
NetDeviceContainer m_apDevices
container for AP's NetDevice
WifiTxopTest(const Params ¶ms)
Constructor.
uint8_t m_staAifsn
AIFSN for STAs (AC BE).
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_received
number of packets received by the stations
TrafficDirection
Enumeration for traffic directions.
uint16_t m_nStations
number of stations
Ptr< ListErrorModel > m_apErrorModel
error model to install on the AP
uint32_t m_staCwMin
CWmin for STAs (AC BE).
Time m_singleExchangeProtectionSurplus
whether the NAV duration should be extended by a PIFS after the frame exchange when protection only c...
bool m_nonHt
use 802.11a standard if true, 802.11ax standard otherwise
std::size_t m_payloadSizeRtsOff
size in bytes of packets not protected by RTS
WifiMode m_mode
wifi mode used to transmit data frames
Time m_apTxopLimit
TXOP limit for AP (AC BE).
std::vector< FrameInfo > m_txPsdus
transmitted PSDUs
Time m_startTime
time when data frame exchanges start
std::vector< PacketSocketAddress > m_ulSockets
packet socket address for UL traffic
bool m_staCorrupted
whether the frame to be corrupted by the STA has been corrupted
Ptr< PacketSocketClient > GetApplication(TrafficDirection dir, std::size_t staId, std::size_t count, std::size_t pktSize) const
void Transmit(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when PHY receives a PSDU to transmit.
bool m_singleRtsPerTxop
whether protection mechanism is used no more than once per TXOP
bool m_protectedIfResponded
whether a station is assumed to be protected if replied to a frame requiring acknowledgment
NetDeviceContainer m_staDevices
container for stations' NetDevices
bool m_apCorrupted
whether the frame to be corrupted by the AP has been corrupted
std::size_t m_payloadSizeRtsOn
size in bytes of packets protected by RTS
uint32_t m_staCwMax
CWmax for STAs (AC BE).
bool m_lengthBasedRtsCtsThresh
if true, use length based RTS/CTS threshold; if false, use TX duration based RTS/CTS threshold
Time m_staTxopLimit
TXOP limit for STAs (AC BE).
bool m_protectSingleExchange
whether the Duration/ID field in frames establishing protection only covers the immediate frame excha...
Ptr< ListErrorModel > m_staErrorModel
error model to install on a STA
void CheckResults()
Check correctness of transmitted frames.
a polymophic address class
AttributeContainerValue< UintAccessParamsPairValue, ';'> UintAccessParamsMapValue
AttributeValue type of an ACI-indexed map of access parameters of type unsigned integer.
std::map< AcIndex, std::vector< uint64_t > > UintAccessParamsMap
ACI-indexed map of access parameters of type unsigned integer (CWmin, CWmax and AIFSN).
A container for one type of attribute.
AttributeValue implementation for Boolean.
PHY entity for HE (11ax).
Provide a list of Packet uids to corrupt.
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
PHY entity for OFDM (11a).
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Make it easy to create and manage PHY objects for the spectrum model.
The IEEE 802.11 SSID Information Element.
AttributeValue implementation for Ssid.
Hold variables of type string.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
bool LookupAttributeByName(std::string name, AttributeInformation *info, bool permissive=false) const
Find an Attribute by name, retrieving the associated AttributeInformation.
Hold an unsigned integer type.
helps to create WifiNetDevice objects
static int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the PHY and MAC aspects ...
create MAC layers for a ns3::WifiNetDevice.
represent a single transmission mode
AttributeValue implementation for WifiMode.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
static Time CalculatePhyPreambleAndHeaderDuration(const WifiTxVector &txVector)
static TypeId GetTypeId()
Get the type ID.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_TEST_EXPECT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to limit and report if not.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report if not.
#define NS_TEST_EXPECT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report if not.
#define NS_TEST_EXPECT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report if not.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
#define NS_TEST_ASSERT_MSG_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal and report and abort if not.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double MHz_u
MHz weak type.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
Time GetEstimatedAckTxTime(const WifiTxVector &txVector)
static constexpr uint8_t SINGLE_LINK_OP_ID
Link ID for single link operations (helps tracking places where correct link ID is to be used to supp...
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU).
const Time DEFAULT_BEACON_INTERVAL
Default Beacon interval.
Information about transmitted frames.
WifiMacHeader header
Frame MAC header.
WifiTxVector txVector
TX vector used to transmit the frame.
Time txStart
Frame start TX time.
Time txDuration
Frame TX duration.
uint32_t size
PSDU size in bytes.
Parameters for this test.
bool lengthBasedRtsCtsThresh
if true, use length based RTS/CTS threshold; if false, use TX duration based RTS/CTS threshold
bool protectSingleExchange
whether the Duration/ID field in frames establishing protection only covers the immediate frame excha...
bool protectedIfResponded
whether a station is assumed to be protected if replied to a frame requiring acknowledgment
bool singleRtsPerTxop
whether protection mechanism is used no more than once per TXOP
bool nonHt
use 802.11a standard if true, 802.11ax standard otherwise
Time singleExchangeProtectionBuffer
whether the NAV duration should be extended by a PIFS after the frame exchange when protection only c...
bool pifsRecovery
whether PIFS recovery is used after failure of a non-initial frame
static WifiTxopTestSuite g_wifiTxopTestSuite
the test suite