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/waypoint-mobility-model.h" 59 int64_t currentStream = stream;
97 virtual void DoRun (
void);
139 mac->SetDevice (dev);
144 phy->SetErrorRateModel (error);
146 phy->SetDevice (dev);
152 mac->SetAddress (Mac48Address::Allocate ());
155 dev->SetRemoteStationManager (manager);
167 channel->SetPropagationDelayModel (propDelay);
168 channel->SetPropagationLossModel (propLoss);
174 Simulator::Stop (
Seconds (10.0));
177 Simulator::Destroy ();
254 virtual void DoRun (
void);
282 :
TestCase (
"InterferenceHelperSequence")
307 mac->SetDevice (dev);
312 phy->SetErrorRateModel (error);
314 phy->SetDevice (dev);
321 mac->SetAddress (Mac48Address::Allocate ());
324 dev->SetRemoteStationManager (manager);
340 channel->SetPropagationDelayModel (propDelay);
341 channel->SetPropagationLossModel (propLoss);
348 propLoss->SetDefaultLoss (999);
350 Simulator::Schedule (
Seconds (1.0),
352 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
354 Simulator::Schedule (
Seconds (1.0000001),
356 DynamicCast<WifiNetDevice> (rxOnly->
GetDevice (0)));
358 Simulator::Schedule (
Seconds (5.0),
360 DynamicCast<WifiNetDevice> (senderA->
GetDevice (0)));
362 Simulator::Schedule (
Seconds (7.0),
364 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
366 Simulator::Stop (
Seconds (100.0));
369 Simulator::Destroy ();
429 virtual void DoRun (
void);
456 :
TestCase (
"Test case for DCF immediate access with broadcast frames")
490 RngSeedManager::SetSeed (1);
491 RngSeedManager::SetRun (40);
496 channel->SetPropagationDelayModel (propDelay);
497 channel->SetPropagationLossModel (propLoss);
499 Ptr<Node> txNode = CreateObject<Node> ();
513 txPhy->SetErrorRateModel (txError);
515 txPhy->SetDevice (txDev);
516 txPhy->SetMobility (txMobility);
523 txMac->SetAddress (Mac48Address::Allocate ());
524 txDev->SetMac (txMac);
525 txDev->SetPhy (txPhy);
536 Simulator::Stop (
Seconds (2.0));
538 Simulator::Destroy ();
548 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
549 Time expectedSecondTransmissionTime = expectedFirstTransmissionTime +
MicroSeconds (expectedWait1);
575 virtual void DoRun (
void);
592 :
TestCase (
"Test case for Bug 730"),
628 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
634 mac.SetType (
"ns3::StaWifiMac",
641 mac.SetType (
"ns3::ApWifiMac",
651 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
652 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
653 mobility.SetPositionAllocator (positionAlloc);
655 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
664 socket.SetPhysicalAddress (ap_device->
GetAddress ());
665 socket.SetProtocol (1);
669 packetSocket.
Install (wifiStaNode);
687 Simulator::Schedule (
Seconds (10.0),
Config::Set,
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"800"));
689 Simulator::Stop (
Seconds (55));
692 Simulator::Destroy ();
695 NS_TEST_ASSERT_MSG_EQ (result,
true,
"packet reception unexpectedly stopped after adapting fragmentation threshold!");
712 virtual void DoRun (
void);
737 :
TestCase (
"Test case for fragmentation with QoS stations"),
783 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
788 mac.SetType (
"ns3::StaWifiMac",
795 mac.SetType (
"ns3::ApWifiMac",
805 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
806 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
807 mobility.SetPositionAllocator (positionAlloc);
809 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
820 sta_mac->GetAttribute (
"BE_Txop", ptr);
825 socket.SetPhysicalAddress (ap_device->
GetAddress ());
826 socket.SetProtocol (1);
830 packetSocket.
Install (wifiStaNode);
849 Config::Set (
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"400"));
855 Simulator::Destroy ();
872 virtual void DoRun (
void);
886 :
TestCase (
"Test case for setting WifiPhy channel and frequency")
912 ssid =
Ssid (
"wifi-phy-configuration");
914 macSta.
SetType (
"ns3::StaWifiMac",
924 phySta = CreateObject<YansWifiPhy> ();
935 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
946 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
957 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
967 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
969 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
978 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
980 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
989 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
991 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1000 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1002 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (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));
1033 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1036 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1045 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1048 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1057 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1059 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1069 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1072 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1081 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1083 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1086 std::ostringstream path;
1087 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber";
1096 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1098 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1101 std::ostringstream path;
1102 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth";
1113 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1115 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1119 std::ostringstream path;
1120 path <<
"/NodeList/*/DeviceList/" << staDevice.
Get(0)->GetIfIndex () <<
"/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth";
1131 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1135 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1146 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1148 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1161 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1163 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1173 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1176 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1201 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1204 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1238 Simulator::Destroy ();
1255 virtual void DoRun (
void);
1272 :
TestCase (
"Test case for Bug 2222"),
1273 m_countInternalCollisions (0)
1295 RngSeedManager::SetSeed (1);
1296 RngSeedManager::SetRun (16);
1297 int64_t streamNumber = 100;
1307 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1312 mac.SetType (
"ns3::AdhocWifiMac",
1316 wifiDevices =
wifi.Install (
phy,
mac, wifiNodes);
1319 wifi.AssignStreams (wifiDevices, streamNumber);
1324 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1325 positionAlloc->
Add (Vector (10.0, 0.0, 0.0));
1326 mobility.SetPositionAllocator (positionAlloc);
1328 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1336 socket.SetPhysicalAddress (device2->GetAddress ());
1337 socket.SetProtocol (1);
1340 packetSocket.
Install (wifiNodes);
1368 Simulator::Stop (
Seconds (1.0));
1370 Simulator::Destroy ();
1393 virtual void DoRun (
void);
1421 :
TestCase (
"Test case for Bug 2843"),
1436 double startingFreq = c->
Begin ()->fl;
1451 if (*it == tupleForCurrentTx)
1466 for (uint8_t i = 0; i < numPackets; i++)
1469 sourceDevice->
Send (pkt, destination, 0);
1476 uint16_t channelWidth = 40;
1487 lossModel->SetFrequency (5.180e9);
1491 = CreateObject<ConstantSpeedPropagationDelayModel> ();
1503 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1509 mac.SetType (
"ns3::StaWifiMac");
1511 staDevice =
wifi.Install (spectrumPhy,
mac, wifiStaNode);
1513 mac.SetType (
"ns3::ApWifiMac");
1519 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1520 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
1521 mobility.SetPositionAllocator (positionAlloc);
1523 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1533 Simulator::Stop (
Seconds (0.8));
1536 Simulator::Destroy ();
1569 virtual void DoRun (
void);
1593 :
TestCase (
"Test case for Bug 2831"),
1594 m_reassocReqCount (0),
1595 m_reassocRespCount (0),
1596 m_countOperationalChannelWidth20 (0),
1597 m_countOperationalChannelWidth40 (0)
1649 propDelay.
SetTypeId (
"ns3::ConstantSpeedPropagationDelayModel");
1652 channel->SetPropagationDelayModel (propagationDelay);
1653 channel->SetPropagationLossModel (propagationLoss);
1655 Ptr<Node> apNode = CreateObject<Node> ();
1658 apDev->SetHtConfiguration (apHtConfiguration);
1660 mac.SetTypeId (
"ns3::ApWifiMac");
1666 Ptr<Node> staNode = CreateObject<Node> ();
1669 staDev->SetHtConfiguration (staHtConfiguration);
1670 mac.SetTypeId (
"ns3::StaWifiMac");
1680 m_apPhy = CreateObject<YansWifiPhy> ();
1690 staMobility->
SetPosition (Vector (1.0, 0.0, 0.0));
1693 m_staPhy = CreateObject<YansWifiPhy> ();
1702 apMac->
SetAddress (Mac48Address::Allocate ());
1703 apDev->SetMac (apMac);
1706 manager.
SetTypeId (
"ns3::ConstantRateWifiManager");
1710 staMac->
SetAddress (Mac48Address::Allocate ());
1711 staDev->SetMac (staMac);
1720 Simulator::Stop (
Seconds (3.0));
1722 Simulator::Destroy ();
1751 virtual void DoRun (
void);
1782 :
TestCase (
"Test case for StaWifiMac scanning capability")
1815 RngSeedManager::SetSeed (1);
1816 RngSeedManager::SetRun (1);
1817 int64_t streamNumber = 1;
1822 Ptr<Node> apNodeNearest = CreateObject<Node> ();
1823 Ptr<Node> staNode = CreateObject<Node> ();
1831 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager");
1835 mac.SetType (
"ns3::ApWifiMac",
1838 mac.SetType (
"ns3::ApWifiMac",
1839 "BeaconGeneration",
BooleanValue (nearestApBeaconGeneration));
1840 apDeviceNearest =
wifi.Install (
phy,
mac, apNodeNearest);
1843 mac.SetType (
"ns3::StaWifiMac",
1845 staDevice =
wifi.Install (
phy,
mac, staNode);
1848 wifi.AssignStreams (apDevice, streamNumber);
1849 wifi.AssignStreams (apDeviceNearest, streamNumber + 1);
1850 wifi.AssignStreams (staDevice, streamNumber + 2);
1854 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1855 positionAlloc->
Add (Vector (10.0, 0.0, 0.0));
1856 positionAlloc->
Add (Vector (5.0, 5.0, 0.0));
1857 positionAlloc->
Add (Vector (6.0, 5.0, 0.0));
1858 mobility.SetPositionAllocator (positionAlloc);
1860 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1877 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1881 Simulator::Stop (
Seconds (0.2));
1883 Simulator::Destroy ();
1891 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1893 Simulator::Stop (
Seconds (0.2));
1895 Simulator::Destroy ();
1903 Mac48Address secondNearestApAddr = DynamicCast<WifiNetDevice> (
nodes.Get (1)->GetDevice (0))->GetMac ()->GetAddress ();
1907 Simulator::Stop (
Seconds (1.5));
1909 Simulator::Destroy ();
1943 virtual void DoRun (
void);
1997 :
TestCase (
"Test case for Bug 2470"),
1998 m_receivedNormalMpduCount (0),
1999 m_receivedAmpduCount (0),
2000 m_failedActionCount (0),
2001 m_addbaEstablishedCount (0),
2002 m_addbaPendingCount (0),
2003 m_addbaRejectedCount (0),
2004 m_addbaNoReplyCount (0),
2005 m_addbaResetCount (0)
2018 case OriginatorBlockAckAgreement::ESTABLISHED:
2021 case OriginatorBlockAckAgreement::PENDING:
2024 case OriginatorBlockAckAgreement::REJECTED:
2027 case OriginatorBlockAckAgreement::NO_REPLY:
2030 case OriginatorBlockAckAgreement::RESET:
2071 for (uint32_t i = 0; i < numPackets; i++)
2074 sourceDevice->
Send (pkt, destination, 0);
2081 RngSeedManager::SetSeed (1);
2082 RngSeedManager::SetRun (1);
2083 int64_t streamNumber = 200;
2095 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
2101 phy.Set (
"PostReceptionErrorModel", apErrorModel);
2102 mac.SetType (
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue (
false));
2106 phy.Set (
"PostReceptionErrorModel", staErrorModel);
2107 mac.SetType (
"ns3::StaWifiMac");
2108 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2111 wifi.AssignStreams (apDevice, streamNumber);
2112 wifi.AssignStreams (staDevice, streamNumber);
2116 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
2117 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
2118 mobility.SetPositionAllocator (positionAlloc);
2120 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2133 Simulator::Stop (
Seconds (1.0));
2135 Simulator::Destroy ();
2146 std::list<uint32_t> blackList;
2148 blackList.push_back (8);
2149 blackList.push_back (9);
2150 blackList.push_back (10);
2151 blackList.push_back (11);
2152 blackList.push_back (12);
2153 blackList.push_back (13);
2185 blackList.push_back (4);
2186 blackList.push_back (5);
2187 blackList.push_back (6);
2229 virtual void DoRun (
void);
2236 void RunOne (
bool useAmpdu);
2264 :
TestCase (
"Test case for issue #40"),
2267 m_txMacFinalDataFailedCount (0)
2284 for (uint8_t i = 0; i < numPackets; i++)
2287 sourceDevice->
Send (pkt, destination, 0);
2305 RngSeedManager::SetSeed (1);
2306 RngSeedManager::SetRun (1);
2307 int64_t streamNumber = 100;
2319 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2323 mac.SetType (
"ns3::ApWifiMac");
2327 mac.SetType (
"ns3::StaWifiMac");
2328 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2331 wifi.AssignStreams (apDevice, streamNumber);
2332 wifi.AssignStreams (staDevice, streamNumber);
2336 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
2337 positionAlloc->
Add (Vector (10.0, 0.0, 0.0));
2338 mobility.SetPositionAllocator (positionAlloc);
2340 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2343 mobility.SetMobilityModel(
"ns3::WaypointMobilityModel");
2360 ap_mac->GetAttribute (
"BE_Txop", ptr);
2377 Simulator::Stop (
Seconds (3.0));
2384 Simulator::Destroy ();
2415 virtual void DoRun (
void);
2438 :
TestCase (
"Test case for issue #169")
2451 for (uint8_t i = 0; i < numPackets; i++)
2455 sourceDevice->
Send (packet, destination, 0);
2471 RngSeedManager::SetSeed (1);
2472 RngSeedManager::SetRun (1);
2473 int64_t streamNumber = 100;
2485 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2489 mac.SetType (
"ns3::ApWifiMac");
2493 mac.SetType (
"ns3::StaWifiMac");
2494 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2497 wifi.AssignStreams (apDevice, streamNumber);
2498 wifi.AssignStreams (staDevice, streamNumber);
2502 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
2503 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
2504 mobility.SetPositionAllocator (positionAlloc);
2506 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2518 Simulator::Stop (
Seconds (2.0));
2521 Simulator::Destroy ();
2545 virtual void DoRun (
void);
2580 :
TestCase (
"Test case for use of channel bonding with Ideal rate manager")
2598 sourceDevice->
Send (packet, destination, 0);
2619 RngSeedManager::SetSeed (1);
2620 RngSeedManager::SetRun (1);
2621 int64_t streamNumber = 100;
2633 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2637 mac.SetType (
"ns3::ApWifiMac");
2641 mac.SetType (
"ns3::StaWifiMac");
2642 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2645 wifi.AssignStreams (apDevice, streamNumber);
2646 wifi.AssignStreams (staDevice, streamNumber);
2650 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
2651 positionAlloc->
Add (Vector (50.0, 0.0, 0.0));
2652 mobility.SetPositionAllocator (positionAlloc);
2654 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2678 Simulator::Stop (
Seconds (3.2));
2681 Simulator::Destroy ();
2698 virtual void DoRun (
void);
2744 :
TestCase (
"Test case for use of imbalanced MIMO settings with Ideal rate manager")
2756 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
UintegerValue (maxStreams));
2757 Config::Set (
"/NodeList/0/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
UintegerValue (maxStreams));
2764 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedTxSpatialStreams",
UintegerValue (maxStreams));
2765 Config::Set (
"/NodeList/1/DeviceList/*/$ns3::WifiNetDevice/Phy/MaxSupportedRxSpatialStreams",
UintegerValue (maxStreams));
2772 sourceDevice->
Send (packet, destination, 0);
2799 RngSeedManager::SetSeed (1);
2800 RngSeedManager::SetRun (1);
2801 int64_t streamNumber = 100;
2813 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
2817 mac.SetType (
"ns3::ApWifiMac");
2821 mac.SetType (
"ns3::StaWifiMac");
2822 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2825 wifi.AssignStreams (apDevice, streamNumber);
2826 wifi.AssignStreams (staDevice, streamNumber);
2830 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
2831 positionAlloc->
Add (Vector (40.0, 0.0, 0.0));
2832 mobility.SetPositionAllocator (positionAlloc);
2834 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2965 Simulator::Stop (
Seconds (10.2));
2967 Simulator::Destroy ();
void TxCallback(std::string context, Ptr< const WifiPsdu > psdu, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
size_t GetNumBands() const
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void RunOne(void)
Run one function.
void Set(std::string name, const AttributeValue &v)
uint32_t AddApplication(Ptr< Application > application)
Associate an Application to this Node.
uint8_t m_countOperationalChannelWidth20
count number of beacon frames announcing a 20 MHz operating channel width
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
void SetStopTime(Time stop)
Specify application stop time.
Simulation virtual time values and global simulation resolution.
void AddbaStateChangedCallback(std::string context, Time t, Mac48Address recipient, uint8_t tid, OriginatorBlockAckAgreement::State state)
Callback when ADDBA state changed.
virtual ~Bug730TestCase()
Smart pointer class similar to boost::intrusive_ptr.
void PopulateArpCache()
Populate ARP cache function.
virtual ~QosFragmentationTestCase()
void Transmit(std::string context, Ptr< const Packet > p, double power)
Callback invoked when PHY transmits a packet.
AttributeValue implementation for Boolean.
void SetLocal(PacketSocketAddress addr)
set the local address and protocol to be used
void TxFinalDataFailedCallback(std::string context, Mac48Address address)
Transmit final data failed function.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void Receive(std::string context, Ptr< const Packet > p, const Address &adr)
Receive function.
uint32_t GetSize(void) const
Returns the the size in bytes of the packet (including the zero-filled initial payload).
void StoreDistinctTuple(std::string context, Ptr< SpectrumSignalParameters > txParams)
Stores the distinct {starting frequency, channelWidth, Number of subbands in SpectrumModel, modulation type} tuples that have been used during the testcase run.
Ptr< WifiPpdu > ppdu
The PPDU being transmitted.
Hold variables of type string.
Make sure that the ADDBA handshake process is protected.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Make it easy to create and manage PHY objects for the YANS model.
void Set(std::string path, const AttributeValue &value)
virtual void DoRun(void)
Implementation to actually run this TestCase.
void SetChannel(const Ptr< YansWifiChannel > channel)
Set the YansWifiChannel this YansWifiPhy is to be connected to.
virtual ~IdealRateManagerMimoTest()
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void AddWaypoint(const Waypoint &waypoint)
virtual void ConfigureStandardAndBand(WifiPhyStandard standard, WifiPhyBand band)
Configure the PHY-level parameters for different Wi-Fi standard.
QosFragmentationTestCase()
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Handle packet fragmentation and retransmissions for QoS data frames as well as MSDU aggregation (A-MS...
an address for a packet socket
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
uint16_t m_receivedNormalMpduCount
Count received normal MPDU packets on STA.
uint16_t m_rxCount
Count number of successfully received data packets.
void RxCallback(std::string context, Ptr< const Packet > p)
Callback triggered when a packet is received by the PHYs.
uint16_t m_receivedAmpduCount
Count received A-MPDU packets on STA.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Make sure that Ideal rate manager is able to handle non best-effort traffic.
void SetMobility(const Ptr< MobilityModel > mobility)
assign a mobility model to this device
The HT Operation Information ElementThis class knows how to serialise and deserialise the HT Operatio...
bool QosUtilsIsOldPacket(uint16_t startingSeq, uint16_t seqNumber)
This function checks if packet with sequence number seqNumber is an "old" packet. ...
virtual void DoRun(void)
Implementation to actually run this TestCase.
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.
Qos Utils Is Old Packet Test.
void AddPropagationLossModel(Ptr< PropagationLossModel > loss)
Add the single-frequency propagation loss model to be used.
virtual ~StaWifiMacScanningTestCase()
uint8_t m_reassocReqCount
count number of reassociation requests
Make sure that when changing the fragmentation threshold during the simulation, the TCP transmission ...
virtual ~Bug2843TestCase()
void AssocCallback(std::string context, Mac48Address bssid)
Callback function on STA assoc event.
virtual void ConfigureStandard(WifiStandard standard)=0
helps to create WifiNetDevice objects
Mac48Address m_associatedApBssid
Associated AP's bssid.
Make sure that Ideal rate manager recovers when the station is moving away from the access point...
InterferenceHelperSequenceTest()
represent a single transmission modeA WifiMode is implemented by a single integer which is used to lo...
Give ns3::PacketSocket powers to ns3::Node.
void SetSingleDevice(uint32_t device)
Set the address to match only a specified NetDevice.
uint32_t GetIfIndex(void) const
Address GetAddress(void) const
void RxCallback(std::string context, Ptr< const Packet > p, uint16_t channelFreqMhz, WifiTxVector txVector, MpduInfo aMpdu, SignalNoiseDbm signalNoise)
Callback when packet is received.
a polymophic address class
void SendPackets(uint8_t numPackets, Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the arrival of 1000 Byte-long packets in the source device.
uint32_t GetSize(void) const
Return the size of the PSDU in bytes.
void SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
virtual ~Issue169TestCase()
uint16_t GetChannelWidth(void) const
void CheckLastSelectedMode(WifiMode expectedMode)
Check if the selected WifiMode is correct.
uint16_t m_addbaRejectedCount
Count number of times ADDBA state machine is in rejected state.
uint16_t m_addbaEstablishedCount
Count number of times ADDBA state machine is in established state.
void SendPacket(Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the transmission of a 1000 Byte-long data packet from the source device. ...
void TurnBeaconGenerationOn(Ptr< Node > apNode)
Turn beacon generation on the AP node.
Keep track of the current position and velocity of an object.
void SetStaMimoSettings(uint8_t antennas, uint8_t maxStreams)
Change the configured MIMO settings for STA node.
The MPDU is not part of an A-MPDU.
virtual ~Bug2470TestCase()
Ptr< Node > CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Create one function.
virtual ~Bug2831TestCase()
IdealRateManagerMimoTest()
Make sure that Wifi STA is correctly associating to the best AP (i.e., nearest from STA)...
void SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
void Receive(std::string context, Ptr< const Packet > p, const Address &adr)
Receive function.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
WifiMode m_txMode
Store the last selected mode to send data packet.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
base class for all MAC-level wifi objects.
uint32_t m_countInternalCollisions
count internal collisions
void SetChannel(Ptr< SpectrumChannel > channel)
Hold an unsigned integer type.
#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.
QosUtilsIsOldPacketTest()
virtual void DoRun(void)
Implementation to actually run this TestCase.
holds a vector of ns3::NetDevice pointers
indicates whether the socket has a priority set.
void RunOne(bool useAmpdu)
Run one function.
WifiMode GetMode(void) const
calculate a propagation delay.
Address GetBroadcast(void) const
Hold together all Wifi-related objects.
uint32_t PeekHeader(Header &header) const
Deserialize but does not remove the header from the internal buffer.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Make sure that the channel width and the channel number can be changed at runtime.
uint16_t m_addbaResetCount
Count number of times ADDBA state machine is in reset state.
virtual void SetAddress(Mac48Address address)=0
hold a list of per-remote-station state.
WifiModulationClass GetModulationClass() const
void Connect(std::string path, const CallbackBase &cb)
uint32_t m_fragments
transmitted fragments
void SendPacket(Ptr< NetDevice > sourceDevice, Address &destination)
Triggers the transmission of a 1000 Byte-long data packet from the source device. ...
void SetErrorRateModel(const Ptr< ErrorRateModel > rate)
Sets the error rate model.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void SwitchCh(Ptr< WifiNetDevice > dev)
Switch channel function.
Ptr< WifiPhy > GetPhy(void) const
Bands::const_iterator Begin() const
Const Iterator to the model Bands container start.
Ptr< YansWifiPhy > m_staPhy
STA PHY.
void CheckLastSelectedMode(WifiMode expectedMode)
Check if the selected WifiMode is correct.
void TxDataFailedTrace(std::string context, Mac48Address adress)
Transmit data failed function.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void SetApMimoSettings(uint8_t antennas, uint8_t maxStreams)
Change the configured MIMO settings for AP node.
Hold objects of type Ptr<T>.
static WifiTestSuite g_wifiTestSuite
the test suite
uint16_t GetFrequency(void) const
802.11 PHY layer modelThis PHY implements a model of 802.11a.
bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)=0
IdealRateManagerChannelWidthTest()
uint32_t m_received
received packets
void SetList(const std::list< uint32_t > &packetlist)
uint16_t m_addbaPendingCount
Count number of times ADDBA state machine is in pending state.
NodeContainer Setup(bool nearestApBeaconGeneration, bool staActiveProbe)
Setup test.
virtual ~Bug2222TestCase()
Ptr< const SpectrumModel > GetSpectrumModel() const
virtual void SetChannelNumber(uint8_t id)
Set channel number.
manage and create wifi channel objects for the YANS model.
ObjectFactory m_propDelay
propagation delay
uint8_t GetChannelNumber(void) const
Return current channel number.
create MAC layers for a ns3::WifiNetDevice.
void SendOnePacket(Ptr< LrWpanPhy > sender, Ptr< LrWpanPhy > receiver)
State
Represents the state for this agreement.
void RxSuccessCallback(std::string context, Ptr< const Packet > p)
Callback when packet is successfully received.
uint8_t m_countOperationalChannelWidth40
count number of beacon frames announcing a 40 MHz operating channel width
void ChangeChannelWidth(uint16_t channelWidth)
Change the configured channel width for all nodes.
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())
Test to validate that Ideal rate manager properly selects TXVECTOR in scenarios where MIMO is used...
void SetPosition(const Vector &position)
The IEEE 802.11 SSID Information Element.
Make sure that the correct channel width and center frequency have been set for OFDM basic rate trans...
ObjectFactory m_propDelay
propagation delay
void RxErrorCallback(std::string context, Ptr< const Packet > p, double snr)
Callback when packet is dropped.
Make sure that when virtual collision occurs the wifi remote station manager is triggered and the ret...
virtual void SetType(std::string type, 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(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue(), std::string n10="", const AttributeValue &v10=EmptyAttributeValue())
std::tuple< double, uint16_t, uint32_t, WifiModulationClass > FreqWidthSubbandModulationTuple
A tuple of {starting frequency, channelWidth, Number of subbands in SpectrumModel, modulation type}.
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint16_t m_txCount
Count number of transmitted data packets.
void RunSubtest(PointerValue apErrorModel, PointerValue staErrorModel)
Run subtest for this test suite.
uint8_t GetStaChannelWidth(void) const
Return the STA channel width.
Helper class used to assign positions and mobility models to nodes.
ObjectFactory m_manager
manager
Instantiate subclasses of ns3::Object.
virtual ~IdealRateManagerChannelWidthTest()
Ptr< WifiMac > GetMac(void) const
StaWifiMacScanningTestCase()
WifiModulationClass
This enumeration defines the modulation classes per (Table 9-4 "Modulation classes"; IEEE 802...
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
void AddPacketTag(const Tag &tag) const
Add a packet tag.
void SetRemote(PacketSocketAddress addr)
set the remote address and protocol to be used
Ptr< SpectrumValue > psd
The Power Spectral Density of the waveform, in linear units.
static void AssignWifiRandomStreams(Ptr< WifiMac > mac, int64_t stream)
SignalNoiseDbm structure.
virtual void SetChannelWidth(uint16_t channelWidth)
Ptr< YansWifiPhy > m_apPhy
AP PHY.
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
Set the propagation delay model to be used.
Time Seconds(double value)
Construct a Time in the indicated unit.
AttributeValue implementation for Ssid.
ObjectFactory m_manager
manager
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.
uint32_t m_received
received
void Add(Vector v)
Add a position to the list of positions.
void TxCallback(std::string context, Ptr< const WifiPsdu > psdu, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
void SendOnePacket(Ptr< WifiNetDevice > dev)
Send one packet function.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
virtual void DoRun(void)
Implementation to actually run this TestCase.
WifiTxVector m_txVector
Store the last TXVECTOR used to transmit Data.
Make sure that Ideal rate manager properly selects MCS based on the configured channel width...
void TurnApOff(Ptr< Node > apNode)
Turn the AP node off.
uint16_t m_txMacFinalDataFailedCount
Count number of unsuccessfully transmitted data packets.
void SendOnePacket(Ptr< WifiNetDevice > dev)
Send one packet function.
void CheckLastSelectedNss(uint8_t expectedNss)
Check if the selected Nss is correct.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
SetChannelFrequencyTest()
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
uint16_t m_addbaNoReplyCount
Count number of times ADDBA state machine is in no_reply state.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
virtual ~Issue40TestCase()
uint16_t GetChannelWidth(void) const
std::vector< FreqWidthSubbandModulationTuple > m_distinctTuples
vector of distinct {starting frequency, channelWidth, Number of subbands in SpectrumModel, modulation type} tuples
void ChangeSupportedChannelWidth(void)
Function called to change the supported channel width at runtime.
void SetPriority(uint8_t priority)
Set the tag's priority.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
uint16_t m_failedActionCount
Count failed ADDBA request/response.
Ptr< YansWifiPhy > GetYansWifiPhyPtr(const NetDeviceContainer &nc) const
Get yans wifi phy function.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
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 GetAttribute(std::string name, AttributeValue &value) const
Get the value of an attribute, raising fatal errors if unsuccessful.
void SetStartTime(Time start)
Specify application start time.
#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.
Ptr< T > Copy(Ptr< T > object)
Return a deep copy of a Ptr.
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...
uint8_t m_reassocRespCount
count number of reassociation responses
void CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Create one function.
uint8_t GetNss(void) const
void TxCallback(std::string context, Ptr< const WifiPsdu > psdu, WifiTxVector txVector, double txPowerW)
Callback that indicates a PSDU is being transmitted.
Make sure that fragmentation works with QoS stations.
uint16_t m_channelWidth
channel width (in MHz)
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyBand band, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth)
Add a channel definition to the WifiPhy.
Set Channel Frequency Test.
Handle packet fragmentation and retransmissions for data and management frames.
Make it easy to create and manage PHY objects for the spectrum model.
virtual void DoRun(void)
Implementation to actually run this TestCase.