diff --git a/src/devices/wifi/propagation-loss-model.cc b/src/devices/wifi/propagation-loss-model.cc index 635209ba2..8c45a0855 100644 --- a/src/devices/wifi/propagation-loss-model.cc +++ b/src/devices/wifi/propagation-loss-model.cc @@ -52,6 +52,10 @@ static NumericDefaultValue g_friisSystemLoss ("FriisPropagationLossSystemLoss", "The system loss to use by default for every FriisPropagationLossModel", 1.0); +static NumericDefaultValue g_friisPropagationLossMinDistance +("FriisPropagationLossMinDistance", + "The distance under which the propagation model refuses to give results (m)", + 0.5); static RandomVariableDefaultValue g_random ("RandomPropagationLossDistribution", @@ -198,6 +202,11 @@ FriisPropagationLossModel::GetRxPower (double txPowerDbm, * lambda: wavelength (m) */ double distance = a->GetDistanceFrom (b); + if (distance <= g_friisPropagationLossMinDistance.GetValue ()) + { + NS_FATAL_ERROR ("The friis propagation loss model is invalid when d="<< + distance<<"m << "<