Modifying transmission range values in ns-2
Tuesday, October 5, 2010
2:15 AM
Posted by
naz
Labels:
fyp
,
ns2
4
In my final year project, I have to vary the transmission range value in order to study the protocol behaviour using simulation with NS-2.
This can be done using a separate C program that is provided at ~ns/indep-utils/propagation/threshold.cc to compute the receiving threshold. It can be used for all the propagation models as discussed in ns-manual 18.4.
In some applications, a user may want to specify the communication range of wireless nodes. This can be done by set an appropriate value of the receiving threshold in the network interface,
- Phy/WirelessPhy set RXThresh_ \
Compile threshold.cc using this command:
- g++ threshold.cc -o threshold
Assume you have compiled it and get the excutable named as threshold. You can use it to compute the threshold as follows:
- threshold -m \
[other-options] distance - where propagation-model is either FreeSpace, TwoRayGround or Shadowing, and the distance is the communication range in meter.
- [other-options] are used to specify parameters other than their default values. For the shadowing model there is a necessary parameter, -r receive-rate, which specifies the rate of correct reception at thedistance.
- Because the communication range in the shadowing model is not an ideal circle, an inverse Q-function [29] is used to calculate the receiving threshold. For example, if you want 95% of packets can be correctly received at the distance of 50m, you can compute the threshold by
- threshold -m Shadowing -r 0.95 50
- Other available values of [other-options] are shown below
- -pl \
-std \ -fr \-Pt \ -Gt \ -L \-Gr \ -ht \ -d0 \-hr \
- Phy/WirelessPhy set RXThresh_ 3.07645e-07