|
Bugzilla – Full Text Bug Listing |
| Summary: | m_minDistance in FriisPropagationLossModel | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Nicola Baldo <nicola> |
| Component: | propagation | Assignee: | Kirill Andreev <andreev> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | ns-bugs, tommaso.pecorella |
| Priority: | P5 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | proposed patch | ||
|
Description
Nicola Baldo
2012-06-11 10:15:03 UTC
Created attachment 1412 [details]
proposed patch
I like the idea, but I'd kinda disagree on it. The point is that the Friis model is an approximate model (very approximate) and it does have a number of hypotheses. One of them is to be in the so-called "far field" region, as is where the wave can be considered uniform. Now, most engineers are used to set this ration to 2*D^2/lambda or 3*lambda (depending on the kind of antenna) and lambda is the max wavelength. Below this limit the formula simply does not hold, so the value returned is simply to return *something*, not to have a meaningful value. Rephrasing: the Friis model should return a warning if the antenna distance is below the limit, as it can't compute a meaningful value and the model should be changed to a way more complex one. Based on this, I'd reject the proposed change, even if it sounds good. I'm, on the opposite, favourable adding a warning and an automatic set of the minimum distance to 3*lambda, since this is the default value for wire-antennas. T. I don't like too much open bugs. And I like even less them if they're patch pending. Either we apply it or we close it as WONTFIX. I already expressed my opinion about the proposed patch. What should we do with this ? (In reply to Tommaso Pecorella from comment #3) > I don't like too much open bugs. And I like even less them if they're patch > pending. Me neither. So I went ahead and pushed the fix as changeset 9d057a27ede2 :-) I added the NS_LOG_WARNING as you suggested, plus I added a pretty verbose description of the arguments for this change in the doxygen documentation. I am pasting it here below. I hope you find it convincing! * The Friis model is valid only for propagation in free space within * the so-called far field region, which can be considered * approximately as the region for \f$ d > 3 \lambda \f$. * The model will still return a value for \f$ d < 3 \lambda \f$, as * doing so (rather than triggering a fatal error) is practical for * many simulation scenarios. However, we stress that the values * obtained in such conditions shall not be considered realistic. * * Related with this issue, we note that the Friis formula is * undefined for \f$ d = 0 \f$, and results in * \f$ P_r > P_t \f$ for \f$ d < \lambda / 2 \sqrt{\pi} \f$. * Both these conditions occur outside of the far field region, so in * principle the Friis model shall not be used in these conditions. * In practice, however, Friis is often used in scenarios where accurate * propagation modeling is not deemed important, and values of \f$ d = * 0 \f$ can occur. To allow practical use of the model in such * scenarios, we have to 1) return some value for \f$ d = 0 \f$, and * 2) avoid large discontinuities in propagation loss values (which * could lead to artifacts such as bogus capture effects which are * much worse than inaccurate propagation loss values). The two issues * are conflicting, as, according to the Friis formula, * \f$\lim_{d \to 0 } P_r = +\infty \f$; * so if, for \f$ d = 0 \f$, we use a fixed loss value, we end up with an infinitely large * discontinuity, which as we discussed can cause undesireable * simulation artifacts. * * To avoid these artifact, this implmentation of the Friis model * provides an attribute called MinLoss which allows to specify the * minimum total loss (in dB) returned by the model. This is used in * such a way that * \f$ P_r \f$ continuously increases for \f$ d \to 0 \f$, until * MinLoss is reached, and then stay constant; this allow to * return a value for \f$ d = 0 \f$ and at the same time avoid * discontinuities. The model won't be much realistic, but at least * the simulation artifacts discussed before are avoided. The default value of * MinLoss is 0 dB, which means that by default the model will return * \f$ P_r = P_t \f$ for \f$ d <= \lambda / 2 \sqrt{\pi} \f$. We note * that this value of \f$ d \f$ is outside of the far field * region, hence the validity of the model in the far field region is * not affected. * Note that from a practical point of view the patch returns Pr = Pt for d = 0, which is exactly the same as before. The main difference is that before the distance at which the model started to return Pr = Pt was arbitrary, hence it caused a discontinuity of path loss vs distance, while now the distance is exactly that for which Friis' formula returns Pr = Pt, hence the discontinuity is eliminated. That's the only change in behavior, at least when default attribute values are used. +1 (in ratification) |