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;
61 if (!mac->GetQosSupported())
63 currentStream += mac->GetTxop()->AssignStreams(currentStream);
67 currentStream += mac->GetQosTxop(
AC_VO)->AssignStreams(currentStream);
68 currentStream += mac->GetQosTxop(
AC_VI)->AssignStreams(currentStream);
69 currentStream += mac->GetQosTxop(
AC_BE)->AssignStreams(currentStream);
70 currentStream += mac->GetQosTxop(
AC_BK)->AssignStreams(currentStream);
85 void DoRun()
override;
116 dev->Send(p, dev->GetBroadcast(), 1);
124 node->AddDevice(dev);
129 phy->SetInterferenceHelper(interferenceHelper);
131 phy->SetErrorRateModel(error);
132 phy->SetChannel(channel);
137 dev->SetRemoteStationManager(manager);
147 if (mac->GetTypeOfStation() ==
STA)
153 fem->SetAddress(mac->GetAddress());
155 protectionManager->SetWifiMac(mac);
156 fem->SetProtectionManager(protectionManager);
158 ackManager->SetWifiMac(mac);
159 fem->SetAckManager(ackManager);
161 mobility->SetPosition(pos);
162 node->AggregateObject(mobility);
173 channel->SetPropagationDelayModel(propDelay);
174 channel->SetPropagationLossModel(propLoss);
176 CreateOne(Vector(0.0, 0.0, 0.0), channel);
177 CreateOne(Vector(5.0, 0.0, 0.0), channel);
178 CreateOne(Vector(5.0, 0.0, 0.0), channel);
189 m_mac.SetTypeId(
"ns3::AdhocWifiMac");
190 m_propDelay.SetTypeId(
"ns3::ConstantSpeedPropagationDelayModel");
192 m_manager.SetTypeId(
"ns3::ArfWifiManager");
194 m_manager.SetTypeId(
"ns3::AarfWifiManager");
196 m_manager.SetTypeId(
"ns3::ConstantRateWifiManager");
198 m_manager.SetTypeId(
"ns3::OnoeWifiManager");
200 m_manager.SetTypeId(
"ns3::AmrrWifiManager");
202 m_manager.SetTypeId(
"ns3::IdealWifiManager");
205 m_mac.SetTypeId(
"ns3::AdhocWifiMac");
207 m_mac.SetTypeId(
"ns3::ApWifiMac");
209 m_mac.SetTypeId(
"ns3::StaWifiMac");
212 m_propDelay.SetTypeId(
"ns3::RandomPropagationDelayModel");
213 m_mac.SetTypeId(
"ns3::AdhocWifiMac");
236 "2047 is new in comparison to 0");
244 "0 is new in comparison to 4095");
250 "2047 is old in comparison to 4095");
254 "4095 is new in comparison to 2048");
258 "0 is new in comparison to 2049");
270 void DoRun()
override;
297 :
TestCase(
"InterferenceHelperSequence")
305 dev->Send(p, dev->GetBroadcast(), 1);
320 node->AddDevice(dev);
325 phy->SetInterferenceHelper(interferenceHelper);
327 phy->SetErrorRateModel(error);
328 phy->SetChannel(channel);
330 phy->SetMobility(mobility);
334 dev->SetRemoteStationManager(manager);
346 fem->SetAddress(mac->GetAddress());
348 protectionManager->SetWifiMac(mac);
349 fem->SetProtectionManager(protectionManager);
351 ackManager->SetWifiMac(mac);
352 fem->SetAckManager(ackManager);
354 mobility->SetPosition(pos);
355 node->AggregateObject(mobility);
363 m_mac.SetTypeId(
"ns3::AdhocWifiMac");
364 m_propDelay.SetTypeId(
"ns3::ConstantSpeedPropagationDelayModel");
365 m_manager.SetTypeId(
"ns3::ConstantRateWifiManager");
370 channel->SetPropagationDelayModel(propDelay);
371 channel->SetPropagationLossModel(propLoss);
381 propLoss->SetDefaultLoss(999);
465 void DoRun()
override;
491 :
TestCase(
"Test case for DCF immediate access with broadcast frames")
513 dev->Send(p, dev->GetBroadcast(), 1);
519 m_mac.SetTypeId(
"ns3::AdhocWifiMac");
520 m_propDelay.SetTypeId(
"ns3::ConstantSpeedPropagationDelayModel");
521 m_manager.SetTypeId(
"ns3::ConstantRateWifiManager");
531 channel->SetPropagationDelayModel(propDelay);
532 channel->SetPropagationLossModel(propLoss);
540 txPhy->SetInterferenceHelper(txInterferenceHelper);
542 txPhy->SetErrorRateModel(txError);
543 txPhy->SetChannel(channel);
544 txPhy->SetDevice(txDev);
545 txPhy->SetMobility(txMobility);
548 txPhy->TraceConnectWithoutContext(
552 txMobility->SetPosition(Vector(0.0, 0.0, 0.0));
553 txNode->AggregateObject(txMobility);
554 txDev->SetPhy(txPhy);
556 txNode->AddDevice(txDev);
563 txDev->SetMac(txMac);
567 auto fem = txMac->GetFrameExchangeManager();
568 fem->SetAddress(txMac->GetAddress());
570 protectionManager->SetWifiMac(txMac);
571 fem->SetProtectionManager(protectionManager);
573 ackManager->SetWifiMac(txMac);
574 fem->SetAckManager(ackManager);
607 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
608 Time expectedSecondTransmissionTime =
609 expectedFirstTransmissionTime +
MicroSeconds(expectedWait1);
611 expectedFirstTransmissionTime,
612 "The first transmission time not correct!");
615 expectedSecondTransmissionTime,
616 "The second transmission time not correct!");
638 void DoRun()
override;
653 :
TestCase(
"Test case for Bug 730"),
680 wifiApNode.Create(1);
684 phy.SetChannel(channel.Create());
688 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
699 staDevices = wifi.Install(phy, mac, wifiStaNode);
704 apDevices = wifi.Install(phy, mac, wifiApNode);
709 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
710 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
711 mobility.SetPositionAllocator(positionAlloc);
713 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
714 mobility.Install(wifiApNode);
715 mobility.Install(wifiStaNode);
727 packetSocket.
Install(wifiStaNode);
728 packetSocket.
Install(wifiApNode);
732 client->SetRemote(socket);
734 client->SetStartTime(
Seconds(1));
735 client->SetStopTime(
Seconds(51));
738 server->SetLocal(socket);
739 wifiApNode.Get(0)->AddApplication(server);
740 server->SetStartTime(
Seconds(0));
741 server->SetStopTime(
Seconds(52));
743 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
748 "/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
760 "packet reception unexpectedly stopped after adapting fragmentation threshold!");
777 void DoRun()
override;
801 :
TestCase(
"Test case for fragmentation with QoS stations"),
814 if (p->GetSize() == 1400)
839 wifiApNode.Create(1);
843 phy.SetChannel(channel.Create());
847 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
"DataMode",
StringValue(
"HtMcs7"));
854 staDevices = wifi.Install(phy, mac, wifiStaNode);
859 apDevices = wifi.Install(phy, mac, wifiApNode);
864 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
865 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
866 mobility.SetPositionAllocator(positionAlloc);
868 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
869 mobility.Install(wifiApNode);
870 mobility.Install(wifiStaNode);
885 packetSocket.
Install(wifiStaNode);
886 packetSocket.
Install(wifiApNode);
891 client->SetRemote(socket);
893 client->SetStartTime(
Seconds(1));
894 client->SetStopTime(
Seconds(3));
897 server->SetLocal(socket);
898 wifiApNode.Get(0)->AddApplication(server);
899 server->SetStartTime(
Seconds(0));
900 server->SetStopTime(
Seconds(4));
902 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
905 Config::Set(
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
930 void DoRun()
override;
942 :
TestCase(
"Test case for setting WifiPhy channel and frequency")
960 wifiApNode.Create(1);
964 phy.SetChannel(channel.Create());
968 ssid =
Ssid(
"wifi-phy-configuration");
970 macSta.
SetType(
"ns3::StaWifiMac",
986 "default configuration");
992 wifi.SetRemoteStationManager(
"ns3::ArfWifiManager");
993 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1004 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1015 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1025 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1027 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_5GHZ, 0}"));
1028 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1033 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1038 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1040 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1049 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1051 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1061 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1062 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_2_4GHZ, 0}"));
1063 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1068 "802.11ax-2.4GHz configuration");
1070 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1075 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1076 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1085 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1086 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_6GHZ, 0}"));
1087 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1092 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1097 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1099 phy.Set(
"ChannelSettings",
StringValue(
"{0, 10, BAND_5GHZ, 0}"));
1100 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1105 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1110 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1112 phy.Set(
"ChannelSettings",
StringValue(
"{0, 5, BAND_5GHZ, 0}"));
1113 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1118 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1123 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1125 phy.Set(
"ChannelSettings",
StringValue(
"{44, 20, BAND_5GHZ, 0}"));
1126 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1131 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1136 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1137 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1138 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1141 std::ostringstream path;
1142 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1143 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1148 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1153 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1154 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1155 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1158 std::ostringstream path;
1159 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1160 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1167 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1172 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1174 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1176 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{3, 20, BAND_2_4GHZ, 0}"));
1178 std::ostringstream path;
1179 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1180 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1187 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1192 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1195 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1196 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1198 bool exceptionThrown =
false;
1201 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1203 catch (
const std::runtime_error&)
1205 exceptionThrown =
true;
1213 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1215 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1216 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1220 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{100, 0, BAND_5GHZ, 0}"));
1230 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1232 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1233 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1235 bool exceptionThrown =
false;
1240 catch (
const std::runtime_error&)
1242 exceptionThrown =
true;
1250 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1253 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1254 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1256 bool exceptionThrown =
false;
1259 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1261 catch (
const std::runtime_error&)
1263 exceptionThrown =
true;
1267 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1272 exceptionThrown =
false;
1275 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{43, 0, BAND_5GHZ, 0}"));
1277 catch (
const std::runtime_error&)
1279 exceptionThrown =
true;
1283 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1291 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1292 phy.Set(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1294 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1301 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1303 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1308 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1313 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1318 bool exceptionThrown =
false;
1321 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1323 catch (
const std::runtime_error&)
1325 exceptionThrown =
true;
1327 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1333 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1334 exceptionThrown =
false;
1337 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{43, 0, BAND_5GHZ, 0}"));
1339 catch (
const std::runtime_error&)
1341 exceptionThrown =
true;
1367 void DoRun()
override;
1381 :
TestCase(
"Test case for Bug 2222"),
1406 int64_t streamNumber = 100;
1413 phy.SetChannel(channel.Create());
1416 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1423 mac.SetType(
"ns3::AdhocWifiMac",
"QosSupported",
BooleanValue(
true));
1426 wifiDevices = wifi.Install(phy, mac, wifiNodes);
1434 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1435 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
1436 mobility.SetPositionAllocator(positionAlloc);
1438 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1439 mobility.Install(wifiNodes);
1450 packetSocket.
Install(wifiNodes);
1453 clientLowPriority->SetAttribute(
"PacketSize",
UintegerValue(1460));
1454 clientLowPriority->SetAttribute(
"MaxPackets",
UintegerValue(1));
1455 clientLowPriority->SetAttribute(
"Priority",
UintegerValue(4));
1456 clientLowPriority->SetRemote(socket);
1458 clientLowPriority->SetStartTime(
Seconds(0));
1459 clientLowPriority->SetStopTime(
Seconds(1));
1462 clientHighPriority->SetAttribute(
"PacketSize",
UintegerValue(1460));
1463 clientHighPriority->SetAttribute(
"MaxPackets",
UintegerValue(1));
1464 clientHighPriority->SetAttribute(
"Priority",
UintegerValue(6));
1465 clientHighPriority->SetRemote(socket);
1467 clientHighPriority->SetStartTime(
Seconds(0));
1468 clientHighPriority->SetStopTime(
Seconds(1));
1471 server->SetLocal(socket);
1473 server->SetStartTime(
Seconds(0));
1474 server->SetStopTime(
Seconds(1));
1476 Config::Connect(
"/NodeList/*/DeviceList/*/RemoteStationManager/MacTxDataFailed",
1485 "unexpected number of internal collisions!");
1506 void DoRun()
override;
1514 std::vector<FreqWidthSubbandModulationTuple>
1539 :
TestCase(
"Test case for Bug 2843"),
1553 std::size_t numBands = c->GetNumBands();
1554 const Hz_u startingFreq{c->Begin()->fl};
1567 std::make_tuple(startingFreq,
m_channelWidth, numBands, modulationClass);
1571 if (*it == tupleForCurrentTx)
1587 for (uint8_t i = 0; i < numPackets; i++)
1590 sourceDevice->Send(pkt, destination, 0);
1597 MHz_u channelWidth{40};
1603 wifiApNode.Create(1);
1608 lossModel->SetFrequency(5.190e9);
1609 spectrumChannel->AddPropagationLossModel(lossModel);
1613 spectrumChannel->SetPropagationDelayModel(delayModel);
1617 spectrumPhy.
Set(
"ChannelSettings",
StringValue(
"{38, 40, BAND_5GHZ, 0}"));
1623 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1632 mac.SetType(
"ns3::StaWifiMac");
1634 staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode);
1636 mac.SetType(
"ns3::ApWifiMac");
1638 apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
1642 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1643 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
1644 mobility.SetPositionAllocator(positionAlloc);
1646 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1647 mobility.Install(wifiApNode);
1648 mobility.Install(wifiStaNode);
1656 staDevice.
Get(0)->GetAddress());
1662 staDevice.
Get(0)->GetAddress());
1664 Config::Connect(
"/ChannelList/*/$ns3::MultiModelSpectrumChannel/TxSigParams",
1678 "The starting frequency of the first tuple should be shifted 20 MHz to "
1679 "the right wrt second tuple");
1683 "First tuple's channel width should be 20 MHz");
1686 "First tuple should have 193 subbands (64+DC, 20MHz+DC, inband and 64*2 "
1687 "out-of-band, 20MHz on each side)");
1690 "First tuple should be OFDM");
1694 "Second tuple's channel width should be 40 MHz");
1697 "Second tuple should have 385 subbands (128+DC, 40MHz+DC, inband and "
1698 "128*2 out-of-band, 40MHz on each side)");
1701 "Second tuple should be VHT_OFDM");
1705 "The starting frequency of the third tuple should be the same as the "
1709 "Third tuple's channel width should be 40 MHz");
1712 "Third tuple should have 385 subbands (128+DC, 40MHz+DC, inband and "
1713 "128*2 out-of-band, 40MHz on each side)");
1716 "Third tuple should be OFDM");
1736 void DoRun()
override;
1763 :
TestCase(
"Test case for Bug 2831"),
1789 packet->RemoveHeader(hdr);
1801 packet->RemoveHeader(beacon);
1802 const auto& htOperation = beacon.Get<
HtOperation>();
1803 if (htOperation.has_value() && htOperation->GetStaChannelWidth() > 0)
1819 propDelay.
SetTypeId(
"ns3::ConstantSpeedPropagationDelayModel");
1822 channel->SetPropagationDelayModel(propagationDelay);
1823 channel->SetPropagationLossModel(propagationLoss);
1827 apNode->AddDevice(apDev);
1830 apDev->SetHtConfiguration(apHtConfiguration);
1832 manager.
SetTypeId(
"ns3::ConstantRateWifiManager");
1836 apMobility->SetPosition(Vector(0.0, 0.0, 0.0));
1837 apNode->AggregateObject(apMobility);
1843 m_apPhy->SetInterferenceHelper(apInterferenceHelper);
1844 m_apPhy->SetErrorRateModel(error);
1846 m_apPhy->SetMobility(apMobility);
1852 mac.SetTypeId(
"ns3::ApWifiMac");
1855 for (
const std::string ac : {
"BE",
"BK",
"VI",
"VO"})
1861 auto apMac = mac.Create<
WifiMac>();
1864 apDev->SetMac(apMac);
1869 fem->SetAddress(apMac->GetAddress());
1871 protectionManager->SetWifiMac(apMac);
1872 fem->SetProtectionManager(protectionManager);
1874 ackManager->SetWifiMac(apMac);
1875 fem->SetAckManager(ackManager);
1879 staNode->AddDevice(staDev);
1882 staDev->SetHtConfiguration(staHtConfiguration);
1886 staMobility->SetPosition(Vector(1.0, 0.0, 0.0));
1887 staNode->AggregateObject(staMobility);
1892 m_staPhy->SetInterferenceHelper(staInterferenceHelper);
1893 m_staPhy->SetErrorRateModel(error);
1895 m_staPhy->SetMobility(staMobility);
1900 mac.SetTypeId(
"ns3::StaWifiMac");
1901 for (
const std::string ac : {
"BE",
"BK",
"VI",
"VO"})
1907 auto staMac = mac.Create<
WifiMac>();
1908 staDev->SetMac(staMac);
1909 staMac->SetDevice(staDev);
1915 fem = staMac->GetFrameExchangeManager();
1916 fem->SetAddress(staMac->GetAddress());
1918 protectionManager->SetWifiMac(staMac);
1919 fem->SetProtectionManager(protectionManager);
1921 ackManager->SetWifiMac(staMac);
1922 fem->SetAckManager(ackManager);
1924 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyRxBegin",
1937 "Incorrect operational channel width before channel change");
1940 "Incorrect operational channel width after channel change");
1964 void DoRun()
override;
1995 :
TestCase(
"Test case for StaWifiMac scanning capability")
2014 mac->SetAttribute(
"BeaconGeneration",
BooleanValue(
true));
2030 int64_t streamNumber = 1;
2040 phy.SetChannel(channel.Create());
2044 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager");
2049 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(
true));
2050 apDevice = wifi.Install(phy, mac, apNodes);
2051 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(nearestApBeaconGeneration));
2052 apDeviceNearest = wifi.Install(phy, mac, apNodeNearest);
2055 mac.SetType(
"ns3::StaWifiMac",
"ActiveProbing",
BooleanValue(staActiveProbe));
2056 staDevice = wifi.Install(phy, mac, staNode);
2065 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2066 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
2067 positionAlloc->Add(Vector(5.0, 5.0, 0.0));
2068 positionAlloc->Add(Vector(6.0, 5.0, 0.0));
2069 mobility.SetPositionAllocator(positionAlloc);
2071 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2072 mobility.Install(apNodes);
2073 mobility.Install(apNodeNearest);
2074 mobility.Install(staNode);
2076 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/Assoc",
2103 "STA is associated to the wrong AP");
2118 "STA is associated to the wrong AP");
2134 secondNearestApAddr,
2135 "STA is associated to the wrong AP");
2167 void DoRun()
override;
2192 std::string context,
2209 uint16_t channelFreqMhz,
2251 :
TestCase(
"Test case for Bug 2470"),
2297 std::string context,
2302 auto psdu = psduMap.begin()->second;
2309 auto uid = psdu->GetPayload(0)->GetUid();
2310 rxErrorModel->SetList({uid});
2317 uint16_t channelFreqMhz,
2331 packet->RemoveHeader(hdr);
2344 packet->RemoveHeader(hdr);
2356 for (
uint32_t i = 0; i < numPackets; i++)
2359 sourceDevice->Send(pkt, destination, 0);
2368 int64_t streamNumber = 200;
2372 wifiApNode.Create(1);
2377 phy.SetChannel(channel.Create());
2381 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
2389 phy.Set(
"ChannelSettings",
StringValue(
"{36, 20, BAND_5GHZ, 0}"));
2390 mac.SetType(
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue(
false));
2391 apDevice = wifi.Install(phy, mac, wifiApNode);
2394 mac.SetType(
"ns3::StaWifiMac");
2395 staDevice = wifi.Install(phy, mac, wifiStaNode);
2403 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2404 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2405 mobility.SetPositionAllocator(positionAlloc);
2407 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2408 mobility.Install(wifiApNode);
2409 mobility.Install(wifiStaNode);
2413 switch (rcvErrorType)
2422 NS_ABORT_MSG(
"Station type " << +rcvErrorType <<
" cannot be used here");
2424 wifiMac->GetWifiPhy(0)->SetPostReceptionErrorModel(rxErrorModel);
2427 "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/MonitorSnifferRx",
2431 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/BE_Txop/"
2432 "BlockAckManager/AgreementState",
2435 "/DeviceList/*/$ns3::WifiNetDevice/Phys/0/PhyTxPsduBegin",
2443 staDevice.
Get(0)->GetAddress());
2449 staDevice.
Get(0)->GetAddress());
2455 staDevice.
Get(0)->GetAddress());
2461 staDevice.
Get(0)->GetAddress());
2480 "Receiving incorrect number of normal MPDU packet on subtest 1");
2483 "Receiving incorrect number of A-MPDU packets on subtest 1");
2487 "Incorrect number of times the ADDBA state machine was in "
2488 "established state on subtest 1");
2492 "Incorrect number of times the ADDBA state machine was in pending state on subtest 1");
2496 "Incorrect number of times the ADDBA state machine was in rejected state on subtest 1");
2500 "Incorrect number of times the ADDBA state machine was in no_reply state on subtest 1");
2504 "Incorrect number of times the ADDBA state machine was in reset state on subtest 1");
2523 "Receiving incorrect number of normal MPDU packet on subtest 2");
2526 "Receiving incorrect number of A-MPDU packet on subtest 2");
2530 "Incorrect number of times the ADDBA state machine was in "
2531 "established state on subtest 2");
2535 "Incorrect number of times the ADDBA state machine was in pending state on subtest 2");
2539 "Incorrect number of times the ADDBA state machine was in rejected state on subtest 2");
2543 "Incorrect number of times the ADDBA state machine was in no_reply state on subtest 2");
2547 "Incorrect number of times the ADDBA state machine was in reset state on subtest 2");
2575 void DoRun()
override;
2582 void RunOne(
bool useAmpdu);
2611 :
TestCase(
"Test case for issue #40"),
2631 for (uint8_t i = 0; i < numPackets; i++)
2634 sourceDevice->Send(pkt, destination, 0);
2654 int64_t streamNumber = 100;
2658 wifiApNode.Create(1);
2663 phy.SetChannel(channel.Create());
2668 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
2672 mac.SetType(
"ns3::ApWifiMac");
2673 apDevice = wifi.Install(phy, mac, wifiApNode);
2676 mac.SetType(
"ns3::StaWifiMac");
2677 staDevice = wifi.Install(phy, mac, wifiStaNode);
2685 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2686 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
2687 mobility.SetPositionAllocator(positionAlloc);
2689 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2690 mobility.Install(wifiApNode);
2692 mobility.SetMobilityModel(
"ns3::WaypointMobilityModel");
2693 mobility.Install(wifiStaNode);
2695 Config::Connect(
"/NodeList/*/DeviceList/*/RemoteStationManager/MacTxFinalDataFailed",
2697 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/MacRx",
2702 staWaypointMobility->AddWaypoint(
Waypoint(
Seconds(1), Vector(10.0, 0.0, 0.0)));
2703 staWaypointMobility->AddWaypoint(
Waypoint(
Seconds(1.5), Vector(50.0, 0.0, 0.0)));
2710 ap_device->GetMac()->GetQosTxop(
AC_BE)->SetAttribute(
"UseExplicitBarAfterMissedBlockAck",
2721 staDevice.
Get(0)->GetAddress());
2730 staDevice.
Get(0)->GetAddress());
2739 staDevice.
Get(0)->GetAddress());
2745 staDevice.
Get(0)->GetAddress());
2751 staDevice.
Get(0)->GetAddress());
2757 staDevice.
Get(0)->GetAddress());
2763 staDevice.
Get(0)->GetAddress());
2769 (useAmpdu ? 14 : 7),
2770 "Incorrect number of transmitted packets");
2772 (useAmpdu ? 12 : 6),
2773 "Incorrect number of successfully received packets");
2776 "Incorrect number of dropped TX packets");
2809 void DoRun()
override;
2838 :
TestCase(
"Test case for issue #169")
2854 for (uint8_t i = 0; i < numPackets; i++)
2857 packet->AddPacketTag(priorityTag);
2858 sourceDevice->Send(packet, destination, 0);
2868 if (psdus.begin()->second->GetSize() >= 1000)
2872 "Ideal rate manager selected incorrect modulation class");
2881 int64_t streamNumber = 100;
2885 wifiApNode.Create(1);
2890 phy.SetChannel(channel.Create());
2894 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
2898 mac.SetType(
"ns3::ApWifiMac");
2899 apDevice = wifi.Install(phy, mac, wifiApNode);
2902 mac.SetType(
"ns3::StaWifiMac");
2903 staDevice = wifi.Install(phy, mac, wifiStaNode);
2911 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2912 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2913 mobility.SetPositionAllocator(positionAlloc);
2915 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2916 mobility.Install(wifiApNode);
2917 mobility.Install(wifiStaNode);
2919 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
2928 staDevice.
Get(0)->GetAddress(),
2937 staDevice.
Get(0)->GetAddress(),
2966 void DoRun()
override;
3004 :
TestCase(
"Test case for use of channel bonding with Ideal rate manager")
3015 Config::Set(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelSettings",
3016 StringValue(
"{0, " + std::to_string(
static_cast<uint16_t
>(channelWidth)) +
3017 ", BAND_5GHZ, 0}"));
3024 sourceDevice->Send(packet, destination, 0);
3033 if (psduMap.begin()->second->GetSize() >= 1000)
3044 "Last selected WifiMode "
3045 <<
m_txMode <<
" does not match expected WifiMode " << expectedMode);
3053 int64_t streamNumber = 100;
3057 wifiApNode.Create(1);
3062 phy.SetChannel(channel.Create());
3066 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
3070 mac.SetType(
"ns3::ApWifiMac");
3071 apDevice = wifi.Install(phy, mac, wifiApNode);
3074 mac.SetType(
"ns3::StaWifiMac");
3075 staDevice = wifi.Install(phy, mac, wifiStaNode);
3083 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3084 positionAlloc->Add(Vector(50.0, 0.0, 0.0));
3085 mobility.SetPositionAllocator(positionAlloc);
3087 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3088 mobility.Install(wifiApNode);
3089 mobility.Install(wifiStaNode);
3091 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
3103 staDevice.
Get(0)->GetAddress());
3119 staDevice.
Get(0)->GetAddress());
3135 staDevice.
Get(0)->GetAddress());
3162 void DoRun()
override;
3211 :
TestCase(
"Test case for use of imbalanced MIMO settings with Ideal rate manager")
3222 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/Antennas",
3224 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
3226 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
3233 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/Antennas",
3235 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
3237 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
3245 sourceDevice->Send(packet, destination, 0);
3254 if (psdus.begin()->second->GetSize() >= 1000)
3266 <<
" does not match expected Nss " << expectedNss);
3274 "Last selected WifiMode " <<
m_txVector.GetMode()
3275 <<
" does not match expected WifiMode "
3284 int64_t streamNumber = 100;
3288 wifiApNode.Create(1);
3293 phy.SetChannel(channel.Create());
3297 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
3301 mac.SetType(
"ns3::ApWifiMac");
3302 apDevice = wifi.Install(phy, mac, wifiApNode);
3305 mac.SetType(
"ns3::StaWifiMac");
3306 staDevice = wifi.Install(phy, mac, wifiStaNode);
3314 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3315 positionAlloc->Add(Vector(40.0, 0.0, 0.0));
3316 mobility.SetPositionAllocator(positionAlloc);
3318 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3319 mobility.Install(wifiApNode);
3320 mobility.Install(wifiStaNode);
3322 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
3334 staDevice.
Get(0)->GetAddress());
3339 staDevice.
Get(0)->GetAddress());
3357 staDevice.
Get(0)->GetAddress());
3362 staDevice.
Get(0)->GetAddress());
3381 staDevice.
Get(0)->GetAddress());
3386 staDevice.
Get(0)->GetAddress());
3404 staDevice.
Get(0)->GetAddress());
3409 staDevice.
Get(0)->GetAddress());
3428 staDevice.
Get(0)->GetAddress());
3433 staDevice.
Get(0)->GetAddress());
3453 staDevice.
Get(0)->GetAddress());
3458 staDevice.
Get(0)->GetAddress());
3476 staDevice.
Get(0)->GetAddress());
3481 staDevice.
Get(0)->GetAddress());
3500 staDevice.
Get(0)->GetAddress());
3505 staDevice.
Get(0)->GetAddress());
3525 staDevice.
Get(0)->GetAddress());
3530 staDevice.
Get(0)->GetAddress());
3547 staDevice.
Get(0)->GetAddress());
3586 uint16_t expectedDataRate);
3587 void DoRun()
override;
3591 :
TestCase(
"Check data rates for different RU types.")
3600 uint16_t expectedDataRate)
3614 txVector.SetMode(mode, staId);
3615 txVector.SetNss(nss, staId);
3617 txVector.SetRu(ru, staId);
3618 uint64_t dataRate = round(mode.GetDataRate(txVector, staId) / 100000.0);
3620 if (
static_cast<uint16_t
>(dataRate) != expectedDataRate)
3622 std::cerr <<
"RU=" << ruType <<
" mode=" << mode <<
" Nss=" << +nss
3623 <<
" guardInterval=" << guardInterval <<
" expected=" << expectedDataRate
3625 <<
" computed=" <<
static_cast<uint16_t
>(dataRate) <<
" x100kbps" << std::endl;
3653 "26-tone RU data rate verification for different MCSs, GIs, and Nss's failed");
3665 "Data rate verification for RUs above 52-tone RU (included) failed");
3670 std::tuple<SupportedRates, std::optional<ExtendedSupportedRatesIE>, std::vector<Ssid>>;
3704 .SetGroupName(
"Wifi")
3728 void DoRun()
override;
3754 "Expected a SupportedRates IE to be included");
3757 "Expected no ExtendedSupportedRatesIE to be included");
3774 "Expected a SupportedRates IE to be included");
3777 "Expected an ExtendedSupportedRatesIE to be included");
3783 Ssid one(
"Ssid One");
3784 frame.Get<
Ssid>().push_back(one);
3788 "Expected a SupportedRates IE to be included");
3791 "Expected an ExtendedSupportedRatesIE to be included");
3800 frame.Get<
Ssid>().emplace_back(
"Ssid Two");
3804 "Expected a SupportedRates IE to be included");
3807 "Expected an ExtendedSupportedRatesIE to be included");
3811 "Incorrect first SSID");
3814 "Incorrect second SSID");
3832 void DoRun()
override;
3846 :
TestCase(
"Test case for Bug 730"),
3866 wifiApNode.Create(1);
3870 phy.SetChannel(channel.Create());
3874 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
3881 auto ssid =
Ssid(
"ns-3-ssid");
3885 staDevices = wifi.Install(phy, mac, wifiStaNode);
3890 apDevices = wifi.Install(phy, mac, wifiApNode);
3891 auto apRemoteStationManager = apDevices.Get(0)
3893 ->GetRemoteStationManager()
3900 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3901 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
3902 mobility.SetPositionAllocator(positionAlloc);
3904 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3905 mobility.Install(wifiApNode);
3906 mobility.Install(wifiStaNode);
3918 packetSocket.
Install(wifiStaNode);
3919 packetSocket.
Install(wifiApNode);
3924 client->SetRemote(socket);
3926 client->SetStartTime(
Seconds(1));
3927 client->SetStopTime(
Seconds(4.5));
3930 server->SetLocal(socket);
3931 wifiApNode.Get(0)->AddApplication(server);
3932 server->SetStartTime(
Seconds(0));
3933 server->SetStopTime(
Seconds(4.5));
3935 Config::Connect(
"/NodeList/1/ApplicationList/0/$ns3::PacketSocketServer/Rx",
3943 "/NodeList/0/DeviceList/0/RemoteStationManager/$ns3::ConstantRateWifiManager/DataMode",
3948 "/NodeList/0/DeviceList/0/RemoteStationManager/$ns3::ConstantRateWifiManager/DataMode",
3953 "/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.
Time m_2ndPktSetStart
time the second set of packets is generated
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 unsuccessfully 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
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.
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 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.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
Received power (W) per spectrum band.
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.
TestCase(const TestCase &)=delete
Caller graph was not generated because of its size.
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
static WifiMode GetVhtMcs3()
static WifiMode GetVhtMcs1()
static WifiMode GetVhtMcs2()
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.
WifiChannelConfig::SegmentWithoutUnits ChannelTuple
kept for backward compatibility, can be deprecated when using strong types
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.
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.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
void 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.
WifiModulationClass
This enumeration defines the modulation classes per (Table 10-6 "Modulation classes"; IEEE 802....
bool QosUtilsIsOldPacket(uint16_t startingSeq, uint16_t seqNumber)
This function checks if packet with sequence number seqNumber is an "old" packet.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17).
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22).
@ NORMAL_MPDU
The MPDU is not part of an A-MPDU.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< void, Ptr< const WifiPsdu > > RxErrorCallback
Callback if PSDU unsuccessfully received.
static constexpr uint8_t WIFI_MIN_TX_PWR_LEVEL
minimum TX power level value
RuType
The different Resource Unit (RU) types.
double MHz_u
MHz weak type.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
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.