20#include "ns3/constant-obss-pd-algorithm.h"
21#include "ns3/he-phy.h"
22#include "ns3/he-ppdu.h"
23#include "ns3/ht-ppdu.h"
24#include "ns3/interference-helper.h"
26#include "ns3/multi-model-spectrum-channel.h"
27#include "ns3/nist-error-rate-model.h"
28#include "ns3/non-communicating-net-device.h"
29#include "ns3/ofdm-ppdu.h"
30#include "ns3/pointer.h"
31#include "ns3/rng-seed-manager.h"
32#include "ns3/spectrum-wifi-helper.h"
33#include "ns3/spectrum-wifi-phy.h"
35#include "ns3/threshold-preamble-detection-model.h"
36#include "ns3/vht-configuration.h"
37#include "ns3/vht-ppdu.h"
38#include "ns3/waveform-generator.h"
39#include "ns3/wifi-mac-header.h"
40#include "ns3/wifi-net-device.h"
41#include "ns3/wifi-phy-listener.h"
42#include "ns3/wifi-psdu.h"
43#include "ns3/wifi-spectrum-value-helper.h"
44#include "ns3/wifi-utils.h"
83 void DoRun()
override;
131 double expectedCcaThresholdDbm);
151 :
TestCase(
"Wi-Fi PHY CCA thresholds test"),
152 m_CcaEdThresholdDbm{-62.0},
153 m_CcaSensitivityDbm{-82.0},
154 m_secondaryCcaSensitivityThresholds{-72.0, -72.0, -69.0},
166 return Create<WifiPsdu>(pkt, hdr);
184 return Create<HtPpdu>(psdu,
198 return Create<VhtPpdu>(psdu,
212 return Create<HePpdu>(psdu,
224 double expectedCcaThresholdDbm)
226 NS_LOG_FUNCTION(
this << phy << channelType << expectedCcaThresholdDbm);
227 double actualThresholdDbm = phy->GetCcaThreshold(ppdu, channelType);
228 NS_LOG_INFO((ppdu ==
nullptr ?
"any signal" :
"a PPDU")
229 <<
" in " << channelType <<
" channel: " << actualThresholdDbm <<
"dBm");
231 expectedCcaThresholdDbm,
233 "Actual CCA threshold for "
234 << (ppdu ==
nullptr ?
"any signal" :
"a PPDU") <<
" in "
235 << channelType <<
" channel " << actualThresholdDbm
236 <<
"dBm does not match expected threshold "
237 << expectedCcaThresholdDbm <<
"dBm");
246 m_device = CreateObject<WifiNetDevice>();
251 m_phy = Create<SpectrumWifiPhy>();
634 const std::vector<Time>& per20MhzDurations)
override
636 NS_LOG_FUNCTION(
this << duration << channelType << per20MhzDurations.size());
695 void DoRun()
override;
704 void SendHeSuPpdu(
double txPowerDbm, uint16_t frequency, uint16_t bandwidth);
741 const std::vector<Time>& expectedPer20MhzDurations);
803 const std::vector<TxSignalInfo>& generatedSignals,
804 const std::vector<TxPpduInfo>& generatedPpdus,
805 const std::vector<StateCheckPoint>& stateCheckpoints,
806 const std::vector<CcaCheckPoint>& ccaCheckpoints);
825 std::unique_ptr<CcaTestPhyListener>
833 :
TestCase(
"Wi-Fi PHY CCA indication test"),
834 m_numSignalGenerators(2),
847 NS_LOG_FUNCTION(
this << signalGenerator << txPowerDbm << frequency << bandwidth << duration);
850 bandInfo.
fc = frequency * 1e6;
851 bandInfo.
fl = bandInfo.
fc - ((bandwidth / 2) * 1e6);
852 bandInfo.
fh = bandInfo.
fc + ((bandwidth / 2) * 1e6);
854 bands.push_back(bandInfo);
858 *signalPsd =
DbmToW(txPowerDbm) / (bandwidth * 1e6);
860 signalGenerator->SetTxPowerSpectralDensity(signalPsd);
861 signalGenerator->SetPeriod(duration);
862 signalGenerator->Start();
870 signalGenerator->Stop();
916 currentState = state->GetState();
919 "PHY State " << currentState <<
" does not match expected state "
925 Time expectedEndTime,
927 const std::vector<Time>& expectedPer20MhzDurations)
932 <<
" does not match expected time " << expectedEndTime
937 <<
" does not match expected channel type "
940 expectedPer20MhzDurations.size(),
941 "PHY CCA-BUSY per-20 MHz durations does not match expected vector"
943 for (std::size_t i = 0; i < expectedPer20MhzDurations.size(); ++i)
946 expectedPer20MhzDurations.at(i),
947 "PHY CCA-BUSY per-20 MHz duration at index "
948 << i <<
" does not match expected duration at "
961 const std::vector<TxSignalInfo>& generatedSignals,
962 const std::vector<TxPpduInfo>& generatedPpdus,
963 const std::vector<StateCheckPoint>& stateCheckpoints,
964 const std::vector<CcaCheckPoint>& ccaCheckpoints)
966 for (
const auto& generatedPpdu : generatedPpdus)
972 generatedPpdu.centerFreq,
973 generatedPpdu.bandwidth);
976 std::size_t index = 0;
977 for (
const auto& generatedSignal : generatedSignals)
983 generatedSignal.power,
984 generatedSignal.centerFreq,
985 generatedSignal.bandwidth,
986 generatedSignal.duration);
989 for (
const auto& checkpoint : ccaCheckpoints)
995 checkpoint.expectedChannelListType,
996 checkpoint.expectedPer20MhzDurations);
999 for (
const auto& checkpoint : stateCheckpoints)
1004 checkpoint.expectedPhyState);
1024 Ptr<Node> rxNode = CreateObject<Node>();
1028 rxDev->SetVhtConfiguration(vhtConfiguration);
1029 m_rxPhy = CreateObject<SpectrumWifiPhy>();
1039 CreateObject<ThresholdPreambleDetectionModel>();
1044 rxNode->AddDevice(rxDev);
1046 Ptr<Node> txNode = CreateObject<Node>();
1048 m_txPhy = CreateObject<SpectrumWifiPhy>();
1059 txNode->AddDevice(txDev);
1063 Ptr<Node> signalGeneratorNode = CreateObject<Node>();
1065 CreateObject<NonCommunicatingNetDevice>();
1067 signalGenerator->SetDevice(signalGeneratorDev);
1068 signalGenerator->SetChannel(spectrumChannel);
1069 signalGenerator->SetDutyCycle(1);
1070 signalGeneratorNode->AddDevice(signalGeneratorDev);
1080 int64_t streamNumber = 0;
1095 std::vector<Time> expectedPer20MhzCcaBusyDurations{};
1106 "Reception of a signal that occupies P20 below ED threshold");
1113 WifiPhyState::IDLE},
1126 "Reception of signal that occupies P20 above ED threshold");
1131 {
aCcaTime, WifiPhyState::CCA_BUSY},
1133 WifiPhyState::CCA_BUSY},
1155 : std::vector<Time>{})}});
1164 "Reception of two 20 MHz signals that occupies P20 below ED threshold with "
1165 "sum above ED threshold");
1174 WifiPhyState::CCA_BUSY},
1196 : std::vector<Time>{})}});
1206 "Reception of a 20 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1213 WifiPhyState::IDLE},
1228 "Reception of a 20 MHz HE PPDU that occupies P20 above CCA sensitivity threshold");
1234 {
aCcaTime, WifiPhyState::CCA_BUSY},
1246 ? std::vector<Time>{
Seconds(0),
1256 : std::vector<Time>{})}});
1266 "Reception of a 40 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1273 WifiPhyState::IDLE},
1288 "Reception of a 40 MHz HE PPDU that occupies P40 above CCA sensitivity threshold");
1294 {
aCcaTime, WifiPhyState::CCA_BUSY},
1298 : WifiPhyState::CCA_BUSY},
1308 ? std::vector<Time>{
Seconds(0),
1318 : std::vector<Time>{})}});
1329 "Reception of a 20 MHz signal that occupies S20 below ED threshold");
1336 WifiPhyState::IDLE},
1349 "Reception of a 20 MHz signal that occupies S20 above ED threshold");
1357 WifiPhyState::IDLE},
1385 "Reception of a 40 MHz signal that occupies P40 above ED threshold");
1391 {
aCcaTime, WifiPhyState::CCA_BUSY},
1393 WifiPhyState::CCA_BUSY},
1421 "Reception of a signal that occupies S20 followed by the reception of "
1422 "another signal that occupies P20");
1431 WifiPhyState::CCA_BUSY},
1434 WifiPhyState::CCA_BUSY},
1478 "Reception of a signal that occupies P20 followed by the reception of "
1479 "another signal that occupies S20");
1486 {
aCcaTime, WifiPhyState::CCA_BUSY},
1488 WifiPhyState::CCA_BUSY},
1491 WifiPhyState::CCA_BUSY},
1536 "Reception of a 20 MHz HE PPDU that occupies S20 below CCA sensitivity threshold");
1543 WifiPhyState::IDLE},
1557 "Reception of a 20 MHz HE PPDU that occupies S20 above CCA sensitivity threshold");
1564 WifiPhyState::IDLE},
1595 "Reception of a 20 MHz signal that occupies S20 above ED threshold followed by a 40 "
1596 "MHz HE PPDU that occupies P40 below CCA sensitivity threshold");
1626 : std::vector<Time>{})},
1654 "Reception of a 20 MHz signal that occupies the first subchannel of "
1655 "S40 below ED threshold");
1662 WifiPhyState::IDLE},
1677 "Reception of a 20 MHz signal that occupies the first subchannel of "
1678 "S40 above ED threshold");
1685 WifiPhyState::IDLE},
1712 "Reception of a 20 MHz signal that occupies the second subchannel of "
1713 "S40 below ED threshold");
1720 WifiPhyState::IDLE},
1735 "Reception of a 20 MHz signal that occupies the second subchannel of "
1736 "S40 above ED threshold");
1743 WifiPhyState::IDLE},
1770 "Reception of a 40 MHz signal that occupies S40 below ED threshold");
1777 WifiPhyState::IDLE},
1792 "Reception of a 20 MHz signal that occupies the second subchannel of "
1793 "S40 above ED threshold");
1800 WifiPhyState::IDLE},
1827 "Reception of a 80 MHz signal that occupies P80 above ED threshold");
1832 {
aCcaTime, WifiPhyState::CCA_BUSY},
1834 WifiPhyState::CCA_BUSY},
1861 "Reception of a 20 MHz signal that occupies S40 followed by the "
1862 "reception of another 20 MHz signal that occupies P20");
1871 WifiPhyState::CCA_BUSY},
1874 WifiPhyState::CCA_BUSY},
1916 "Reception of a signal that occupies S40 followed by the reception of "
1917 "another signal that occupies S20");
1927 WifiPhyState::IDLE},
1970 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
1977 WifiPhyState::IDLE},
1991 "Reception of a 40 MHz HE PPDU that occupies S40 above CCA sensitivity threshold");
1998 WifiPhyState::IDLE},
2027 "Reception of a 40 MHz signal that occupies S40 above ED threshold followed by a 80 "
2028 "MHz HE PPDU that occupies P80 below CCA sensitivity threshold");
2081 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA "
2082 "sensitivity threshold");
2087 {
aCcaTime, WifiPhyState::CCA_BUSY},
2089 WifiPhyState::CCA_BUSY},
2106 : std::vector<Time>{
Seconds(0),
2111 : std::vector<Time>{})},
2125 : std::vector<Time>{
Seconds(0),
2130 : std::vector<Time>{})}});
2140 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA "
2141 "sensitivity threshold");
2147 {
aCcaTime, WifiPhyState::CCA_BUSY},
2149 WifiPhyState::CCA_BUSY},
2171 : std::vector<Time>{})},
2190 : std::vector<Time>{})}});
2200 "Reception of a 40 MHz HE PPDU that does not occupy the operational channel");
2207 WifiPhyState::IDLE},
2223 "Reception of a 20 MHz signal that occupies the first subchannel of "
2224 "S80 below ED threshold");
2231 WifiPhyState::IDLE},
2245 "Reception of a 20 MHz signal that occupies the first subchannel of "
2246 "S80 above ED threshold");
2253 WifiPhyState::IDLE},
2276 "Reception of a 20 MHz signal that occupies the second subchannel of "
2277 "S80 below ED threshold");
2284 WifiPhyState::IDLE},
2298 "Reception of a 20 MHz signal that occupies the second subchannel of "
2299 "S80 above ED threshold");
2306 WifiPhyState::IDLE},
2329 "Reception of a 20 MHz signal that occupies the third subchannel of "
2330 "S80 below ED threshold");
2337 WifiPhyState::IDLE},
2351 "Reception of a 20 MHz signal that occupies the third subchannel of "
2352 "S80 above ED threshold");
2359 WifiPhyState::IDLE},
2382 "Reception of a 20 MHz signal that occupies the fourth subchannel of "
2383 "S80 below ED threshold");
2390 WifiPhyState::IDLE},
2404 "Reception of a 20 MHz signal that occupies the fourth subchannel of "
2405 "S80 above ED threshold");
2412 WifiPhyState::IDLE},
2435 "Reception of a 40 MHz signal that occupies the first and second "
2436 "subchannels of S80 below ED threshold");
2443 WifiPhyState::IDLE},
2457 "Reception of a 40 MHz signal that occupies the first and second "
2458 "subchannels of S80 above ED threshold");
2465 WifiPhyState::IDLE},
2488 "Reception of a 40 MHz signal that occupies the third and fourth "
2489 "subchannels of S80 below ED threshold");
2496 WifiPhyState::IDLE},
2510 "Reception of a 40 MHz signal that occupies the third and fourth "
2511 "subchannels of S80 above ED threshold");
2518 WifiPhyState::IDLE},
2541 "Reception of a 80 MHz signal that occupies S80 below ED threshold");
2548 WifiPhyState::IDLE},
2562 "Reception of a 80 MHz signal that occupies S80 above ED threshold");
2569 WifiPhyState::IDLE},
2593 "Reception of a 160 MHz signal that occupies the whole band below ED threshold");
2600 WifiPhyState::IDLE},
2615 "Reception of a 160 MHz signal that occupies the whole band above ED threshold");
2620 {
aCcaTime, WifiPhyState::CCA_BUSY},
2622 WifiPhyState::CCA_BUSY},
2645 "Reception of a 20 MHz signal that occupies S80 followed by the "
2646 "reception of another 20 MHz signal that occupies P20");
2655 WifiPhyState::CCA_BUSY},
2658 WifiPhyState::CCA_BUSY},
2692 "Reception of a signal that occupies S80 followed by the reception of "
2693 "another signal that occupies S40");
2703 WifiPhyState::IDLE},
2737 "Reception of a signal that occupies S80 followed by the reception of "
2738 "another signal that occupies S20");
2748 WifiPhyState::IDLE},
2783 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
2790 WifiPhyState::IDLE},
2804 "Reception of a 80 MHz HE PPDU that occupies S80 above CCA sensitivity threshold");
2811 WifiPhyState::IDLE},
2834 "Reception of a 20 MHz signal that generates a per20bitmap parameter "
2835 "change when previous CCA indication reports IDLE");
2842 WifiPhyState::IDLE},
2866 "Reception of a 20 MHz signal that generates a per20bitmap parameter change when "
2867 "previous CCA indication reports BUSY for the primary channel");
2874 {
aCcaTime, WifiPhyState::CCA_BUSY},
2876 WifiPhyState::CCA_BUSY},
2940 signalGenerator =
nullptr;
PHY listener for CCA tests.
void NotifyOn() override
Notify listeners that we went to switch on.
WifiChannelListType m_lastCcaBusyChannelType
Channel type indication for the last CCA-BUSY notification.
void NotifyRxEndError() override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
void NotifyCcaBusyStart(Time duration, WifiChannelListType channelType, const std::vector< Time > &per20MhzDurations) override
void NotifySleep() override
Notify listeners that we went to sleep.
void NotifyRxEndOk() override
We have received the last bit of a packet for which NotifyRxStart was invoked first and,...
void NotifyTxStart(Time duration, double txPowerDbm) override
CcaTestPhyListener()=default
void NotifyOff() override
Notify listeners that we went to switch off.
std::size_t m_notifications
Number of CCA notifications.
void NotifyRxStart(Time duration) override
Time m_endCcaBusy
End of the CCA-BUSY duration.
void Reset()
Reset function.
void NotifyWakeup() override
Notify listeners that we woke up.
std::vector< Time > m_lastPer20MhzCcaBusyDurations
End of the CCA-BUSY durations per 20 MHz.
void NotifySwitchingStart(Time duration) override
Wifi Phy Threshold Test base class.
std::size_t m_numSignalGenerators
The number of non-wifi signals generators needed for the test.
void CheckPhyState(WifiPhyState expectedState)
Check the PHY state.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
void CheckLastCcaBusyNotification(Time expectedEndTime, WifiChannelListType expectedChannelType, const std::vector< Time > &expectedPer20MhzDurations)
Check the last CCA-BUSY notification.
std::unique_ptr< CcaTestPhyListener > m_rxPhyStateListener
Listener for PHY state transitions.
void SendHeSuPpdu(double txPowerDbm, uint16_t frequency, uint16_t bandwidth)
Send an HE SU PPDU.
void StartSignal(Ptr< WaveformGenerator > signalGenerator, double txPowerDbm, uint16_t frequency, uint16_t bandwidth, Time duration)
Start to generate a signal.
void RunOne()
Run one function.
void DoCheckPhyState(WifiPhyState expectedState)
Check the PHY state.
std::vector< Ptr< WaveformGenerator > > m_signalGenerators
Generators of non-wifi signals.
void ScheduleTest(Time delay, const std::vector< TxSignalInfo > &generatedSignals, const std::vector< TxPpduInfo > &generatedPpdus, const std::vector< StateCheckPoint > &stateCheckpoints, const std::vector< CcaCheckPoint > &ccaCheckpoints)
Schedule test to perform.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
uint16_t m_frequency
Operating frequency in MHz.
void DoRun() override
Implementation to actually run this TestCase.
void LogScenario(const std::string &log) const
Log scenario description.
void Reset()
Reset function.
Ptr< SpectrumWifiPhy > m_rxPhy
PHY object of the receiver.
Ptr< SpectrumWifiPhy > m_txPhy
PHY object of the transmitter.
void StopSignal(Ptr< WaveformGenerator > signalGenerator)
Stop to generate a signal.
WifiPhyCcaIndicationTest()
uint16_t m_channelWidth
Operating channel width in MHz.
Wi-Fi PHY CCA Test Suite.
Ptr< OfdmPpdu > CreateDummyNonHtPpdu()
Create a non-HT PPDU.
Ptr< WifiNetDevice > m_device
The WifiNetDevice.
Ptr< HePpdu > CreateDummyHePpdu(uint16_t bandwidth)
Create a HE PPDU.
void DoSetup() override
Implementation to do any local setup required for this TestCase.
void DoTeardown() override
Implementation to do any local setup required for this TestCase.
double m_CcaSensitivityDbm
The current CCA sensitivity threshold for signals that occupy the primary 20 MHz channel (in dBm)
Ptr< HtPpdu > CreateDummyHtPpdu(uint16_t bandwidth)
Create a HT PPDU.
Ptr< SpectrumWifiPhy > m_phy
The spectrum PHY.
Ptr< ObssPdAlgorithm > m_obssPdAlgorithm
The OBSS-PD algorithm.
void VerifyCcaThreshold(const Ptr< PhyEntity > phy, const Ptr< const WifiPpdu > ppdu, WifiChannelListType channelType, double expectedCcaThresholdDbm)
Function to verify the CCA threshold that is being reported by a given PHY entity upon reception of a...
Ptr< WifiPsdu > CreateDummyPsdu()
Create a dummy PSDU whose payload is 1000 bytes.
VhtConfiguration::SecondaryCcaSensitivityThresholds m_secondaryCcaSensitivityThresholds
The current CCA sensitivity thresholds for signals that do not occupy the primary 20 MHz channel (in ...
Ptr< VhtPpdu > CreateDummyVhtPpdu(uint16_t bandwidth)
Create a VHT PPDU.
void RunOne()
Run tests for given CCA attributes.
Ptr< VhtConfiguration > m_vhtConfiguration
The VHT configuration.
double m_CcaEdThresholdDbm
The current CCA-ED threshold for a 20 MHz subchannel (in dBm)
void DoRun() override
Implementation to actually run this TestCase.
double m_obssPdLevel
The current OBSS-PD level (in dBm)
WifiPhyCcaThresholdsTest()
static WifiMode GetHeMcs0()
Return MCS 0 from HE MCS values.
static WifiMode GetHtMcs0()
Return MCS 0 from HT MCS values.
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 AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
void Dispose()
Dispose of this Object.
void SetObssPdLevel(double level)
virtual void ConnectWifiNetDevice(const Ptr< WifiNetDevice > device)
Connect the WifiNetDevice and setup eventual callbacks.
static WifiMode GetOfdmRate6Mbps()
Return a WifiMode for OFDM at 6 Mbps.
Hold objects of type Ptr<T>.
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 Time Now()
Return the current simulation virtual time.
static void Run()
Run the simulation.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
void SetChannel(const Ptr< SpectrumChannel > channel)
Set the SpectrumChannel this SpectrumWifiPhy is to be connected to.
void CreateWifiSpectrumPhyInterface(Ptr< NetDevice > device)
Method to encapsulate the creation of the WifiSpectrumPhyInterface object (used to bind the WifiSpect...
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Simulation virtual time values and global simulation resolution.
AttributeValue implementation for Time.
std::tuple< double, double, double > SecondaryCcaSensitivityThresholds
Tuple identifying CCA sensitivity thresholds for secondary channels.
void SetSecondaryCcaSensitivityThresholds(const SecondaryCcaSensitivityThresholds &thresholds)
Sets the CCA sensitivity thresholds for PPDUs that do not occupy the primary channel.
static WifiMode GetVhtMcs0()
Return MCS 0 from VHT MCS values.
void SetVhtConfiguration(Ptr< VhtConfiguration > vhtConfiguration)
void SetStandard(WifiStandard standard)
Set the Wifi standard.
void SetPhy(const Ptr< WifiPhy > phy)
virtual void SetInterferenceHelper(const Ptr< InterferenceHelper > helper)
Sets the interference helper.
void Send(Ptr< const WifiPsdu > psdu, const WifiTxVector &txVector)
This function is a wrapper for the Send variant that accepts a WifiConstPsduMap as first argument.
void SetCcaEdThreshold(double threshold)
Sets the CCA energy detection threshold (dBm).
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.
void SetCcaSensitivityThreshold(double threshold)
Sets the CCA sensitivity threshold (dBm).
Ptr< PhyEntity > GetPhyEntity(WifiModulationClass modulation) const
Get the supported PHY entity corresponding to the modulation class.
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.
void RegisterListener(WifiPhyListener *listener)
std::tuple< uint8_t, uint16_t, int, 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.
receive notifications about PHY events.
static ConstIterator FindFirst(uint8_t number, uint16_t frequency, uint16_t width, WifiStandard standard, WifiPhyBand band, ConstIterator start=m_frequencyChannels.begin())
Find the first channel matching the specified parameters.
This objects implements the PHY state machine of the Wifi device.
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_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time NanoSeconds(uint64_t value)
Construct a Time in the indicated unit.
Time Seconds(double value)
Construct a Time in the indicated unit.
WifiChannelListType
Enumeration of the possible channel-list parameter elements defined in Table 8-5 of IEEE 802....
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
@ WIFI_MOD_CLASS_OFDM
OFDM (Clause 17)
@ WIFI_MOD_CLASS_HT
HT (Clause 19)
@ WIFI_MOD_CLASS_VHT
VHT (Clause 22)
@ WIFI_MOD_CLASS_HE
HE (Clause 27)
@ WIFI_CHANLIST_SECONDARY40
@ WIFI_CHANLIST_SECONDARY
@ WIFI_CHANLIST_SECONDARY80
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< BandInfo > Bands
Container of BandInfo.
double DbmToW(double dBm)
Convert from dBm to Watts.
@ IDLE
Channel is IDLE, no packet is being transmitted.
structure that holds information to perform CCA check
Time expectedCcaEndTime
expected CCA_BUSY end time
Time timePoint
time at which the check will performed
std::vector< Time > expectedPer20MhzDurations
expected per-20 MHz CCA duration
WifiChannelListType expectedChannelListType
expected channel list type
structure that holds information to perform PHY state check
WifiPhyState expectedPhyState
expected PHY state
Time timePoint
time at which the check will performed
structure that holds information to generate PPDUs
uint16_t centerFreq
center frequency to use in MHz
Time startTime
time at which transmission will be started
uint16_t bandwidth
bandwidth to use in MHz
double power
transmit power to use in dBm
structure that holds information to generate signals
uint16_t centerFreq
center frequency to use in MHz
double power
transmit power to use in dBm
uint16_t bandwidth
bandwidth to use in MHz
Time startTime
time at which transmission will be started
Time duration
the duration of the transmission
The building block of a SpectrumModel.
double fc
center frequency
double fl
lower limit of subband
double fh
upper limit of subband
constexpr uint32_t P40_CENTER_FREQUENCY
constexpr uint32_t P20_CENTER_FREQUENCY
const std::map< uint16_t, Time > PpduDurations
constexpr uint32_t P160_CENTER_FREQUENCY
constexpr uint32_t P80_CENTER_FREQUENCY
constexpr uint32_t S40_CENTER_FREQUENCY
constexpr uint32_t S80_CENTER_FREQUENCY
constexpr uint32_t S20_CENTER_FREQUENCY
WifiPhyState
The state of the PHY layer.