Bugzilla – Bug 2274
Nakagami Propagation Loss Model Doesn't Work Properly
Last modified: 2016-01-27 18:15:58 UTC
Not quite sure if this topic has been discussed before or not. My apologies if it's been mentioned before and somebody is already working on it. I noticed that the NakagamiPropagationLossModel with the default parameters can deliver packets for any given distance. Following you can see some of the default debug log for the loss model: Nakagami distance=99920m, power=0.1W, resultPower=0.179078W=22.5304dBm Nakagami distance=80m, power=0.1W, resultPower=0.0641593W=18.0726dBm Nakagami distance=69.7062m, power=0.1W, resultPower=0.184986W=22.6714dBm Nakagami distance=100000m, power=0.1W, resultPower=0.17592W=22.4531dBm Nakagami distance=99920m, power=0.1W, resultPower=0.404484W=26.069dBm Nakagami distance=100000m, power=0.1W, resultPower=0.0149106W=11.735dBm Nakagami distance=80m, power=0.1W, resultPower=0.000818786W=-0.868295dBm Nakagami distance=106.061m, power=0.1W, resultPower=0.0285696W=14.559dBm It can be clearly seen that the RSSI is very high (i.e. 18.0726 instead of a value near -70 to -80 for 80 m). It also can be seen that the number is mostly independent of the distance between sender and receiver. These log lines show that the model is not working properly.
Hi, indeed these numbers are... disturbing. Beside the quite high values, the main point is that Nakagami should be a LOSS model, while in your case there are also some GAINS. Heck, if that could be true we'd be running for a Nobel prize. however, I'm more inclined to think that we'd run for an IgNobel prize (if we punish these results). Mind to attack a test program ?
Hi Tomasso, I already implemented the Nakagami propagation model based on the ThreeLogDistancePropagationLossModel class provided by the ns3. You can find the patches here: http://winlab.rutgers.edu/~rostami/patches/NakagamiModelPatch.html Regards, -Ali
Hi, Tom said that Nicola will take a look at this (even better), so I'll just add that there's a "bug" in the documentation: * \f[ p(x; m, \omega) = \frac{2 m^m}{\Gamma(m) \omega^m} x^{2m - 1} e^{-\frac{m}{\omega} x^2} = 2 x \cdot p_{\text{Gamma}}(x^2, m, \frac{m}{\omega}) \f] should be * \f[ p(x; m, \omega) = \frac{2 m^m}{\Gamma(m) \omega^m} x^{2m - 1} e^{-\frac{m}{\omega} x^2} = 2 x \cdot p_{\text{Gamma}}(x^2, m, \frac{\omega}{m}) \f] (the last fraction is inverted) ( In reply to Ali Rostami from comment #2) > Hi Tomasso, > > I already implemented the Nakagami propagation model based on the > ThreeLogDistancePropagationLossModel class provided by the ns3. > > You can find the patches here: > > http://winlab.rutgers.edu/~rostami/patches/NakagamiModelPatch.html > > Regards, > -Ali
Thanks Ali and Tommaso for the feedback on this bug! I agree with Konstantino's comments on ns-3-users: https://groups.google.com/d/msg/ns-3-users/AX17EtF1e9I/kOSDiBS4BAAJ i.e., Nakagami models only multipath fading, hence it should be used in conjunction with a distance-based path loss propagation model for most scenarios. I've updated the documentation to make this clearer (changeset fcb9df8fa153). Begin a multipath fading only model explains why gains (not losses) do appear in some cases, it's constructive interference. As for the formula, I was not able to find any reference for the expression of the probability density as a function of the Gamma function, i.e., this part: = 2 x \cdot p_{\text{Gamma}}(x^2, m, \frac{\omega}{m} and actually from the references to the Gamma function that I found I got the impression that this alternative formulation might actually be incorrect, hence I removed it to the documentation, leaving only the main formulation (which is the one that you would typically find). Of course, if anyone has a good explanation or reference for the alternative formulation, I'd be ok with including it back again.
The second formula is obtained from simple math operations. Just when you find in the textbooks something like "This is the formula [horribly long formula] with is equivalent to this [utterly simple one]. The passages are left to the reader as a useful exercise." In this case the math *is* simple (I was able to do it, so it is). It could be useful to re-add it back since the second formula is what is used for real in the code (if I'm right).
(In reply to Tommaso Pecorella from comment #5) > The second formula is obtained from simple math operations. > > Just when you find in the textbooks something like "This is the formula > [horribly long formula] with is equivalent to this [utterly simple one]. The > passages are left to the reader as a useful exercise." > > In this case the math *is* simple (I was able to do it, so it is). Ok let me play Saint Tommaso here ;-) I'll believe in it when I'll see it... > > It could be useful to re-add it back since the second formula is what is > used for real in the code (if I'm right). I think the code does not use that formula, but rather this approach: https://en.wikipedia.org/wiki/Nakagami_distribution#Generation by the way, I get the impression that a square root is missing in the code
Created attachment 2252 [details] proof Attaching also the LateX, just if you want to use it :) p(x;m,\omega) &= \frac{2m^m}{\Gamma(m)\omega^m}x^{2m-1}e^{-\frac{m}{\omega}x^2} \\ &= 2x\left(\left(\frac{m}{\omega}\right)^m \frac{x^{2(m-1)}}{\Gamma(m)} e^{-\frac{m}{\omega}x^2} \right) \\ & \text{Notation change: } y=x^2, \theta = \omega/m \\ &= 2x\left(\frac{y^{m-1}}{\Gamma(m)\theta^m} e^{- \frac{y}{\theta}} \right) \\ &= 2x \ p_\text{gamma}(y;m,\theta) \\ &= 2x \ p_\text{gamma}(x^2;m,\frac{\omega}{m})
(In reply to Nicola Baldo from comment #4) > Thanks Ali and Tommaso for the feedback on this bug! > > I agree with Konstantino's comments on ns-3-users: > https://groups.google.com/d/msg/ns-3-users/AX17EtF1e9I/kOSDiBS4BAAJ > i.e., Nakagami models only multipath fading, hence it should be used in > conjunction with a distance-based path loss propagation model for most > scenarios. > > I've updated the documentation to make this clearer (changeset fcb9df8fa153). here is the URL of the documentation patch: http://code.nsnam.org/ns-3-dev/rev/fcb9df8fa153
(In reply to Tom Henderson from comment #8) > (In reply to Nicola Baldo from comment #4) > > Thanks Ali and Tommaso for the feedback on this bug! > > > > I agree with Konstantino's comments on ns-3-users: > > https://groups.google.com/d/msg/ns-3-users/AX17EtF1e9I/kOSDiBS4BAAJ > > i.e., Nakagami models only multipath fading, hence it should be used in > > conjunction with a distance-based path loss propagation model for most > > scenarios. > > > > I've updated the documentation to make this clearer (changeset fcb9df8fa153). > > here is the URL of the documentation patch: > http://code.nsnam.org/ns-3-dev/rev/fcb9df8fa153 Hi Tom, Thanks for the effort. I guess everything is right now. The ambiguity was that one should use more than one path loss model to properly employ all the path loss components. I need to say I'm surprised that I never came across a tutorial (as a user, not a developer) indicating that the Nakagami model could (should) be used in conjunction with other path loss models such as Three Log-Distance mode. I changed the description page of provided patch, indicating that the patch is mo longer needed if you add Nakagami and (i.e.) three log-distance path loss model together. The only possible advantage could be the performance in larger scales simulation where there are a lot of packets need to be handled. I'm not sure of the last claim, though. I'll try to provide evidence for it and then we can continue the performance discussion on a different thread. Thanks again for clarification.