9#include "ns3/ap-wifi-mac.h"
10#include "ns3/attribute-container.h"
11#include "ns3/boolean.h"
12#include "ns3/config.h"
13#include "ns3/ctrl-headers.h"
15#include "ns3/he-configuration.h"
16#include "ns3/he-phy.h"
17#include "ns3/mobility-helper.h"
18#include "ns3/multi-model-spectrum-channel.h"
19#include "ns3/rng-seed-manager.h"
20#include "ns3/spectrum-wifi-helper.h"
21#include "ns3/sta-wifi-mac.h"
24#include "ns3/wifi-net-device.h"
25#include "ns3/wifi-psdu.h"
130 std::vector<bool> perMpduStatus);
144 std::vector<bool> perMpduStatus);
174 MHz_u txChannelWidth,
191 void DoRun()
override;
210 :
TestCase(
"Check correct transmissions for various primary channel settings"),
211 m_channelWidth(channelWidth),
212 m_useDistinctBssColors(useDistinctBssColors)
226 for (
const auto& psduPair : psduMap)
228 std::stringstream ss;
232 ss <<
" STA-ID " << psduPair.first;
234 ss <<
" " << psduPair.second->GetHeader(0).GetTypeString() <<
" seq "
235 << psduPair.second->GetHeader(0).GetSequenceNumber() <<
" from "
236 << psduPair.second->GetAddr2() <<
" to " << psduPair.second->GetAddr1();
248 std::vector<bool> perMpduStatus)
250 if (psdu->GetNMpdus() == 1)
256 NS_LOG_INFO(
"RECEIVED BY BSS=" << +bss <<
" STA=" << +station <<
" " << *psdu);
260 "Station [" << +bss <<
"][" << +station
261 <<
"] received a frame twice");
270 "Station [" << +bss <<
"][" << +station
271 <<
"] processed a frame twice");
283 std::vector<bool> perMpduStatus)
287 if (psdu->GetNMpdus() == 1 && psdu->GetHeader(0).IsQosData() && txVector.
IsUlMu())
292 uint8_t station = staId - 1;
293 NS_LOG_INFO(
"RECEIVED FROM BSSID=" << psdu->GetHeader(0).GetAddr3() <<
" STA=" << +station
298 "AP of BSS " << +bss <<
" received a frame from station " << +station
302 if (psdu->GetHeader(0).GetAddr1() == dev->GetMac()->GetAddress())
306 "AP of BSS " << +bss <<
" received a frame from station "
307 << +station <<
" twice");
318 int64_t streamNumber = 100;
351 std::vector<NodeContainer> wifiStaNodes(
m_nBss);
352 for (
auto& container : wifiStaNodes)
359 spectrumChannel->AddPropagationLossModel(lossModel);
362 spectrumChannel->SetPropagationDelayModel(delayModel);
365 phy.SetChannel(spectrumChannel);
369 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager");
372 mac.SetType(
"ns3::StaWifiMac",
386 for (uint8_t bss = 0; bss <
m_nBss; bss++)
390 phy.Set(
"ChannelSettings", channelValue);
392 m_staDevices.push_back(wifi.Install(phy, mac, wifiStaNodes[bss]));
395 for (uint8_t bss = 0; bss <
m_nBss; bss++)
399 phy.Set(
"ChannelSettings", channelValue);
401 mac.SetType(
"ns3::ApWifiMac",
406 "EnableBeaconJitter",
414 for (uint8_t bss = 0; bss <
m_nBss; bss++)
422 for (uint8_t bss = 0; bss <
m_nBss; bss++)
425 dev->GetHeConfiguration()->SetBssColor(bss + 1);
432 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
433 mobility.SetPositionAllocator(positionAlloc);
435 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
436 mobility.Install(wifiApNodes);
437 for (uint8_t bss = 0; bss <
m_nBss; bss++)
439 mobility.Install(wifiStaNodes[bss]);
456 trigger.
SetType(TriggerFrameType::BASIC_TRIGGER);
457 pkt->AddHeader(trigger);
474 apDev->GetMac()->GetWifiPhy()->GetPhyBand());
486 for (uint8_t bss = 0; bss <
m_nBss; bss++)
489 dev->GetMac()->SetSsid(
Ssid(
"wifi-ssid-" + std::to_string(bss)));
497 Ssid(
"wifi-ssid-" + std::to_string(bss)));
503 for (uint8_t bss = 0; bss <
m_nBss; bss++)
520 for (uint8_t bss = 0; bss <
m_nBss; bss++)
613 txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2)
615 nRounds = std::min<uint16_t>(nRounds,
m_nBss);
616 nApsPerRound = std::max<uint16_t>(nApsPerRound, 1);
618 for (uint16_t round = 0; round < nRounds; round++)
620 std::set<uint8_t> txBss;
622 for (uint16_t i = 0; i < nApsPerRound; i++)
624 uint16_t ap = round + i * nRounds;
649 txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2)
651 nRounds = std::min<uint16_t>(nRounds,
m_nBss);
652 nApsPerRound = std::max<uint16_t>(nApsPerRound, 1);
654 for (uint16_t round = 0; round < nRounds; round++)
656 for (
unsigned int type = 0; type < 7; type++)
660 std::set<uint8_t> txBss;
663 for (uint16_t i = 0; i < nApsPerRound; i++)
665 uint16_t ap = round + i * nRounds;
697 txChannelWidth *= 2, nRounds *= 2, nApsPerRound /= 2)
699 nRounds = std::min<uint16_t>(nRounds,
m_nBss);
700 nApsPerRound = std::max<uint16_t>(nApsPerRound, 1);
702 for (uint16_t round = 0; round < nRounds; round++)
704 for (
unsigned int type = 0; type < 7; type++)
708 std::set<uint8_t> txBss;
711 for (uint16_t i = 0; i < nApsPerRound; i++)
713 uint16_t ap = round + i * nRounds;
745 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxPsduBegin",
757 NS_LOG_INFO(
"*** BSS " << +bss <<
" transmits on primary " << txChannelWidth <<
" MHz channel");
762 uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor();
778 hdr.
SetAddr1(staDev->GetMac()->GetAddress());
779 hdr.
SetAddr2(apDev->GetMac()->GetAddress());
780 hdr.
SetAddr3(apDev->GetMac()->GetBssid(0));
788 MHz_u txChannelWidth,
792 NS_LOG_INFO(
"*** BSS " << +bss <<
" transmits on primary " << txChannelWidth
793 <<
" MHz channel a DL MU PPDU "
794 <<
"addressed to " << nRus <<
" stations (RU type: " << ruType <<
")");
797 uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor();
814 hdr.
SetAddr2(apDev->GetMac()->GetAddress());
815 hdr.
SetAddr3(apDev->GetMac()->GetBssid(0));
820 for (std::size_t i = 1; i <= nRus; i++)
822 bool primary80 = !(txChannelWidth == 160 && i > nRus / 2);
823 std::size_t index = (primary80 ? i : i - nRus / 2);
828 hdr.
SetAddr1(staDev->GetMac()->GetAddress());
833 const std::size_t numRuAllocs = txChannelWidth / 20;
834 ruAllocations.resize(numRuAllocs);
835 auto IsOddNum = (nRus / numRuAllocs) % 2 == 1;
837 std::fill_n(ruAllocations.begin(), numRuAllocs, ruAlloc);
840 apDev->GetPhy()->Send(psduMap, txVector);
845 MHz_u txChannelWidth,
849 NS_LOG_INFO(
"*** BSS " << +bss <<
" transmits a Basic Trigger Frame");
869 MHz_u txChannelWidth,
874 uint8_t bssColor = apDev->GetHeConfiguration()->GetBssColor();
879 hdr.
SetAddr1(apDev->GetMac()->GetAddress());
880 hdr.
SetAddr3(apDev->GetMac()->GetBssid(0));
898 for (std::size_t i = 1; i <= nRus; i++)
900 NS_LOG_INFO(
"*** BSS " << +bss <<
" STA " << i - 1 <<
" transmits on primary "
902 <<
" MHz channel an HE TB PPDU (RU type: " << ruType <<
")");
904 bool primary80 = !(txChannelWidth == 160 && i > nRus / 2);
905 std::size_t index = (primary80 ? i : i - nRus / 2);
925 hdr.
SetAddr2(staDev->GetMac()->GetAddress());
933 staDev->GetMac()->GetWifiPhy()->GetPhyBand(),
938 staDev->GetMac()->GetWifiPhy()->GetPhyBand());
948 apHePhy->SetTrigVector(trigVector, duration);
954 for (uint8_t bss = 0; bss <
m_nBss; bss++)
960 "Not all the stations completed association");
967 for (uint8_t bss = 0; bss <
m_nBss; bss++)
969 if (txBss.find(bss) != txBss.end())
977 "Station [" << +bss <<
"][" << +sta
978 <<
"] did not receive the SU frame on primary"
979 << txChannelWidth <<
" channel");
984 "Station [" << +bss <<
"][0]"
985 <<
" did not process the SU frame on primary"
986 << txChannelWidth <<
" channel");
991 "Station [" << +bss <<
"][" << +sta
992 <<
"] processed the SU frame on primary"
993 << txChannelWidth <<
" channel");
1002 std::none_of(txBss.begin(), txBss.end(), [&](
const uint8_t& txAp) {
1003 auto txApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(txAp))->GetPhy();
1004 auto thisApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(bss))->GetPhy();
1005 return txApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth) ==
1006 thisApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth);
1013 "Station [" << +bss <<
"][" << +sta
1014 <<
"] received the SU frame on primary"
1015 << txChannelWidth <<
" channel");
1025 "Station [" << +bss <<
"][" << +sta
1026 <<
"] did not receive the SU frame on primary"
1027 << txChannelWidth <<
" channel");
1030 "Station [" << +bss <<
"][" << +sta
1031 <<
"] processed the SU frame on primary"
1032 << txChannelWidth <<
" channel");
1044 MHz_u txChannelWidth,
1049 for (uint8_t bss = 0; bss <
m_nBss; bss++)
1051 if (txBss.find(bss) != txBss.end())
1056 for (std::size_t sta = 0; sta < nRus; sta++)
1061 (isDlMu ?
"A DL MU PPDU transmitted to" :
"An HE TB PPDU transmitted by")
1062 <<
" station [" << +bss <<
"][" << +sta <<
"] on primary" << txChannelWidth
1063 <<
" channel, RU type " << ruType <<
" was not received");
1069 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1070 <<
" transmitted on primary" << txChannelWidth
1071 <<
" channel, RU type " << ruType <<
" was received "
1072 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1073 <<
"][" << +sta <<
"]");
1077 for (std::size_t sta = 0; sta < nRus; sta++)
1082 (isDlMu ?
"A DL MU PPDU transmitted to" :
"An HE TB PPDU transmitted by")
1083 <<
" station [" << +bss <<
"][" << +sta <<
"] on primary" << txChannelWidth
1084 <<
" channel, RU type " << ruType <<
" was not processed");
1090 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1091 <<
" transmitted on primary" << txChannelWidth
1092 <<
" channel, RU type " << ruType <<
" was received "
1093 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1094 <<
"][" << +sta <<
"] and processed");
1104 std::none_of(txBss.begin(), txBss.end(), [&](
const uint8_t& txAp) {
1105 auto txApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(txAp))->GetPhy();
1106 auto thisApPhy = DynamicCast<WifiNetDevice>(m_apDevices.Get(bss))->GetPhy();
1107 return txApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth) ==
1108 thisApPhy->GetOperatingChannel().GetPrimaryChannelIndex(txChannelWidth);
1115 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1116 <<
" transmitted on primary" << txChannelWidth
1117 <<
" channel, RU type " << ruType <<
" was received "
1118 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1119 <<
"][" << +sta <<
"]");
1126 for (std::size_t sta = 0; sta < nRus; sta++)
1131 (isDlMu ?
"A DL MU PPDU transmitted to" :
"An HE TB PPDU transmitted by")
1132 <<
" station [" << +bss <<
"][" << +sta <<
"] on primary"
1133 << txChannelWidth <<
" channel, RU type " << ruType
1134 <<
" was not received");
1140 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1141 <<
" transmitted on primary" << txChannelWidth
1142 <<
" channel, RU type " << ruType <<
" was received "
1143 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1144 <<
"][" << +sta <<
"]");
1151 (isDlMu ?
"A DL MU PPDU" :
"An HE TB PPDU")
1152 <<
" transmitted on primary" << txChannelWidth
1153 <<
" channel, RU type " << ruType <<
" was received "
1154 << (isDlMu ?
"by" :
"from") <<
" station [" << +bss
1155 <<
"][" << +sta <<
"] and processed");
1168 for (uint8_t bss = 0; bss <
m_nBss; bss++)
1170 if (txBss.find(bss) != txBss.end())
1178 "Station [" << +bss <<
"][" << +sta
1179 <<
"] did not receive the Trigger Frame "
1180 "soliciting a transmission on primary"
1181 << txChannelWidth <<
" channel");
1184 "Station [" << +bss <<
"][" << +sta
1185 <<
"] did not process the Trigger Frame "
1186 "soliciting a transmission on primary"
1187 << txChannelWidth <<
" channel");
1200 << +bss <<
"][" << +sta
1201 <<
"] received the Trigger Frame soliciting a transmission on primary"
1202 << txChannelWidth <<
" channel");
1238 void RunOne(uint8_t primary20,
1239 const std::set<uint8_t>& secondary20,
1240 const std::set<uint8_t>& primary40,
1241 const std::set<uint8_t>& secondary40,
1242 const std::set<uint8_t>& primary80,
1243 const std::set<uint8_t>& secondary80);
1246 void DoRun()
override;
1252 :
TestCase(
"Check computation of primary and secondary channel indices")
1258 const std::set<uint8_t>& secondary20,
1259 const std::set<uint8_t>& primary40,
1260 const std::set<uint8_t>& secondary40,
1261 const std::set<uint8_t>& primary80,
1262 const std::set<uint8_t>& secondary80)
1264 auto printToStr = [](
const std::set<uint8_t>& s) {
1265 std::stringstream ss;
1267 for (
const auto& index : s)
1269 ss << +index <<
" ";
1280 "Expected Primary20 {" << +primary20 <<
"}"
1281 <<
" differs from actual "
1282 << printToStr(actualPrimary20));
1287 "Expected Secondary20 " << printToStr(secondary20)
1288 <<
" differs from actual "
1289 << printToStr(actualSecondary20));
1294 "Expected Primary40 " << printToStr(primary40) <<
" differs from actual "
1295 << printToStr(actualPrimary40));
1300 "Expected Secondary40 " << printToStr(secondary40)
1301 <<
" differs from actual "
1302 << printToStr(actualSecondary40));
1307 "Expected Primary80 " << printToStr(primary80) <<
" differs from actual "
1308 << printToStr(actualPrimary80));
1313 "Expected Secondary80 " << printToStr(secondary80)
1314 <<
" differs from actual "
1315 << printToStr(actualSecondary80));
1323 RunOne(0, {}, {}, {}, {}, {});
1327 RunOne(0, {1}, {0, 1}, {}, {}, {});
1328 RunOne(1, {0}, {0, 1}, {}, {}, {});
1332 RunOne(0, {1}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {});
1333 RunOne(1, {0}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {});
1334 RunOne(2, {3}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {});
1335 RunOne(3, {2}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {});
1339 RunOne(0, {1}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {4, 5, 6, 7});
1340 RunOne(1, {0}, {0, 1}, {2, 3}, {0, 1, 2, 3}, {4, 5, 6, 7});
1341 RunOne(2, {3}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {4, 5, 6, 7});
1342 RunOne(3, {2}, {2, 3}, {0, 1}, {0, 1, 2, 3}, {4, 5, 6, 7});
1343 RunOne(4, {5}, {4, 5}, {6, 7}, {4, 5, 6, 7}, {0, 1, 2, 3});
1344 RunOne(5, {4}, {4, 5}, {6, 7}, {4, 5, 6, 7}, {0, 1, 2, 3});
1345 RunOne(6, {7}, {6, 7}, {4, 5}, {4, 5, 6, 7}, {0, 1, 2, 3});
1346 RunOne(7, {6}, {6, 7}, {4, 5}, {4, 5, 6, 7}, {0, 1, 2, 3});
Test functions returning the indices of primary and secondary channels of different width.
Wifi20MHzChannelIndicesTest()
Constructor.
void DoRun() override
Implementation to actually run this TestCase.
~Wifi20MHzChannelIndicesTest() override=default
void RunOne(uint8_t primary20, const std::set< uint8_t > &secondary20, const std::set< uint8_t > &primary40, const std::set< uint8_t > &secondary40, const std::set< uint8_t > &primary80, const std::set< uint8_t > &secondary80)
Check that the indices of the 20 MHz channels included in all the primary and secondary channels are ...
WifiPhyOperatingChannel m_channel
operating channel
Test transmissions under different primary channel settings.
void DoSendHeTbPpdu(uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
Have the STAs of the given BSS transmit an HE TB PPDU using the given transmission channel width and ...
std::vector< std::bitset< 74 > > m_processed
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was processed
WifiPrimaryChannelsTest(MHz_u channelWidth, bool useDistinctBssColors)
Constructor.
void CheckAssociation()
Check that all stations associated with an AP.
void CheckReceivedSuPpdus(std::set< uint8_t > txBss, MHz_u txChannelWidth)
Check that (i) all stations belonging to the given BSSes received the SU PPDUs transmitted over the g...
std::vector< std::bitset< 74 > > m_received
whether the last packet transmitted to/from each of the (up to 74 per BSS) stations was received
uint8_t m_nBss
number of BSSes
void CheckReceivedTriggerFrames(std::set< uint8_t > txBss, MHz_u txChannelWidth)
Check that (i) all stations belonging to the given BSSes received the transmitted Trigger Frame; and ...
void Transmit(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback invoked when PHY receives a PSDU to transmit.
void SendDlMuPpdu(uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
Have the AP of the given BSS transmit a MU PPDU using the given transmission channel width and RU typ...
MHz_u m_channelWidth
operating channel width
Ptr< WifiPsdu > m_trigger
Basic Trigger Frame.
void DoRun() override
Implementation to actually run this TestCase.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
Time m_time
the time when the current action is executed
Time m_triggerTxDuration
TX duration for Basic Trigger Frame.
uint8_t m_nStationsPerBss
number of stations per AP
void CheckReceivedMuPpdus(std::set< uint8_t > txBss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus, bool isDlMu)
Check that (i) all stations/APs belonging to the given BSSes received the DL/UL MU PPDUs transmitted ...
std::vector< NetDeviceContainer > m_staDevices
containers for stations' NetDevices
NetDeviceContainer m_apDevices
container for AP's NetDevice
void ReceiveDl(uint8_t bss, uint8_t station, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
Callback invoked when a station receives a DL PPDU.
void ReceiveUl(uint8_t bss, Ptr< const WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > perMpduStatus)
Callback invoked when an AP receives an UL PPDU.
~WifiPrimaryChannelsTest() override
void SendHeTbPpdu(uint8_t bss, MHz_u txChannelWidth, HeRu::RuType ruType, std::size_t nRus)
Have the AP of the given BSS transmit a Basic Trigger Frame.
bool m_useDistinctBssColors
true to set distinct BSS colors to BSSes
WifiTxVector m_triggerTxVector
TX vector for Basic Trigger Frame.
void SendDlSuPpdu(uint8_t bss, MHz_u txChannelWidth)
Have the AP of the given BSS transmit a SU PPDU using the given transmission channel width.
wifi primary channels test suite
WifiPrimaryChannelsTestSuite()
void SetBeaconInterval(Time interval)
A container for one type of attribute.
void Set(const T &c)
Copy items from container c.
static WifiMode GetHeMcs8()
Return MCS 8 from HE MCS values.
static std::pair< uint16_t, Time > ConvertHeTbPpduDurationToLSigLength(Time ppduDuration, const WifiTxVector &txVector, WifiPhyBand band)
Compute the L-SIG length value corresponding to the given HE TB PPDU duration.
static uint8_t GetEqualizedRuAllocation(RuType ruType, bool isOdd)
Get the RU_ALLOCATION value for equal size RUs.
static std::size_t GetNRus(MHz_u bw, RuType ruType)
Get the number of distinct RUs of the given type (number of tones) available in a HE PPDU of the give...
RuType
The different HE Resource Unit (RU) types.
static Mac48Address GetBroadcast()
Helper class used to assign positions and mobility models to nodes.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of 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.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6 Mbps.
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 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.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
bool IsZero() const
Exactly equivalent to t == 0.
AttributeValue implementation for Tuple.
Hold an unsigned integer type.
static WifiMode GetVhtMcs5()
Return MCS 5 from VHT MCS values.
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.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
std::vector< ChannelTuple > ChannelSegments
segments identifying an operating channel
void SetReceiveOkCallback(RxOkCallback callback)
Class that keeps track of all information about the current PHY operating channel.
std::set< uint8_t > GetAll20MHzChannelIndicesInSecondary(MHz_u width) const
Get the channel indices of all the 20 MHz channels included in the secondary channel of the given wid...
void SetPrimary20Index(uint8_t index)
Set the index of the primary 20 MHz channel (0 indicates the 20 MHz subchannel with the lowest center...
std::set< uint8_t > GetAll20MHzChannelIndicesInPrimary(MHz_u width) const
Get the channel indices of all the 20 MHz channels included in the primary channel of the given width...
void SetDefault(MHz_u width, WifiStandard standard, WifiPhyBand band)
Set the default channel of the given width and for the given standard and band.
const WifiMacHeader & GetHeader(std::size_t i) const
Get the header of the i-th MPDU.
uint32_t GetSize() const
Return the size of the PSDU in bytes.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetRuAllocation(const RuAllocation &ruAlloc, uint8_t p20Index)
Set RU_ALLOCATION field.
void SetHeMuUserInfo(uint16_t staId, HeMuUserInfo userInfo)
Set the HE MU user-specific transmission information for the given STA-ID.
const HeMuUserInfoMap & GetHeMuUserInfoMap() const
Get a const reference to the map HE MU user-specific transmission information indexed by STA-ID.
void SetLength(uint16_t length)
Set the LENGTH field of the L-SIG.
void SetSigBMode(const WifiMode &mode)
Set the MCS used for SIG-B.
void Connect(std::string path, const CallbackBase &cb)
#define NS_ABORT_MSG(msg)
Unconditional abnormal program termination with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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_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.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
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...
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
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...
Ptr< T1 > StaticCast(const Ptr< T2 > &p)
Cast a Ptr.
std::vector< uint8_t > RuAllocation
8 bit RU_ALLOCATION per 20 MHz
static constexpr uint16_t SU_STA_ID
STA_ID to identify a single user (SU)
-ns3 Test suite for the ns3 wrapper script
RxSignalInfo structure containing info on the received signal.
static WifiPrimaryChannelsTestSuite g_wifiPrimaryChannelsTestSuite
the test suite