分类: LINUX
2009-05-15 01:11:54
Thresh如设置:
最近在NS2中做802.11b链路,需要改设置如下:
( Modified model for 802.11b)
TxPower |
0.031622777 W (15dbm) | Rate |
distance |
CST |
-100dbm (1e-13 W) |
1124m |
|
RxThreshold[0] |
-94dbm
3.9811e-13 W |
1Mbps |
796 |
RxThreshold[1] | -91dbm 7.9433e-13W |
2Mbps |
669 |
RxThreshold[2] | -87dbm
1.9953e-12 W |
5.5Mbps |
532m |
RxThreshold[3] | -82dbm
6.3096e-12 W |
11Mbps |
399m |
-----
在../tcl/lib/ns-default.tcl中,有如下几行:
# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11 ;#550m
Phy/WirelessPhy set RXThresh_ 3.652e-10 ;#250m
Phy/WirelessPhy set bandwidth_ 2e6 ;#2Mbps
Phy/WirelessPhy set Pt_ 0.28183815 ;#传输功率
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0
默认载波侦听距离为550米,无线节点覆盖范围250米,带宽2Mbps
RXThresh_ 门限的生成可以使用NS中的~ns/indep-utils/propagation/threshold.cc文件来生成可执行文件 a.out
具体方法如下:
先进如文件夹
[root@localhost propagation]# g++ threshold.cc
生成了a.out文件
附:1. 要执行 ./a.out即可
是因为环境变量 $PATH 中没有当前目录;
也可以 $set $PATH=$PATH:当前目录(比如/home/you)
2. 编译c用 gcc 命令
编译c++ 用 g++ 命令
然后假如要生成RXThresh_ 为 100m,则
使用的是TwoRayGround模型
[root@localhost propagation]# ./a.out -m TwoRayGround -r 0.95 100
则可得到要用的门限
[root@localhost propagation]# ./a.out -m TwoRayGround -r 0.95 100
distance = 100
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: 1.42681e-08
红色的即为所要的值
附:使用说明
USAGE: find receiving threshold for certain communication range (distance)
SYNOPSIS: threshold -m
[other-options]: set parameters other than default values:
Common parameters:
-Pt
-fr
-Gt
-Gr
-L
For two-ray ground model:
-ht
-hr
For shadowing model:
-pl
-std
-d0
-r