w^P#-BWD!v4wIIPaPX`cqhNDw=i!k){3W4KliSjW|I}8x3Z|P
z1)eHwhPH_9*L#Ic)WNprqrw(=I>Dp3@r)#IhC1Y4=xHr)nLLGhFRSaGNk}R6%t*e$cKf8qrvCRwVKZBmnJ=e2
M^*A#@J#Ux#KbvOOH2?qr
diff --git a/src/mesh/test/flame/flame-regression.cc b/src/mesh/test/flame/flame-regression.cc
index a77d41b77..921374739 100644
--- a/src/mesh/test/flame/flame-regression.cc
+++ b/src/mesh/test/flame/flame-regression.cc
@@ -99,8 +99,7 @@ FlameRegressionTest::CreateDevices ()
YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default ();
Ptr chan = wifiChannel.Create ();
wifiPhy.SetChannel (chan);
- wifiPhy.Set ("TxGain", DoubleValue (1.0)); //this configuration should go away in future revision to the test
- wifiPhy.Set ("RxGain", DoubleValue (1.0)); //this configuration should go away in future revision to the test
+
// 2. setup mesh
MeshHelper mesh = MeshHelper::Default ();
mesh.SetStackInstaller ("ns3::FlameStack");
diff --git a/src/test/ns3wifi/wifi-interference-test-suite.cc b/src/test/ns3wifi/wifi-interference-test-suite.cc
index c0f215f07..d29605557 100644
--- a/src/test/ns3wifi/wifi-interference-test-suite.cc
+++ b/src/test/ns3wifi/wifi-interference-test-suite.cc
@@ -137,10 +137,6 @@ WifiInterferenceTestCase::WifiSimpleInterference (std::string phyMode,double Prs
wifi.SetStandard (wifiStandard);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
- // This is one parameter that matters when using FixedRssLossModel
- // set it to zero; otherwise, gain will be added
- wifiPhy.Set ("RxGain", DoubleValue (0) );
- wifiPhy.Set ("CcaMode1Threshold", DoubleValue (0.0) );
// ns-3 supports RadioTap and Prism tracing extensions for 802.11b
wifiPhy.SetPcapDataLinkType (WifiPhyHelper::DLT_IEEE802_11_RADIO);
@@ -172,7 +168,6 @@ WifiInterferenceTestCase::WifiSimpleInterference (std::string phyMode,double Prs
// This will disable these sending devices from detecting a signal
// so that they do not backoff
- wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (0.0) );
wifiPhy.Set ("TxGain", DoubleValue (offset + Prss) );
devices.Add (wifi.Install (wifiPhy, wifiMac, c.Get (1)));
wifiPhy.Set ("TxGain", DoubleValue (offset + Irss) );
diff --git a/src/wifi/doc/source/wifi-design.rst b/src/wifi/doc/source/wifi-design.rst
index 0b95f451e..0171c2e49 100644
--- a/src/wifi/doc/source/wifi-design.rst
+++ b/src/wifi/doc/source/wifi-design.rst
@@ -284,8 +284,7 @@ The PHY layer can be in one of six states:
#. SLEEP: the PHY is in a power save mode and cannot send nor receive frames.
Packet reception works as follows. The ``YansWifiPhy`` attribute
-CcaMode1Threshold
-corresponds to what the standard calls the "ED threshold" for CCA Mode 1.
+CcaEdThreshold corresponds to what the standard calls the "ED threshold" for CCA Mode 1.
In section 16.4.8.5: "CCA Mode 1: Energy above threshold. CCA shall report
a busy medium upon detection of any energy above the ED threshold."
@@ -295,23 +294,17 @@ However, the model doesn't support this, because there are no 'foreign'
signals in the YansWifi model-- everything is a Wi-Fi signal.
In the standard, there is also what is called the "minimum modulation
-and coding rate sensitivity" in section 18.3.10.6 CCA requirements. This is
-the -82 dBm requirement for 20 MHz channels. This is analogous to the
-EnergyDetectionThreshold attribute in ``YansWifiPhy``. CCA busy state is
-not raised in this model when this threshold is exceeded but instead RX
-state is immediately reached, since it is assumed that PLCP sync always
-succeeds in this model. Even if the PLCP header reception fails, the
+and coding rate sensitivity" in section 18.3.10.6 CCA requirements.
+This is analogous to the RxSensitivity attribute in ``YansWifiPhy``.
+CCA busy state is not raised in this model when this threshold is exceeded
+but instead RX state is immediately reached, since it is assumed that PLCP
+sync always succeeds in this model. Even if the PLCP header reception fails, the
channel state is still held in RX until YansWifiPhy::EndReceive().
-In ns-3, the values of these attributes are set to small default values
-(-96 dBm for EnergyDetectionThreshold and -99 dBm for CcaMode1Threshold).
-So, if a signal comes in at > -96 dBm and the state is IDLE or CCA BUSY,
-this model will lock onto it for the signal duration and raise RX state.
-If it comes in at <= -96 dBm but >= -99 dBm, it will definitely raise
-CCA BUSY but not RX state. If it comes in < -99 dBm, it gets added to
-the interference tracker and, by itself, it will not raise CCA BUSY, but
-maybe a later signal will contribute more power so that the threshold
-of -99 dBm is reached at a later time.
+In ns-3, the values of these attributes are -101 dBm for RxSensitivity
+and -62 dBm for CcaEdThreshold.
+So, if a signal comes in at > -101 dBm and the state is IDLE or CCA BUSY,
+this model will lock onto it for the signal duration and raise RX state.
The energy of the signal intended to be received is
calculated from the transmission power and adjusted based on the Tx gain
@@ -443,12 +436,9 @@ add their received power to the noise, in the same way that
unintended Wi-Fi signals (perhaps from a different SSID or arriving
late from a hidden node) are added to the noise.
-Third, the default value for CcaMode1Threshold attribute is -62 dBm
-rather than the value of -99 dBm used for YansWifiPhy. This is because,
-unlike YansWifiPhy, where there are no foreign signals, CCA BUSY state
-will be raised for foreign signals that are higher than this 'energy
-detection' threshold (see section 16.4.8.5 in the 802.11-2012 standard
-for definition of CCA Mode 1).
+Unlike YansWifiPhy, where there are no foreign signals, CCA BUSY state
+will be raised for foreign signals that are higher than CcaEdThreshold
+(see section 16.4.8.5 in the 802.11-2012 standard for definition of CCA Mode 1).
To support the Spectrum channel, the ``YansWifiPhy`` transmit and receive methods
were adapted to use the Spectrum channel API. This required developing
diff --git a/src/wifi/examples/wifi-manager-example.cc b/src/wifi/examples/wifi-manager-example.cc
index 402609aa1..0899d25f2 100644
--- a/src/wifi/examples/wifi-manager-example.cc
+++ b/src/wifi/examples/wifi-manager-example.cc
@@ -336,9 +336,6 @@ int main (int argc, char *argv[])
WifiHelper wifi;
wifi.SetStandard (serverSelectedStandard.m_standard);
YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();
- wifiPhy.Set ("RxNoiseFigure", DoubleValue (0.0));
- wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-110.0));
- wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-110.0));
Ptr wifiChannel = CreateObject ();
Ptr delayModel = CreateObject ();
diff --git a/src/wifi/model/spectrum-wifi-phy.cc b/src/wifi/model/spectrum-wifi-phy.cc
index 70e94ba24..892a7ca32 100644
--- a/src/wifi/model/spectrum-wifi-phy.cc
+++ b/src/wifi/model/spectrum-wifi-phy.cc
@@ -242,6 +242,14 @@ SpectrumWifiPhy::StartRx (Ptr rxParams)
// Log the signal arrival to the trace source
m_signalCb (wifiRxParams ? true : false, senderNodeId, WToDbm (rxPowerW), rxDuration);
+
+ // Do no further processing if signal is too weak
+ // Current implementation assumes constant rx power over the packet duration
+ if (WToDbm (rxPowerW) < GetRxSensitivity ())
+ {
+ NS_LOG_INFO ("Received signal too weak to process: " << WToDbm (rxPowerW) << " dBm");
+ return;
+ }
if (wifiRxParams == 0)
{
NS_LOG_INFO ("Received non Wi-Fi signal");
diff --git a/src/wifi/model/wifi-phy-state-helper.cc b/src/wifi/model/wifi-phy-state-helper.cc
index cf4e93801..4186a04e0 100644
--- a/src/wifi/model/wifi-phy-state-helper.cc
+++ b/src/wifi/model/wifi-phy-state-helper.cc
@@ -517,6 +517,7 @@ WifiPhyStateHelper::SwitchMaybeToCcaBusy (Time duration)
{
m_startCcaBusy = now;
}
+ m_stateLogger (now, duration, WifiPhyState::CCA_BUSY);
m_endCcaBusy = std::max (m_endCcaBusy, now + duration);
}
diff --git a/src/wifi/model/wifi-phy.cc b/src/wifi/model/wifi-phy.cc
index 79f9028f3..d88312e42 100644
--- a/src/wifi/model/wifi-phy.cc
+++ b/src/wifi/model/wifi-phy.cc
@@ -182,15 +182,24 @@ WifiPhy::GetTypeId (void)
.AddAttribute ("EnergyDetectionThreshold",
"The energy of a received signal should be higher than "
"this threshold (dbm) to allow the PHY layer to detect the signal.",
- DoubleValue (-96.0),
+ DoubleValue (-101.0),
MakeDoubleAccessor (&WifiPhy::SetEdThreshold),
- MakeDoubleChecker ())
- .AddAttribute ("CcaMode1Threshold",
+ MakeDoubleChecker (),
+ TypeId::DEPRECATED, "Replaced by RxSensitivity, this attribute has no effect.")
+ .AddAttribute ("RxSensitivity",
"The energy of a received signal should be higher than "
- "this threshold (dbm) to allow the PHY layer to declare CCA BUSY state.",
- DoubleValue (-99.0),
- MakeDoubleAccessor (&WifiPhy::SetCcaMode1Threshold,
- &WifiPhy::GetCcaMode1Threshold),
+ "this threshold (dBm) for the PHY to detect the signal.",
+ DoubleValue (-101.0),
+ MakeDoubleAccessor (&WifiPhy::SetRxSensitivity,
+ &WifiPhy::GetRxSensitivity),
+ MakeDoubleChecker ())
+ .AddAttribute ("CcaEdThreshold",
+ "The energy of a non Wi-Fi received signal should be higher than "
+ "this threshold (dbm) to allow the PHY layer to declare CCA BUSY state. "
+ "This check is performed on the 20 MHz primary channel only.",
+ DoubleValue (-62.0),
+ MakeDoubleAccessor (&WifiPhy::SetCcaEdThreshold,
+ &WifiPhy::GetCcaEdThreshold),
MakeDoubleChecker ())
.AddAttribute ("TxGain",
"Transmission gain (dB).",
@@ -414,6 +423,12 @@ WifiPhy::DoInitialize (void)
InitializeFrequencyChannelNumber ();
}
+Ptr