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/packet-socket-server.h" 39 #include "ns3/packet-socket-client.h" 40 #include "ns3/packet-socket-helper.h" 41 #include "ns3/spectrum-wifi-helper.h" 42 #include "ns3/multi-model-spectrum-channel.h" 43 #include "ns3/wifi-spectrum-signal-parameters.h" 44 #include "ns3/wifi-phy-tag.h" 45 #include "ns3/yans-wifi-phy.h" 46 #include "ns3/mgt-headers.h" 47 #include "ns3/ht-configuration.h" 48 #include "ns3/wifi-phy-header.h" 57 int64_t currentStream = stream;
95 virtual void DoRun (
void);
137 mac->SetDevice (dev);
142 phy->SetErrorRateModel (error);
144 phy->SetDevice (dev);
150 mac->SetAddress (Mac48Address::Allocate ());
153 dev->SetRemoteStationManager (manager);
165 channel->SetPropagationDelayModel (propDelay);
166 channel->SetPropagationLossModel (propLoss);
172 Simulator::Stop (
Seconds (10.0));
175 Simulator::Destroy ();
252 virtual void DoRun (
void);
280 :
TestCase (
"InterferenceHelperSequence")
305 mac->SetDevice (dev);
310 phy->SetErrorRateModel (error);
312 phy->SetDevice (dev);
319 mac->SetAddress (Mac48Address::Allocate ());
322 dev->SetRemoteStationManager (manager);
338 channel->SetPropagationDelayModel (propDelay);
339 channel->SetPropagationLossModel (propLoss);
346 propLoss->SetDefaultLoss (999);
348 Simulator::Schedule (
Seconds (1.0),
350 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
352 Simulator::Schedule (
Seconds (1.0000001),
354 DynamicCast<WifiNetDevice> (rxOnly->
GetDevice (0)));
356 Simulator::Schedule (
Seconds (5.0),
358 DynamicCast<WifiNetDevice> (senderA->
GetDevice (0)));
360 Simulator::Schedule (
Seconds (7.0),
362 DynamicCast<WifiNetDevice> (senderB->
GetDevice (0)));
364 Simulator::Stop (
Seconds (100.0));
367 Simulator::Destroy ();
427 virtual void DoRun (
void);
454 :
TestCase (
"Test case for DCF immediate access with broadcast frames")
489 RngSeedManager::SetSeed (1);
490 RngSeedManager::SetRun (40);
495 channel->SetPropagationDelayModel (propDelay);
496 channel->SetPropagationLossModel (propLoss);
498 Ptr<Node> txNode = CreateObject<Node> ();
512 txPhy->SetErrorRateModel (txError);
514 txPhy->SetDevice (txDev);
515 txPhy->SetMobility (txMobility);
522 txMac->SetAddress (Mac48Address::Allocate ());
523 txDev->SetMac (txMac);
524 txDev->SetPhy (txPhy);
535 Simulator::Stop (
Seconds (2.0));
537 Simulator::Destroy ();
543 uint32_t expectedWait1 = 1408 + (1 * 9) + 16 + (2 * 9);
570 virtual void DoRun (
void);
587 :
TestCase (
"Test case for Bug 730"),
623 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
629 mac.SetType (
"ns3::StaWifiMac",
636 mac.SetType (
"ns3::ApWifiMac",
646 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
647 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
648 mobility.SetPositionAllocator (positionAlloc);
650 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
659 socket.SetPhysicalAddress (ap_device->
GetAddress ());
660 socket.SetProtocol (1);
664 packetSocket.
Install (wifiStaNode);
682 Simulator::Schedule (
Seconds (10.0),
Config::Set,
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"800"));
684 Simulator::Stop (
Seconds (55));
687 Simulator::Destroy ();
690 NS_TEST_ASSERT_MSG_EQ (result,
true,
"packet reception unexpectedly stopped after adapting fragmentation threshold!");
707 virtual void DoRun (
void);
732 :
TestCase (
"Test case for fragmentation with QoS stations"),
778 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
783 mac.SetType (
"ns3::StaWifiMac",
790 mac.SetType (
"ns3::ApWifiMac",
800 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
801 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
802 mobility.SetPositionAllocator (positionAlloc);
804 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
815 sta_mac->GetAttribute (
"BE_Txop", ptr);
820 socket.SetPhysicalAddress (ap_device->
GetAddress ());
821 socket.SetProtocol (1);
825 packetSocket.
Install (wifiStaNode);
844 Config::Set (
"/NodeList/0/DeviceList/0/RemoteStationManager/FragmentationThreshold",
StringValue (
"400"));
850 Simulator::Destroy ();
867 virtual void DoRun (
void);
881 :
TestCase (
"Test case for setting WifiPhy channel and frequency")
907 ssid =
Ssid (
"wifi-phy-configuration");
909 macSta.
SetType (
"ns3::StaWifiMac",
919 phySta = CreateObject<YansWifiPhy> ();
930 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
941 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
952 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
962 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
964 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
973 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
975 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
984 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
986 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
995 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
997 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1006 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1008 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1017 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1019 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1029 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1032 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1041 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1043 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1046 Config::Set (
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelNumber",
UintegerValue (40));
1054 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1056 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1059 Config::Set (
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth",
UintegerValue (40));
1069 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1071 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1075 Config::Set (
"/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/$ns3::YansWifiPhy/ChannelWidth",
UintegerValue (40));
1085 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1089 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1100 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1102 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1115 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1117 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1127 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1130 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1155 wifi.SetRemoteStationManager (
"ns3::IdealWifiManager");
1158 staDevice =
wifi.Install (
phy, macSta, wifiStaNode.
Get (0));
1192 Simulator::Destroy ();
1209 virtual void DoRun (
void);
1226 :
TestCase (
"Test case for Bug 2222"),
1227 m_countInternalCollisions (0)
1249 RngSeedManager::SetSeed (1);
1250 RngSeedManager::SetRun (2);
1251 int64_t streamNumber = 100;
1261 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1266 mac.SetType (
"ns3::AdhocWifiMac",
1270 wifiDevices =
wifi.Install (
phy,
mac, wifiNodes);
1273 wifi.AssignStreams (wifiDevices, streamNumber);
1278 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1279 positionAlloc->
Add (Vector (10.0, 0.0, 0.0));
1280 mobility.SetPositionAllocator (positionAlloc);
1282 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1290 socket.SetPhysicalAddress (device2->GetAddress ());
1291 socket.SetProtocol (1);
1294 packetSocket.
Install (wifiNodes);
1322 Simulator::Stop (
Seconds (2.0));
1324 Simulator::Destroy ();
1347 virtual void DoRun (
void);
1375 :
TestCase (
"Test case for Bug 2843"),
1390 double startingFreq = c->
Begin ()->fl;
1396 if (!packet->RemovePacketTag (tag))
1407 packet->RemoveHeader (sig);
1413 packet->RemoveHeader (vhtSig);
1422 if (*it == tupleForCurrentTx)
1437 for (uint8_t i = 0; i < numPackets; i++)
1440 sourceDevice->
Send (pkt, destination, 0);
1447 uint16_t channelWidth = 40;
1458 lossModel->SetFrequency (5.180e9);
1462 = CreateObject<ConstantSpeedPropagationDelayModel> ();
1474 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
1480 mac.SetType (
"ns3::StaWifiMac");
1482 staDevice =
wifi.Install (spectrumPhy,
mac, wifiStaNode);
1484 mac.SetType (
"ns3::ApWifiMac");
1490 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1491 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
1492 mobility.SetPositionAllocator (positionAlloc);
1494 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1504 Simulator::Stop (
Seconds (0.8));
1507 Simulator::Destroy ();
1540 virtual void DoRun (
void);
1564 :
TestCase (
"Test case for Bug 2831"),
1565 m_reassocReqCount (0),
1566 m_reassocRespCount (0),
1567 m_countOperationalChannelWidth20 (0),
1568 m_countOperationalChannelWidth40 (0)
1620 propDelay.
SetTypeId (
"ns3::ConstantSpeedPropagationDelayModel");
1623 channel->SetPropagationDelayModel (propagationDelay);
1624 channel->SetPropagationLossModel (propagationLoss);
1626 Ptr<Node> apNode = CreateObject<Node> ();
1629 apDev->SetHtConfiguration (apHtConfiguration);
1631 mac.SetTypeId (
"ns3::ApWifiMac");
1637 Ptr<Node> staNode = CreateObject<Node> ();
1640 staDev->SetHtConfiguration (staHtConfiguration);
1641 mac.SetTypeId (
"ns3::StaWifiMac");
1651 m_apPhy = CreateObject<YansWifiPhy> ();
1661 staMobility->
SetPosition (Vector (1.0, 0.0, 0.0));
1664 m_staPhy = CreateObject<YansWifiPhy> ();
1673 apMac->
SetAddress (Mac48Address::Allocate ());
1674 apDev->SetMac (apMac);
1677 manager.
SetTypeId (
"ns3::ConstantRateWifiManager");
1681 staMac->
SetAddress (Mac48Address::Allocate ());
1682 staDev->SetMac (staMac);
1691 Simulator::Stop (
Seconds (3.0));
1693 Simulator::Destroy ();
1722 virtual void DoRun (
void);
1753 :
TestCase (
"Test case for StaWifiMac scanning capability")
1789 Ptr<Node> apNodeNearest = CreateObject<Node> ();
1790 Ptr<Node> staNode = CreateObject<Node> ();
1798 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager");
1802 mac.SetType (
"ns3::ApWifiMac",
1805 mac.SetType (
"ns3::ApWifiMac",
1806 "BeaconGeneration",
BooleanValue (nearestApBeaconGeneration));
1807 apDeviceNearest =
wifi.Install (
phy,
mac, apNodeNearest);
1810 mac.SetType (
"ns3::StaWifiMac",
1812 staDevice =
wifi.Install (
phy,
mac, staNode);
1816 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
1817 positionAlloc->
Add (Vector (10.0, 0.0, 0.0));
1818 positionAlloc->
Add (Vector (5.0, 5.0, 0.0));
1819 positionAlloc->
Add (Vector (6.0, 5.0, 0.0));
1820 mobility.SetPositionAllocator (positionAlloc);
1822 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
1837 RngSeedManager::SetSeed (1);
1838 RngSeedManager::SetRun (1);
1842 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1846 Simulator::Stop (
Seconds (0.2));
1848 Simulator::Destroy ();
1854 RngSeedManager::SetSeed (1);
1855 RngSeedManager::SetRun (1);
1859 Mac48Address nearestApAddr = DynamicCast<WifiNetDevice> (nearestAp->
GetDevice (0))->GetMac ()->GetAddress ();
1861 Simulator::Stop (
Seconds (0.2));
1863 Simulator::Destroy ();
1869 RngSeedManager::SetSeed (1);
1870 RngSeedManager::SetRun (1);
1874 Mac48Address secondNearestApAddr = DynamicCast<WifiNetDevice> (
nodes.Get (1)->GetDevice (0))->GetMac ()->GetAddress ();
1878 Simulator::Stop (
Seconds (1.5));
1880 Simulator::Destroy ();
1914 virtual void DoRun (
void);
1968 :
TestCase (
"Test case for Bug 2470"),
1969 m_receivedNormalMpduCount (0),
1970 m_receivedAmpduCount (0),
1971 m_droppedActionCount (0),
1972 m_addbaEstablishedCount (0),
1973 m_addbaPendingCount (0),
1974 m_addbaRejectedCount (0),
1975 m_addbaNoReplyCount (0),
1976 m_addbaResetCount (0)
1989 case OriginatorBlockAckAgreement::ESTABLISHED:
1992 case OriginatorBlockAckAgreement::PENDING:
1995 case OriginatorBlockAckAgreement::REJECTED:
1998 case OriginatorBlockAckAgreement::NO_REPLY:
2001 case OriginatorBlockAckAgreement::RESET:
2042 for (uint32_t i = 0; i < numPackets; i++)
2045 sourceDevice->
Send (pkt, destination, 0);
2052 RngSeedManager::SetSeed (1);
2053 RngSeedManager::SetRun (1);
2054 int64_t streamNumber = 200;
2066 wifi.SetRemoteStationManager (
"ns3::ConstantRateWifiManager",
2072 phy.Set (
"PostReceptionErrorModel", apErrorModel);
2073 mac.SetType (
"ns3::ApWifiMac",
"EnableBeaconJitter",
BooleanValue (
false));
2077 phy.Set (
"PostReceptionErrorModel", staErrorModel);
2078 mac.SetType (
"ns3::StaWifiMac");
2079 staDevice =
wifi.Install (
phy,
mac, wifiStaNode);
2082 wifi.AssignStreams (apDevice, streamNumber);
2083 wifi.AssignStreams (staDevice, streamNumber);
2087 positionAlloc->
Add (Vector (0.0, 0.0, 0.0));
2088 positionAlloc->
Add (Vector (1.0, 0.0, 0.0));
2089 mobility.SetPositionAllocator (positionAlloc);
2091 mobility.SetMobilityModel (
"ns3::ConstantPositionMobilityModel");
2102 Simulator::Stop (
Seconds (1.0));
2104 Simulator::Destroy ();
2115 std::list<uint32_t> blackList;
2117 blackList.push_back (8);
2118 blackList.push_back (9);
2119 blackList.push_back (10);
2120 blackList.push_back (11);
2121 blackList.push_back (12);
2122 blackList.push_back (13);
2154 blackList.push_back (4);
2155 blackList.push_back (5);
2156 blackList.push_back (6);
ERP-OFDM PHY (Clause 19, Section 19.5)
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.
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
void PopulateArpCache()
Populate ARP cache function.
virtual ~QosFragmentationTestCase()
bool DefineChannelNumber(uint8_t channelNumber, WifiPhyStandard standard, uint16_t frequency, uint16_t channelWidth)
Add a channel definition to the WifiPhy.
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
HT PHY for the 5 GHz band (clause 20)
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.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
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.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
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
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void RxCallback(std::string context, Ptr< const Packet > p)
Callback triggered when a packet is received by the PHYs.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
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.
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
void ConfigureStandard(WifiPhyStandard standard)
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...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
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.
uint8_t m_addbaRejectedCount
Count number of times ADDBA state machine is in rejected state.
HT PHY for the 2.4 GHz band (clause 20)
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.
helps to create WifiNetDevice objects
Mac48Address m_associatedApBssid
Associated AP's bssid.
InterferenceHelperSequenceTest()
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
uint8_t m_addbaEstablishedCount
Count number of times ADDBA state machine is in established state.
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 SetDevice(const Ptr< NetDevice > device)
Sets the device this PHY is associated with.
uint16_t GetChannelWidth(void) const
void TurnBeaconGenerationOn(Ptr< Node > apNode)
Turn beacon generation on the AP node.
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Keep track of the current position and velocity of an object.
The MPDU is not part of an A-MPDU.
virtual ~Bug2470TestCase()
Ptr< Node > CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Create one function.
virtual ~Bug2831TestCase()
HE PHY for the 5 GHz band (clause 26)
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.
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.
uint8_t m_addbaResetCount
Count number of times ADDBA state machine is in reset state.
holds a vector of ns3::NetDevice pointers
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.
WifiPreamble GetPreambleType(void) const
Getter for preamble parameter.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint8_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.
Make sure that the channel width and the channel number can be changed at runtime.
virtual void SetAddress(Mac48Address address)=0
uint8_t m_receivedAmpduCount
Count received A-MPDU packets on STA.
hold a list of per-remote-station state.
void Connect(std::string path, const CallbackBase &cb)
uint32_t m_fragments
transmitted fragments
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
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.
virtual void DoRun(void)
Implementation to actually run this TestCase.
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
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 SetChannelWidth(uint16_t channelwidth)
DSSS PHY (Clause 15) and HR/DSSS PHY (Clause 18)
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
uint32_t m_received
received packets
void SetList(const std::list< uint32_t > &packetlist)
uint8_t m_droppedActionCount
Count dropped ADDBA request/response.
NodeContainer Setup(bool nearestApBeaconGeneration, bool staActiveProbe)
Setup test.
virtual ~Bug2222TestCase()
Ptr< const SpectrumModel > GetSpectrumModel() const
virtual void SetChannelNumber(uint8_t id)
Set channel number.
Ptr< Packet > packet
The packet being transmitted with this signal.
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.
uint8_t m_countOperationalChannelWidth40
count number of beacon frames announcing a 40 MHz operating channel width
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 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
Make sure that when virtual collision occurs the wifi remote station manager is triggered and the ret...
WifiModulationClass GetModulation(void) const
Getter for modulation parameter.
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.
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.
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 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.
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 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.
Tag for WifiTxVector and WifiPreamble information to be embedded in outgoing transmissions as a Packe...
void Install(Ptr< Node > node) const
Aggregate an instance of a ns3::PacketSocketFactory onto the provided node.
void TurnApOff(Ptr< Node > apNode)
Turn the AP node off.
void SendOnePacket(Ptr< WifiNetDevice > dev)
Send one packet function.
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.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
std::vector< FreqWidthSubbandModulationTuple > m_distinctTuples
vector of distinct {starting frequency, channelWidth, Number of subbands in SpectrumModel, modulation type} tuples
uint8_t m_addbaPendingCount
Count number of times ADDBA state machine is in pending state.
virtual void ConfigureStandard(WifiPhyStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
void RxDropCallback(std::string context, Ptr< const Packet > p, WifiPhyRxfailureReason reason)
Callback when packet is dropped.
void TxDataFailedTrace(std::string context, Mac48Address adr)
Transmit data failed function.
void ChangeSupportedChannelWidth(void)
Function called to change the supported channel width at runtime.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
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 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.
uint8_t m_reassocRespCount
count number of reassociation responses
uint8_t m_receivedNormalMpduCount
Count received normal MPDU packets on STA.
void CreateOne(Vector pos, Ptr< YansWifiChannel > channel)
Create one function.
Make sure that fragmentation works with QoS stations.
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.