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/yans-error-rate-model.h"
32#include "ns3/constant-position-mobility-model.h"
34#include "ns3/pointer.h"
35#include "ns3/rng-seed-manager.h"
36#include "ns3/config.h"
37#include "ns3/error-model.h"
38#include "ns3/socket.h"
39#include "ns3/packet-socket-server.h"
40#include "ns3/packet-socket-client.h"
41#include "ns3/packet-socket-helper.h"
42#include "ns3/spectrum-wifi-helper.h"
43#include "ns3/multi-model-spectrum-channel.h"
44#include "ns3/wifi-spectrum-signal-parameters.h"
45#include "ns3/yans-wifi-phy.h"
46#include "ns3/mgt-headers.h"
47#include "ns3/ht-configuration.h"
48#include "ns3/wifi-ppdu.h"
49#include "ns3/wifi-psdu.h"
50#include "ns3/vht-phy.h"
51#include "ns3/waypoint-mobility-model.h"
52#include "ns3/frame-exchange-manager.h"
53#include "ns3/wifi-default-protection-manager.h"
54#include "ns3/wifi-default-ack-manager.h"
63 int64_t currentStream = stream;
65 if (!
mac->GetQosSupported ())
67 mac->GetAttribute (
"Txop", ptr);
73 mac->GetAttribute (
"VO_Txop", ptr);
77 mac->GetAttribute (
"VI_Txop", ptr);
81 mac->GetAttribute (
"BE_Txop", ptr);
85 mac->GetAttribute (
"BK_Txop", ptr);
102 void DoRun (
void)
override;
144 mac->SetDevice (dev);
145 mac->SetAddress (Mac48Address::Allocate ());
149 protectionManager->SetWifiMac (
mac);
150 fem->SetProtectionManager (protectionManager);
152 ackManager->SetWifiMac (
mac);
153 fem->SetAckManager (ackManager);
158 phy->SetErrorRateModel (error);
160 phy->SetDevice (dev);
180 channel->SetPropagationDelayModel (propDelay);
181 channel->SetPropagationLossModel (propLoss);
187 Simulator::Stop (
Seconds (10.0));
190 Simulator::Destroy ();
267 void DoRun (
void)
override;
295 :
TestCase (
"InterferenceHelperSequence")
320 mac->SetDevice (dev);
321 mac->SetAddress (Mac48Address::Allocate ());
325 protectionManager->SetWifiMac (
mac);
326 fem->SetProtectionManager (protectionManager);
328 ackManager->SetWifiMac (
mac);
329 fem->SetAckManager (ackManager);
334 phy->SetErrorRateModel (error);
336 phy->SetDevice (dev);
361 channel->SetPropagationDelayModel (propDelay);
362 channel->SetPropagationLossModel (propLoss);
369 propLoss->SetDefaultLoss (999);
371 Simulator::Schedule (
Seconds (1.0),
373 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
375 Simulator::Schedule (
Seconds (1.0000001),
377 DynamicCast<WifiNetDevice> (rxOnly->
GetDevice (0)));
379 Simulator::Schedule (
Seconds (5.0),
381 DynamicCast<WifiNetDevice> (senderA->
GetDevice (0)));
383 Simulator::Schedule (
Seconds (7.0),
385 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
387 Simulator::Stop (
Seconds (100.0));
390 Simulator::Destroy ();
449 void DoRun (
void)
override;
476 :
TestCase (
"Test case for DCF immediate access with broadcast frames")
510 RngSeedManager::SetSeed (1);
511 RngSeedManager::SetRun (40);
516 channel->SetPropagationDelayModel (propDelay);
517 channel->SetPropagationLossModel (propLoss);
519 Ptr<Node> txNode = CreateObject<Node> ();
522 txMac->SetDevice (txDev);
526 protectionManager->SetWifiMac (txMac);
527 fem->SetProtectionManager (protectionManager);
529 ackManager->SetWifiMac (txMac);
530 fem->SetAckManager (ackManager);
550 txMobility->SetPosition (Vector (0.0, 0.0, 0.0));
552 txMac->SetAddress (Mac48Address::Allocate ());
565 Simulator::Stop (
Seconds (2.0));
567 Simulator::Destroy ();
577 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
578 Time expectedSecondTransmissionTime = expectedFirstTransmissionTime +
MicroSeconds (expectedWait1);
603 void DoRun (
void)
override;
620 :
TestCase (
"Test case for Bug 730"),
656 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
662 mac.SetType (
"ns3::StaWifiMac",
669 mac.SetType (
"ns3::ApWifiMac",
679 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
680 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
681 mobility.SetPositionAllocator (positionAlloc);
683 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
697 packetSocket.
Install (wifiStaNode);
702 client->SetRemote (socket);
704 client->SetStartTime (
Seconds (1));
705 client->SetStopTime (
Seconds (51.0));
708 server->SetLocal (socket);
710 server->SetStartTime (
Seconds (0.0));
711 server->SetStopTime (
Seconds (52.0));
715 Simulator::Schedule (
Seconds (10.0),
Config::Set,
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"800"));
717 Simulator::Stop (
Seconds (55));
720 Simulator::Destroy ();
740 void DoRun (
void)
override;
765 :
TestCase (
"Test case for fragmentation with QoS stations"),
811 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
816 mac.SetType (
"ns3::StaWifiMac",
823 mac.SetType (
"ns3::ApWifiMac",
833 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
834 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
835 mobility.SetPositionAllocator (positionAlloc);
837 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
846 sta_device->
GetMac ()->GetAttribute (
"BE_Txop", ptr);
851 socket.SetPhysicalAddress (ap_device->
GetAddress ());
852 socket.SetProtocol (1);
856 packetSocket.
Install (wifiStaNode);
862 client->SetRemote (socket);
864 client->SetStartTime (
Seconds (1));
865 client->SetStopTime (
Seconds (3.0));
868 server->SetLocal (socket);
870 server->SetStartTime (
Seconds (0.0));
871 server->SetStopTime (
Seconds (4.0));
875 Config::Set (
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"400"));
881 Simulator::Destroy ();
898 void DoRun (
void)
override;
912 :
TestCase (
"Test case for setting WifiPhy channel and frequency")
938 ssid =
Ssid (
"wifi-phy-configuration");
940 macSta.
SetType (
"ns3::StaWifiMac",
950 phySta = CreateObject<YansWifiPhy> ();
958 wifi.SetRemoteStationManager (
"ns3::ArfWifiManager");
959 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
970 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
981 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
991 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
993 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_5GHZ, 0}"));
994 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
999 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1004 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1006 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1015 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1017 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1027 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1028 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_2_4GHZ, 0}"));
1029 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1034 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1039 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1040 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1049 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1050 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_6GHZ, 0}"));
1051 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1056 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1061 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1063 phy.Set (
"ChannelSettings",
StringValue (
"{0, 10, BAND_5GHZ, 0}"));
1064 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1069 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1074 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1076 phy.Set (
"ChannelSettings",
StringValue (
"{0, 5, BAND_5GHZ, 0}"));
1077 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1082 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1087 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1089 phy.Set (
"ChannelSettings",
StringValue (
"{44, 20, BAND_5GHZ, 0}"));
1090 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1095 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1100 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1101 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1102 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1105 std::ostringstream path;
1106 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->
GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1111 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1116 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1117 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1118 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1121 std::ostringstream path;
1122 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->
GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1129 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1134 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1136 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1141 std::ostringstream path;
1142 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->
GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelSettings";
1149 phy.Set (
"ChannelSettings",
StringValue (
"{0, 0, BAND_UNSPECIFIED, 0}"));
1154 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1157 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1158 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1160 bool exceptionThrown =
false;
1165 catch (
const std::runtime_error&)
1167 exceptionThrown =
true;
1175 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1177 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1178 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1192 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1194 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1195 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1197 bool exceptionThrown =
false;
1202 catch (
const std::runtime_error&)
1204 exceptionThrown =
true;
1212 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1215 phy.Set (
"ChannelSettings",
StringValue (
"{44, 0, BAND_5GHZ, 0}"));
1216 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1218 bool exceptionThrown =
false;
1223 catch (
const std::runtime_error&)
1225 exceptionThrown =
true;
1234 exceptionThrown =
false;
1239 catch (
const std::runtime_error&)
1241 exceptionThrown =
true;
1253 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1254 phy.Set (
"ChannelSettings",
StringValue (
"{40, 0, BAND_5GHZ, 0}"));
1256 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1263 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1280 bool exceptionThrown =
false;
1285 catch (
const std::runtime_error&)
1287 exceptionThrown =
true;
1296 exceptionThrown =
false;
1301 catch (
const std::runtime_error&)
1303 exceptionThrown =
true;
1312 Simulator::Destroy ();
1329 void DoRun (
void)
override;
1344 :
TestCase (
"Test case for Bug 2222"),
1345 m_countInternalCollisions (0)
1367 RngSeedManager::SetSeed (1);
1368 RngSeedManager::SetRun (1);
1369 int64_t streamNumber = 100;
1379 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1384 mac.SetType (
"ns3::AdhocWifiMac",
1388 wifiDevices =
wifi.Install (
phy,
mac, wifiNodes);
1391 wifi.AssignStreams (wifiDevices, streamNumber);
1396 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1397 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
1398 mobility.SetPositionAllocator (positionAlloc);
1400 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1412 packetSocket.
Install (wifiNodes);
1415 clientLowPriority->SetAttribute (
"PacketSize",
UintegerValue (1460));
1416 clientLowPriority->SetAttribute (
"MaxPackets",
UintegerValue (1));
1417 clientLowPriority->SetAttribute (
"Priority",
UintegerValue (4));
1418 clientLowPriority->SetRemote (socket);
1420 clientLowPriority->SetStartTime (
Seconds (0.0));
1421 clientLowPriority->SetStopTime (
Seconds (1.0));
1424 clientHighPriority->SetAttribute (
"PacketSize",
UintegerValue (1460));
1425 clientHighPriority->SetAttribute (
"MaxPackets",
UintegerValue (1));
1426 clientHighPriority->SetAttribute (
"Priority",
UintegerValue (6));
1427 clientHighPriority->SetRemote (socket);
1429 clientHighPriority->SetStartTime (
Seconds (0.0));
1430 clientHighPriority->SetStopTime (
Seconds (1.0));
1433 server->SetLocal (socket);
1435 server->SetStartTime (
Seconds (0.0));
1436 server->SetStopTime (
Seconds (1.0));
1440 Simulator::Stop (
Seconds (1.0));
1442 Simulator::Destroy ();
1465 void DoRun (
void)
override;
1493 :
TestCase (
"Test case for Bug 2843"),
1508 double startingFreq = c->
Begin ()->fl;
1523 if (*it == tupleForCurrentTx)
1538 for (uint8_t i = 0; i < numPackets; i++)
1541 sourceDevice->
Send (pkt, destination, 0);
1548 uint16_t channelWidth = 40;
1559 lossModel->SetFrequency (5.190e9);
1560 spectrumChannel->AddPropagationLossModel (lossModel);
1563 = CreateObject<ConstantSpeedPropagationDelayModel> ();
1564 spectrumChannel->SetPropagationDelayModel (delayModel);
1568 spectrumPhy.
Set (
"ChannelSettings",
StringValue (
"{38, 40, BAND_5GHZ, 0}"));
1574 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1580 mac.SetType (
"ns3::StaWifiMac");
1582 staDevice =
wifi.Install (spectrumPhy,
mac, wifiStaNode);
1584 mac.SetType (
"ns3::ApWifiMac");
1590 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1591 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
1592 mobility.SetPositionAllocator (positionAlloc);
1594 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1604 Simulator::Stop (
Seconds (0.8));
1607 Simulator::Destroy ();
1640 void DoRun (
void)
override;
1665 :
TestCase (
"Test case for Bug 2831"),
1666 m_assocReqCount (0),
1667 m_assocRespCount (0),
1668 m_countOperationalChannelWidth20 (0),
1669 m_countOperationalChannelWidth40 (0)
1719 propDelay.
SetTypeId (
"ns3::ConstantSpeedPropagationDelayModel");
1722 channel->SetPropagationDelayModel (propagationDelay);
1723 channel->SetPropagationLossModel (propagationLoss);
1725 Ptr<Node> apNode = CreateObject<Node> ();
1731 mac.SetTypeId (
"ns3::ApWifiMac");
1735 apMac->SetDevice (apDev);
1736 apMac->SetAddress (Mac48Address::Allocate ());
1740 protectionManager->SetWifiMac (apMac);
1741 fem->SetProtectionManager (protectionManager);
1743 ackManager->SetWifiMac (apMac);
1744 fem->SetAckManager (ackManager);
1746 Ptr<Node> staNode = CreateObject<Node> ();
1751 mac.SetTypeId (
"ns3::StaWifiMac");
1753 staMac->SetDevice (staDev);
1754 staMac->SetAddress (Mac48Address::Allocate ());
1756 fem = staMac->GetFrameExchangeManager ();
1757 protectionManager = CreateObject<WifiDefaultProtectionManager> ();
1758 protectionManager->SetWifiMac (staMac);
1759 fem->SetProtectionManager (protectionManager);
1760 ackManager = CreateObject<WifiDefaultAckManager> ();
1761 ackManager->SetWifiMac (staMac);
1762 fem->SetAckManager (ackManager);
1765 apMobility->SetPosition (Vector (0.0, 0.0, 0.0));
1769 m_apPhy = CreateObject<YansWifiPhy> ();
1778 staMobility->SetPosition (Vector (1.0, 0.0, 0.0));
1781 m_staPhy = CreateObject<YansWifiPhy> ();
1792 manager.
SetTypeId (
"ns3::ConstantRateWifiManager");
1805 Simulator::Stop (
Seconds (3.0));
1807 Simulator::Destroy ();
1836 void DoRun (
void)
override;
1867 :
TestCase (
"Test case for StaWifiMac scanning capability")
1900 RngSeedManager::SetSeed (1);
1901 RngSeedManager::SetRun (1);
1902 int64_t streamNumber = 1;
1907 Ptr<Node> apNodeNearest = CreateObject<Node> ();
1908 Ptr<Node> staNode = CreateObject<Node> ();
1916 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager");
1920 mac.SetType (
"ns3::ApWifiMac",
1923 mac.SetType (
"ns3::ApWifiMac",
1924 "BeaconGeneration",
BooleanValue (nearestApBeaconGeneration));
1925 apDeviceNearest =
wifi.Install (
phy,
mac, apNodeNearest);
1928 mac.SetType (
"ns3::StaWifiMac",
1930 staDevice =
wifi.Install (
phy,
mac, staNode);
1933 wifi.AssignStreams (apDevice, streamNumber);
1934 wifi.AssignStreams (apDeviceNearest, streamNumber + 1);
1935 wifi.AssignStreams (staDevice, streamNumber + 2);
1939 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
1940 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
1941 positionAlloc->Add (Vector (5.0, 5.0, 0.0));
1942 positionAlloc->Add (Vector (6.0, 5.0, 0.0));
1943 mobility.SetPositionAllocator (positionAlloc);
1945 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1962 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1966 Simulator::Stop (
Seconds (0.2));
1968 Simulator::Destroy ();
1976 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1978 Simulator::Stop (
Seconds (0.2));
1980 Simulator::Destroy ();
1988 Mac48Address secondNearestApAddr = DynamicCast<WifiNetDevice> (
nodes.Get (1)->GetDevice (0))->GetMac ()->GetAddress ();
1992 Simulator::Stop (
Seconds (1.5));
1994 Simulator::Destroy ();
2028 void DoRun (
void)
override;
2083 :
TestCase (
"Test case for Bug 2470"),
2084 m_receivedNormalMpduCount (0),
2085 m_receivedAmpduCount (0),
2086 m_failedActionCount (0),
2087 m_addbaEstablishedCount (0),
2088 m_addbaPendingCount (0),
2089 m_addbaRejectedCount (0),
2090 m_addbaNoReplyCount (0),
2091 m_addbaResetCount (0)
2104 case OriginatorBlockAckAgreement::ESTABLISHED:
2107 case OriginatorBlockAckAgreement::PENDING:
2110 case OriginatorBlockAckAgreement::REJECTED:
2113 case OriginatorBlockAckAgreement::NO_REPLY:
2116 case OriginatorBlockAckAgreement::RESET:
2157 for (
uint32_t i = 0; i < numPackets; i++)
2160 sourceDevice->
Send (pkt, destination, 0);
2167 RngSeedManager::SetSeed (1);
2168 RngSeedManager::SetRun (1);
2169 int64_t streamNumber = 200;
2181 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
2187 phy.Set (
"PostReceptionErrorModel", apErrorModel);
2188 phy.Set (
"ChannelSettings",
StringValue (
"{36, 20, BAND_5GHZ, 0}"));
2189 mac.SetType (
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue (
false));
2193 phy.Set (
"PostReceptionErrorModel", staErrorModel);
2194 mac.SetType (
"ns3::StaWifiMac");
2195 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2198 wifi.AssignStreams (apDevice, streamNumber);
2199 wifi.AssignStreams (staDevice, streamNumber);
2203 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2204 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
2205 mobility.SetPositionAllocator (positionAlloc);
2207 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2220 Simulator::Stop (
Seconds (1.0));
2222 Simulator::Destroy ();
2233 std::list<uint32_t> blackList;
2235 blackList.push_back (9);
2236 blackList.push_back (10);
2237 blackList.push_back (11);
2238 blackList.push_back (12);
2239 blackList.push_back (13);
2240 blackList.push_back (14);
2241 staPem->SetList (blackList);
2272 blackList.push_back (5);
2273 blackList.push_back (6);
2274 blackList.push_back (7);
2275 blackList.push_back (9);
2276 apPem->SetList (blackList);
2316 void DoRun (
void)
override;
2323 void RunOne (
bool useAmpdu);
2351 :
TestCase (
"Test case for issue #40"),
2354 m_txMacFinalDataFailedCount (0)
2371 for (uint8_t i = 0; i < numPackets; i++)
2374 sourceDevice->
Send (pkt, destination, 0);
2392 RngSeedManager::SetSeed (1);
2393 RngSeedManager::SetRun (1);
2394 int64_t streamNumber = 100;
2406 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2410 mac.SetType (
"ns3::ApWifiMac");
2414 mac.SetType (
"ns3::StaWifiMac");
2415 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2418 wifi.AssignStreams (apDevice, streamNumber);
2419 wifi.AssignStreams (staDevice, streamNumber);
2423 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2424 positionAlloc->Add (Vector (10.0, 0.0, 0.0));
2425 mobility.SetPositionAllocator (positionAlloc);
2427 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2430 mobility.SetMobilityModel(
"ns3::WaypointMobilityModel");
2445 ap_device->
GetMac ()->GetAttribute (
"BE_Txop", ptr);
2462 Simulator::Stop (
Seconds (3.0));
2469 Simulator::Destroy ();
2500 void DoRun (
void)
override;
2523 :
TestCase (
"Test case for issue #169")
2536 for (uint8_t i = 0; i < numPackets; i++)
2540 sourceDevice->
Send (packet, destination, 0);
2547 if (psdus.begin()->second->GetSize () >= 1000)
2556 RngSeedManager::SetSeed (1);
2557 RngSeedManager::SetRun (1);
2558 int64_t streamNumber = 100;
2570 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2574 mac.SetType (
"ns3::ApWifiMac");
2578 mac.SetType (
"ns3::StaWifiMac");
2579 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2582 wifi.AssignStreams (apDevice, streamNumber);
2583 wifi.AssignStreams (staDevice, streamNumber);
2587 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2588 positionAlloc->Add (Vector (1.0, 0.0, 0.0));
2589 mobility.SetPositionAllocator (positionAlloc);
2591 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2603 Simulator::Stop (
Seconds (2.0));
2606 Simulator::Destroy ();
2630 void DoRun (
void)
override;
2665 :
TestCase (
"Test case for use of channel bonding with Ideal rate manager")
2676 Config::Set (
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/ChannelSettings",
2677 StringValue (
"{0, " + std::to_string (channelWidth) +
", BAND_5GHZ, 0}"));
2684 sourceDevice->
Send (packet, destination, 0);
2690 if (psduMap.begin ()->second->GetSize () >= 1000)
2705 RngSeedManager::SetSeed (1);
2706 RngSeedManager::SetRun (1);
2707 int64_t streamNumber = 100;
2719 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2723 mac.SetType (
"ns3::ApWifiMac");
2727 mac.SetType (
"ns3::StaWifiMac");
2728 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2731 wifi.AssignStreams (apDevice, streamNumber);
2732 wifi.AssignStreams (staDevice, streamNumber);
2736 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2737 positionAlloc->Add (Vector (50.0, 0.0, 0.0));
2738 mobility.SetPositionAllocator (positionAlloc);
2740 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2764 Simulator::Stop (
Seconds (3.2));
2767 Simulator::Destroy ();
2784 void DoRun (
void)
override;
2830 :
TestCase (
"Test case for use of imbalanced MIMO settings with Ideal rate manager")
2842 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
UintegerValue (maxStreams));
2843 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
UintegerValue (maxStreams));
2850 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
UintegerValue (maxStreams));
2851 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
UintegerValue (maxStreams));
2858 sourceDevice->
Send (packet, destination, 0);
2864 if (psdus.begin ()->second->GetSize () >= 1000)
2885 RngSeedManager::SetSeed (1);
2886 RngSeedManager::SetRun (1);
2887 int64_t streamNumber = 100;
2899 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2903 mac.SetType (
"ns3::ApWifiMac");
2907 mac.SetType (
"ns3::StaWifiMac");
2908 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2911 wifi.AssignStreams (apDevice, streamNumber);
2912 wifi.AssignStreams (staDevice, streamNumber);
2916 positionAlloc->Add (Vector (0.0, 0.0, 0.0));
2917 positionAlloc->Add (Vector (40.0, 0.0, 0.0));
2918 mobility.SetPositionAllocator (positionAlloc);
2920 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
3051 Simulator::Stop (
Seconds (10.2));
3053 Simulator::Destroy ();
3078 bool CheckDataRate (
HeRu::RuType ruType, std::string mcs, uint8_t nss, uint16_t guardInterval, uint16_t expectedDataRate);
3079 void DoRun (
void)
override;
3083 :
TestCase (
"Check data rates for different RU types.")
3090 uint16_t approxWidth = HeRu::GetBandwidth (ruType);
3092 uint64_t dataRate = round (mode.
GetDataRate (approxWidth, guardInterval, nss) / 100000.0);
3094 if (
static_cast<uint16_t
> (dataRate) != expectedDataRate)
3096 std::cerr <<
"RU=" << ruType
3099 <<
" guardInterval=" << guardInterval
3100 <<
" expected=" << expectedDataRate <<
" x100kbps"
3101 <<
" computed=" <<
static_cast<uint16_t
> (dataRate) <<
" x100kbps"
3125 &&
CheckDataRate (HeRu::RU_26_TONE,
"HeMcs10", 4, 1600, 500)
3126 &&
CheckDataRate (HeRu::RU_26_TONE,
"HeMcs11", 4, 3200, 500);
3128 NS_TEST_EXPECT_MSG_EQ (retval,
true,
"26-tone RU data rate verification for different MCSs, GIs, and Nss's failed");
3133 &&
CheckDataRate ( HeRu::RU_106_TONE,
"HeMcs9", 1, 800, 500)
3134 &&
CheckDataRate ( HeRu::RU_242_TONE,
"HeMcs5", 1, 1600, 650)
3135 &&
CheckDataRate ( HeRu::RU_484_TONE,
"HeMcs3", 1, 1600, 650)
3136 &&
CheckDataRate ( HeRu::RU_996_TONE,
"HeMcs5", 1, 3200, 2450)
3137 &&
CheckDataRate (HeRu::RU_2x996_TONE,
"HeMcs3", 1, 3200, 2450);
3139 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 SetErrorRateModel(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
void Set(std::string name, const AttributeValue &v)
uint8_t GetChannelNumber(void) const
Return current channel number.
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
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
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 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.
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