23 #include "ns3/spectrum-wifi-helper.h"
24 #include "ns3/wifi-spectrum-value-helper.h"
25 #include "ns3/spectrum-wifi-phy.h"
26 #include "ns3/interference-helper.h"
27 #include "ns3/nist-error-rate-model.h"
28 #include "ns3/wifi-mac-header.h"
29 #include "ns3/wifi-spectrum-signal-parameters.h"
30 #include "ns3/wifi-utils.h"
31 #include "ns3/wifi-psdu.h"
32 #include "ns3/ofdm-ppdu.h"
33 #include "ns3/ofdm-phy.h"
81 virtual void SendSignal (
double txPowerWatts,
bool wifiSignal);
120 void DoSetup (
void)
override;
121 void DoTeardown (
void)
override;
131 m_idleStateCount (0),
132 m_ccabusyStateCount (0)
158 txParams->psd = txPowerSpectrum;
160 txParams->duration = txDuration;
161 txParams->ppdu = ppdu;
170 txParams->psd = txPowerSpectrum;
172 txParams->duration =
Seconds (0.5);
233 m_phy = CreateObject<SpectrumWifiPhy> ();
267 virtual void DoRun (
void);
282 double txPowerWatts =
DbmToW (-110);
287 Simulator::Destroy ();
307 virtual void DoRun (
void);
322 double txPowerWatts =
DbmToW (-90);
327 Simulator::Destroy ();
347 virtual void DoRun (
void);
362 double txPowerWatts =
DbmToW (-60);
367 Simulator::Destroy ();
391 virtual void DoRun (
void);
406 double txPowerWatts =
DbmToW (-60);
411 Simulator::Destroy ();
430 :
TestSuite (
"wifi-phy-thresholds", UNIT)
Wifi Phy Threshold Strong Foreign Signal Test.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~WifiPhyThresholdsStrongForeignSignalTest()
WifiPhyThresholdsStrongForeignSignalTest()
Wifi Phy Threshold Strong Wifi Signal Test.
WifiPhyThresholdsStrongWifiSignalTest()
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~WifiPhyThresholdsStrongWifiSignalTest()
Wifi Phy Threshold Test base class.
uint32_t m_rxDropped
count number of dropped packets
virtual Ptr< SpectrumSignalParameters > MakeWifiSignal(double txPowerWatts)
Make wifi signal function.
uint32_t m_ccabusyStateCount
count number of PHY state change to CCA_BUSY state
uint32_t m_idleStateCount
count number of PHY state change to IDLE state
uint32_t m_rxStateCount
count number of PHY state change to RX state
virtual ~WifiPhyThresholdsTest()
Destructor.
virtual void RxSuccess(Ptr< WifiPsdu > psdu, RxSignalInfo rxSignalInfo, WifiTxVector txVector, std::vector< bool > statusPerMpdu)
PHY receive success callback function.
virtual void PhyStateChanged(Time start, Time duration, WifiPhyState newState)
PHY state changed callback function.
uint32_t m_stateChanged
count number of PHY state change
uint32_t m_rxFailure
count number of unsuccessfully received packets
virtual Ptr< SpectrumSignalParameters > MakeForeignSignal(double txPowerWatts)
Make foreign signal function.
void DoSetup(void) override
Implementation to do any local setup required for this TestCase.
void RxDropped(Ptr< const Packet > p, WifiPhyRxfailureReason reason)
PHY dropped packet callback function.
Ptr< SpectrumWifiPhy > m_phy
PHY object.
void DoTeardown(void) override
Implementation to do any local setup required for this TestCase.
virtual void RxFailure(Ptr< WifiPsdu > psdu)
PHY receive failure callback function.
virtual void SendSignal(double txPowerWatts, bool wifiSignal)
Send signal function.
WifiPhyThresholdsTest(std::string test_name)
Constructor.
uint32_t m_rxSuccess
count number of successfully received packets
Wifi Phy Thresholds Test Suite.
WifiPhyThresholdsTestSuite()
Wifi Phy Threshold Weak Foreign Signal Test.
WifiPhyThresholdsWeakForeignSignalTest()
virtual ~WifiPhyThresholdsWeakForeignSignalTest()
virtual void DoRun(void)
Implementation to actually run this TestCase.
Wifi Phy Threshold Weak Wifi Signal Test.
WifiPhyThresholdsWeakWifiSignalTest()
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual ~WifiPhyThresholdsWeakWifiSignalTest()
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
void Dispose(void)
Dispose of this Object.
Smart pointer class similar to boost::intrusive_ptr.
void StartRx(Ptr< SpectrumSignalParameters > rxParams)
Input method for delivering a signal from the spectrum channel and low-level PHY interface to this Sp...
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
void SetErrorRateModel(const Ptr< ErrorRateModel > model)
Sets the error rate model.
WifiPhyBand GetPhyBand(void) const
Get the configured Wi-Fi band.
Ptr< WifiPhyStateHelper > GetState(void) const
Return the WifiPhyStateHelper of this PHY.
void SetReceiveErrorCallback(RxErrorCallback callback)
virtual void ConfigureStandard(WifiStandard standard)
Configure the PHY-level parameters for different Wi-Fi standard.
static Time CalculateTxDuration(uint32_t size, const WifiTxVector &txVector, WifiPhyBand band, uint16_t staId=SU_STA_ID)
void SetOperatingChannel(const ChannelTuple &channelTuple)
If the standard for this object has not been set yet, store the given channel settings.
void SetReceiveOkCallback(RxOkCallback callback)
std::tuple< uint8_t, uint16_t, int, uint8_t > ChannelTuple
Tuple identifying an operating channel.
uint32_t GetSize(void) const
Return the size of the PSDU in bytes.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#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 Seconds(double value)
Construct a Time in the indicated unit.
WifiPhyRxfailureReason
Enumeration of the possible reception failure reasons.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double DbmToW(double dBm)
Convert from dBm to Watts.
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...
RxSignalInfo structure containing info on the received signal.
WifiPhyState
The state of the PHY layer.
@ CCA_BUSY
The PHY layer has sense the medium busy through the CCA mechanism.
@ RX
The PHY layer is receiving a packet.
@ IDLE
The PHY layer is IDLE.
static const uint8_t CHANNEL_NUMBER
static WifiPhyThresholdsTestSuite wifiPhyThresholdsTestSuite
the test suite
static const uint16_t CHANNEL_WIDTH
static const uint32_t FREQUENCY