12#include "ns3/adhoc-wifi-mac.h"
13#include "ns3/ap-wifi-mac.h"
14#include "ns3/config.h"
15#include "ns3/constant-position-mobility-model.h"
16#include "ns3/constant-rate-wifi-manager.h"
17#include "ns3/error-model.h"
18#include "ns3/fcfs-wifi-queue-scheduler.h"
19#include "ns3/he-frame-exchange-manager.h"
20#include "ns3/he-phy.h"
21#include "ns3/header-serialization-test.h"
22#include "ns3/ht-configuration.h"
23#include "ns3/interference-helper.h"
24#include "ns3/mgt-headers.h"
25#include "ns3/mobility-helper.h"
26#include "ns3/multi-model-spectrum-channel.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/pointer.h"
31#include "ns3/propagation-loss-model.h"
32#include "ns3/rng-seed-manager.h"
33#include "ns3/socket.h"
34#include "ns3/spectrum-wifi-helper.h"
35#include "ns3/string.h"
37#include "ns3/uinteger.h"
38#include "ns3/waypoint-mobility-model.h"
39#include "ns3/wifi-default-ack-manager.h"
40#include "ns3/wifi-default-assoc-manager.h"
41#include "ns3/wifi-default-protection-manager.h"
42#include "ns3/wifi-mgt-header.h"
43#include "ns3/wifi-net-device.h"
44#include "ns3/wifi-ppdu.h"
45#include "ns3/wifi-psdu.h"
46#include "ns3/wifi-spectrum-signal-parameters.h"
47#include "ns3/yans-error-rate-model.h"
48#include "ns3/yans-wifi-helper.h"
49#include "ns3/yans-wifi-phy.h"
60 int64_t currentStream = stream;
62 if (!mac->GetQosSupported())
64 mac->GetAttribute(
"Txop", ptr);
66 currentStream += txop->AssignStreams(currentStream);
70 mac->GetAttribute(
"VO_Txop", ptr);
72 currentStream += vo_txop->AssignStreams(currentStream);
74 mac->GetAttribute(
"VI_Txop", ptr);
76 currentStream += vi_txop->AssignStreams(currentStream);
78 mac->GetAttribute(
"BE_Txop", ptr);
80 currentStream += be_txop->AssignStreams(currentStream);
82 mac->GetAttribute(
"BK_Txop", ptr);
84 bk_txop->AssignStreams(currentStream);
99 void DoRun()
override;
130 dev->Send(p, dev->GetBroadcast(), 1);
138 node->AddDevice(dev);
143 phy->SetInterferenceHelper(interferenceHelper);
145 phy->SetErrorRateModel(error);
146 phy->SetChannel(channel);
151 dev->SetRemoteStationManager(manager);
161 if (mac->GetTypeOfStation() ==
STA)
167 fem->SetAddress(mac->GetAddress());
169 protectionManager->SetWifiMac(mac);
170 fem->SetProtectionManager(protectionManager);
172 ackManager->SetWifiMac(mac);
173 fem->SetAckManager(ackManager);
175 mobility->SetPosition(pos);
176 node->AggregateObject(mobility);
187 channel->SetPropagationDelayModel(propDelay);
188 channel->SetPropagationLossModel(propLoss);
190 CreateOne(Vector(0.0, 0.0, 0.0), channel);
191 CreateOne(Vector(5.0, 0.0, 0.0), channel);
192 CreateOne(Vector(5.0, 0.0, 0.0), channel);
250 "2047 is new in comparison to 0");
258 "0 is new in comparison to 4095");
264 "2047 is old in comparison to 4095");
268 "4095 is new in comparison to 2048");
272 "0 is new in comparison to 2049");
284 void DoRun()
override;
311 :
TestCase(
"InterferenceHelperSequence")
319 dev->Send(p, dev->GetBroadcast(), 1);
334 node->AddDevice(dev);
339 phy->SetInterferenceHelper(interferenceHelper);
341 phy->SetErrorRateModel(error);
342 phy->SetChannel(channel);
344 phy->SetMobility(mobility);
348 dev->SetRemoteStationManager(manager);
360 fem->SetAddress(mac->GetAddress());
362 protectionManager->SetWifiMac(mac);
363 fem->SetProtectionManager(protectionManager);
365 ackManager->SetWifiMac(mac);
366 fem->SetAckManager(ackManager);
368 mobility->SetPosition(pos);
369 node->AggregateObject(mobility);
384 channel->SetPropagationDelayModel(propDelay);
385 channel->SetPropagationLossModel(propLoss);
395 propLoss->SetDefaultLoss(999);
479 void DoRun()
override;
505 :
TestCase(
"Test case for DCF immediate access with broadcast frames")
527 dev->Send(p, dev->GetBroadcast(), 1);
545 channel->SetPropagationDelayModel(propDelay);
546 channel->SetPropagationLossModel(propLoss);
554 txPhy->SetInterferenceHelper(txInterferenceHelper);
556 txPhy->SetErrorRateModel(txError);
557 txPhy->SetChannel(channel);
558 txPhy->SetDevice(txDev);
559 txPhy->SetMobility(txMobility);
562 txPhy->TraceConnectWithoutContext(
566 txMobility->SetPosition(Vector(0.0, 0.0, 0.0));
567 txNode->AggregateObject(txMobility);
568 txDev->SetPhy(txPhy);
570 txNode->AddDevice(txDev);
577 txDev->SetMac(txMac);
581 auto fem = txMac->GetFrameExchangeManager();
582 fem->SetAddress(txMac->GetAddress());
584 protectionManager->SetWifiMac(txMac);
585 fem->SetProtectionManager(protectionManager);
587 ackManager->SetWifiMac(txMac);
588 fem->SetAckManager(ackManager);
621 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
622 Time expectedSecondTransmissionTime =
623 expectedFirstTransmissionTime +
MicroSeconds(expectedWait1);
625 expectedFirstTransmissionTime,
626 "The first transmission time not correct!");
629 expectedSecondTransmissionTime,
630 "The second transmission time not correct!");
652 void DoRun()
override;
667 :
TestCase(
"Test case for Bug 730"),
694 wifiApNode.Create(1);
698 phy.SetChannel(channel.Create());
702 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
713 staDevices = wifi.Install(phy, mac, wifiStaNode);
718 apDevices = wifi.Install(phy, mac, wifiApNode);
723 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
724 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
725 mobility.SetPositionAllocator(positionAlloc);
727 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
728 mobility.Install(wifiApNode);
729 mobility.Install(wifiStaNode);
741 packetSocket.
Install(wifiStaNode);
742 packetSocket.
Install(wifiApNode);
746 client->SetRemote(socket);
748 client->SetStartTime(
Seconds(1));
749 client->SetStopTime(
Seconds(51));
752 server->SetLocal(socket);
753 wifiApNode.Get(0)->AddApplication(server);
754 server->SetStartTime(
Seconds(0));
755 server->SetStopTime(
Seconds(52));
757 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
762 "/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
774 "packet reception unexpectedly stopped after adapting fragmentation threshold!");
791 void DoRun()
override;
815 :
TestCase(
"Test case for fragmentation with QoS stations"),
828 if (p->GetSize() == 1400)
853 wifiApNode.Create(1);
857 phy.SetChannel(channel.Create());
861 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
"DataMode",
StringValue(
"HtMcs7"));
868 staDevices = wifi.Install(phy, mac, wifiStaNode);
873 apDevices = wifi.Install(phy, mac, wifiApNode);
878 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
879 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
880 mobility.SetPositionAllocator(positionAlloc);
882 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
883 mobility.Install(wifiApNode);
884 mobility.Install(wifiStaNode);
891 sta_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
896 socket.SetPhysicalAddress(ap_device->GetAddress());
897 socket.SetProtocol(1);
901 packetSocket.
Install(wifiStaNode);
902 packetSocket.
Install(wifiApNode);
907 client->SetRemote(socket);
909 client->SetStartTime(
Seconds(1));
910 client->SetStopTime(
Seconds(3));
913 server->SetLocal(socket);
914 wifiApNode.Get(0)->AddApplication(server);
915 server->SetStartTime(
Seconds(0));
916 server->SetStopTime(
Seconds(4));
918 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
921 Config::Set(
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
946 void DoRun()
override;
958 :
TestCase(
"Test case for setting WifiPhy channel and frequency")
976 wifiApNode.Create(1);
980 phy.SetChannel(channel.Create());
984 ssid =
Ssid(
"wifi-phy-configuration");
986 macSta.
SetType(
"ns3::StaWifiMac",
1002 "default configuration");
1008 wifi.SetRemoteStationManager(
"ns3::ArfWifiManager");
1009 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1020 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1031 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1041 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1043 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_5GHZ, 0}"));
1044 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1049 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1054 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1056 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1065 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1067 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1077 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1078 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_2_4GHZ, 0}"));
1079 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1084 "802.11ax-2.4GHz configuration");
1086 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1091 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1092 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1101 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1102 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_6GHZ, 0}"));
1103 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1108 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1113 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1115 phy.Set(
"ChannelSettings",
StringValue(
"{0, 10, BAND_5GHZ, 0}"));
1116 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1121 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1126 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1128 phy.Set(
"ChannelSettings",
StringValue(
"{0, 5, BAND_5GHZ, 0}"));
1129 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1134 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1139 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1141 phy.Set(
"ChannelSettings",
StringValue(
"{44, 20, BAND_5GHZ, 0}"));
1142 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1147 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1152 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1153 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1154 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1157 std::ostringstream path;
1158 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1159 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1164 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1169 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1170 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1171 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1174 std::ostringstream path;
1175 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1176 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1183 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1188 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1190 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1192 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{3, 20, BAND_2_4GHZ, 0}"));
1194 std::ostringstream path;
1195 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1196 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1203 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1208 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1211 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1212 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1214 bool exceptionThrown =
false;
1217 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1219 catch (
const std::runtime_error&)
1221 exceptionThrown =
true;
1229 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1231 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1232 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1236 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{100, 0, BAND_5GHZ, 0}"));
1246 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1248 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1249 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1251 bool exceptionThrown =
false;
1256 catch (
const std::runtime_error&)
1258 exceptionThrown =
true;
1266 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1269 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1270 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1272 bool exceptionThrown =
false;
1275 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1277 catch (
const std::runtime_error&)
1279 exceptionThrown =
true;
1283 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1288 exceptionThrown =
false;
1291 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{43, 0, BAND_5GHZ, 0}"));
1293 catch (
const std::runtime_error&)
1295 exceptionThrown =
true;
1299 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1307 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1308 phy.Set(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1310 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1317 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1319 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1324 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1329 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1334 bool exceptionThrown =
false;
1337 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1339 catch (
const std::runtime_error&)
1341 exceptionThrown =
true;
1343 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1349 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1350 exceptionThrown =
false;
1353 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{43, 0, BAND_5GHZ, 0}"));
1355 catch (
const std::runtime_error&)
1357 exceptionThrown =
true;
1383 void DoRun()
override;
1397 :
TestCase(
"Test case for Bug 2222"),
1398 m_countInternalCollisions(0)
1422 int64_t streamNumber = 100;
1429 phy.SetChannel(channel.Create());
1432 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1439 mac.SetType(
"ns3::AdhocWifiMac",
"QosSupported",
BooleanValue(
true));
1442 wifiDevices = wifi.Install(phy, mac, wifiNodes);
1450 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1451 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
1452 mobility.SetPositionAllocator(positionAlloc);
1454 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1455 mobility.Install(wifiNodes);
1466 packetSocket.
Install(wifiNodes);
1469 clientLowPriority->SetAttribute(
"PacketSize",
UintegerValue(1460));
1470 clientLowPriority->SetAttribute(
"MaxPackets",
UintegerValue(1));
1471 clientLowPriority->SetAttribute(
"Priority",
UintegerValue(4));
1472 clientLowPriority->SetRemote(socket);
1474 clientLowPriority->SetStartTime(
Seconds(0));
1475 clientLowPriority->SetStopTime(
Seconds(1));
1478 clientHighPriority->SetAttribute(
"PacketSize",
UintegerValue(1460));
1479 clientHighPriority->SetAttribute(
"MaxPackets",
UintegerValue(1));
1480 clientHighPriority->SetAttribute(
"Priority",
UintegerValue(6));
1481 clientHighPriority->SetRemote(socket);
1483 clientHighPriority->SetStartTime(
Seconds(0));
1484 clientHighPriority->SetStopTime(
Seconds(1));
1487 server->SetLocal(socket);
1489 server->SetStartTime(
Seconds(0));
1490 server->SetStopTime(
Seconds(1));
1492 Config::Connect(
"/NodeList/*/DeviceList/*/RemoteStationManager/MacTxDataFailed",
1501 "unexpected number of internal collisions!");
1522 void DoRun()
override;
1530 std::vector<FreqWidthSubbandModulationTuple>
1555 :
TestCase(
"Test case for Bug 2843"),
1556 m_channelWidth(
MHz_u{20})
1569 std::size_t numBands = c->GetNumBands();
1570 const Hz_u startingFreq{c->Begin()->fl};
1583 std::make_tuple(startingFreq,
m_channelWidth, numBands, modulationClass);
1587 if (*it == tupleForCurrentTx)
1603 for (uint8_t i = 0; i < numPackets; i++)
1606 sourceDevice->Send(pkt, destination, 0);
1613 MHz_u channelWidth{40};
1619 wifiApNode.Create(1);
1624 lossModel->SetFrequency(5.190e9);
1625 spectrumChannel->AddPropagationLossModel(lossModel);
1629 spectrumChannel->SetPropagationDelayModel(delayModel);
1633 spectrumPhy.
Set(
"ChannelSettings",
StringValue(
"{38, 40, BAND_5GHZ, 0}"));
1639 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1648 mac.SetType(
"ns3::StaWifiMac");
1650 staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode);
1652 mac.SetType(
"ns3::ApWifiMac");
1654 apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
1658 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1659 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
1660 mobility.SetPositionAllocator(positionAlloc);
1662 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1663 mobility.Install(wifiApNode);
1664 mobility.Install(wifiStaNode);
1672 staDevice.
Get(0)->GetAddress());
1678 staDevice.
Get(0)->GetAddress());
1680 Config::Connect(
"/ChannelList/*/$ns3::MultiModelSpectrumChannel/TxSigParams",
1694 "The starting frequency of the first tuple should be shifted 20 MHz to "
1695 "the right wrt second tuple");
1699 "First tuple's channel width should be 20 MHz");
1702 "First tuple should have 193 subbands (64+DC, 20MHz+DC, inband and 64*2 "
1703 "out-of-band, 20MHz on each side)");
1705 WifiModulationClass::WIFI_MOD_CLASS_OFDM,
1706 "First tuple should be OFDM");
1710 "Second tuple's channel width should be 40 MHz");
1713 "Second tuple should have 385 subbands (128+DC, 40MHz+DC, inband and "
1714 "128*2 out-of-band, 40MHz on each side)");
1716 WifiModulationClass::WIFI_MOD_CLASS_VHT,
1717 "Second tuple should be VHT_OFDM");
1721 "The starting frequency of the third tuple should be the same as the "
1725 "Third tuple's channel width should be 40 MHz");
1728 "Third tuple should have 385 subbands (128+DC, 40MHz+DC, inband and "
1729 "128*2 out-of-band, 40MHz on each side)");
1731 WifiModulationClass::WIFI_MOD_CLASS_OFDM,
1732 "Third tuple should be OFDM");
1752 void DoRun()
override;
1779 :
TestCase(
"Test case for Bug 2831"),
1781 m_assocRespCount(0),
1782 m_countOperationalChannelWidth20(0),
1783 m_countOperationalChannelWidth40(0)
1805 packet->RemoveHeader(hdr);
1817 packet->RemoveHeader(beacon);
1818 const auto& htOperation = beacon.Get<
HtOperation>();
1819 if (htOperation.has_value() && htOperation->GetStaChannelWidth() > 0)
1835 propDelay.
SetTypeId(
"ns3::ConstantSpeedPropagationDelayModel");
1838 channel->SetPropagationDelayModel(propagationDelay);
1839 channel->SetPropagationLossModel(propagationLoss);
1843 apNode->AddDevice(apDev);
1846 apDev->SetHtConfiguration(apHtConfiguration);
1848 manager.
SetTypeId(
"ns3::ConstantRateWifiManager");
1852 apMobility->SetPosition(Vector(0.0, 0.0, 0.0));
1853 apNode->AggregateObject(apMobility);
1868 mac.SetTypeId(
"ns3::ApWifiMac");
1871 for (
const std::string ac : {
"BE",
"BK",
"VI",
"VO"})
1877 auto apMac = mac.Create<
WifiMac>();
1880 apDev->SetMac(apMac);
1885 fem->SetAddress(apMac->GetAddress());
1887 protectionManager->SetWifiMac(apMac);
1888 fem->SetProtectionManager(protectionManager);
1890 ackManager->SetWifiMac(apMac);
1891 fem->SetAckManager(ackManager);
1895 staNode->AddDevice(staDev);
1898 staDev->SetHtConfiguration(staHtConfiguration);
1902 staMobility->SetPosition(Vector(1.0, 0.0, 0.0));
1903 staNode->AggregateObject(staMobility);
1916 mac.SetTypeId(
"ns3::StaWifiMac");
1917 for (
const std::string ac : {
"BE",
"BK",
"VI",
"VO"})
1923 auto staMac = mac.Create<
WifiMac>();
1924 staDev->SetMac(staMac);
1925 staMac->SetDevice(staDev);
1931 fem = staMac->GetFrameExchangeManager();
1932 fem->SetAddress(staMac->GetAddress());
1934 protectionManager->SetWifiMac(staMac);
1935 fem->SetProtectionManager(protectionManager);
1937 ackManager->SetWifiMac(staMac);
1938 fem->SetAckManager(ackManager);
1940 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyRxBegin",
1953 "Incorrect operational channel width before channel change");
1956 "Incorrect operational channel width after channel change");
1980 void DoRun()
override;
2011 :
TestCase(
"Test case for StaWifiMac scanning capability")
2030 mac->SetAttribute(
"BeaconGeneration",
BooleanValue(
true));
2046 int64_t streamNumber = 1;
2056 phy.SetChannel(channel.Create());
2060 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager");
2065 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(
true));
2066 apDevice = wifi.Install(phy, mac, apNodes);
2067 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(nearestApBeaconGeneration));
2068 apDeviceNearest = wifi.Install(phy, mac, apNodeNearest);
2071 mac.SetType(
"ns3::StaWifiMac",
"ActiveProbing",
BooleanValue(staActiveProbe));
2072 staDevice = wifi.Install(phy, mac, staNode);
2081 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2082 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
2083 positionAlloc->Add(Vector(5.0, 5.0, 0.0));
2084 positionAlloc->Add(Vector(6.0, 5.0, 0.0));
2085 mobility.SetPositionAllocator(positionAlloc);
2087 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2088 mobility.Install(apNodes);
2089 mobility.Install(apNodeNearest);
2090 mobility.Install(staNode);
2092 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/Assoc",
2119 "STA is associated to the wrong AP");
2134 "STA is associated to the wrong AP");
2150 secondNearestApAddr,
2151 "STA is associated to the wrong AP");
2183 void DoRun()
override;
2208 std::string context,
2225 uint16_t channelFreqMhz,
2266 :
TestCase(
"Test case for Bug 2470"),
2267 m_receivedNormalMpduCount(0),
2268 m_receivedAmpduCount(0),
2269 m_failedActionCount(0),
2270 m_addbaEstablishedCount(0),
2271 m_addbaPendingCount(0),
2272 m_addbaRejectedCount(0),
2273 m_addbaNoReplyCount(0),
2274 m_addbaResetCount(0)
2311 std::string context,
2316 auto psdu = psduMap.begin()->second;
2323 auto uid = psdu->GetPayload(0)->GetUid();
2324 rxErrorModel->SetList({uid});
2331 uint16_t channelFreqMhz,
2338 if (aMpdu.
type != MpduType::NORMAL_MPDU)
2345 packet->RemoveHeader(hdr);
2358 packet->RemoveHeader(hdr);
2370 for (
uint32_t i = 0; i < numPackets; i++)
2373 sourceDevice->Send(pkt, destination, 0);
2382 int64_t streamNumber = 200;
2386 wifiApNode.Create(1);
2391 phy.SetChannel(channel.Create());
2395 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
2403 phy.Set(
"ChannelSettings",
StringValue(
"{36, 20, BAND_5GHZ, 0}"));
2404 mac.SetType(
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue(
false));
2405 apDevice = wifi.Install(phy, mac, wifiApNode);
2408 mac.SetType(
"ns3::StaWifiMac");
2409 staDevice = wifi.Install(phy, mac, wifiStaNode);
2417 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2418 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2419 mobility.SetPositionAllocator(positionAlloc);
2421 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2422 mobility.Install(wifiApNode);
2423 mobility.Install(wifiStaNode);
2427 switch (rcvErrorType)
2436 NS_ABORT_MSG(
"Station type " << +rcvErrorType <<
" cannot be used here");
2438 wifiMac->GetWifiPhy(0)->SetPostReceptionErrorModel(rxErrorModel);
2441 "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/MonitorSnifferRx",
2445 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/BE_Txop/"
2446 "BlockAckManager/AgreementState",
2449 "/DeviceList/*/$ns3::WifiNetDevice/Phys/0/PhyTxPsduBegin",
2457 staDevice.
Get(0)->GetAddress());
2463 staDevice.
Get(0)->GetAddress());
2469 staDevice.
Get(0)->GetAddress());
2475 staDevice.
Get(0)->GetAddress());
2494 "Receiving incorrect number of normal MPDU packet on subtest 1");
2497 "Receiving incorrect number of A-MPDU packets on subtest 1");
2501 "Incorrect number of times the ADDBA state machine was in "
2502 "established state on subtest 1");
2506 "Incorrect number of times the ADDBA state machine was in pending state on subtest 1");
2510 "Incorrect number of times the ADDBA state machine was in rejected state on subtest 1");
2514 "Incorrect number of times the ADDBA state machine was in no_reply state on subtest 1");
2518 "Incorrect number of times the ADDBA state machine was in reset state on subtest 1");
2537 "Receiving incorrect number of normal MPDU packet on subtest 2");
2540 "Receiving incorrect number of A-MPDU packet on subtest 2");
2544 "Incorrect number of times the ADDBA state machine was in "
2545 "established state on subtest 2");
2549 "Incorrect number of times the ADDBA state machine was in pending state on subtest 2");
2553 "Incorrect number of times the ADDBA state machine was in rejected state on subtest 2");
2557 "Incorrect number of times the ADDBA state machine was in no_reply state on subtest 2");
2561 "Incorrect number of times the ADDBA state machine was in reset state on subtest 2");
2589 void DoRun()
override;
2596 void RunOne(
bool useAmpdu);
2625 :
TestCase(
"Test case for issue #40"),
2628 m_txMacFinalDataFailedCount(0)
2645 for (uint8_t i = 0; i < numPackets; i++)
2648 sourceDevice->Send(pkt, destination, 0);
2668 int64_t streamNumber = 100;
2672 wifiApNode.Create(1);
2677 phy.SetChannel(channel.Create());
2682 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
2686 mac.SetType(
"ns3::ApWifiMac");
2687 apDevice = wifi.Install(phy, mac, wifiApNode);
2690 mac.SetType(
"ns3::StaWifiMac");
2691 staDevice = wifi.Install(phy, mac, wifiStaNode);
2699 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2700 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
2701 mobility.SetPositionAllocator(positionAlloc);
2703 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2704 mobility.Install(wifiApNode);
2706 mobility.SetMobilityModel(
"ns3::WaypointMobilityModel");
2707 mobility.Install(wifiStaNode);
2709 Config::Connect(
"/NodeList/*/DeviceList/*/RemoteStationManager/MacTxFinalDataFailed",
2711 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/MacRx",
2716 staWaypointMobility->AddWaypoint(
Waypoint(
Seconds(1), Vector(10.0, 0.0, 0.0)));
2717 staWaypointMobility->AddWaypoint(
Waypoint(
Seconds(1.5), Vector(50.0, 0.0, 0.0)));
2725 ap_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
2736 staDevice.
Get(0)->GetAddress());
2745 staDevice.
Get(0)->GetAddress());
2754 staDevice.
Get(0)->GetAddress());
2760 staDevice.
Get(0)->GetAddress());
2766 staDevice.
Get(0)->GetAddress());
2772 staDevice.
Get(0)->GetAddress());
2778 staDevice.
Get(0)->GetAddress());
2784 (useAmpdu ? 14 : 7),
2785 "Incorrect number of transmitted packets");
2787 (useAmpdu ? 12 : 6),
2788 "Incorrect number of successfully received packets");
2791 "Incorrect number of dropped TX packets");
2824 void DoRun()
override;
2853 :
TestCase(
"Test case for issue #169")
2869 for (uint8_t i = 0; i < numPackets; i++)
2872 packet->AddPacketTag(priorityTag);
2873 sourceDevice->Send(packet, destination, 0);
2883 if (psdus.begin()->second->GetSize() >= 1000)
2886 WifiModulationClass::WIFI_MOD_CLASS_VHT,
2887 "Ideal rate manager selected incorrect modulation class");
2896 int64_t streamNumber = 100;
2900 wifiApNode.Create(1);
2905 phy.SetChannel(channel.Create());
2909 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
2913 mac.SetType(
"ns3::ApWifiMac");
2914 apDevice = wifi.Install(phy, mac, wifiApNode);
2917 mac.SetType(
"ns3::StaWifiMac");
2918 staDevice = wifi.Install(phy, mac, wifiStaNode);
2926 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2927 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2928 mobility.SetPositionAllocator(positionAlloc);
2930 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2931 mobility.Install(wifiApNode);
2932 mobility.Install(wifiStaNode);
2934 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
2943 staDevice.
Get(0)->GetAddress(),
2952 staDevice.
Get(0)->GetAddress(),
2981 void DoRun()
override;
3019 :
TestCase(
"Test case for use of channel bonding with Ideal rate manager")
3030 Config::Set(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelSettings",
3031 StringValue(
"{0, " + std::to_string(
static_cast<uint16_t
>(channelWidth)) +
3032 ", BAND_5GHZ, 0}"));
3039 sourceDevice->Send(packet, destination, 0);
3048 if (psduMap.begin()->second->GetSize() >= 1000)
3059 "Last selected WifiMode "
3060 <<
m_txMode <<
" does not match expected WifiMode " << expectedMode);
3068 int64_t streamNumber = 100;
3072 wifiApNode.Create(1);
3077 phy.SetChannel(channel.Create());
3081 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
3085 mac.SetType(
"ns3::ApWifiMac");
3086 apDevice = wifi.Install(phy, mac, wifiApNode);
3089 mac.SetType(
"ns3::StaWifiMac");
3090 staDevice = wifi.Install(phy, mac, wifiStaNode);
3098 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3099 positionAlloc->Add(Vector(50.0, 0.0, 0.0));
3100 mobility.SetPositionAllocator(positionAlloc);
3102 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3103 mobility.Install(wifiApNode);
3104 mobility.Install(wifiStaNode);
3106 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
3118 staDevice.
Get(0)->GetAddress());
3134 staDevice.
Get(0)->GetAddress());
3150 staDevice.
Get(0)->GetAddress());
3177 void DoRun()
override;
3226 :
TestCase(
"Test case for use of imbalanced MIMO settings with Ideal rate manager")
3237 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/Antennas",
3239 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
3241 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
3248 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/Antennas",
3250 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
3252 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
3260 sourceDevice->Send(packet, destination, 0);
3269 if (psdus.begin()->second->GetSize() >= 1000)
3281 <<
" does not match expected Nss " << expectedNss);
3290 <<
" does not match expected WifiMode "
3299 int64_t streamNumber = 100;
3303 wifiApNode.Create(1);
3308 phy.SetChannel(channel.Create());
3312 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
3316 mac.SetType(
"ns3::ApWifiMac");
3317 apDevice = wifi.Install(phy, mac, wifiApNode);
3320 mac.SetType(
"ns3::StaWifiMac");
3321 staDevice = wifi.Install(phy, mac, wifiStaNode);
3329 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3330 positionAlloc->Add(Vector(40.0, 0.0, 0.0));
3331 mobility.SetPositionAllocator(positionAlloc);
3333 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3334 mobility.Install(wifiApNode);
3335 mobility.Install(wifiStaNode);
3337 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
3349 staDevice.
Get(0)->GetAddress());
3354 staDevice.
Get(0)->GetAddress());
3372 staDevice.
Get(0)->GetAddress());
3377 staDevice.
Get(0)->GetAddress());
3396 staDevice.
Get(0)->GetAddress());
3401 staDevice.
Get(0)->GetAddress());
3419 staDevice.
Get(0)->GetAddress());
3424 staDevice.
Get(0)->GetAddress());
3443 staDevice.
Get(0)->GetAddress());
3448 staDevice.
Get(0)->GetAddress());
3468 staDevice.
Get(0)->GetAddress());
3473 staDevice.
Get(0)->GetAddress());
3491 staDevice.
Get(0)->GetAddress());
3496 staDevice.
Get(0)->GetAddress());
3515 staDevice.
Get(0)->GetAddress());
3520 staDevice.
Get(0)->GetAddress());
3540 staDevice.
Get(0)->GetAddress());
3545 staDevice.
Get(0)->GetAddress());
3562 staDevice.
Get(0)->GetAddress());
3601 uint16_t expectedDataRate);
3602 void DoRun()
override;
3606 :
TestCase(
"Check data rates for different RU types.")
3615 uint16_t expectedDataRate)
3629 txVector.SetMode(mode, staId);
3630 txVector.SetNss(nss, staId);
3632 txVector.SetRu(ru, staId);
3633 uint64_t dataRate = round(mode.GetDataRate(txVector, staId) / 100000.0);
3635 if (
static_cast<uint16_t
>(dataRate) != expectedDataRate)
3637 std::cerr <<
"RU=" << ruType <<
" mode=" << mode <<
" Nss=" << +nss
3638 <<
" guardInterval=" << guardInterval <<
" expected=" << expectedDataRate
3640 <<
" computed=" <<
static_cast<uint16_t
>(dataRate) <<
" x100kbps" << std::endl;
3668 "26-tone RU data rate verification for different MCSs, GIs, and Nss's failed");
3680 "Data rate verification for RUs above 52-tone RU (included) failed");
3685 std::tuple<SupportedRates, std::optional<ExtendedSupportedRatesIE>, std::vector<Ssid>>;
3719 .SetGroupName(
"Wifi")
3743 void DoRun()
override;
3769 "Expected a SupportedRates IE to be included");
3772 "Expected no ExtendedSupportedRatesIE to be included");
3789 "Expected a SupportedRates IE to be included");
3792 "Expected an ExtendedSupportedRatesIE to be included");
3798 Ssid one(
"Ssid One");
3799 frame.Get<
Ssid>().push_back(one);
3803 "Expected a SupportedRates IE to be included");
3806 "Expected an ExtendedSupportedRatesIE to be included");
3815 frame.Get<
Ssid>().emplace_back(
"Ssid Two");
3819 "Expected a SupportedRates IE to be included");
3822 "Expected an ExtendedSupportedRatesIE to be included");
3826 "Incorrect first SSID");
3829 "Incorrect second SSID");
3847 void DoRun()
override;
3861 :
TestCase(
"Test case for Bug 730"),
3881 wifiApNode.Create(1);
3885 phy.SetChannel(channel.Create());
3889 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
3896 auto ssid =
Ssid(
"ns-3-ssid");
3900 staDevices = wifi.Install(phy, mac, wifiStaNode);
3905 apDevices = wifi.Install(phy, mac, wifiApNode);
3906 auto apRemoteStationManager = apDevices.Get(0)
3908 ->GetRemoteStationManager()
3915 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3916 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
3917 mobility.SetPositionAllocator(positionAlloc);
3919 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3920 mobility.Install(wifiApNode);
3921 mobility.Install(wifiStaNode);
3933 packetSocket.
Install(wifiStaNode);
3934 packetSocket.
Install(wifiApNode);
3939 client->SetRemote(socket);
3941 client->SetStartTime(
Seconds(1));
3942 client->SetStopTime(
Seconds(4.5));
3945 server->SetLocal(socket);
3946 wifiApNode.Get(0)->AddApplication(server);
3947 server->SetStartTime(
Seconds(0));
3948 server->SetStopTime(
Seconds(4.5));
3950 Config::Connect(
"/NodeList/1/ApplicationList/0/$ns3::PacketSocketServer/Rx",
3958 "/NodeList/0/DeviceList/0/RemoteStationManager/$ns3::ConstantRateWifiManager/DataMode",
3963 "/NodeList/0/DeviceList/0/RemoteStationManager/$ns3::ConstantRateWifiManager/DataMode",
3968 "/NodeList/0/DeviceList/0/RemoteStationManager/$ns3::ConstantRateWifiManager/DataMode",
Make sure that when virtual collision occurs the wifi remote station manager is triggered and the ret...
~Bug2222TestCase() override
uint32_t m_countInternalCollisions
count internal collisions
void DoRun() override
Implementation to actually run this TestCase.
void TxDataFailedTrace(std::string context, Mac48Address adr)
Transmit data failed function.
Make sure that the ADDBA handshake process is protected.
void RxErrorCallback(std::string context, Ptr< const Packet > p, double snr)
Callback when packet is dropped.
void RunSubtest(TypeOfStation rcvErrorType)
Run subtest for this test suite.
void DoRun() override
Implementation to actually run this TestCase.
uint16_t m_addbaResetCount
Count number of times ADDBA state machine is in reset state.
uint16_t m_addbaRejectedCount
Count number of times ADDBA state machine is in rejected state.
void AddbaStateChangedCallback(std::string context, Time t, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
Callback when ADDBA state changed.
uint16_t m_failedActionCount
Count failed ADDBA request/response.
void TxCallback(Ptr< ListErrorModel > rxErrorModel, std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback when a frame is transmitted.
uint16_t m_addbaEstablishedCount
Count number of times ADDBA state machine is in established state.
void RxCallback(std::string context, Ptr< const Packet > p, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise, uint16_t staId)
Callback when packet is received.
~Bug2470TestCase() override
uint16_t m_receivedNormalMpduCount
Count received normal MPDU packets on STA.
uint16_t m_addbaNoReplyCount
Count number of times ADDBA state machine is in no_reply state.
uint16_t m_addbaPendingCount
Count number of times ADDBA state machine is in pending state.
void SendPacketBurst(uint32_t numPackets, Ptr< NetDevice > sourceDevice, Address &destination) const
Triggers the arrival of a burst of 1000 Byte-long packets in the source device.
uint16_t m_receivedAmpduCount
Count received A-MPDU packets on STA.
Make sure that the channel width and the channel number can be changed at runtime.
uint16_t m_countOperationalChannelWidth20
count number of beacon frames announcing a 20 MHz operating channel width
void ChangeSupportedChannelWidth()
Function called to change the supported channel width at runtime.
uint16_t m_countOperationalChannelWidth40
count number of beacon frames announcing a 40 MHz operating channel width
void RxCallback(std::string context, Ptr< const Packet > p, RxPowerWattPerChannelBand rxPowersW)
Callback triggered when a packet is received by the PHYs.
uint16_t m_assocReqCount
count number of association requests
Ptr< YansWifiPhy > m_apPhy
AP PHY.
void DoRun() override
Implementation to actually run this TestCase.
Ptr< YansWifiPhy > m_staPhy
STA PHY.
uint16_t m_assocRespCount
count number of association responses
~Bug2831TestCase() override
Make sure that the correct channel width and center frequency have been set for OFDM basic rate trans...
void SendPacketBurst(uint8_t numPackets, Ptr< NetDevice > sourceDevice, Address &destination) const
Triggers the arrival of a burst of 1000 Byte-long packets in the source device.
void StoreDistinctTuple(std::string context, Ptr< SpectrumSignalParameters > txParams)
Stores the distinct {starting frequency, channelWidth, Number of subbands in SpectrumModel,...
std::vector< FreqWidthSubbandModulationTuple > m_distinctTuples
vector of distinct {starting frequency, channelWidth, Number of subbands in SpectrumModel,...
void DoRun() override
Implementation to actually run this TestCase.
MHz_u m_channelWidth
channel width
std::tuple< Hz_u, MHz_u, uint32_t, WifiModulationClass > FreqWidthSubbandModulationTuple
A tuple of {starting frequency, channelWidth, Number of subbands in SpectrumModel,...
~Bug2843TestCase() override
Make sure that when changing the fragmentation threshold during the simulation, the TCP transmission ...
~Bug730TestCase() override
void Receive(std::string context, Ptr< const Packet > p, const Address &adr)
Receive function.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t m_received
received
Make sure that all DSSS modulation types work (see issue #1095).
void Receive(std::string context, Ptr< const Packet > p, const Address &)
Trace sink to receive from the PacketSocket; the address parameter is unused.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t m_received
number of received packets
Data rate verification test for MCSs of different RU sizes.
HeRuMcsDataRateTestCase()
bool CheckDataRate(RuType ruType, std::string mcs, uint8_t nss, Time guardInterval, uint16_t expectedDataRate)
Compare the data rate computed for the provided combination with standard defined one.
void DoRun() override
Implementation to actually run this TestCase.
Make sure that Ideal rate manager properly selects MCS based on the configured channel width.
WifiMode m_txMode
Store the last selected mode to send data packet.
void ChangeChannelWidth(MHz_u channelWidth)
Change the configured channel width for all nodes.
IdealRateManagerChannelWidthTest()
void DoRun() override
Implementation to actually run this TestCase.
void SendPacket(Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the transmission of a 1000 Byte-long data packet from the source device.
void CheckLastSelectedMode(WifiMode expectedMode)
Check if the selected WifiMode is correct.
void TxCallback(std::string context, WifiConstPsduMap psduMap, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
~IdealRateManagerChannelWidthTest() override
Test to validate that Ideal rate manager properly selects TXVECTOR in scenarios where MIMO is used.
~IdealRateManagerMimoTest() override
void CheckLastSelectedNss(uint8_t expectedNss)
Check if the selected Nss is correct.
void DoRun() override
Implementation to actually run this TestCase.
void TxCallback(std::string context, WifiConstPsduMap psdus, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
void SetApMimoSettings(uint8_t antennas, uint8_t maxStreams)
Change the configured MIMO settings for AP node.
WifiTxVector m_txVector
Store the last TXVECTOR used to transmit Data.
void SetStaMimoSettings(uint8_t antennas, uint8_t maxStreams)
Change the configured MIMO settings for STA node.
void SendPacket(Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the transmission of a 1000 Byte-long data packet from the source device.
void CheckLastSelectedMode(WifiMode expectedMode)
Check if the selected WifiMode is correct.
IdealRateManagerMimoTest()
void SwitchCh(Ptr< WifiNetDevice > dev)
Switch channel function.
InterferenceHelperSequenceTest()
void SendOnePacket(Ptr< WifiNetDevice > dev)
Send one packet function.
void DoRun() override
Implementation to actually run this TestCase.
ObjectFactory m_manager
manager
ObjectFactory m_propDelay
propagation delay
Ptr< Node > CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Create one function.
Make sure that Ideal rate manager is able to handle non best-effort traffic.
void SendPackets(uint8_t numPackets, Ptr< NetDevice > sourceDevice, Address &destination, uint8_t priority)
Triggers the transmission of a 1000 Byte-long data packet from the source device.
~Issue169TestCase() override
void TxCallback(std::string context, WifiConstPsduMap psdus, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
void DoRun() override
Implementation to actually run this TestCase.
Make sure that Ideal rate manager recovers when the station is moving away from the access point.
uint16_t m_txCount
Count number of transmitted data packets.
uint16_t m_txMacFinalDataFailedCount
Count number of unsuccessfuly transmitted data packets.
void RunOne(bool useAmpdu)
Run one function.
uint16_t m_rxCount
Count number of successfully received data packets.
void RxSuccessCallback(std::string context, Ptr< const Packet > p)
Callback when packet is successfully received.
void DoRun() override
Implementation to actually run this TestCase.
void TxFinalDataFailedCallback(std::string context, Mac48Address address)
Transmit final data failed function.
void SendPackets(uint8_t numPackets, Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the arrival of 1000 Byte-long packets in the source device.
~Issue40TestCase() override
Make sure that fragmentation works with QoS stations.
void DoRun() override
Implementation to actually run this TestCase.
uint32_t m_received
received packets
QosFragmentationTestCase()
~QosFragmentationTestCase() override
uint32_t m_fragments
transmitted fragments
void Transmit(std::string context, Ptr< const Packet > p, double power)
Callback invoked when PHY transmits a packet.
void Receive(std::string context, Ptr< const Packet > p, const Address &adr)
Receive function.
Qos Utils Is Old Packet Test.
void DoRun() override
Implementation to actually run this TestCase.
QosUtilsIsOldPacketTest()
Set Channel Frequency Test.
Ptr< YansWifiPhy > GetYansWifiPhyPtr(const NetDeviceContainer &nc) const
Get yans wifi phy function.
SetChannelFrequencyTest()
void DoRun() override
Implementation to actually run this TestCase.
Make sure that Wifi STA is correctly associating to the best AP (i.e., nearest from STA).
void DoRun() override
Implementation to actually run this TestCase.
StaWifiMacScanningTestCase()
void TurnBeaconGenerationOn(Ptr< Node > apNode)
Turn beacon generation on the AP node.
Mac48Address m_associatedApBssid
Associated AP's bssid.
~StaWifiMacScanningTestCase() override
void TurnApOff(Ptr< Node > apNode)
Turn the AP node off.
NodeContainer Setup(bool nearestApBeaconGeneration, bool staActiveProbe)
Setup test.
void AssocCallback(std::string context, Mac48Address bssid)
Callback function on STA assoc event.
void CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Create one function.
void RunOne()
Run one function.
void DoRun() override
Implementation to actually run this TestCase.
void SendOnePacket(Ptr< WifiNetDevice > dev)
Send one packet function.
ObjectFactory m_manager
manager
ObjectFactory m_propDelay
propagation delay
a polymophic address class
AttributeValue implementation for Boolean.
use constant rates for data and RTS transmissions
This class can be used to hold variables of floating point type such as 'double' or 'float'.
The Extended Supported Rates Information Element.
static WifiMode GetHeMcs(uint8_t index)
Return the HE MCS corresponding to the provided index.
The HT Operation Information Element.
static Mac48Address Allocate()
Allocate a new Mac48Address.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
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.
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
State
Represents the state for this agreement.
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.
AttributeValue implementation for Pointer.
calculate a propagation delay.
Smart pointer class similar to boost::intrusive_ptr.
Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC).
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.
indicates whether the socket has a priority set.
void SetPriority(uint8_t priority)
Set the tag's priority.
Make it easy to create and manage PHY objects for the spectrum model.
void SetChannel(const Ptr< SpectrumChannel > channel)
The IEEE 802.11 SSID Information Element.
char * PeekString() const
Peek the SSID.
AttributeValue implementation for Ssid.
Hold variables of type string.
The Supported Rates 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.
Handles the packet queue and stores DCF/EDCA access parameters (one Txop per AC).
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
static WifiMode GetVhtMcs3()
Return MCS 3 from VHT MCS values.
static WifiMode GetVhtMcs1()
Return MCS 1 from VHT MCS values.
static WifiMode GetVhtMcs2()
Return MCS 2 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.
void SetType(std::string type, Args &&... args)
base class for all MAC-level wifi objects.
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
represent a single transmission mode
WifiModulationClass GetModulationClass() const
Hold together all Wifi-related objects.
void Set(std::string name, const AttributeValue &v)
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
std::tuple< uint8_t, MHz_u, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying a segment of an operating channel.
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
virtual void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void SetOperatingChannel(const WifiPhyOperatingChannel &channel)
If the standard for this object has not been set yet, store the channel settings corresponding to the...
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
hold a list of per-remote-station state.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
uint8_t GetNss(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the number of spatial streams.
MHz_u GetChannelWidth() const
manage and create wifi channel objects for the YANS model.
static YansWifiChannelHelper Default()
Create a channel helper in a default working state.
Make it easy to create and manage PHY objects for the YANS model.
void SetChannel(const Ptr< YansWifiChannel > channel)
Set the YansWifiChannel this YansWifiPhy is to be connected to.
void SetInterferenceHelper(const Ptr< InterferenceHelper > helper) override
Sets the interference helper.
void Connect(std::string path, const CallbackBase &cb)
void Set(std::string path, const AttributeValue &value)
#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.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > CreateObjectWithAttributes(Args... args)
Allocate an Object on the heap and initialize with a set of attributes.
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_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_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.
TypeOfStation
Enumeration for type of WiFi station.
bool QosUtilsIsOldPacket(uint16_t startingSeq, uint16_t seqNumber)
This function checks if packet with sequence number seqNumber is an "old" packet.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< void, Ptr< const WifiPsdu > > RxErrorCallback
Callback if PSDU unsuccessfuly received.
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...
RuType
The different Resource Unit (RU) types.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
std::map< WifiSpectrumBandInfo, Watt_u > RxPowerWattPerChannelBand
A map of the received power for each band.
Ptr< T1 > StaticCast(const Ptr< T2 > &p)
Cast a Ptr.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
Struct containing all supported rates.
SupportedRates rates
supported rates
std::optional< ExtendedSupportedRatesIE > extendedRates
supported extended rates
void AddSupportedRate(uint64_t bs)
Add the given rate to the supported rates.
MpduType type
type of MPDU
SignalNoiseDbm structure.
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
static WifiTestSuite g_wifiTestSuite
the test suite
std::tuple< SupportedRates, std::optional< ExtendedSupportedRatesIE >, std::vector< Ssid > > MgtTestElems
List of Information Elements included in the test management frame.