24 #include "ns3/string.h"
25 #include "ns3/yans-wifi-helper.h"
26 #include "ns3/mobility-helper.h"
27 #include "ns3/wifi-net-device.h"
28 #include "ns3/adhoc-wifi-mac.h"
29 #include "ns3/ap-wifi-mac.h"
30 #include "ns3/propagation-loss-model.h"
31 #include "ns3/interference-helper.h"
32 #include "ns3/yans-error-rate-model.h"
33 #include "ns3/constant-position-mobility-model.h"
35 #include "ns3/pointer.h"
36 #include "ns3/rng-seed-manager.h"
37 #include "ns3/config.h"
38 #include "ns3/error-model.h"
39 #include "ns3/socket.h"
40 #include "ns3/packet-socket-server.h"
41 #include "ns3/packet-socket-client.h"
42 #include "ns3/packet-socket-helper.h"
43 #include "ns3/spectrum-wifi-helper.h"
44 #include "ns3/multi-model-spectrum-channel.h"
45 #include "ns3/wifi-spectrum-signal-parameters.h"
46 #include "ns3/yans-wifi-phy.h"
47 #include "ns3/mgt-headers.h"
48 #include "ns3/ht-configuration.h"
49 #include "ns3/wifi-ppdu.h"
50 #include "ns3/wifi-psdu.h"
51 #include "ns3/vht-phy.h"
52 #include "ns3/waypoint-mobility-model.h"
53 #include "ns3/frame-exchange-manager.h"
54 #include "ns3/wifi-default-protection-manager.h"
55 #include "ns3/wifi-default-ack-manager.h"
64 int64_t currentStream = stream;
66 if (!
mac->GetQosSupported ())
68 mac->GetAttribute (
"Txop", ptr);
74 mac->GetAttribute (
"VO_Txop", ptr);
78 mac->GetAttribute (
"VI_Txop", ptr);
82 mac->GetAttribute (
"BE_Txop", ptr);
86 mac->GetAttribute (
"BK_Txop", ptr);
103 void DoRun (
void)
override;
145 mac->SetDevice (dev);
146 mac->SetAddress (Mac48Address::Allocate ());
150 protectionManager->SetWifiMac (
mac);
151 fem->SetProtectionManager (protectionManager);
153 ackManager->SetWifiMac (
mac);
154 fem->SetAckManager (ackManager);
159 phy->SetInterferenceHelper (interferenceHelper);
161 phy->SetErrorRateModel (error);
163 phy->SetDevice (dev);
183 channel->SetPropagationDelayModel (propDelay);
184 channel->SetPropagationLossModel (propLoss);
190 Simulator::Stop (
Seconds (10.0));
193 Simulator::Destroy ();
270 void DoRun (
void)
override;
298 :
TestCase (
"InterferenceHelperSequence")
323 mac->SetDevice (dev);
324 mac->SetAddress (Mac48Address::Allocate ());
328 protectionManager->SetWifiMac (
mac);
329 fem->SetProtectionManager (protectionManager);
331 ackManager->SetWifiMac (
mac);
332 fem->SetAckManager (ackManager);
337 phy->SetInterferenceHelper (interferenceHelper);
339 phy->SetErrorRateModel (error);
341 phy->SetDevice (dev);
366 channel->SetPropagationDelayModel (propDelay);
367 channel->SetPropagationLossModel (propLoss);
374 propLoss->SetDefaultLoss (999);
376 Simulator::Schedule (
Seconds (1.0),
378 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
380 Simulator::Schedule (
Seconds (1.0000001),
382 DynamicCast<WifiNetDevice> (rxOnly->
GetDevice (0)));
384 Simulator::Schedule (
Seconds (5.0),
386 DynamicCast<WifiNetDevice> (senderA->
GetDevice (0)));
388 Simulator::Schedule (
Seconds (7.0),
390 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
392 Simulator::Stop (
Seconds (100.0));
395 Simulator::Destroy ();
454 void DoRun (
void)
override;
481 :
TestCase (
"Test case for DCF immediate access with broadcast frames")
515 RngSeedManager::SetSeed (1);
516 RngSeedManager::SetRun (40);
521 channel->SetPropagationDelayModel (propDelay);
522 channel->SetPropagationLossModel (propLoss);
524 Ptr<Node> txNode = CreateObject<Node> ();
527 txMac->SetDevice (txDev);
531 protectionManager->SetWifiMac (txMac);
532 fem->SetProtectionManager (protectionManager);
534 ackManager->SetWifiMac (txMac);
535 fem->SetAckManager (ackManager);
557 txMobility->SetPosition (Vector (0.0, 0.0, 0.0));
559 txMac->SetAddress (Mac48Address::Allocate ());
572 Simulator::Stop (
Seconds (2.0));
574 Simulator::Destroy ();
584 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
585 Time expectedSecondTransmissionTime = expectedFirstTransmissionTime +
MicroSeconds (expectedWait1);
610 void DoRun (
void)
override;
627 :
TestCase (
"Test case for Bug 730"),
663 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
669 mac.SetType (
"ns3::StaWifiMac",
676 mac.SetType (
"ns3::ApWifiMac",
686 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
687 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
688 mobility.SetPositionAllocator (positionAlloc);
690 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
704 packetSocket.
Install (wifiStaNode);
709 client->SetRemote (socket);
711 client->SetStartTime (
Seconds (1));
712 client->SetStopTime (
Seconds (51.0));
715 server->SetLocal (socket);
717 server->SetStartTime (
Seconds (0.0));
718 server->SetStopTime (
Seconds (52.0));
722 Simulator::Schedule (
Seconds (10.0),
Config::Set,
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"800"));
724 Simulator::Stop (
Seconds (55));
727 Simulator::Destroy ();
747 void DoRun (
void)
override;
772 :
TestCase (
"Test case for fragmentation with QoS stations"),
818 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
823 mac.SetType (
"ns3::StaWifiMac",
830 mac.SetType (
"ns3::ApWifiMac",
840 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
841 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
842 mobility.SetPositionAllocator (positionAlloc);
844 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
853 sta_device->
GetMac ()->GetAttribute (
"BE_Txop", ptr);
858 socket.SetPhysicalAddress (ap_device->
GetAddress ());
859 socket.SetProtocol (1);
863 packetSocket.
Install (wifiStaNode);
869 client->SetRemote (socket);
871 client->SetStartTime (
Seconds (1));
872 client->SetStopTime (
Seconds (3.0));
875 server->SetLocal (socket);
877 server->SetStartTime (
Seconds (0.0));
878 server->SetStopTime (
Seconds (4.0));
882 Config::Set (
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"400"));
888 Simulator::Destroy ();
905 void DoRun (
void)
override;
919 :
TestCase (
"Test case for setting WifiPhy channel and frequency")
945 ssid =
Ssid (
"wifi-phy-configuration");
947 macSta.
SetType (
"ns3::StaWifiMac",
957 phySta = CreateObject<YansWifiPhy> ();
965 wifi.SetRemoteStationManager (
"ns3::ArfWifiManager");
966 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
977 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
988 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
998 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1000 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_5GHZ, 0}"));
1001 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1006 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1011 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1013 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1022 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1024 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1034 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1035 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_2_4GHZ, 0}"));
1036 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1041 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1046 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1047 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1056 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1057 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_6GHZ, 0}"));
1058 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1063 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1068 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1070 phy.Set (
"ChannelSettings",
StringValue (
"{0, 10, BAND_5GHZ, 0}"));
1071 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1076 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1081 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1083 phy.Set (
"ChannelSettings",
StringValue (
"{0, 5, BAND_5GHZ, 0}"));
1084 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1089 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1094 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1096 phy.Set (
"ChannelSettings",
StringValue (
"{44, 20, BAND_5GHZ, 0}"));
1097 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1102 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1107 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1108 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1109 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1112 std::ostringstream path;
1113 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->
GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1118 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1123 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1124 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1125 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1128 std::ostringstream path;
1129 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->
GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1136 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1141 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1143 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1148 std::ostringstream path;
1149 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->
GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1156 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1161 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1164 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1165 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1167 bool exceptionThrown =
false;
1172 catch (
const std::runtime_error&)
1174 exceptionThrown =
true;
1182 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1184 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1185 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1199 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1201 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1202 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1204 bool exceptionThrown =
false;
1209 catch (
const std::runtime_error&)
1211 exceptionThrown =
true;
1219 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1222 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1223 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1225 bool exceptionThrown =
false;
1230 catch (
const std::runtime_error&)
1232 exceptionThrown =
true;
1241 exceptionThrown =
false;
1246 catch (
const std::runtime_error&)
1248 exceptionThrown =
true;
1260 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1261 phy.Set (
"ChannelSettings",
StringValue (
"{40, 0, BAND_5GHZ, 0}"));
1263 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1270 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1287 bool exceptionThrown =
false;
1292 catch (
const std::runtime_error&)
1294 exceptionThrown =
true;
1303 exceptionThrown =
false;
1308 catch (
const std::runtime_error&)
1310 exceptionThrown =
true;
1319 Simulator::Destroy ();
1336 void DoRun (
void)
override;
1351 :
TestCase (
"Test case for Bug 2222"),
1352 m_countInternalCollisions (0)
1374 RngSeedManager::SetSeed (1);
1375 RngSeedManager::SetRun (1);
1376 int64_t streamNumber = 100;
1386 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1391 mac.SetType (
"ns3::AdhocWifiMac",
1395 wifiDevices =
wifi.Install (
phy,
mac, wifiNodes);
1398 wifi.AssignStreams (wifiDevices, streamNumber);
1403 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1404 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
1405 mobility.SetPositionAllocator (positionAlloc);
1407 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1419 packetSocket.
Install (wifiNodes);
1422 clientLowPriority->SetAttribute (
"PacketSize",
UintegerValue (1460));
1423 clientLowPriority->SetAttribute (
"MaxPackets",
UintegerValue (1));
1424 clientLowPriority->SetAttribute (
"Priority",
UintegerValue (4));
1425 clientLowPriority->SetRemote (socket);
1427 clientLowPriority->SetStartTime (
Seconds (0.0));
1428 clientLowPriority->SetStopTime (
Seconds (1.0));
1431 clientHighPriority->SetAttribute (
"PacketSize",
UintegerValue (1460));
1432 clientHighPriority->SetAttribute (
"MaxPackets",
UintegerValue (1));
1433 clientHighPriority->SetAttribute (
"Priority",
UintegerValue (6));
1434 clientHighPriority->SetRemote (socket);
1436 clientHighPriority->SetStartTime (
Seconds (0.0));
1437 clientHighPriority->SetStopTime (
Seconds (1.0));
1440 server->SetLocal (socket);
1442 server->SetStartTime (
Seconds (0.0));
1443 server->SetStopTime (
Seconds (1.0));
1447 Simulator::Stop (
Seconds (1.0));
1449 Simulator::Destroy ();
1472 void DoRun (
void)
override;
1500 :
TestCase (
"Test case for Bug 2843"),
1515 double startingFreq = c->
Begin ()->fl;
1530 if (*it == tupleForCurrentTx)
1545 for (uint8_t i = 0; i < numPackets; i++)
1548 sourceDevice->
Send (pkt, destination, 0);
1555 uint16_t channelWidth = 40;
1566 lossModel->SetFrequency (5.190e9);
1567 spectrumChannel->AddPropagationLossModel (lossModel);
1570 = CreateObject<ConstantSpeedPropagationDelayModel> ();
1571 spectrumChannel->SetPropagationDelayModel (delayModel);
1575 spectrumPhy.
Set (
"ChannelSettings",
StringValue (
"{38, 40, BAND_5GHZ, 0}"));
1581 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1587 mac.SetType (
"ns3::StaWifiMac");
1589 staDevice =
wifi.Install (spectrumPhy,
mac, wifiStaNode);
1591 mac.SetType (
"ns3::ApWifiMac");
1597 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1598 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
1599 mobility.SetPositionAllocator (positionAlloc);
1601 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1611 Simulator::Stop (
Seconds (0.8));
1614 Simulator::Destroy ();
1647 void DoRun (
void)
override;
1672 :
TestCase (
"Test case for Bug 2831"),
1673 m_assocReqCount (0),
1674 m_assocRespCount (0),
1675 m_countOperationalChannelWidth20 (0),
1676 m_countOperationalChannelWidth40 (0)
1726 propDelay.
SetTypeId (
"ns3::ConstantSpeedPropagationDelayModel");
1729 channel->SetPropagationDelayModel (propagationDelay);
1730 channel->SetPropagationLossModel (propagationLoss);
1732 Ptr<Node> apNode = CreateObject<Node> ();
1738 mac.SetTypeId (
"ns3::ApWifiMac");
1742 apMac->SetDevice (apDev);
1743 apMac->SetAddress (Mac48Address::Allocate ());
1747 protectionManager->SetWifiMac (apMac);
1748 fem->SetProtectionManager (protectionManager);
1750 ackManager->SetWifiMac (apMac);
1751 fem->SetAckManager (ackManager);
1753 Ptr<Node> staNode = CreateObject<Node> ();
1758 mac.SetTypeId (
"ns3::StaWifiMac");
1760 staMac->SetDevice (staDev);
1761 staMac->SetAddress (Mac48Address::Allocate ());
1763 fem = staMac->GetFrameExchangeManager ();
1764 protectionManager = CreateObject<WifiDefaultProtectionManager> ();
1765 protectionManager->SetWifiMac (staMac);
1766 fem->SetProtectionManager (protectionManager);
1767 ackManager = CreateObject<WifiDefaultAckManager> ();
1768 ackManager->SetWifiMac (staMac);
1769 fem->SetAckManager (ackManager);
1772 apMobility->SetPosition (Vector (0.0, 0.0, 0.0));
1775 m_apPhy = CreateObject<YansWifiPhy> ();
1787 staMobility->SetPosition (Vector (1.0, 0.0, 0.0));
1790 m_staPhy = CreateObject<YansWifiPhy> ();
1804 manager.
SetTypeId (
"ns3::ConstantRateWifiManager");
1817 Simulator::Stop (
Seconds (3.0));
1819 Simulator::Destroy ();
1848 void DoRun (
void)
override;
1879 :
TestCase (
"Test case for StaWifiMac scanning capability")
1912 RngSeedManager::SetSeed (1);
1913 RngSeedManager::SetRun (1);
1914 int64_t streamNumber = 1;
1919 Ptr<Node> apNodeNearest = CreateObject<Node> ();
1920 Ptr<Node> staNode = CreateObject<Node> ();
1928 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager");
1932 mac.SetType (
"ns3::ApWifiMac",
1935 mac.SetType (
"ns3::ApWifiMac",
1936 "BeaconGeneration",
BooleanValue (nearestApBeaconGeneration));
1937 apDeviceNearest =
wifi.Install (
phy,
mac, apNodeNearest);
1940 mac.SetType (
"ns3::StaWifiMac",
1942 staDevice =
wifi.Install (
phy,
mac, staNode);
1945 wifi.AssignStreams (apDevice, streamNumber);
1946 wifi.AssignStreams (apDeviceNearest, streamNumber + 1);
1947 wifi.AssignStreams (staDevice, streamNumber + 2);
1951 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1952 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
1953 positionAlloc->Add (Vector (5.0, 5.0, 0.0));
1954 positionAlloc->Add (Vector (6.0, 5.0, 0.0));
1955 mobility.SetPositionAllocator (positionAlloc);
1957 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1974 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1978 Simulator::Stop (
Seconds (0.2));
1980 Simulator::Destroy ();
1988 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1990 Simulator::Stop (
Seconds (0.2));
1992 Simulator::Destroy ();
2000 Mac48Address secondNearestApAddr = DynamicCast<WifiNetDevice> (
nodes.Get (1)->GetDevice (0))->GetMac ()->GetAddress ();
2004 Simulator::Stop (
Seconds (1.5));
2006 Simulator::Destroy ();
2040 void DoRun (
void)
override;
2095 :
TestCase (
"Test case for Bug 2470"),
2096 m_receivedNormalMpduCount (0),
2097 m_receivedAmpduCount (0),
2098 m_failedActionCount (0),
2099 m_addbaEstablishedCount (0),
2100 m_addbaPendingCount (0),
2101 m_addbaRejectedCount (0),
2102 m_addbaNoReplyCount (0),
2103 m_addbaResetCount (0)
2116 case OriginatorBlockAckAgreement::ESTABLISHED:
2119 case OriginatorBlockAckAgreement::PENDING:
2122 case OriginatorBlockAckAgreement::REJECTED:
2125 case OriginatorBlockAckAgreement::NO_REPLY:
2128 case OriginatorBlockAckAgreement::RESET:
2169 for (uint32_t i = 0; i < numPackets; i++)
2172 sourceDevice->
Send (pkt, destination, 0);
2179 RngSeedManager::SetSeed (1);
2180 RngSeedManager::SetRun (1);
2181 int64_t streamNumber = 200;
2193 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
2199 phy.Set (
"PostReceptionErrorModel", apErrorModel);
2200 phy.Set (
"ChannelSettings",
StringValue (
"{36, 20, BAND_5GHZ, 0}"));
2201 mac.SetType (
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue (
false));
2205 phy.Set (
"PostReceptionErrorModel", staErrorModel);
2206 mac.SetType (
"ns3::StaWifiMac");
2207 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2210 wifi.AssignStreams (apDevice, streamNumber);
2211 wifi.AssignStreams (staDevice, streamNumber);
2215 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2216 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
2217 mobility.SetPositionAllocator (positionAlloc);
2219 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2232 Simulator::Stop (
Seconds (1.0));
2234 Simulator::Destroy ();
2245 std::list<uint32_t> blackList;
2247 blackList.push_back (9);
2248 blackList.push_back (10);
2249 blackList.push_back (11);
2250 blackList.push_back (12);
2251 blackList.push_back (13);
2252 blackList.push_back (14);
2253 staPem->SetList (blackList);
2284 blackList.push_back (5);
2285 blackList.push_back (6);
2286 blackList.push_back (7);
2287 blackList.push_back (9);
2288 apPem->SetList (blackList);
2328 void DoRun (
void)
override;
2335 void RunOne (
bool useAmpdu);
2363 :
TestCase (
"Test case for issue #40"),
2366 m_txMacFinalDataFailedCount (0)
2383 for (uint8_t i = 0; i < numPackets; i++)
2386 sourceDevice->
Send (pkt, destination, 0);
2404 RngSeedManager::SetSeed (1);
2405 RngSeedManager::SetRun (1);
2406 int64_t streamNumber = 100;
2418 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2422 mac.SetType (
"ns3::ApWifiMac");
2426 mac.SetType (
"ns3::StaWifiMac");
2427 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2430 wifi.AssignStreams (apDevice, streamNumber);
2431 wifi.AssignStreams (staDevice, streamNumber);
2435 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2436 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
2437 mobility.SetPositionAllocator (positionAlloc);
2439 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2442 mobility.SetMobilityModel(
"ns3::WaypointMobilityModel");
2457 ap_device->
GetMac ()->GetAttribute (
"BE_Txop", ptr);
2474 Simulator::Stop (
Seconds (3.0));
2481 Simulator::Destroy ();
2512 void DoRun (
void)
override;
2535 :
TestCase (
"Test case for issue #169")
2548 for (uint8_t i = 0; i < numPackets; i++)
2552 sourceDevice->
Send (packet, destination, 0);
2559 if (psdus.begin()->second->GetSize () >= 1000)
2568 RngSeedManager::SetSeed (1);
2569 RngSeedManager::SetRun (1);
2570 int64_t streamNumber = 100;
2582 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2586 mac.SetType (
"ns3::ApWifiMac");
2590 mac.SetType (
"ns3::StaWifiMac");
2591 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2594 wifi.AssignStreams (apDevice, streamNumber);
2595 wifi.AssignStreams (staDevice, streamNumber);
2599 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2600 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
2601 mobility.SetPositionAllocator (positionAlloc);
2603 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2615 Simulator::Stop (
Seconds (2.0));
2618 Simulator::Destroy ();
2642 void DoRun (
void)
override;
2677 :
TestCase (
"Test case for use of channel bonding with Ideal rate manager")
2688 Config::Set (
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelSettings",
2696 sourceDevice->
Send (packet, destination, 0);
2702 if (psduMap.begin ()->second->GetSize () >= 1000)
2717 RngSeedManager::SetSeed (1);
2718 RngSeedManager::SetRun (1);
2719 int64_t streamNumber = 100;
2731 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2735 mac.SetType (
"ns3::ApWifiMac");
2739 mac.SetType (
"ns3::StaWifiMac");
2740 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2743 wifi.AssignStreams (apDevice, streamNumber);
2744 wifi.AssignStreams (staDevice, streamNumber);
2748 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2749 positionAlloc->Add (Vector (50.0, 0.0, 0.0));
2750 mobility.SetPositionAllocator (positionAlloc);
2752 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2776 Simulator::Stop (
Seconds (3.2));
2779 Simulator::Destroy ();
2796 void DoRun (
void)
override;
2842 :
TestCase (
"Test case for use of imbalanced MIMO settings with Ideal rate manager")
2854 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
UintegerValue (maxStreams));
2855 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
UintegerValue (maxStreams));
2862 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
UintegerValue (maxStreams));
2863 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
UintegerValue (maxStreams));
2870 sourceDevice->
Send (packet, destination, 0);
2876 if (psdus.begin ()->second->GetSize () >= 1000)
2897 RngSeedManager::SetSeed (1);
2898 RngSeedManager::SetRun (1);
2899 int64_t streamNumber = 100;
2911 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2915 mac.SetType (
"ns3::ApWifiMac");
2919 mac.SetType (
"ns3::StaWifiMac");
2920 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2923 wifi.AssignStreams (apDevice, streamNumber);
2924 wifi.AssignStreams (staDevice, streamNumber);
2928 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2929 positionAlloc->Add (Vector (40.0, 0.0, 0.0));
2930 mobility.SetPositionAllocator (positionAlloc);
2932 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
3063 Simulator::Stop (
Seconds (10.2));
3065 Simulator::Destroy ();
3090 bool CheckDataRate (
HeRu::RuType ruType, std::string mcs, uint8_t nss, uint16_t guardInterval, uint16_t expectedDataRate);
3091 void DoRun (
void)
override;
3095 :
TestCase (
"Check data rates for different RU types.")
3102 uint16_t approxWidth = HeRu::GetBandwidth (ruType);
3104 uint64_t dataRate = round (mode.
GetDataRate (approxWidth, guardInterval, nss) / 100000.0);
3106 if (
static_cast<uint16_t
> (dataRate) != expectedDataRate)
3108 std::cerr <<
"RU=" << ruType
3111 <<
" guardInterval=" << guardInterval
3112 <<
" expected=" << expectedDataRate <<
" x100kbps"
3113 <<
" computed=" <<
static_cast<uint16_t
> (dataRate) <<
" x100kbps"
3137 &&
CheckDataRate (HeRu::RU_26_TONE,
"HeMcs10", 4, 1600, 500)
3138 &&
CheckDataRate (HeRu::RU_26_TONE,
"HeMcs11", 4, 3200, 500);
3140 NS_TEST_EXPECT_MSG_EQ (retval,
true,
"26-tone RU data rate verification for different MCSs, GIs, and Nss's failed");
3145 &&
CheckDataRate ( HeRu::RU_106_TONE,
"HeMcs9", 1, 800, 500)
3146 &&
CheckDataRate ( HeRu::RU_242_TONE,
"HeMcs5", 1, 1600, 650)
3147 &&
CheckDataRate ( HeRu::RU_484_TONE,
"HeMcs3", 1, 1600, 650)
3148 &&
CheckDataRate ( HeRu::RU_996_TONE,
"HeMcs5", 1, 3200, 2450)
3149 &&
CheckDataRate (HeRu::RU_2x996_TONE,
"HeMcs3", 1, 3200, 2450);
3151 NS_TEST_EXPECT_MSG_EQ (retval,
true,
"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...
uint32_t m_countInternalCollisions
count internal collisions
void TxDataFailedTrace(std::string context, Mac48Address adr)
Transmit data failed function.
virtual ~Bug2222TestCase()
void DoRun(void) override
Implementation to actually run this TestCase.
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.
uint16_t m_addbaResetCount
Count number of times ADDBA state machine is in reset state.
virtual ~Bug2470TestCase()
void DoRun(void) override
Implementation to actually run this TestCase.
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.
void RunSubtest(PointerValue apErrorModel, PointerValue staErrorModel)
Run subtest for this test suite.
uint16_t m_failedActionCount
Count failed ADDBA request/response.
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.
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
uint16_t m_countOperationalChannelWidth40
count number of beacon frames announcing a 40 MHz operating channel width
virtual ~Bug2831TestCase()
void DoRun(void) override
Implementation to actually run this TestCase.
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.
Ptr< YansWifiPhy > m_staPhy
STA PHY.
void ChangeSupportedChannelWidth(void)
Function called to change the supported channel width at runtime.
uint16_t m_assocRespCount
count number of association responses
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,...
void DoRun(void) override
Implementation to actually run this TestCase.
std::vector< FreqWidthSubbandModulationTuple > m_distinctTuples
vector of distinct {starting frequency, channelWidth, Number of subbands in SpectrumModel,...
uint16_t m_channelWidth
channel width (in MHz)
std::tuple< double, uint16_t, uint32_t, WifiModulationClass > FreqWidthSubbandModulationTuple
A tuple of {starting frequency, channelWidth, Number of subbands in SpectrumModel,...
virtual ~Bug2843TestCase()
Make sure that when changing the fragmentation threshold during the simulation, the TCP transmission ...
virtual ~Bug730TestCase()
void Receive(std::string context, Ptr< const Packet > p, const Address &adr)
Receive function.
void DoRun(void) override
Implementation to actually run this TestCase.
uint32_t m_received
received
Data rate verification test for MCSs of different RU sizes.
void DoRun(void) override
Implementation to actually run this TestCase.
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.
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 DoRun(void) override
Implementation to actually run this TestCase.
IdealRateManagerChannelWidthTest()
void SendPacket(Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the transmission of a 1000 Byte-long data packet from the source device.
virtual ~IdealRateManagerChannelWidthTest()
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.
Test to validate that Ideal rate manager properly selects TXVECTOR in scenarios where MIMO is used.
void CheckLastSelectedNss(uint8_t expectedNss)
Check if the selected Nss is correct.
virtual ~IdealRateManagerMimoTest()
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 DoRun(void) override
Implementation to actually run this TestCase.
void CheckLastSelectedMode(WifiMode expectedMode)
Check if the selected WifiMode is correct.
IdealRateManagerMimoTest()
void SwitchCh(Ptr< WifiNetDevice > dev)
Switch channel function.
InterferenceHelperSequenceTest()
void DoRun(void) 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
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.
void TxCallback(std::string context, WifiConstPsduMap psdus, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
virtual ~Issue169TestCase()
void DoRun(void) 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(void) override
Implementation to actually run this TestCase.
virtual ~Issue40TestCase()
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.
Make sure that fragmentation works with QoS stations.
void DoRun(void) override
Implementation to actually run this TestCase.
uint32_t m_received
received packets
QosFragmentationTestCase()
virtual ~QosFragmentationTestCase()
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(void) override
Implementation to actually run this TestCase.
QosUtilsIsOldPacketTest()
Set Channel Frequency Test.
void DoRun(void) override
Implementation to actually run this TestCase.
Ptr< YansWifiPhy > GetYansWifiPhyPtr(const NetDeviceContainer &nc) const
Get yans wifi phy function.
SetChannelFrequencyTest()
Make sure that Wifi STA is correctly associating to the best AP (i.e., nearest from STA).
void DoRun(void) 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.
virtual ~StaWifiMacScanningTestCase()
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(void)
Run one function.
void SendOnePacket(Ptr< WifiNetDevice > dev)
Send one packet function.
ObjectFactory m_manager
manager
ObjectFactory m_propDelay
propagation delay
void DoRun(void) override
Implementation to actually run this TestCase.
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'.
RuType
The different HE Resource Unit (RU) types.
The HT Operation Information Element.
uint8_t GetStaChannelWidth(void) const
Return the STA channel width.
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.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
virtual Address GetAddress(void) const =0
virtual uint32_t GetIfIndex(void) const =0
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 AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
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.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
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(void) 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(void) const
Get a pointer to the requested aggregated Object.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
State
Represents the state for this agreement.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
an address for a packet socket
void SetProtocol(uint16_t protocol)
Set the protocol.
void SetPhysicalAddress(const Address address)
Set the destination address.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
Give ns3::PacketSocket powers to ns3::Node.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
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...
indicates whether the socket has a priority set.
void SetPriority(uint8_t priority)
Set the tag's priority.
size_t GetNumBands() const
Bands::const_iterator Begin() const
Const Iterator to the model Bands container start.
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.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Hold an unsigned integer type.
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
void AddWaypoint(const Waypoint &waypoint)
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.
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 SetMac(const Ptr< WifiMac > mac)
void SetHtConfiguration(Ptr< HtConfiguration > htConfiguration)
Ptr< WifiMac > GetMac(void) const
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
Address GetAddress(void) const override
Address GetBroadcast(void) const override
Ptr< WifiPhy > GetPhy(void) const
void SetRemoteStationManager(const Ptr< WifiRemoteStationManager > manager)
uint32_t GetIfIndex(void) const override
void SetStandard(WifiStandard standard)
Set the Wifi standard.
void SetPhy(const Ptr< WifiPhy > phy)
void Set(std::string name, const AttributeValue &v)
void SetErrorRateModel(std::string type, Args &&... args)
Helper function used to set the error rate model.
uint8_t GetChannelNumber(void) const
Return current channel number.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
const WifiPhyOperatingChannel & GetOperatingChannel(void) const
Get a const reference to the operating channel.
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.
uint16_t GetChannelWidth(void) const
uint16_t GetFrequency(void) const
bool IsSet(void) const
Return true if a valid channel has been set, false otherwise.
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(void) const
manage and create wifi channel objects for the YANS model.
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_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#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.
@ 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.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
Send one packet.
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::unordered_map< uint16_t, Ptr< const WifiPsdu > > WifiConstPsduMap
Map of const PSDUs indexed by STA-ID.
std::map< WifiSpectrumBand, double > RxPowerWattPerChannelBand
A map of the received power (Watts) for each band.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
MpduType type
type of MPDU
SignalNoiseDbm structure.
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
static WifiTestSuite g_wifiTestSuite
the test suite