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;
135 double expectedCcaThresholdDbm);
155 :
TestCase(
"Wi-Fi PHY CCA thresholds test"),
156 m_CcaEdThresholdDbm{-62.0},
157 m_CcaSensitivityDbm{-82.0},
158 m_secondaryCcaSensitivityThresholds{-72.0, -72.0, -69.0},
170 return Create<WifiPsdu>(pkt, hdr);
179 return Create<OfdmPpdu>(psdu, txVector, channel, 0);
189 return Create<HtPpdu>(psdu, txVector, channel,
MicroSeconds(100), 0);
199 return Create<VhtPpdu>(psdu, txVector, channel,
MicroSeconds(100), 0);
209 return Create<HePpdu>(psdu, txVector, channel,
MicroSeconds(100), 0);
216 double expectedCcaThresholdDbm)
218 NS_LOG_FUNCTION(
this << phy << channelType << expectedCcaThresholdDbm);
219 double actualThresholdDbm = phy->GetCcaThreshold(ppdu, channelType);
220 NS_LOG_INFO((ppdu ==
nullptr ?
"any signal" :
"a PPDU")
221 <<
" in " << channelType <<
" channel: " << actualThresholdDbm <<
"dBm");
223 expectedCcaThresholdDbm,
225 "Actual CCA threshold for "
226 << (ppdu ==
nullptr ?
"any signal" :
"a PPDU") <<
" in "
227 << channelType <<
" channel " << actualThresholdDbm
228 <<
"dBm does not match expected threshold "
229 << expectedCcaThresholdDbm <<
"dBm");
238 m_device = CreateObject<WifiNetDevice>();
243 m_phy = CreateObject<SpectrumWifiPhy>();
249 auto channelNum = std::get<0>(
624 const std::vector<Time>& per20MhzDurations)
override
626 NS_LOG_FUNCTION(
this << duration << channelType << per20MhzDurations.size());
685 void DoRun()
override;
694 void SendHeSuPpdu(
double txPowerDbm, uint16_t frequency, uint16_t bandwidth);
731 const std::vector<Time>& expectedPer20MhzDurations);
793 const std::vector<TxSignalInfo>& generatedSignals,
794 const std::vector<TxPpduInfo>& generatedPpdus,
795 const std::vector<StateCheckPoint>& stateCheckpoints,
796 const std::vector<CcaCheckPoint>& ccaCheckpoints);
815 std::unique_ptr<CcaTestPhyListener>
823 :
TestCase(
"Wi-Fi PHY CCA indication test"),
824 m_numSignalGenerators(2),
837 NS_LOG_FUNCTION(
this << signalGenerator << txPowerDbm << frequency << bandwidth << duration);
840 bandInfo.
fc = frequency * 1e6;
841 bandInfo.
fl = bandInfo.
fc - ((bandwidth / 2) * 1e6);
842 bandInfo.
fh = bandInfo.
fc + ((bandwidth / 2) * 1e6);
844 bands.push_back(bandInfo);
848 *signalPsd =
DbmToW(txPowerDbm) / (bandwidth * 1e6);
850 signalGenerator->SetTxPowerSpectralDensity(signalPsd);
851 signalGenerator->SetPeriod(duration);
852 signalGenerator->Start();
860 signalGenerator->Stop();
906 currentState = state->GetState();
909 "PHY State " << currentState <<
" does not match expected state "
915 Time expectedEndTime,
917 const std::vector<Time>& expectedPer20MhzDurations)
922 <<
" does not match expected time " << expectedEndTime
927 <<
" does not match expected channel type "
930 expectedPer20MhzDurations.size(),
931 "PHY CCA-BUSY per-20 MHz durations does not match expected vector"
933 for (std::size_t i = 0; i < expectedPer20MhzDurations.size(); ++i)
936 expectedPer20MhzDurations.at(i),
937 "PHY CCA-BUSY per-20 MHz duration at index "
938 << i <<
" does not match expected duration at "
951 const std::vector<TxSignalInfo>& generatedSignals,
952 const std::vector<TxPpduInfo>& generatedPpdus,
953 const std::vector<StateCheckPoint>& stateCheckpoints,
954 const std::vector<CcaCheckPoint>& ccaCheckpoints)
956 for (
const auto& generatedPpdu : generatedPpdus)
962 generatedPpdu.centerFreq,
963 generatedPpdu.bandwidth);
966 std::size_t index = 0;
967 for (
const auto& generatedSignal : generatedSignals)
973 generatedSignal.power,
974 generatedSignal.centerFreq,
975 generatedSignal.bandwidth,
976 generatedSignal.duration);
979 for (
const auto& checkpoint : ccaCheckpoints)
985 checkpoint.expectedChannelListType,
986 checkpoint.expectedPer20MhzDurations);
989 for (
const auto& checkpoint : stateCheckpoints)
994 checkpoint.expectedPhyState);
1014 Ptr<Node> rxNode = CreateObject<Node>();
1018 rxDev->SetVhtConfiguration(vhtConfiguration);
1019 m_rxPhy = CreateObject<SpectrumWifiPhy>();
1027 CreateObject<ThresholdPreambleDetectionModel>();
1033 rxNode->AddDevice(rxDev);
1035 Ptr<Node> txNode = CreateObject<Node>();
1037 m_txPhy = CreateObject<SpectrumWifiPhy>();
1047 txNode->AddDevice(txDev);
1051 Ptr<Node> signalGeneratorNode = CreateObject<Node>();
1053 CreateObject<NonCommunicatingNetDevice>();
1055 signalGenerator->SetDevice(signalGeneratorDev);
1056 signalGenerator->SetChannel(spectrumChannel);
1057 signalGenerator->SetDutyCycle(1);
1058 signalGeneratorNode->AddDevice(signalGeneratorDev);
1068 int64_t streamNumber = 0;
1083 std::vector<Time> expectedPer20MhzCcaBusyDurations{};
1094 "Reception of a signal that occupies P20 below ED threshold");
1101 WifiPhyState::IDLE},
1114 "Reception of signal that occupies P20 above ED threshold");
1119 {
aCcaTime, WifiPhyState::CCA_BUSY},
1121 WifiPhyState::CCA_BUSY},
1143 : std::vector<Time>{})}});
1152 "Reception of two 20 MHz signals that occupies P20 below ED threshold with "
1153 "sum above ED threshold");
1162 WifiPhyState::CCA_BUSY},
1184 : std::vector<Time>{})}});
1194 "Reception of a 20 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1201 WifiPhyState::IDLE},
1216 "Reception of a 20 MHz HE PPDU that occupies P20 above CCA sensitivity threshold");
1222 {
aCcaTime, WifiPhyState::CCA_BUSY},
1234 ? std::vector<Time>{
Seconds(0),
1244 : std::vector<Time>{})}});
1254 "Reception of a 40 MHz HE PPDU that occupies P20 below CCA sensitivity threshold");
1261 WifiPhyState::IDLE},
1276 "Reception of a 40 MHz HE PPDU that occupies P40 above CCA sensitivity threshold");
1282 {
aCcaTime, WifiPhyState::CCA_BUSY},
1286 : WifiPhyState::CCA_BUSY},
1296 ? std::vector<Time>{
Seconds(0),
1306 : std::vector<Time>{})}});
1317 "Reception of a 20 MHz signal that occupies S20 below ED threshold");
1324 WifiPhyState::IDLE},
1337 "Reception of a 20 MHz signal that occupies S20 above ED threshold");
1345 WifiPhyState::IDLE},
1373 "Reception of a 40 MHz signal that occupies P40 above ED threshold");
1379 {
aCcaTime, WifiPhyState::CCA_BUSY},
1381 WifiPhyState::CCA_BUSY},
1409 "Reception of a signal that occupies S20 followed by the reception of "
1410 "another signal that occupies P20");
1419 WifiPhyState::CCA_BUSY},
1422 WifiPhyState::CCA_BUSY},
1466 "Reception of a signal that occupies P20 followed by the reception of "
1467 "another signal that occupies S20");
1474 {
aCcaTime, WifiPhyState::CCA_BUSY},
1476 WifiPhyState::CCA_BUSY},
1479 WifiPhyState::CCA_BUSY},
1524 "Reception of a 20 MHz HE PPDU that occupies S20 below CCA sensitivity threshold");
1531 WifiPhyState::IDLE},
1545 "Reception of a 20 MHz HE PPDU that occupies S20 above CCA sensitivity threshold");
1552 WifiPhyState::IDLE},
1583 "Reception of a 20 MHz signal that occupies S20 above ED threshold followed by a 40 "
1584 "MHz HE PPDU that occupies P40 below CCA sensitivity threshold");
1614 : std::vector<Time>{})},
1642 "Reception of a 20 MHz signal that occupies the first subchannel of "
1643 "S40 below ED threshold");
1650 WifiPhyState::IDLE},
1665 "Reception of a 20 MHz signal that occupies the first subchannel of "
1666 "S40 above ED threshold");
1673 WifiPhyState::IDLE},
1700 "Reception of a 20 MHz signal that occupies the second subchannel of "
1701 "S40 below ED threshold");
1708 WifiPhyState::IDLE},
1723 "Reception of a 20 MHz signal that occupies the second subchannel of "
1724 "S40 above ED threshold");
1731 WifiPhyState::IDLE},
1758 "Reception of a 40 MHz signal that occupies S40 below ED threshold");
1765 WifiPhyState::IDLE},
1780 "Reception of a 20 MHz signal that occupies the second subchannel of "
1781 "S40 above ED threshold");
1788 WifiPhyState::IDLE},
1815 "Reception of a 80 MHz signal that occupies P80 above ED threshold");
1820 {
aCcaTime, WifiPhyState::CCA_BUSY},
1822 WifiPhyState::CCA_BUSY},
1849 "Reception of a 20 MHz signal that occupies S40 followed by the "
1850 "reception of another 20 MHz signal that occupies P20");
1859 WifiPhyState::CCA_BUSY},
1862 WifiPhyState::CCA_BUSY},
1904 "Reception of a signal that occupies S40 followed by the reception of "
1905 "another signal that occupies S20");
1915 WifiPhyState::IDLE},
1958 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
1965 WifiPhyState::IDLE},
1979 "Reception of a 40 MHz HE PPDU that occupies S40 above CCA sensitivity threshold");
1986 WifiPhyState::IDLE},
2015 "Reception of a 40 MHz signal that occupies S40 above ED threshold followed by a 80 "
2016 "MHz HE PPDU that occupies P80 below CCA sensitivity threshold");
2069 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA "
2070 "sensitivity threshold");
2075 {
aCcaTime, WifiPhyState::CCA_BUSY},
2077 WifiPhyState::CCA_BUSY},
2094 : std::vector<Time>{
Seconds(0),
2099 : std::vector<Time>{})},
2113 : std::vector<Time>{
Seconds(0),
2118 : std::vector<Time>{})}});
2128 "Reception of a 80 MHz HE PPDU that occupies the 40 MHz band above CCA "
2129 "sensitivity threshold");
2135 {
aCcaTime, WifiPhyState::CCA_BUSY},
2137 WifiPhyState::CCA_BUSY},
2159 : std::vector<Time>{})},
2178 : std::vector<Time>{})}});
2188 "Reception of a 40 MHz HE PPDU that does not occupy the operational channel");
2195 WifiPhyState::IDLE},
2211 "Reception of a 20 MHz signal that occupies the first subchannel of "
2212 "S80 below ED threshold");
2219 WifiPhyState::IDLE},
2233 "Reception of a 20 MHz signal that occupies the first subchannel of "
2234 "S80 above ED threshold");
2241 WifiPhyState::IDLE},
2264 "Reception of a 20 MHz signal that occupies the second subchannel of "
2265 "S80 below ED threshold");
2272 WifiPhyState::IDLE},
2286 "Reception of a 20 MHz signal that occupies the second subchannel of "
2287 "S80 above ED threshold");
2294 WifiPhyState::IDLE},
2317 "Reception of a 20 MHz signal that occupies the third subchannel of "
2318 "S80 below ED threshold");
2325 WifiPhyState::IDLE},
2339 "Reception of a 20 MHz signal that occupies the third subchannel of "
2340 "S80 above ED threshold");
2347 WifiPhyState::IDLE},
2370 "Reception of a 20 MHz signal that occupies the fourth subchannel of "
2371 "S80 below ED threshold");
2378 WifiPhyState::IDLE},
2392 "Reception of a 20 MHz signal that occupies the fourth subchannel of "
2393 "S80 above ED threshold");
2400 WifiPhyState::IDLE},
2423 "Reception of a 40 MHz signal that occupies the first and second "
2424 "subchannels of S80 below ED threshold");
2431 WifiPhyState::IDLE},
2445 "Reception of a 40 MHz signal that occupies the first and second "
2446 "subchannels of S80 above ED threshold");
2453 WifiPhyState::IDLE},
2476 "Reception of a 40 MHz signal that occupies the third and fourth "
2477 "subchannels of S80 below ED threshold");
2484 WifiPhyState::IDLE},
2498 "Reception of a 40 MHz signal that occupies the third and fourth "
2499 "subchannels of S80 above ED threshold");
2506 WifiPhyState::IDLE},
2529 "Reception of a 80 MHz signal that occupies S80 below ED threshold");
2536 WifiPhyState::IDLE},
2550 "Reception of a 80 MHz signal that occupies S80 above ED threshold");
2557 WifiPhyState::IDLE},
2581 "Reception of a 160 MHz signal that occupies the whole band below ED threshold");
2588 WifiPhyState::IDLE},
2603 "Reception of a 160 MHz signal that occupies the whole band above ED threshold");
2608 {
aCcaTime, WifiPhyState::CCA_BUSY},
2610 WifiPhyState::CCA_BUSY},
2633 "Reception of a 20 MHz signal that occupies S80 followed by the "
2634 "reception of another 20 MHz signal that occupies P20");
2643 WifiPhyState::CCA_BUSY},
2646 WifiPhyState::CCA_BUSY},
2680 "Reception of a signal that occupies S80 followed by the reception of "
2681 "another signal that occupies S40");
2691 WifiPhyState::IDLE},
2725 "Reception of a signal that occupies S80 followed by the reception of "
2726 "another signal that occupies S20");
2736 WifiPhyState::IDLE},
2771 "Reception of a 40 MHz HE PPDU that occupies S40 below CCA sensitivity threshold");
2778 WifiPhyState::IDLE},
2792 "Reception of a 80 MHz HE PPDU that occupies S80 above CCA sensitivity threshold");
2799 WifiPhyState::IDLE},
2822 "Reception of a 20 MHz signal that generates a per20bitmap parameter "
2823 "change when previous CCA indication reports IDLE");
2830 WifiPhyState::IDLE},
2854 "Reception of a 20 MHz signal that generates a per20bitmap parameter change when "
2855 "previous CCA indication reports BUSY for the primary channel");
2862 {
aCcaTime, WifiPhyState::CCA_BUSY},
2864 WifiPhyState::CCA_BUSY},
2928 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< WifiNetDevice > m_device
The WifiNetDevice.
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< SpectrumWifiPhy > m_phy
The spectrum PHY.
Ptr< ObssPdAlgorithm > m_obssPdAlgorithm
The OBSS-PD algorithm.
Ptr< HtPpdu > CreateDummyHtPpdu(uint16_t bandwidth, const WifiPhyOperatingChannel &channel)
Create a HT PPDU.
Ptr< VhtPpdu > CreateDummyVhtPpdu(uint16_t bandwidth, const WifiPhyOperatingChannel &channel)
Create a VHT PPDU.
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 ...
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.
Ptr< HePpdu > CreateDummyHePpdu(uint16_t bandwidth, const WifiPhyOperatingChannel &channel)
Create a HE PPDU.
Ptr< OfdmPpdu > CreateDummyNonHtPpdu(const WifiPhyOperatingChannel &channel)
Create a non-HT PPDU.
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 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, 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 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.
const WifiPhyOperatingChannel & GetOperatingChannel() const
Get a const reference to the 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.
Class that keeps track of all information about the current PHY operating channel.
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.