20#include "ns3/config.h"
21#include "ns3/he-configuration.h"
22#include "ns3/he-frame-exchange-manager.h"
23#include "ns3/he-phy.h"
24#include "ns3/mobility-helper.h"
25#include "ns3/multi-model-spectrum-channel.h"
26#include "ns3/multi-user-scheduler.h"
27#include "ns3/packet-socket-client.h"
28#include "ns3/packet-socket-helper.h"
29#include "ns3/packet-socket-server.h"
30#include "ns3/packet.h"
31#include "ns3/qos-utils.h"
32#include "ns3/rng-seed-manager.h"
33#include "ns3/spectrum-wifi-helper.h"
34#include "ns3/string.h"
36#include "ns3/wifi-acknowledgment.h"
37#include "ns3/wifi-mac-header.h"
38#include "ns3/wifi-mac-queue.h"
39#include "ns3/wifi-net-device.h"
40#include "ns3/wifi-protection.h"
41#include "ns3/wifi-psdu.h"
95 static TypeId tid =
TypeId(
"ns3::TestMultiUserScheduler")
145 Time duration = WifiPhy::CalculateTxDuration(ampduSize,
151 std::tie(length, duration) = HePhy::ConvertHeTbPpduDurationToLSigLength(
180 NS_LOG_DEBUG(
"Remaining TXOP duration is not enough for BSRP TF exchange");
192 NS_ABORT_MSG_IF(staList.size() != 4,
"There must be 4 associated stations");
198 for (
auto& sta : staList)
203 for (tid = 0; tid < 8; tid++)
225 NS_LOG_DEBUG(
"Not enough time to send frames to all the stations");
229 std::vector<Ptr<WifiMpdu>> mpduList;
233 if (mpduList.size() > 1)
235 m_psduMap[sta.first] = Create<WifiPsdu>(std::move(mpduList));
239 m_psduMap[sta.first] = Create<WifiPsdu>(mpdu,
true);
277 NS_ABORT_MSG_IF(staList.size() != 4,
"There must be 4 associated stations");
283 ruType = HeRu::RU_52_TONE;
287 ruType = HeRu::RU_106_TONE;
291 ruType = HeRu::RU_242_TONE;
295 ruType = HeRu::RU_484_TONE;
302 bool primary80 =
true;
303 std::size_t ruIndex = 1;
305 for (
auto& sta : staList)
307 if (bw == 160 && ruIndex == 3)
313 {{ruType, ruIndex++, primary80},
WifiMode(
"HeMcs11"), 1});
315 m_txVector.SetSigBMode(VhtPhy::GetVhtMcs5());
375 uint16_t nPktsPerSta,
412 void DoRun()
override;
447 uint16_t nPktsPerSta,
449 :
TestCase(
"Check correct operation of DL OFDMA acknowledgment sequences"),
451 m_sockets(m_nStations),
452 m_channelWidth(width),
453 m_dlMuAckType(dlType),
454 m_maxAmpduSize(maxAmpduSize),
455 m_txopLimit(txopLimit),
456 m_nPktsPerSta(nPktsPerSta),
457 m_muEdcaParameterSet(muEdcaParameterSet),
458 m_ulPktsGenerated(false),
461 m_edcaDisabledStartTime(
Seconds(0)),
503 for (
const auto& [staId, psdu] : psduMap)
506 << psdu->GetHeader(0).GetTypeString() <<
" #MPDUs " << psdu->GetNMpdus()
507 << (psdu->GetHeader(0).IsQosData()
508 ?
" TID " + std::to_string(*psdu->GetTids().begin())
510 <<
" txDuration " << txDuration <<
" duration/ID "
511 << psdu->GetHeader(0).GetDuration() <<
" #TX PSDUs = " <<
m_txPsdus.size());
528 while ((mpdu = queue->PeekByTidAndAddress(i * 2,
529 staDev->GetMac()->GetAddress(),
530 lastInFlight)) !=
nullptr)
532 if (mpdu->IsInFlight())
545 psduMap.begin()->second->GetHeader(0).HasData())
547 Mac48Address sender = psduMap.begin()->second->GetAddr2();
553 if (dev->GetAddress() == sender)
577 else if (!txVector.
IsMu() && psduMap.begin()->second->GetHeader(0).IsBlockAck() &&
582 psduMap.begin()->second->GetPayload(0)->PeekHeader(blockAck);
592 else if (!txVector.
IsMu() && psduMap.begin()->second->GetHeader(0).IsTrigger() &&
596 psduMap.
begin()->second->GetPayload(0)->PeekHeader(trigger);
604 client->SetAttribute(
"PacketSize",
UintegerValue(1400 + i * 100));
610 client->SetStartTime(
Seconds(0));
611 client->SetStopTime(
Seconds(1.0));
612 client->Initialize();
652 "Expected a Trigger Frame");
657 "Expected one User Info field per station");
662 m_txPsdus[1].psduMap.begin()->second->GetNMpdus() == 1),
664 "Expected a QoS Null frame in an HE TB PPDU");
677 uint8_t tid = staId * 2;
685 tEnd + sifs + tolerance,
686 "QoS Null frame in HE TB PPDU sent too late");
689 "Duration/ID in BSRP Trigger Frame is too short");
695 m_txPsdus[2].psduMap.begin()->second->GetNMpdus() == 1),
697 "Expected a QoS Null frame in an HE TB PPDU");
710 uint8_t tid = staId * 2;
716 tEnd + sifs + tolerance,
717 "QoS Null frame in HE TB PPDU sent too late");
720 "Duration/ID in BSRP Trigger Frame is too short");
725 m_txPsdus[3].psduMap.begin()->second->GetNMpdus() == 1),
727 "Expected a QoS Null frame in an HE TB PPDU");
740 uint8_t tid = staId * 2;
746 tEnd + sifs + tolerance,
747 "QoS Null frame in HE TB PPDU sent too late");
750 "Duration/ID in BSRP Trigger Frame is too short");
756 m_txPsdus[4].psduMap.begin()->second->GetNMpdus() == 1),
758 "Expected a QoS Null frame in an HE TB PPDU");
771 uint8_t tid = staId * 2;
777 tEnd + sifs + tolerance,
778 "QoS Null frame in HE TB PPDU sent too late");
781 "Duration/ID in BSRP Trigger Frame is too short");
789 "Expected a Trigger Frame");
794 "Expected one User Info field per station");
806 m_txPsdus[6].psduMap.begin()->second->GetNMpdus() == 2 &&
807 m_txPsdus[6].psduMap.begin()->second->GetHeader(0).IsQosData() &&
808 m_txPsdus[6].psduMap.begin()->second->GetHeader(1).IsQosData()),
810 "Expected 2 QoS data frames in an HE TB PPDU");
815 tEnd + sifs + tolerance,
816 "QoS data frames in HE TB PPDU sent too late");
822 m_txPsdus[7].psduMap.begin()->second->GetNMpdus() == 2 &&
823 m_txPsdus[7].psduMap.begin()->second->GetHeader(0).IsQosData() &&
824 m_txPsdus[7].psduMap.begin()->second->GetHeader(1).IsQosData()),
826 "Expected 2 QoS data frames in an HE TB PPDU");
831 tEnd + sifs + tolerance,
832 "QoS data frames in HE TB PPDU sent too late");
837 m_txPsdus[8].psduMap.begin()->second->GetNMpdus() == 2 &&
838 m_txPsdus[8].psduMap.begin()->second->GetHeader(0).IsQosData() &&
839 m_txPsdus[8].psduMap.begin()->second->GetHeader(1).IsQosData()),
841 "Expected 2 QoS data frames in an HE TB PPDU");
846 tEnd + sifs + tolerance,
847 "QoS data frames in HE TB PPDU sent too late");
853 m_txPsdus[9].psduMap.begin()->second->GetNMpdus() == 2 &&
854 m_txPsdus[9].psduMap.begin()->second->GetHeader(0).IsQosData() &&
855 m_txPsdus[9].psduMap.begin()->second->GetHeader(1).IsQosData()),
857 "Expected 2 QoS data frames in an HE TB PPDU");
862 tEnd + sifs + tolerance,
863 "QoS data frames in HE TB PPDU sent too late");
870 "Expected a Block Ack");
875 "Expected one Per AID TID Info subfield per station");
876 for (uint8_t i = 0; i < 4; i++)
889 "Duration/ID in Basic Trigger Frame is too short");
891 m_txPsdus[6].psduMap.begin()->second->GetDuration();
894 "Duration/ID in 1st QoS Data frame is too short");
896 m_txPsdus[7].psduMap.begin()->second->GetDuration();
899 "Duration/ID in 2nd QoS Data frame is too short");
901 m_txPsdus[8].psduMap.begin()->second->GetDuration();
904 "Duration/ID in 3rd QoS Data frame is too short");
906 m_txPsdus[9].psduMap.begin()->second->GetDuration();
909 "Duration/ID in 4th QoS Data frame is too short");
915 "Expected a DL MU PPDU");
918 "Expected 4 PSDUs within the DL MU PPDU");
922 "TX duration cannot exceed max PPDU duration");
927 "Max A-MPDU size exceeded");
939 navEnd += psdu.second->GetDuration();
945 "Duration/ID must be the same for all PSDUs");
950 "Duration/ID of the DL MU PPDU cannot be zero");
952 std::size_t nTxPsdus = 0;
954 if (
m_dlMuAckType == WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE)
982 "Expected a Block Ack");
992 "Expected a Block Ack Request");
997 tEnd + sifs + tolerance,
998 "First Block Ack Request sent too late");
1004 "Expected a Block Ack");
1014 "Expected a Block Ack Request");
1019 tEnd + sifs + tolerance,
1020 "Second Block Ack Request sent too late");
1026 "Expected a Block Ack");
1036 "Expected a Block Ack Request");
1041 tEnd + sifs + tolerance,
1042 "Third Block Ack Request sent too late");
1048 "Expected a Block Ack");
1059 "Duration/ID in the DL MU PPDU is too short");
1064 "Duration/ID in the 1st BlockAckReq is too short");
1069 "Duration/ID in the 2nd BlockAckReq is too short");
1074 "Duration/ID in the 3rd BlockAckReq is too short");
1078 else if (
m_dlMuAckType == WifiAcknowledgment::DL_MU_TF_MU_BAR)
1101 "Expected a MU-BAR Trigger Frame");
1110 m_txPsdus[13].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1112 "Expected a Block Ack");
1117 tEnd + sifs + tolerance,
1118 "Block Ack in HE TB PPDU sent too late");
1124 m_txPsdus[14].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1126 "Expected a Block Ack");
1131 tEnd + sifs + tolerance,
1132 "Block Ack in HE TB PPDU sent too late");
1138 m_txPsdus[15].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1140 "Expected a Block Ack");
1145 tEnd + sifs + tolerance,
1146 "Block Ack in HE TB PPDU sent too late");
1152 m_txPsdus[16].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1154 "Expected a Block Ack");
1159 tEnd + sifs + tolerance,
1160 "Block Ack in HE TB PPDU sent too late");
1167 "Duration/ID in the DL MU PPDU is too short");
1170 "Duration/ID in the DL MU PPDU is too short");
1173 "Duration/ID in the DL MU PPDU is too short");
1176 "Duration/ID in the DL MU PPDU is too short");
1182 "Duration/ID in the MU-BAR Trigger Frame is too short");
1185 "Duration/ID in the MU-BAR Trigger Frame is too short");
1188 "Duration/ID in the MU-BAR Trigger Frame is too short");
1191 "Duration/ID in the MU-BAR Trigger Frame is too short");
1195 else if (
m_dlMuAckType == WifiAcknowledgment::DL_MU_AGGREGATE_TF)
1214 for (
auto& psdu :
m_txPsdus[11].psduMap)
1218 "Expected an aggregated MU-BAR Trigger Frame");
1225 m_txPsdus[12].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1227 "Expected a Block Ack");
1232 tEnd + sifs + tolerance,
1233 "Block Ack in HE TB PPDU sent too late");
1236 "Duration/ID in the DL MU PPDU is too short");
1242 m_txPsdus[13].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1244 "Expected a Block Ack");
1249 tEnd + sifs + tolerance,
1250 "Block Ack in HE TB PPDU sent too late");
1253 "Duration/ID in the DL MU PPDU is too short");
1259 m_txPsdus[14].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1261 "Expected a Block Ack");
1266 tEnd + sifs + tolerance,
1267 "Block Ack in HE TB PPDU sent too late");
1270 "Duration/ID in the DL MU PPDU is too short");
1276 m_txPsdus[15].psduMap.begin()->second->GetHeader(0).IsBlockAck()),
1278 "Expected a Block Ack");
1283 tEnd + sifs + tolerance,
1284 "Block Ack in HE TB PPDU sent too late");
1287 "Duration/ID in the DL MU PPDU is too short");
1294 "Not all DL packets have been received");
1301 for (std::size_t i = nTxPsdus; i <
m_txPsdus.size(); ++i)
1304 m_txPsdus[i].psduMap.begin()->second->GetHeader(0).GetAddr2() !=
1312 "A station transmitted before the MU EDCA timer expired");
1324 "A station did not set the correct MU CW min");
1334 uint32_t previousSeed = RngSeedManager::GetSeed();
1335 uint64_t previousRun = RngSeedManager::GetRun();
1338 int64_t streamNumber = 20;
1348 spectrumChannel->AddPropagationLossModel(lossModel);
1350 CreateObject<ConstantSpeedPropagationDelayModel>();
1351 spectrumChannel->SetPropagationDelayModel(delayModel);
1354 phy.SetPcapDataLinkType(WifiPhyHelper::DLT_IEEE802_11_RADIO);
1355 phy.SetErrorRateModel(
"ns3::NistErrorRateModel");
1356 phy.SetChannel(spectrumChannel);
1360 phy.Set(
"ChannelSettings",
StringValue(
"{36, 20, BAND_5GHZ, 0}"));
1363 phy.Set(
"ChannelSettings",
StringValue(
"{38, 40, BAND_5GHZ, 0}"));
1366 phy.Set(
"ChannelSettings",
StringValue(
"{42, 80, BAND_5GHZ, 0}"));
1369 phy.Set(
"ChannelSettings",
StringValue(
"{50, 160, BAND_5GHZ, 0}"));
1372 NS_ABORT_MSG(
"Invalid channel bandwidth (must be 20, 40, 80 or 160)");
1416 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1417 wifi.ConfigHeOptions(
"MuBeAifsn",
1435 mac.SetType(
"ns3::StaWifiMac",
1443 "BE_BlockAckThreshold",
1450 "BK_BlockAckThreshold",
1457 "VI_BlockAckThreshold",
1464 "VO_BlockAckThreshold",
1471 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(
true));
1472 mac.SetMultiUserScheduler(
"ns3::TestMultiUserScheduler",
1474 "AccessReqInterval",
1476 "DelayAccessReqUponAccess",
1478 mac.SetAckManager(
"ns3::WifiDefaultAckManager",
1479 "DlMuAckSequenceType",
1491 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1492 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
1493 positionAlloc->Add(Vector(0.0, 1.0, 0.0));
1494 positionAlloc->Add(Vector(-1.0, 0.0, 0.0));
1495 positionAlloc->Add(Vector(-1.0, -1.0, 0.0));
1496 mobility.SetPositionAllocator(positionAlloc);
1498 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1505 auto dev = DynamicCast<WifiNetDevice>(allDevices.
Get(i));
1512 dev->GetMac()->GetQosTxop(
AC_BE)->SetAifsn(3);
1513 dev->GetMac()->GetQosTxop(
AC_BK)->SetAifsn(3);
1514 dev->GetMac()->GetQosTxop(
AC_VI)->SetAifsn(3);
1515 dev->GetMac()->GetQosTxop(
AC_VO)->SetAifsn(3);
1537 client1->SetRemote(socket);
1540 client1->SetStopTime(
Seconds(2.0));
1545 client2->SetAttribute(
"PacketSize",
UintegerValue(1400 + i * 100));
1549 client2->SetRemote(socket);
1551 client2->SetStartTime(
Seconds(1.5003));
1552 client2->SetStopTime(
Seconds(2.5));
1555 server->SetLocal(socket);
1557 server->SetStartTime(
Seconds(0.0));
1558 server->SetStopTime(
Seconds(3.0));
1578 client1->SetStopTime(
Seconds(2.0));
1586 server->SetStartTime(
Seconds(0.0));
1587 server->SetStopTime(
Seconds(3.0));
1590 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
1593 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
1603 Simulator::Destroy();
1625 using MuEdcaParams = std::initializer_list<OfdmaAckSequenceTest::MuEdcaParameterSet>;
1627 for (
auto& muEdcaParameterSet : MuEdcaParams{{0, 0, 0, 0} ,
1628 {0, 127, 2047, 100} ,
1629 {10, 127, 2047, 100} })
1632 WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE,
1636 muEdcaParameterSet),
1639 WifiAcknowledgment::DL_MU_AGGREGATE_TF,
1643 muEdcaParameterSet),
1646 WifiAcknowledgment::DL_MU_TF_MU_BAR,
1650 muEdcaParameterSet),
1653 WifiAcknowledgment::DL_MU_BAR_BA_SEQUENCE,
1657 muEdcaParameterSet),
1660 WifiAcknowledgment::DL_MU_AGGREGATE_TF,
1664 muEdcaParameterSet),
1667 WifiAcknowledgment::DL_MU_TF_MU_BAR,
1671 muEdcaParameterSet),
Test OFDMA acknowledgment sequences.
std::vector< FrameInfo > m_txPsdus
transmitted PSDUs
Time m_edcaDisabledStartTime
time when disabling EDCA started
uint16_t m_flushed
number of DL packets flushed after DL MU PPDU
void Transmit(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when FrameExchangeManager passes PSDUs to the PHY.
OfdmaAckSequenceTest(uint16_t width, WifiAcknowledgment::Method dlType, uint32_t maxAmpduSize, uint16_t txopLimit, uint16_t nPktsPerSta, MuEdcaParameterSet muEdcaParameterSet)
Constructor.
static constexpr uint16_t m_muTimerRes
MU timer resolution in usec.
uint16_t m_received
number of packets received by the stations
void CheckResults(Time sifs, Time slotTime, uint8_t aifsn)
Check correctness of transmitted frames.
WifiAcknowledgment::Method m_dlMuAckType
DL MU ack sequence type.
bool m_ulPktsGenerated
whether UL packets for HE TB PPDUs have been generated
uint16_t m_nPktsPerSta
number of packets to send to each station
NetDeviceContainer m_staDevices
stations' devices
std::vector< PacketSocketAddress > m_sockets
packet socket addresses for STAs
uint16_t m_txopLimit
TXOP limit in microseconds.
void DoRun() override
Implementation to actually run this TestCase.
void L7Receive(std::string context, Ptr< const Packet > p, const Address &addr)
Function to trace packets received by the server application.
uint16_t m_channelWidth
PHY channel bandwidth in MHz.
~OfdmaAckSequenceTest() override
uint32_t m_maxAmpduSize
maximum A-MPDU size in bytes
Ptr< WifiNetDevice > m_apDevice
AP's device.
std::vector< uint32_t > m_cwValues
CW used by stations after MU exchange.
void TraceCw(uint32_t staIndex, uint32_t cw, uint8_t)
Function to trace CW value used by the given station after the MU exchange.
uint16_t m_nStations
number of stations
MuEdcaParameterSet m_muEdcaParameterSet
MU EDCA Parameter Set.
Dummy Multi User Scheduler used to test OFDMA ack sequences.
WifiPsduMap m_psduMap
the DL MU PPDU to transmit
TxFormat m_txFormat
the format of next transmission
WifiTxVector m_txVector
the TX vector for MU PPDUs
UlMuInfo ComputeUlMuInfo() override
Prepare the information required to solicit an UL MU transmission.
TriggerFrameType m_ulTriggerType
Trigger Frame type for UL MU.
WifiTxParameters m_txParams
TX parameters.
TxFormat SelectTxFormat() override
Select the format of the next transmission.
void ComputeWifiTxVector()
Compute the TX vector to use for MU PPDUs.
~TestMultiUserScheduler() override
static TypeId GetTypeId()
Get the type ID.
WifiMacHeader m_triggerHdr
MAC header for Trigger Frame.
CtrlTriggerHeader m_trigger
Trigger Frame to send.
DlMuInfo ComputeDlMuInfo() override
Compute the information required to perform a DL MU transmission.
wifi MAC OFDMA Test Suite
a polymophic address class
const std::map< uint16_t, Mac48Address > & GetStaList(uint8_t linkId=SINGLE_LINK_OP_ID) const
Get a const reference to the map of associated stations on the given link.
AttributeValue implementation for Boolean.
Hold variables of type enum.
RuType
The different HE Resource Unit (RU) types.
Helper class used to assign positions and mobility models to nodes.
MultiUserScheduler is an abstract base class defining the API that APs supporting at least VHT can us...
bool m_initialFrame
true if a TXOP is being started
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager() const
Get the station manager attached to the AP.
Ptr< ApWifiMac > m_apMac
the AP wifi MAC
Time m_availableTime
the time available for frame exchange
Ptr< HeFrameExchangeManager > m_heFem
HE Frame Exchange Manager.
uint32_t GetMaxSizeOfQosNullAmpdu(const CtrlTriggerHeader &trigger) const
Get the maximum size in bytes among the A-MPDUs containing QoS Null frames and solicited by the given...
TxFormat
Enumeration of the possible transmission formats.
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
void AddHeader(const Header &header)
Add header to this packet.
uint32_t GetSize() const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetPhysicalAddress(const Address address)
Set the destination address.
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.
Ptr< WifiMpdu > PeekNextMpdu(uint8_t linkId, uint8_t tid=8, Mac48Address recipient=Mac48Address::GetBroadcast(), Ptr< WifiMpdu > item=nullptr)
Peek the next frame to transmit on the given link to the given receiver and of the given TID from the...
Ptr< WifiMpdu > GetNextMpdu(uint8_t linkId, Ptr< WifiMpdu > peekedItem, WifiTxParameters &txParams, Time availableTime, bool initialFrame)
Prepare the frame to transmit on the given link starting from the MPDU that has been previously peeke...
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, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
int64_t GetMicroSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
AttributeValue implementation for Time.
Ptr< WifiMacQueue > GetWifiMacQueue() const
Return the packet queue associated with this Txop.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
helps to create WifiNetDevice objects
create MAC layers for a ns3::WifiNetDevice.
Ptr< HeConfiguration > GetHeConfiguration() const
Ptr< WifiPhy > GetWifiPhy(uint8_t linkId=SINGLE_LINK_OP_ID) const
Ptr< WifiRemoteStationManager > GetWifiRemoteStationManager(uint8_t linkId=0) const
Mac48Address GetAddress() const
Ptr< QosTxop > GetQosTxop(AcIndex ac) const
Accessor for a specified EDCA object.
represent a single transmission mode
Ptr< WifiMac > GetMac() const
uint32_t GetIfIndex() const override
Address GetAddress() const override
uint16_t GetChannelWidth() const
Time GetSifs() const
Return the Short Interframe Space (SIFS) for this PHY.
WifiPhyBand GetPhyBand() const
Get the configured Wi-Fi band.
WifiTxVector GetRtsTxVector(Mac48Address address)
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
std::unique_ptr< WifiProtection > m_protection
protection method
std::unique_ptr< WifiAcknowledgment > m_acknowledgment
acknowledgment method
Time m_txDuration
TX duration of the frame.
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
void Clear()
Reset the TX parameters.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetTxPowerLevel(uint8_t powerlevel)
Sets the selected transmission power level.
void SetChannelWidth(uint16_t channelWidth)
Sets the selected channelWidth (in MHz)
void SetGuardInterval(uint16_t guardInterval)
Sets the guard interval duration (in nanoseconds)
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
WifiPreamble GetPreambleType() const
void SetRuAllocation(const RuAllocation &ruAlloc)
Set RU Allocation of SIG-B common field.
bool IsMu() const
Return true if this TX vector is used for a multi-user transmission.
void SetPreambleType(WifiPreamble preamble)
Sets the preamble type.
void SetGlobal(std::string name, const AttributeValue &value)
void SetDefault(std::string name, const AttributeValue &value)
void Connect(std::string path, const CallbackBase &cb)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#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.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Now()
create an ns3::Time instance which contains the current simulation time.
#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_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_NE(actual, limit, msg)
Test that an actual and expected (limit) value are not equal 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.
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.
AcIndex
This enumeration defines the Access Categories as an enumeration with values corresponding to the AC ...
TriggerFrameType
The different Trigger frame types.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Time GetPpduMaxTime(WifiPreamble preamble)
Get the maximum PPDU duration (see Section 10.14 of 802.11-2016) for the PHY layers defining the aPPD...
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
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...
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< WifiPsdu > > WifiPsduMap
Map of PSDUs indexed by STA-ID.
Information about transmitted frames.
Time startTx
start TX time
WifiTxVector txVector
TXVECTOR.
WifiConstPsduMap psduMap
transmitted PSDU map
uint8_t muAifsn
MU AIFS (0 to disable EDCA)
uint16_t muCwMin
MU CW min.
uint8_t muTimer
MU EDCA Timer in units of 8192 microseconds (0 not to use MU EDCA)
uint16_t muCwMax
MU CW max.
Information to be provided in case of DL MU transmission.
Information to be provided in case of UL MU transmission.
Method
Available acknowledgment methods.
static WifiMacOfdmaTestSuite g_wifiMacOfdmaTestSuite
the test suite