23#include "ns3/adhoc-wifi-mac.h"
24#include "ns3/ap-wifi-mac.h"
25#include "ns3/config.h"
26#include "ns3/constant-position-mobility-model.h"
27#include "ns3/error-model.h"
28#include "ns3/fcfs-wifi-queue-scheduler.h"
29#include "ns3/frame-exchange-manager.h"
30#include "ns3/ht-configuration.h"
31#include "ns3/interference-helper.h"
32#include "ns3/mgt-headers.h"
33#include "ns3/mobility-helper.h"
34#include "ns3/multi-model-spectrum-channel.h"
35#include "ns3/packet-socket-client.h"
36#include "ns3/packet-socket-helper.h"
37#include "ns3/packet-socket-server.h"
38#include "ns3/pointer.h"
39#include "ns3/propagation-loss-model.h"
40#include "ns3/rng-seed-manager.h"
41#include "ns3/socket.h"
42#include "ns3/spectrum-wifi-helper.h"
43#include "ns3/string.h"
45#include "ns3/vht-phy.h"
46#include "ns3/waypoint-mobility-model.h"
47#include "ns3/wifi-default-ack-manager.h"
48#include "ns3/wifi-default-assoc-manager.h"
49#include "ns3/wifi-default-protection-manager.h"
50#include "ns3/wifi-net-device.h"
51#include "ns3/wifi-ppdu.h"
52#include "ns3/wifi-psdu.h"
53#include "ns3/wifi-spectrum-signal-parameters.h"
54#include "ns3/yans-error-rate-model.h"
55#include "ns3/yans-wifi-helper.h"
56#include "ns3/yans-wifi-phy.h"
65 int64_t currentStream = stream;
67 if (!mac->GetQosSupported())
69 mac->GetAttribute(
"Txop", ptr);
71 currentStream += txop->AssignStreams(currentStream);
75 mac->GetAttribute(
"VO_Txop", ptr);
77 currentStream += vo_txop->AssignStreams(currentStream);
79 mac->GetAttribute(
"VI_Txop", ptr);
81 currentStream += vi_txop->AssignStreams(currentStream);
83 mac->GetAttribute(
"BE_Txop", ptr);
85 currentStream += be_txop->AssignStreams(currentStream);
87 mac->GetAttribute(
"BK_Txop", ptr);
89 bk_txop->AssignStreams(currentStream);
104 void DoRun()
override;
135 dev->Send(p, dev->GetBroadcast(), 1);
143 node->AddDevice(dev);
145 auto mobility = CreateObject<ConstantPositionMobilityModel>();
146 auto phy = CreateObject<YansWifiPhy>();
148 phy->SetInterferenceHelper(interferenceHelper);
149 auto error = CreateObject<YansErrorRateModel>();
150 phy->SetErrorRateModel(error);
151 phy->SetChannel(channel);
156 dev->SetRemoteStationManager(manager);
163 if (mac->GetTypeOfStation() ==
STA)
165 StaticCast<StaWifiMac>(mac)->SetAssocManager(CreateObject<WifiDefaultAssocManager>());
167 mac->SetMacQueueScheduler(CreateObject<FcfsWifiQueueScheduler>());
170 protectionManager->SetWifiMac(mac);
171 fem->SetProtectionManager(protectionManager);
173 ackManager->SetWifiMac(mac);
174 fem->SetAckManager(ackManager);
176 mobility->SetPosition(pos);
177 node->AggregateObject(mobility);
188 channel->SetPropagationDelayModel(propDelay);
189 channel->SetPropagationLossModel(propLoss);
191 CreateOne(Vector(0.0, 0.0, 0.0), channel);
192 CreateOne(Vector(5.0, 0.0, 0.0), channel);
193 CreateOne(Vector(5.0, 0.0, 0.0), channel);
251 "2047 is new in comparison to 0");
259 "0 is new in comparison to 4095");
265 "2047 is old in comparison to 4095");
269 "4095 is new in comparison to 2048");
273 "0 is new in comparison to 2049");
285 void DoRun()
override;
312 :
TestCase(
"InterferenceHelperSequence")
320 dev->Send(p, dev->GetBroadcast(), 1);
335 node->AddDevice(dev);
337 auto mobility = CreateObject<ConstantPositionMobilityModel>();
338 auto phy = CreateObject<YansWifiPhy>();
340 phy->SetInterferenceHelper(interferenceHelper);
341 auto error = CreateObject<YansErrorRateModel>();
342 phy->SetErrorRateModel(error);
343 phy->SetChannel(channel);
345 phy->SetMobility(mobility);
349 dev->SetRemoteStationManager(manager);
356 mac->SetMacQueueScheduler(CreateObject<FcfsWifiQueueScheduler>());
359 protectionManager->SetWifiMac(mac);
360 fem->SetProtectionManager(protectionManager);
362 ackManager->SetWifiMac(mac);
363 fem->SetAckManager(ackManager);
365 mobility->SetPosition(pos);
366 node->AggregateObject(mobility);
381 channel->SetPropagationDelayModel(propDelay);
382 channel->SetPropagationLossModel(propLoss);
392 propLoss->SetDefaultLoss(999);
397 DynamicCast<WifiNetDevice>(senderB->GetDevice(0)));
402 DynamicCast<WifiNetDevice>(rxOnly->GetDevice(0)));
407 DynamicCast<WifiNetDevice>(senderA->GetDevice(0)));
412 DynamicCast<WifiNetDevice>(senderB->GetDevice(0)));
476 void DoRun()
override;
502 :
TestCase(
"Test case for DCF immediate access with broadcast frames")
524 dev->Send(p, dev->GetBroadcast(), 1);
542 channel->SetPropagationDelayModel(propDelay);
543 channel->SetPropagationLossModel(propLoss);
551 txPhy->SetInterferenceHelper(txInterferenceHelper);
553 txPhy->SetErrorRateModel(txError);
554 txPhy->SetChannel(channel);
555 txPhy->SetDevice(txDev);
556 txPhy->SetMobility(txMobility);
559 txPhy->TraceConnectWithoutContext(
563 txMobility->SetPosition(Vector(0.0, 0.0, 0.0));
564 txNode->AggregateObject(txMobility);
565 txDev->SetPhy(txPhy);
567 txNode->AddDevice(txDev);
572 txDev->SetMac(txMac);
574 txMac->SetMacQueueScheduler(CreateObject<FcfsWifiQueueScheduler>());
575 auto fem = txMac->GetFrameExchangeManager();
576 auto protectionManager = CreateObject<WifiDefaultProtectionManager>();
577 protectionManager->SetWifiMac(txMac);
578 fem->SetProtectionManager(protectionManager);
579 auto ackManager = CreateObject<WifiDefaultAckManager>();
580 ackManager->SetWifiMac(txMac);
581 fem->SetAckManager(ackManager);
614 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
615 Time expectedSecondTransmissionTime =
616 expectedFirstTransmissionTime +
MicroSeconds(expectedWait1);
618 expectedFirstTransmissionTime,
619 "The first transmission time not correct!");
622 expectedSecondTransmissionTime,
623 "The second transmission time not correct!");
645 void DoRun()
override;
660 :
TestCase(
"Test case for Bug 730"),
687 wifiApNode.Create(1);
691 phy.SetChannel(channel.Create());
695 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
706 staDevices = wifi.Install(phy, mac, wifiStaNode);
711 apDevices = wifi.Install(phy, mac, wifiApNode);
716 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
717 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
718 mobility.SetPositionAllocator(positionAlloc);
720 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
721 mobility.Install(wifiApNode);
722 mobility.Install(wifiStaNode);
734 packetSocket.
Install(wifiStaNode);
735 packetSocket.
Install(wifiApNode);
739 client->SetRemote(socket);
741 client->SetStartTime(
Seconds(1));
742 client->SetStopTime(
Seconds(51.0));
745 server->SetLocal(socket);
746 wifiApNode.Get(0)->AddApplication(server);
747 server->SetStartTime(
Seconds(0.0));
748 server->SetStopTime(
Seconds(52.0));
750 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
755 "/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
767 "packet reception unexpectedly stopped after adapting fragmentation threshold!");
784 void DoRun()
override;
808 :
TestCase(
"Test case for fragmentation with QoS stations"),
821 if (p->GetSize() == 1400)
846 wifiApNode.Create(1);
850 phy.SetChannel(channel.Create());
854 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
"DataMode",
StringValue(
"HtMcs7"));
861 staDevices = wifi.Install(phy, mac, wifiStaNode);
866 apDevices = wifi.Install(phy, mac, wifiApNode);
871 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
872 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
873 mobility.SetPositionAllocator(positionAlloc);
875 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
876 mobility.Install(wifiApNode);
877 mobility.Install(wifiStaNode);
884 sta_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
889 socket.SetPhysicalAddress(ap_device->GetAddress());
890 socket.SetProtocol(1);
894 packetSocket.
Install(wifiStaNode);
895 packetSocket.
Install(wifiApNode);
900 client->SetRemote(socket);
902 client->SetStartTime(
Seconds(1));
903 client->SetStopTime(
Seconds(3.0));
906 server->SetLocal(socket);
907 wifiApNode.Get(0)->AddApplication(server);
908 server->SetStartTime(
Seconds(0.0));
909 server->SetStopTime(
Seconds(4.0));
911 Config::Connect(
"/NodeList/*/ApplicationList/0/$ns3::PacketSocketServer/Rx",
914 Config::Set(
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
939 void DoRun()
override;
951 :
TestCase(
"Test case for setting WifiPhy channel and frequency")
969 wifiApNode.Create(1);
973 phy.SetChannel(channel.Create());
977 ssid =
Ssid(
"wifi-phy-configuration");
979 macSta.
SetType(
"ns3::StaWifiMac",
991 phySta = CreateObject<YansWifiPhy>();
995 "default configuration");
1001 wifi.SetRemoteStationManager(
"ns3::ArfWifiManager");
1002 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1013 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1024 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1034 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1036 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_5GHZ, 0}"));
1037 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1042 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1047 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1049 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1058 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1060 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1070 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1071 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_2_4GHZ, 0}"));
1072 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1077 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1082 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1083 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1092 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1093 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_6GHZ, 0}"));
1094 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1099 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1104 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1106 phy.Set(
"ChannelSettings",
StringValue(
"{0, 10, BAND_5GHZ, 0}"));
1107 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1112 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1117 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1119 phy.Set(
"ChannelSettings",
StringValue(
"{0, 5, BAND_5GHZ, 0}"));
1120 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1125 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1130 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1132 phy.Set(
"ChannelSettings",
StringValue(
"{44, 20, BAND_5GHZ, 0}"));
1133 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1138 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1143 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1144 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1145 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1148 std::ostringstream path;
1149 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1150 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1155 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1160 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1161 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1162 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1165 std::ostringstream path;
1166 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1167 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1174 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1179 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1181 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1183 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{3, 20, BAND_2_4GHZ, 0}"));
1186 std::ostringstream path;
1187 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex()
1188 <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1195 phy.Set(
"ChannelSettings",
StringValue(
"{0, 0, BAND_UNSPECIFIED, 0}"));
1200 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1203 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1204 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1206 bool exceptionThrown =
false;
1209 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1211 catch (
const std::runtime_error&)
1213 exceptionThrown =
true;
1221 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1223 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1224 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1228 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{100, 0, BAND_5GHZ, 0}"));
1238 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1240 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1241 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1243 bool exceptionThrown =
false;
1248 catch (
const std::runtime_error&)
1250 exceptionThrown =
true;
1258 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1261 phy.Set(
"ChannelSettings",
StringValue(
"{44, 0, BAND_5GHZ, 0}"));
1262 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1264 bool exceptionThrown =
false;
1267 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1269 catch (
const std::runtime_error&)
1271 exceptionThrown =
true;
1275 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1280 exceptionThrown =
false;
1283 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{43, 0, BAND_5GHZ, 0}"));
1285 catch (
const std::runtime_error&)
1287 exceptionThrown =
true;
1291 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1299 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
1300 phy.Set(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1302 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1309 staDevice = wifi.Install(phy, macSta, wifiStaNode.
Get(0));
1311 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1316 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1321 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{40, 0, BAND_5GHZ, 0}"));
1326 bool exceptionThrown =
false;
1329 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{45, 0, BAND_5GHZ, 0}"));
1331 catch (
const std::runtime_error&)
1333 exceptionThrown =
true;
1335 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1341 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{36, 0, BAND_5GHZ, 0}"));
1342 exceptionThrown =
false;
1345 phySta->SetAttribute(
"ChannelSettings",
StringValue(
"{43, 0, BAND_5GHZ, 0}"));
1347 catch (
const std::runtime_error&)
1349 exceptionThrown =
true;
1375 void DoRun()
override;
1389 :
TestCase(
"Test case for Bug 2222"),
1390 m_countInternalCollisions(0)
1414 int64_t streamNumber = 100;
1421 phy.SetChannel(channel.Create());
1424 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1431 mac.SetType(
"ns3::AdhocWifiMac",
"QosSupported",
BooleanValue(
true));
1434 wifiDevices = wifi.Install(phy, mac, wifiNodes);
1437 wifi.AssignStreams(wifiDevices, streamNumber);
1442 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1443 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
1444 mobility.SetPositionAllocator(positionAlloc);
1446 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1447 mobility.Install(wifiNodes);
1458 packetSocket.
Install(wifiNodes);
1461 clientLowPriority->SetAttribute(
"PacketSize",
UintegerValue(1460));
1462 clientLowPriority->SetAttribute(
"MaxPackets",
UintegerValue(1));
1463 clientLowPriority->SetAttribute(
"Priority",
UintegerValue(4));
1464 clientLowPriority->SetRemote(socket);
1466 clientLowPriority->SetStartTime(
Seconds(0.0));
1467 clientLowPriority->SetStopTime(
Seconds(1.0));
1470 clientHighPriority->SetAttribute(
"PacketSize",
UintegerValue(1460));
1471 clientHighPriority->SetAttribute(
"MaxPackets",
UintegerValue(1));
1472 clientHighPriority->SetAttribute(
"Priority",
UintegerValue(6));
1473 clientHighPriority->SetRemote(socket);
1475 clientHighPriority->SetStartTime(
Seconds(0.0));
1476 clientHighPriority->SetStopTime(
Seconds(1.0));
1479 server->SetLocal(socket);
1481 server->SetStartTime(
Seconds(0.0));
1482 server->SetStopTime(
Seconds(1.0));
1484 Config::Connect(
"/NodeList/*/DeviceList/*/RemoteStationManager/MacTxDataFailed",
1493 "unexpected number of internal collisions!");
1514 void DoRun()
override;
1521 typedef std::tuple<double, uint16_t, uint32_t, WifiModulationClass>
1523 std::vector<FreqWidthSubbandModulationTuple>
1548 :
TestCase(
"Test case for Bug 2843"),
1562 std::size_t numBands = c->GetNumBands();
1563 double startingFreq = c->Begin()->fl;
1567 DynamicCast<WifiSpectrumSignalParameters>(txParams);
1576 std::make_tuple(startingFreq,
m_channelWidth, numBands, modulationClass);
1578 for (std::vector<FreqWidthSubbandModulationTuple>::const_iterator it =
m_distinctTuples.begin();
1582 if (*it == tupleForCurrentTx)
1598 for (uint8_t i = 0; i < numPackets; i++)
1601 sourceDevice->Send(pkt, destination, 0);
1608 uint16_t channelWidth = 40;
1614 wifiApNode.Create(1);
1619 lossModel->SetFrequency(5.190e9);
1620 spectrumChannel->AddPropagationLossModel(lossModel);
1623 CreateObject<ConstantSpeedPropagationDelayModel>();
1624 spectrumChannel->SetPropagationDelayModel(delayModel);
1628 spectrumPhy.
Set(
"ChannelSettings",
StringValue(
"{38, 40, BAND_5GHZ, 0}"));
1634 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
1643 mac.SetType(
"ns3::StaWifiMac");
1645 staDevice = wifi.Install(spectrumPhy, mac, wifiStaNode);
1647 mac.SetType(
"ns3::ApWifiMac");
1649 apDevice = wifi.Install(spectrumPhy, mac, wifiApNode);
1653 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
1654 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
1655 mobility.SetPositionAllocator(positionAlloc);
1657 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
1658 mobility.Install(wifiApNode);
1659 mobility.Install(wifiStaNode);
1667 staDevice.
Get(0)->GetAddress());
1673 staDevice.
Get(0)->GetAddress());
1675 Config::Connect(
"/ChannelList/*/$ns3::MultiModelSpectrumChannel/TxSigParams",
1689 "The starting frequency of the first tuple should be shifted 20 MHz to "
1690 "the right wrt second tuple");
1694 "First tuple's channel width should be 20 MHz");
1697 "First tuple should have 193 subbands (64+DC, 20MHz+DC, inband and 64*2 "
1698 "out-of-band, 20MHz on each side)");
1700 WifiModulationClass::WIFI_MOD_CLASS_OFDM,
1701 "First tuple should be OFDM");
1705 "Second tuple's channel width should be 40 MHz");
1708 "Second tuple should have 385 subbands (128+DC, 40MHz+DC, inband and "
1709 "128*2 out-of-band, 40MHz on each side)");
1711 WifiModulationClass::WIFI_MOD_CLASS_VHT,
1712 "Second tuple should be VHT_OFDM");
1732 void DoRun()
override;
1759 :
TestCase(
"Test case for Bug 2831"),
1761 m_assocRespCount(0),
1762 m_countOperationalChannelWidth20(0),
1763 m_countOperationalChannelWidth40(0)
1785 packet->RemoveHeader(hdr);
1797 packet->RemoveHeader(beacon);
1799 if (htOperation.has_value() && htOperation->GetStaChannelWidth() > 0)
1815 propDelay.
SetTypeId(
"ns3::ConstantSpeedPropagationDelayModel");
1818 channel->SetPropagationDelayModel(propagationDelay);
1819 channel->SetPropagationLossModel(propagationLoss);
1821 Ptr<Node> apNode = CreateObject<Node>();
1823 apNode->AddDevice(apDev);
1826 apDev->SetHtConfiguration(apHtConfiguration);
1828 manager.
SetTypeId(
"ns3::ConstantRateWifiManager");
1831 auto apMobility = CreateObject<ConstantPositionMobilityModel>();
1832 apMobility->SetPosition(Vector(0.0, 0.0, 0.0));
1833 apNode->AggregateObject(apMobility);
1835 auto error = CreateObject<YansErrorRateModel>();
1836 m_apPhy = CreateObject<YansWifiPhy>();
1848 mac.SetTypeId(
"ns3::ApWifiMac");
1852 apMac->SetDevice(apDev);
1854 apDev->SetMac(apMac);
1856 apMac->SetMacQueueScheduler(CreateObject<FcfsWifiQueueScheduler>());
1859 protectionManager->SetWifiMac(apMac);
1860 fem->SetProtectionManager(protectionManager);
1862 ackManager->SetWifiMac(apMac);
1863 fem->SetAckManager(ackManager);
1865 Ptr<Node> staNode = CreateObject<Node>();
1867 staNode->AddDevice(staDev);
1870 staDev->SetHtConfiguration(staHtConfiguration);
1874 staMobility->SetPosition(Vector(1.0, 0.0, 0.0));
1875 staNode->AggregateObject(staMobility);
1877 m_staPhy = CreateObject<YansWifiPhy>();
1888 mac.SetTypeId(
"ns3::StaWifiMac");
1889 auto staMac = mac.Create<
WifiMac>();
1890 staDev->SetMac(staMac);
1891 staMac->SetDevice(staDev);
1894 StaticCast<StaWifiMac>(staMac)->SetAssocManager(CreateObject<WifiDefaultAssocManager>());
1895 staMac->SetMacQueueScheduler(CreateObject<FcfsWifiQueueScheduler>());
1896 fem = staMac->GetFrameExchangeManager();
1897 protectionManager = CreateObject<WifiDefaultProtectionManager>();
1898 protectionManager->SetWifiMac(staMac);
1899 fem->SetProtectionManager(protectionManager);
1900 ackManager = CreateObject<WifiDefaultAckManager>();
1901 ackManager->SetWifiMac(staMac);
1902 fem->SetAckManager(ackManager);
1904 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyRxBegin",
1917 "Incorrect operational channel width before channel change");
1920 "Incorrect operational channel width after channel change");
1944 void DoRun()
override;
1975 :
TestCase(
"Test case for StaWifiMac scanning capability")
1993 Ptr<ApWifiMac> mac = DynamicCast<ApWifiMac>(netDevice->GetMac());
1994 mac->SetAttribute(
"BeaconGeneration",
BooleanValue(
true));
2010 int64_t streamNumber = 1;
2015 Ptr<Node> apNodeNearest = CreateObject<Node>();
2016 Ptr<Node> staNode = CreateObject<Node>();
2020 phy.SetChannel(channel.Create());
2024 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager");
2029 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(
true));
2030 apDevice = wifi.Install(phy, mac, apNodes);
2031 mac.SetType(
"ns3::ApWifiMac",
"BeaconGeneration",
BooleanValue(nearestApBeaconGeneration));
2032 apDeviceNearest = wifi.Install(phy, mac, apNodeNearest);
2035 mac.SetType(
"ns3::StaWifiMac",
"ActiveProbing",
BooleanValue(staActiveProbe));
2036 staDevice = wifi.Install(phy, mac, staNode);
2039 wifi.AssignStreams(apDevice, streamNumber);
2040 wifi.AssignStreams(apDeviceNearest, streamNumber + 1);
2041 wifi.AssignStreams(staDevice, streamNumber + 2);
2045 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2046 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
2047 positionAlloc->Add(Vector(5.0, 5.0, 0.0));
2048 positionAlloc->Add(Vector(6.0, 5.0, 0.0));
2049 mobility.SetPositionAllocator(positionAlloc);
2051 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2052 mobility.Install(apNodes);
2053 mobility.Install(apNodeNearest);
2054 mobility.Install(staNode);
2056 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::StaWifiMac/Assoc",
2070 DynamicCast<WifiNetDevice>(nearestAp->GetDevice(0))->GetMac()->GetAddress();
2083 "STA is associated to the wrong AP");
2090 DynamicCast<WifiNetDevice>(nearestAp->GetDevice(0))->GetMac()->GetAddress();
2098 "STA is associated to the wrong AP");
2114 secondNearestApAddr,
2115 "STA is associated to the wrong AP");
2147 void DoRun()
override;
2172 std::string context,
2189 uint16_t channelFreqMhz,
2230 :
TestCase(
"Test case for Bug 2470"),
2231 m_receivedNormalMpduCount(0),
2232 m_receivedAmpduCount(0),
2233 m_failedActionCount(0),
2234 m_addbaEstablishedCount(0),
2235 m_addbaPendingCount(0),
2236 m_addbaRejectedCount(0),
2237 m_addbaNoReplyCount(0),
2238 m_addbaResetCount(0)
2275 std::string context,
2280 auto psdu = psduMap.begin()->second;
2287 auto uid = psdu->GetPayload(0)->GetUid();
2288 rxErrorModel->SetList({uid});
2295 uint16_t channelFreqMhz,
2302 if (aMpdu.
type != MpduType::NORMAL_MPDU)
2309 packet->RemoveHeader(hdr);
2322 packet->RemoveHeader(hdr);
2334 for (
uint32_t i = 0; i < numPackets; i++)
2337 sourceDevice->Send(pkt, destination, 0);
2346 int64_t streamNumber = 200;
2350 wifiApNode.Create(1);
2355 phy.SetChannel(channel.Create());
2359 wifi.SetRemoteStationManager(
"ns3::ConstantRateWifiManager",
2367 phy.Set(
"ChannelSettings",
StringValue(
"{36, 20, BAND_5GHZ, 0}"));
2368 mac.SetType(
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue(
false));
2369 apDevice = wifi.Install(phy, mac, wifiApNode);
2372 mac.SetType(
"ns3::StaWifiMac");
2373 staDevice = wifi.Install(phy, mac, wifiStaNode);
2376 wifi.AssignStreams(apDevice, streamNumber);
2377 wifi.AssignStreams(staDevice, streamNumber);
2381 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2382 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2383 mobility.SetPositionAllocator(positionAlloc);
2385 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2386 mobility.Install(wifiApNode);
2387 mobility.Install(wifiStaNode);
2389 auto rxErrorModel = CreateObject<ListErrorModel>();
2391 switch (rcvErrorType)
2394 wifiMac = DynamicCast<WifiNetDevice>(apDevice.
Get(0))->GetMac();
2397 wifiMac = DynamicCast<WifiNetDevice>(staDevice.
Get(0))->GetMac();
2400 NS_ABORT_MSG(
"Station type " << +rcvErrorType <<
" cannot be used here");
2402 wifiMac->GetWifiPhy(0)->SetPostReceptionErrorModel(rxErrorModel);
2405 "/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/MonitorSnifferRx",
2409 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/BE_Txop/"
2410 "BlockAckManager/AgreementState",
2413 "/DeviceList/*/$ns3::WifiNetDevice/Phys/0/PhyTxPsduBegin",
2421 staDevice.
Get(0)->GetAddress());
2427 staDevice.
Get(0)->GetAddress());
2433 staDevice.
Get(0)->GetAddress());
2439 staDevice.
Get(0)->GetAddress());
2458 "Receiving incorrect number of normal MPDU packet on subtest 1");
2461 "Receiving incorrect number of A-MPDU packets on subtest 1");
2465 "Incorrect number of times the ADDBA state machine was in "
2466 "established state on subtest 1");
2470 "Incorrect number of times the ADDBA state machine was in pending state on subtest 1");
2474 "Incorrect number of times the ADDBA state machine was in rejected state on subtest 1");
2478 "Incorrect number of times the ADDBA state machine was in no_reply state on subtest 1");
2482 "Incorrect number of times the ADDBA state machine was in reset state on subtest 1");
2501 "Receiving incorrect number of normal MPDU packet on subtest 2");
2504 "Receiving incorrect number of A-MPDU packet on subtest 2");
2508 "Incorrect number of times the ADDBA state machine was in "
2509 "established state on subtest 2");
2513 "Incorrect number of times the ADDBA state machine was in pending state on subtest 2");
2517 "Incorrect number of times the ADDBA state machine was in rejected state on subtest 2");
2521 "Incorrect number of times the ADDBA state machine was in no_reply state on subtest 2");
2525 "Incorrect number of times the ADDBA state machine was in reset state on subtest 2");
2553 void DoRun()
override;
2560 void RunOne(
bool useAmpdu);
2589 :
TestCase(
"Test case for issue #40"),
2592 m_txMacFinalDataFailedCount(0)
2609 for (uint8_t i = 0; i < numPackets; i++)
2612 sourceDevice->Send(pkt, destination, 0);
2632 int64_t streamNumber = 100;
2636 wifiApNode.Create(1);
2641 phy.SetChannel(channel.Create());
2645 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
2649 mac.SetType(
"ns3::ApWifiMac");
2650 apDevice = wifi.Install(phy, mac, wifiApNode);
2653 mac.SetType(
"ns3::StaWifiMac");
2654 staDevice = wifi.Install(phy, mac, wifiStaNode);
2657 wifi.AssignStreams(apDevice, streamNumber);
2658 wifi.AssignStreams(staDevice, streamNumber);
2662 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2663 positionAlloc->Add(Vector(10.0, 0.0, 0.0));
2664 mobility.SetPositionAllocator(positionAlloc);
2666 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2667 mobility.Install(wifiApNode);
2669 mobility.SetMobilityModel(
"ns3::WaypointMobilityModel");
2670 mobility.Install(wifiStaNode);
2672 Config::Connect(
"/NodeList/*/DeviceList/*/RemoteStationManager/MacTxFinalDataFailed",
2674 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/$ns3::WifiMac/MacRx",
2679 staWaypointMobility->AddWaypoint(
Waypoint(
Seconds(1.0), Vector(10.0, 0.0, 0.0)));
2680 staWaypointMobility->AddWaypoint(
Waypoint(
Seconds(1.5), Vector(50.0, 0.0, 0.0)));
2688 ap_device->GetMac()->GetAttribute(
"BE_Txop", ptr);
2699 staDevice.
Get(0)->GetAddress());
2708 staDevice.
Get(0)->GetAddress());
2717 staDevice.
Get(0)->GetAddress());
2723 staDevice.
Get(0)->GetAddress());
2729 staDevice.
Get(0)->GetAddress());
2735 staDevice.
Get(0)->GetAddress());
2741 staDevice.
Get(0)->GetAddress());
2747 (useAmpdu ? 14 : 7),
2748 "Incorrect number of transmitted packets");
2750 (useAmpdu ? 12 : 6),
2751 "Incorrect number of successfully received packets");
2785 void DoRun()
override;
2814 :
TestCase(
"Test case for issue #169")
2830 for (uint8_t i = 0; i < numPackets; i++)
2833 packet->AddPacketTag(priorityTag);
2834 sourceDevice->Send(packet, destination, 0);
2844 if (psdus.begin()->second->GetSize() >= 1000)
2847 WifiModulationClass::WIFI_MOD_CLASS_VHT,
2848 "Ideal rate manager selected incorrect modulation class");
2857 int64_t streamNumber = 100;
2861 wifiApNode.Create(1);
2866 phy.SetChannel(channel.Create());
2870 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
2874 mac.SetType(
"ns3::ApWifiMac");
2875 apDevice = wifi.Install(phy, mac, wifiApNode);
2878 mac.SetType(
"ns3::StaWifiMac");
2879 staDevice = wifi.Install(phy, mac, wifiStaNode);
2882 wifi.AssignStreams(apDevice, streamNumber);
2883 wifi.AssignStreams(staDevice, streamNumber);
2887 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
2888 positionAlloc->Add(Vector(1.0, 0.0, 0.0));
2889 mobility.SetPositionAllocator(positionAlloc);
2891 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
2892 mobility.Install(wifiApNode);
2893 mobility.Install(wifiStaNode);
2895 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
2904 staDevice.
Get(0)->GetAddress(),
2913 staDevice.
Get(0)->GetAddress(),
2942 void DoRun()
override;
2980 :
TestCase(
"Test case for use of channel bonding with Ideal rate manager")
2991 Config::Set(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelSettings",
2992 StringValue(
"{0, " + std::to_string(channelWidth) +
", BAND_5GHZ, 0}"));
2999 sourceDevice->Send(packet, destination, 0);
3008 if (psduMap.begin()->second->GetSize() >= 1000)
3019 "Last selected WifiMode "
3020 <<
m_txMode <<
" does not match expected WifiMode " << expectedMode);
3028 int64_t streamNumber = 100;
3032 wifiApNode.Create(1);
3037 phy.SetChannel(channel.Create());
3041 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
3045 mac.SetType(
"ns3::ApWifiMac");
3046 apDevice = wifi.Install(phy, mac, wifiApNode);
3049 mac.SetType(
"ns3::StaWifiMac");
3050 staDevice = wifi.Install(phy, mac, wifiStaNode);
3053 wifi.AssignStreams(apDevice, streamNumber);
3054 wifi.AssignStreams(staDevice, streamNumber);
3058 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3059 positionAlloc->Add(Vector(50.0, 0.0, 0.0));
3060 mobility.SetPositionAllocator(positionAlloc);
3062 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3063 mobility.Install(wifiApNode);
3064 mobility.Install(wifiStaNode);
3066 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
3078 staDevice.
Get(0)->GetAddress());
3094 staDevice.
Get(0)->GetAddress());
3110 staDevice.
Get(0)->GetAddress());
3137 void DoRun()
override;
3186 :
TestCase(
"Test case for use of imbalanced MIMO settings with Ideal rate manager")
3197 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/Antennas",
3199 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
3201 Config::Set(
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
3208 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/Antennas",
3210 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
3212 Config::Set(
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
3220 sourceDevice->Send(packet, destination, 0);
3229 if (psdus.begin()->second->GetSize() >= 1000)
3241 <<
" does not match expected Nss " << expectedNss);
3250 <<
" does not match expected WifiMode "
3259 int64_t streamNumber = 100;
3263 wifiApNode.Create(1);
3268 phy.SetChannel(channel.Create());
3272 wifi.SetRemoteStationManager(
"ns3::IdealWifiManager");
3276 mac.SetType(
"ns3::ApWifiMac");
3277 apDevice = wifi.Install(phy, mac, wifiApNode);
3280 mac.SetType(
"ns3::StaWifiMac");
3281 staDevice = wifi.Install(phy, mac, wifiStaNode);
3284 wifi.AssignStreams(apDevice, streamNumber);
3285 wifi.AssignStreams(staDevice, streamNumber);
3289 positionAlloc->Add(Vector(0.0, 0.0, 0.0));
3290 positionAlloc->Add(Vector(40.0, 0.0, 0.0));
3291 mobility.SetPositionAllocator(positionAlloc);
3293 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
3294 mobility.Install(wifiApNode);
3295 mobility.Install(wifiStaNode);
3297 Config::Connect(
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::WifiPhy/PhyTxPsduBegin",
3309 staDevice.
Get(0)->GetAddress());
3314 staDevice.
Get(0)->GetAddress());
3332 staDevice.
Get(0)->GetAddress());
3337 staDevice.
Get(0)->GetAddress());
3356 staDevice.
Get(0)->GetAddress());
3361 staDevice.
Get(0)->GetAddress());
3379 staDevice.
Get(0)->GetAddress());
3384 staDevice.
Get(0)->GetAddress());
3403 staDevice.
Get(0)->GetAddress());
3408 staDevice.
Get(0)->GetAddress());
3428 staDevice.
Get(0)->GetAddress());
3433 staDevice.
Get(0)->GetAddress());
3451 staDevice.
Get(0)->GetAddress());
3456 staDevice.
Get(0)->GetAddress());
3475 staDevice.
Get(0)->GetAddress());
3480 staDevice.
Get(0)->GetAddress());
3500 staDevice.
Get(0)->GetAddress());
3505 staDevice.
Get(0)->GetAddress());
3522 staDevice.
Get(0)->GetAddress());
3560 uint16_t guardInterval,
3561 uint16_t expectedDataRate);
3562 void DoRun()
override;
3566 :
TestCase(
"Check data rates for different RU types.")
3574 uint16_t guardInterval,
3575 uint16_t expectedDataRate)
3579 uint64_t dataRate = round(mode.
GetDataRate(approxWidth, guardInterval, nss) / 100000.0);
3581 if (
static_cast<uint16_t
>(dataRate) != expectedDataRate)
3583 std::cerr <<
"RU=" << ruType <<
" mode=" << mode <<
" Nss=" << +nss
3584 <<
" guardInterval=" << guardInterval <<
" expected=" << expectedDataRate
3586 <<
" computed=" <<
static_cast<uint16_t
>(dataRate) <<
" x100kbps" << std::endl;
3614 "26-tone RU data rate verification for different MCSs, GIs, and Nss's failed");
3626 "Data rate verification for RUs above 52-tone RU (included) failed");
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.
uint16_t m_channelWidth
channel width (in MHz)
~Bug2843TestCase() override
std::tuple< double, uint16_t, uint32_t, WifiModulationClass > FreqWidthSubbandModulationTuple
A tuple of {starting frequency, channelWidth, Number of subbands in SpectrumModel,...
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
Data rate verification test for MCSs of different RU sizes.
HeRuMcsDataRateTestCase()
bool CheckDataRate(HeRu::RuType ruType, std::string mcs, uint8_t nss, uint16_t 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.
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.
void ChangeChannelWidth(uint16_t channelWidth)
Change the configured channel width for all nodes.
~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.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static uint16_t GetBandwidth(RuType ruType)
Get the approximate bandwidth occupied by a RU.
RuType
The different HE Resource Unit (RU) types.
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.
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.
Hold objects of type Ptr<T>.
calculate a propagation delay.
Smart pointer class similar to boost::intrusive_ptr.
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
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(Ptr< SpectrumChannel > channel)
The IEEE 802.11 SSID Information Element.
AttributeValue implementation for Ssid.
Hold variables of type string.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
Handle packet fragmentation and retransmissions for data and management frames.
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
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
uint64_t GetDataRate(uint16_t channelWidth, uint16_t guardInterval, uint8_t nss) 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.
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
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.
uint16_t 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.
#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 Seconds(double value)
Construct a Time in the indicated unit.
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.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
TypeOfStation
Enumeration for type of station.
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...
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
MpduType type
type of MPDU
SignalNoiseDbm structure.
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
static WifiTestSuite g_wifiTestSuite
the test suite