Question:   How can you set the communication radius in wireless nodes?

Answer:

To set communication radius, you have to set the receiving threshold value, RXThresh_. This can be obtained by running the program ~ns/indep-utils/propagation/threshold.cc (compile using g++ and the option –lm) and specifying the propagation model and the desired radius. Then in your script, before creating the simulator, use the command “Phy/WirelessPhy set RXThresh_ ”. Ideally, you would also like to set the transmission power, Pt_ and the carrier sensing threshold, CSThresh_. But I still don’t know how to obtain their values. Some standard values for Pt_ are: 7.214e-4 for 100m, 8.5872e-4 for 40m. Also note that the effectiveness of the radius depends on the propagation model. While it works perfectly for FreeSpace, it might not work as well for the other two.

這段話的意思是說可以藉由調整Pt_與RXThresh_的值來估算node的TX_range, 步驟如下 ($為linux提示符號):

首先complier threshold.cc檔
$ cd ns/indep-utils/propagation/
$ g++ -lm threshold.cc -o threshold

接下來就可以直接使用了,詳細的參數說明請參考ns Manual, 以下是執行的範例.
$ threshold -m TwoRayGround 250
distance = 250
propagation model: TwoRayGround

Selected parameters:
transmit power: 0.281838
frequency: 9.14e+08
transmit antenna gain: 1
receive antenna gain: 1
system loss: 1
transmit antenna height: 1.5
receive antenna height: 1.5

Receiving threshold RXThresh_ is: 3.65262e-10
$
 

另外也可以指定其它的參數,詳細的參數設定請參考NS-2手冊,CH18 Radio Propagation Models, 或者直接執行threshold指令, 若輸入參數不足, 這個程式會告訴你有哪些參數可使用, 以下是執行的結果 ($為linux提示符號):

$ threshold

USAGE: find receiving threshold for certain communication range (distance)
SYNOPSIS: threshold -m <propagation-model> [other-options] distance

<propagation-model>: FreeSpace, TwoRayGround or Shadowing
[other-options]: set parameters other than default values:

Common parameters:
-Pt <transmit-power>
-fr <frequency>
-Gt <transmit-antenna-gain>
-Gr <receive-antenna-gain>
-L <system-loss>

For two-ray ground model:
-ht <transmit-antenna-height>
-hr <receive-antenna-height>

For shadowing model:
-pl <path-loss-exponent>
-std <shadowing-deviation>
-d0 <reference-distance>
-r <receiving-rate>

下面是一個使用的範例, 假設頻率為2.4G, 傳輸距離為250 meters ($為linux提示符號):

 

$ threshold -m TwoRayGround -fr 2.4e+9 250
distance = 250
propagation model: TwoRayGround

Selected parameters:
transmit power: 0.281838
frequency: 2.4e+09
transmit antenna gain: 1
receive antenna gain: 1
system loss: 1
transmit antenna height: 1.5
receive antenna height: 1.5

Receiving threshold RXThresh_ is: 3.65262e-10
註: (0.28183815×1.52×1.52) / (2504)=3.652e-10

Reference

  1. http://www.cecs.uci.edu/~arijitg/faq.html
  2. http://web.syr.edu/~dchen02/FAQ.txt