17#include "ns3/ampdu-tag.h"
18#include "ns3/ap-wifi-mac.h"
19#include "ns3/boolean.h"
20#include "ns3/config.h"
21#include "ns3/constant-position-mobility-model.h"
22#include "ns3/double.h"
23#include "ns3/eht-configuration.h"
24#include "ns3/he-phy.h"
25#include "ns3/he-ppdu.h"
26#include "ns3/interference-helper.h"
28#include "ns3/mobility-helper.h"
29#include "ns3/mpdu-aggregator.h"
30#include "ns3/multi-model-spectrum-channel.h"
31#include "ns3/nist-error-rate-model.h"
32#include "ns3/ofdm-ppdu.h"
33#include "ns3/packet-socket-address.h"
34#include "ns3/packet-socket-client.h"
35#include "ns3/packet-socket-helper.h"
36#include "ns3/packet-socket-server.h"
37#include "ns3/pointer.h"
38#include "ns3/rng-seed-manager.h"
39#include "ns3/simple-frame-capture-model.h"
40#include "ns3/single-model-spectrum-channel.h"
41#include "ns3/spectrum-wifi-helper.h"
42#include "ns3/spectrum-wifi-phy.h"
44#include "ns3/threshold-preamble-detection-model.h"
45#include "ns3/wifi-bandwidth-filter.h"
46#include "ns3/wifi-mac-header.h"
47#include "ns3/wifi-mpdu.h"
48#include "ns3/wifi-net-device.h"
49#include "ns3/wifi-phy-rx-trace-helper.h"
50#include "ns3/wifi-psdu.h"
51#include "ns3/wifi-spectrum-phy-interface.h"
52#include "ns3/wifi-spectrum-signal-parameters.h"
53#include "ns3/wifi-spectrum-value-helper.h"
54#include "ns3/wifi-utils.h"
55#include "ns3/yans-wifi-channel.h"
56#include "ns3/yans-wifi-phy.h"
57#include <ns3/propagation-loss-model.h>
93 void DoRun()
override;
128 uint64_t expectedPpduFailure,
129 uint64_t expectedMpduSuccess,
130 uint64_t expectedMpduFailure,
131 uint64_t expectedOverlaps,
132 uint64_t expectedNonOverlaps);
186 auto spectrumChannel = CreateObject<SingleModelSpectrumChannel>();
188 auto nodeA = CreateObject<Node>();
189 auto devA = CreateObject<WifiNetDevice>();
190 m_txA = CreateObject<SpectrumWifiPhy>();
195 auto nodeB = CreateObject<Node>();
196 auto devB = CreateObject<WifiNetDevice>();
197 m_txB = CreateObject<SpectrumWifiPhy>();
202 nodeRx = CreateObject<Node>();
203 auto devRx = CreateObject<WifiNetDevice>();
204 m_rx = CreateObject<SpectrumWifiPhy>();
209 auto errorTxA = CreateObject<NistErrorRateModel>();
212 auto interferenceTxB = CreateObject<InterferenceHelper>();
214 auto errorTxB = CreateObject<NistErrorRateModel>();
217 auto interferenceRx = CreateObject<InterferenceHelper>();
219 auto errorRx = CreateObject<NistErrorRateModel>();
235 nodeA->AddDevice(devA);
237 nodeB->AddDevice(devB);
248 auto preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel>();
249 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(4));
250 preambleDetectionModel->SetAttribute(
"MinimumRssi",
DoubleValue(-82));
268 double txPower = rxPowerDbm;
269 tx_phy->SetTxPowerStart(txPower);
270 tx_phy->SetTxPowerEnd(txPower);
275 std::vector<Ptr<WifiMpdu>> mpduList;
281 auto p1 = Create<Packet>(750);
282 mpduList.emplace_back(Create<WifiMpdu>(p1, hdr1));
288 auto p2 = Create<Packet>(750);
289 mpduList.emplace_back(Create<WifiMpdu>(p2, hdr2));
291 auto psdu = Create<WifiPsdu>(mpduList);
293 tx_phy->Send(psdu, txVector);
301 double txPower = rxPowerDbm;
302 tx_phy->SetTxPowerStart(txPower);
303 tx_phy->SetTxPowerEnd(txPower);
308 std::vector<Ptr<WifiMpdu>> mpduList;
314 auto p1 = Create<Packet>(750);
315 mpduList.emplace_back(Create<WifiMpdu>(p1, hdr1));
317 auto psdu = Create<WifiPsdu>(mpduList);
318 tx_phy->Send(psdu, txVector);
323 uint64_t expectedPpduFailure,
324 uint64_t expectedMpduSuccess,
325 uint64_t expectedMpduFailure,
326 uint64_t expectedOverlaps,
327 uint64_t expectedNonOverlaps)
333 "Didn't receive right number of successful PPDUs");
336 "Didn't receive right number of unsuccessful PPDUs");
339 "Didn't receive right number of successful MPDUs");
342 "Didn't receive right number of unsuccessful MPDUs");
345 "Didn't receive right number of overlapping PPDUs");
348 "Didn't receive right number of nonoverlapping PPDUs");
362 "Didn't receive right number of successful PPDUs");
365 "Didn't receive right number of unsuccessful PPDUs");
368 "Didn't receive right number of successful MPDUs");
371 "Didn't receive right number of unsuccessful MPDUs");
374 "Didn't receive right number of overlapping PPDUs");
377 "Didn't receive right number of nonoverlapping PPDUs");
386 "Didn't produce the right number of Records");
394 int64_t streamNumber = 1;
395 double rxPowerDbm = -80;
864 void DoRun()
override;
928 uint64_t expectedPpduFailure,
929 uint64_t expectedMpduSuccess,
930 uint64_t expectedMpduFailure,
931 uint64_t expectedOverlaps,
932 uint64_t expectedNonOverlaps);
968 :
TestCase(
"Test for correct MLO operation")
976 auto ehtConfiguration = CreateObject<EhtConfiguration>();
978 auto nodeA = CreateObject<Node>();
979 auto devA = CreateObject<WifiNetDevice>();
981 devA->SetEhtConfiguration(ehtConfiguration);
983 m_tx0A = CreateObject<SpectrumWifiPhy>();
988 m_tx0B = CreateObject<SpectrumWifiPhy>();
993 auto nodeB = CreateObject<Node>();
994 auto devB = CreateObject<WifiNetDevice>();
996 devB->SetEhtConfiguration(ehtConfiguration);
998 m_tx1A = CreateObject<SpectrumWifiPhy>();
1003 m_tx1B = CreateObject<SpectrumWifiPhy>();
1008 auto nodeRx = CreateObject<Node>();
1009 auto devRx = CreateObject<WifiNetDevice>();
1011 devRx->SetEhtConfiguration(ehtConfiguration);
1012 m_rxA = CreateObject<SpectrumWifiPhy>();
1014 m_rxB = CreateObject<SpectrumWifiPhy>();
1017 auto interferenceTx0A = CreateObject<InterferenceHelper>();
1019 auto errorTx0A = CreateObject<NistErrorRateModel>();
1022 auto interferenceTx0B = CreateObject<InterferenceHelper>();
1024 auto errorTx0B = CreateObject<NistErrorRateModel>();
1027 auto interferenceTx1A = CreateObject<InterferenceHelper>();
1029 auto errorTx1A = CreateObject<NistErrorRateModel>();
1032 auto interferenceTx1B = CreateObject<InterferenceHelper>();
1034 auto errorTx1B = CreateObject<NistErrorRateModel>();
1037 auto interferenceRxA = CreateObject<InterferenceHelper>();
1039 auto errorRxA = CreateObject<NistErrorRateModel>();
1042 auto interferenceRxB = CreateObject<InterferenceHelper>();
1044 auto errorRxB = CreateObject<NistErrorRateModel>();
1047 auto spectrumChannelA = CreateObject<MultiModelSpectrumChannel>();
1048 auto spectrumChannelB = CreateObject<MultiModelSpectrumChannel>();
1077 std::vector<Ptr<WifiPhy>> phys0;
1078 phys0.emplace_back(
m_tx0A);
1079 phys0.emplace_back(
m_tx0B);
1081 std::vector<Ptr<WifiPhy>> phys1;
1082 phys1.emplace_back(
m_tx1A);
1083 phys1.emplace_back(
m_tx1B);
1085 std::vector<Ptr<WifiPhy>> physRx;
1086 physRx.emplace_back(
m_rxA);
1087 physRx.emplace_back(
m_rxB);
1089 devA->SetPhys(phys0);
1090 nodeA->AddDevice(devA);
1092 devB->SetPhys(phys1);
1093 nodeB->AddDevice(devB);
1095 devRx->SetPhys(physRx);
1096 nodeRx->AddDevice(devRx);
1104 auto preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel>();
1105 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(4));
1106 preambleDetectionModel->SetAttribute(
"MinimumRssi",
DoubleValue(-82));
1128 double txPower = rxPowerDbm;
1129 tx_phy->SetTxPowerStart(txPower);
1130 tx_phy->SetTxPowerEnd(txPower);
1135 std::vector<Ptr<WifiMpdu>> mpduList;
1141 auto p1 = Create<Packet>(750);
1142 mpduList.emplace_back(Create<WifiMpdu>(p1, hdr1));
1148 auto p2 = Create<Packet>(750);
1149 mpduList.emplace_back(Create<WifiMpdu>(p2, hdr2));
1151 auto psdu = Create<WifiPsdu>(mpduList);
1153 tx_phy->Send(psdu, txVector);
1161 double txPower = rxPowerDbm;
1162 tx_phy->SetTxPowerStart(txPower);
1163 tx_phy->SetTxPowerEnd(txPower);
1176 std::vector<Ptr<WifiMpdu>> mpduList;
1182 auto p1 = Create<Packet>(750);
1183 mpduList.emplace_back(Create<WifiMpdu>(p1, hdr1));
1185 auto psdu = Create<WifiPsdu>(mpduList);
1186 tx_phy->Send(psdu, txVector);
1205 "Didn't receive right number of successful PPDUs");
1208 "Didn't receive right number of unsuccessful PPDUs");
1211 "Didn't receive right number of successful MPDUs");
1214 "Didn't receive right number of unsuccessful MPDUs");
1217 "Didn't receive right number of overlapping PPDUs");
1220 "Didn't receive right number of nonoverlapping PPDUs");
1239 "Didn't receive right number of successful PPDUs");
1242 "Didn't receive right number of unsuccessful PPDUs");
1245 "Didn't receive right number of successful MPDUs");
1248 "Didn't receive right number of unsuccessful MPDUs");
1251 "Didn't receive right number of overlapping PPDUs");
1254 "Didn't receive right number of nonoverlapping PPDUs");
1267 "Didn't receive right number of successful PPDUs");
1270 "Didn't receive right number of unsuccessful PPDUs");
1273 "Didn't receive right number of successful MPDUs");
1276 "Didn't receive right number of unsuccessful MPDUs");
1279 "Didn't receive right number of overlapping PPDUs");
1282 "Didn't receive right number of nonoverlapping PPDUs");
1287 uint64_t expectedPpduFailure,
1288 uint64_t expectedMpduSuccess,
1289 uint64_t expectedMpduFailure,
1290 uint64_t expectedOverlaps,
1291 uint64_t expectedNonOverlaps)
1296 expectedPpduSuccess,
1297 "Didn't receive right number of successful PPDUs");
1299 expectedPpduFailure,
1300 "Didn't receive right number of unsuccessful PPDUs");
1302 expectedMpduSuccess,
1303 "Didn't receive right number of successful MPDUs");
1305 expectedMpduFailure,
1306 "Didn't receive right number of unsuccessful MPDUs");
1309 "Didn't receive right number of overlapping PPDUs");
1311 expectedNonOverlaps,
1312 "Didn't receive right number of nonoverlapping PPDUs");
1322 expectedRecordCount,
1323 "Didn't produce the right number of Records");
1331 int64_t streamNumber = 1;
1332 double rxPowerDbm = -80;
1690 void DoRun()
override;
1724 uint64_t expectedPpduFailure,
1725 uint64_t expectedMpduSuccess,
1726 uint64_t expectedMpduFailure,
1727 uint64_t expectedOverlaps,
1728 uint64_t expectedNonOverlaps);
1777 :
TestCase(
"Test for correct operation when using Yans")
1784 double txPower = 20;
1786 auto yansChannel = CreateObject<YansWifiChannel>();
1787 auto propDelay = CreateObject<ConstantSpeedPropagationDelayModel>();
1788 propLoss = CreateObject<FixedRssLossModel>();
1789 yansChannel->SetPropagationDelayModel(propDelay);
1790 yansChannel->SetPropagationLossModel(
propLoss);
1792 auto nodeA = CreateObject<Node>();
1793 auto devA = CreateObject<WifiNetDevice>();
1794 m_txA = CreateObject<YansWifiPhy>();
1799 auto nodeB = CreateObject<Node>();
1800 auto devB = CreateObject<WifiNetDevice>();
1801 m_txB = CreateObject<YansWifiPhy>();
1806 nodeRx = CreateObject<Node>();
1807 auto devRx = CreateObject<WifiNetDevice>();
1808 m_rx = CreateObject<YansWifiPhy>();
1811 auto interferenceTxA = CreateObject<InterferenceHelper>();
1813 auto errorTxA = CreateObject<NistErrorRateModel>();
1816 auto interferenceTxB = CreateObject<InterferenceHelper>();
1818 auto errorTxB = CreateObject<NistErrorRateModel>();
1821 auto interferenceRx = CreateObject<InterferenceHelper>();
1823 auto errorRx = CreateObject<NistErrorRateModel>();
1838 devA->SetPhy(
m_txA);
1839 nodeA->AddDevice(devA);
1840 devB->SetPhy(
m_txB);
1841 nodeB->AddDevice(devB);
1842 devRx->SetPhy(
m_rx);
1845 auto mobilityA = CreateObject<ConstantPositionMobilityModel>();
1846 mobilityA->SetPosition(Vector(0.0, 0.0, 0.0));
1847 nodeA->AggregateObject(mobilityA);
1849 auto mobilityB = CreateObject<ConstantPositionMobilityModel>();
1850 mobilityB->SetPosition(Vector(0.0, 0.0, 0.0));
1851 nodeB->AggregateObject(mobilityB);
1853 auto mobilityRx = CreateObject<ConstantPositionMobilityModel>();
1854 mobilityRx->SetPosition(Vector(0.0, 0.0, 0.0));
1864 auto preambleDetectionModel = CreateObject<ThresholdPreambleDetectionModel>();
1865 preambleDetectionModel->SetAttribute(
"Threshold",
DoubleValue(4));
1866 preambleDetectionModel->SetAttribute(
"MinimumRssi",
DoubleValue(-82));
1889 std::vector<Ptr<WifiMpdu>> mpduList;
1895 auto p1 = Create<Packet>(750);
1896 mpduList.emplace_back(Create<WifiMpdu>(p1, hdr1));
1902 auto p2 = Create<Packet>(750);
1903 mpduList.emplace_back(Create<WifiMpdu>(p2, hdr2));
1905 auto psdu = Create<WifiPsdu>(mpduList);
1907 Create<HePpdu>(psdu,
1909 tx_phy->GetOperatingChannel(),
1910 tx_phy->CalculateTxDuration(psdu->GetSize(), txVector, tx_phy->GetPhyBand()),
1915 tx_phy->StartTx(ppdu);
1928 std::vector<Ptr<WifiMpdu>> mpduList;
1934 auto p1 = Create<Packet>(750);
1935 mpduList.emplace_back(Create<WifiMpdu>(p1, hdr1));
1937 auto psdu = Create<WifiPsdu>(mpduList);
1939 Create<HePpdu>(psdu,
1941 tx_phy->GetOperatingChannel(),
1942 tx_phy->CalculateTxDuration(psdu->GetSize(), txVector, tx_phy->GetPhyBand()),
1947 tx_phy->StartTx(ppdu);
1952 uint64_t expectedPpduFailure,
1953 uint64_t expectedMpduSuccess,
1954 uint64_t expectedMpduFailure,
1955 uint64_t expectedOverlaps,
1956 uint64_t expectedNonOverlaps)
1961 expectedPpduSuccess,
1962 "Didn't receive right number of successful PPDUs");
1964 expectedPpduFailure,
1965 "Didn't receive right number of unsuccessful PPDUs");
1967 expectedMpduSuccess,
1968 "Didn't receive right number of successful MPDUs");
1970 expectedMpduFailure,
1971 "Didn't receive right number of unsuccessful MPDUs");
1974 "Didn't receive right number of overlapping PPDUs");
1976 expectedNonOverlaps,
1977 "Didn't receive right number of nonoverlapping PPDUs");
1992 "Didn't receive right number of successful PPDUs");
1995 "Didn't receive right number of unsuccessful PPDUs");
1998 "Didn't receive right number of successful MPDUs");
2001 "Didn't receive right number of unsuccessful MPDUs");
2004 "Didn't receive right number of overlapping PPDUs");
2007 "Didn't receive right number of nonoverlapping PPDUs");
2015 expectedRecordCount,
2016 "Didn't produce the right number of Records");
2024 int64_t streamNumber = 1;
2025 double rxPowerDbm = -80;
Implements a test case to evaluate the reception process of WiFi Physical Layer (PHY) frames (PPDU) w...
void SendPpduWithTwoMpdus(double rxPowerDbm, Mac48Address add1, Mac48Address add2, Ptr< ns3::SpectrumWifiPhy > tx_phy)
Sends a PPDU containing two MPDUs addressed to specific receivers.
TestWifiPhyRxTraceHelper(std::string test_name)
Constructs a TestWifiPhyRxTraceHelper instance with a given test name.
void DoRun() override
Implementation to actually run this TestCase.
Mac48Address wrongReceiver
The MAC address representing an incorrect receiver, used for testing.
WifiPhyRxTraceHelper m_rxTraceHelper
The helper being tested for tracking PHY reception events.
void CheckRecords(uint64_t expectedRecordCount)
Checks the statistics of PPDU and MPDU reception success and failure.
Mac48Address correctReceiver
The MAC address representing the correct receiver, used for testing.
Ptr< SpectrumWifiPhy > m_txB
The transmit function for node B.
std::map< ns3::Mac48Address, uint32_t > MacToNodeId
Maps MAC addresses to node IDs.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
Ptr< Node > nodeRx
The receiving node.
void CheckAllStats(uint64_t expectedPpduSuccess, uint64_t expectedPpduFailure, uint64_t expectedMpduSuccess, uint64_t expectedMpduFailure, uint64_t expectedOverlaps, uint64_t expectedNonOverlaps)
Checks the statistics of PPDU and MPDU reception success and failure.
~TestWifiPhyRxTraceHelper() override=default
Destructor.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void SendPpduWithOneMpdu(double rxPowerDbm, Mac48Address add1, Ptr< ns3::SpectrumWifiPhy > tx_phy)
Sends a PPDU containing one MPDU addressed to a specific receiver.
Ptr< SpectrumWifiPhy > m_txA
The transmit function for node A.
void CheckStats(WifiPhyTraceStatistics expectedStats, uint32_t nodeId, uint32_t deviceId, uint32_t linkId)
Checks the statistics of PPDU and MPDU reception success and failure.
Ptr< SpectrumWifiPhy > m_rx
The receive function for testing.
Implements a test case to evaluate the reception process of WiFi Physical Layer (PHY) frames (PPDU) c...
Ptr< SpectrumWifiPhy > m_tx1A
The transmit function for node 1, link A.
void CheckRecords(uint64_t expectedRecordCount)
Checks the statistics of PPDU and MPDU reception success and failure.
void CheckAllStats(uint64_t expectedPpduSuccess, uint64_t expectedPpduFailure, uint64_t expectedMpduSuccess, uint64_t expectedMpduFailure, uint64_t expectedOverlaps, uint64_t expectedNonOverlaps)
Checks the statistics of PPDU and MPDU reception success and failure in MLO scenarios.
WifiPhyRxTraceHelper m_rxTraceHelper
The helper being tested for tracking PHY reception events in MLO scenarios.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void SendPpduWithTwoMpdus(double rxPowerDbm, Mac48Address add1, Mac48Address add2, Ptr< ns3::SpectrumWifiPhy > tx_phy)
Sends a PPDU containing two MPDUs addressed to specific receivers, simulating an MLO scenario.
TestWifiPhyRxTraceHelperMloStr()
Constructs a TestWifiPhyRxTraceHelperMloStr instance for MLO reception testing.
Ptr< SpectrumWifiPhy > m_rxA
The receive function for node 2, link A.
void DoRun() override
Implementation to actually run this TestCase.
void CheckStats(WifiPhyTraceStatistics expectedStats, uint32_t nodeId)
Checks the statistics of PPDU and MPDU reception success and failure.
Ptr< SpectrumWifiPhy > m_rxB
The receive function for node 2, link B.
Mac48Address correctReceiver
The MAC address representing the correct receiver, used for testing in MLO.
Ptr< SpectrumWifiPhy > m_tx1B
The transmit function for node 1, link B.
NodeContainer wifiNodes
All wifi nodes.
std::map< ns3::Mac48Address, uint32_t > MacToNodeId
Maps MAC addresses to node IDs for MLO test configuration.
Mac48Address wrongReceiver
The MAC address representing an incorrect receiver, used for testing in MLO.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
Ptr< SpectrumWifiPhy > m_tx0A
The transmit function for node 0, link A.
void SendPpduWithOneMpdu(double rxPowerDbm, Mac48Address add1, Ptr< ns3::SpectrumWifiPhy > tx_phy)
Sends a PPDU containing one MPDU addressed to a specific receiver, within an MLO setup.
Ptr< SpectrumWifiPhy > m_tx0B
The transmit function for node 0, link B.
Implements a test case to evaluate the reception process of WiFi Physical Layer (PHY) frames (PPDU) w...
Ptr< YansWifiPhy > m_rx
The receive function for testing.
WifiPhyRxTraceHelper m_rxTraceHelper
The helper being tested for tracking PHY reception events.
void CheckStats(WifiPhyTraceStatistics expectedStats, uint32_t nodeId, uint32_t deviceId, uint32_t linkId)
Checks the statistics of PPDU and MPDU reception success and failure.
void DoRun() override
Implementation to actually run this TestCase.
void SendPpduWithTwoMpdus(double rxPowerDbm, Mac48Address add1, Mac48Address add2, Ptr< ns3::YansWifiPhy > tx_phy)
Sends a PPDU containing two MPDUs addressed to specific receivers.
Ptr< YansWifiPhy > m_txA
The transmit function for node A.
uint64_t m_uid
The unique identifier used for the PPDU in the test.
TestWifiPhyRxTraceHelperYans()
Constructs a TestWifiPhyRxTraceHelperYans instance for testing the trace helper with Yans.
void SendPpduWithOneMpdu(double rxPowerDbm, Mac48Address add1, Ptr< ns3::YansWifiPhy > tx_phy)
Sends a PPDU containing one MPDU addressed to a specific receiver.
void CheckRecords(uint64_t expectedRecordCount)
Checks the statistics of PPDU and MPDU reception success and failure.
Mac48Address wrongReceiver
The MAC address representing an incorrect receiver, used for testing.
std::map< ns3::Mac48Address, uint32_t > MacToNodeId
Maps MAC addresses to node IDs.
Mac48Address correctReceiver
The MAC address representing the correct receiver, used for testing.
Ptr< Node > nodeRx
The receiving node.
Ptr< YansWifiPhy > m_txB
The transmit function for node B.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void CheckAllStats(uint64_t expectedPpduSuccess, uint64_t expectedPpduFailure, uint64_t expectedMpduSuccess, uint64_t expectedMpduFailure, uint64_t expectedOverlaps, uint64_t expectedNonOverlaps)
Checks the statistics of PPDU and MPDU reception success and failure.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
Ptr< FixedRssLossModel > propLoss
The propagation loss model used to configure RSSI.
wifi PHY reception Test Suite
WifiPhyRxTraceHelperTestSuite()
This class can be used to hold variables of floating point type such as 'double' or 'float'.
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
keep track of a set of node pointers.
void Add(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
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.
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
void Dispose()
Dispose of this Object.
Smart pointer class similar to boost::intrusive_ptr.
static void SetRun(uint64_t run)
Set the run number of simulation.
static void SetSeed(uint32_t seed)
Set the seed.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
void SetDevice(const Ptr< WifiNetDevice > device) override
Sets the device this PHY is associated with.
void AddChannel(const Ptr< SpectrumChannel > channel, const FrequencyRange &freqRange=WHOLE_WIFI_SPECTRUM)
Attach a SpectrumChannel to use for a given frequency range.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
virtual void SetDevice(const Ptr< WifiNetDevice > device)
Sets the device this PHY is associated with.
void SetTxPowerEnd(double end)
Sets the maximum available transmission power level (dBm).
void SetPreambleDetectionModel(const Ptr< PreambleDetectionModel > preambleDetectionModel)
Sets the preamble detection model.
std::tuple< uint8_t, uint16_t, WifiPhyBand, uint8_t > ChannelTuple
Tuple identifying an operating channel.
void SetTxPowerStart(double start)
Sets the minimum available transmission power level (dBm).
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Assists in tracing and analyzing Wi-Fi Physical Layer (PHY) receptions.
const std::vector< WifiPpduRxRecord > & GetPpduRecords() const
Accesses a vector of saved and completed PPDU reception records.
void Reset()
Resets the current statistics, clearing all counts and PPDU records.
void Stop(Time stopTime)
Stops the collection of statistics at a specified time.
WifiPhyTraceStatistics GetStatistics() const
Retrieves current statistics of successful and failed data PPDUs and MPDUs receptions,...
void Enable(NodeContainer nodes)
Enables trace collection for all nodes and WifiNetDevices in the specified NodeContainer.
void Start(Time startTime)
Starts the collection of statistics from a specified start time.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
void SetChannel(const Ptr< YansWifiChannel > channel)
Set the YansWifiChannel this YansWifiPhy is to be connected to.
void SetInterferenceHelper(const Ptr< InterferenceHelper > helper) override
Sets the interference helper.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
constexpr FrequencyRange WIFI_SPECTRUM_5_GHZ
Identifier for the frequency range covering the wifi spectrum in the 5 GHz band.
constexpr FrequencyRange WIFI_SPECTRUM_2_4_GHZ
Identifier for the frequency range covering the wifi spectrum in the 2.4 GHz band.
Keeps track of PHY layer trace statistics.
uint64_t m_failedMpdus
Number of failed unicast data MPDU receptions.
uint64_t m_failedPpdus
Number of failed PPDU receptions (with unicast data).
uint64_t m_receivedPpdus
Number of successfully received PPDUs (with unicast data).
uint64_t m_receivedMpdus
Number of successfully received unicast data MPDUs.
uint64_t m_overlappingPpdus
Number of PPDUs that overlapped in time with at least one other PPDU.
uint64_t m_nonOverlappingPpdus
Number of PPDUs that did not overlap in time with any other PPDU.
static WifiPhyRxTraceHelperTestSuite wifiPhyRxTestSuite
the test suite