NS2节点通信半径修改

ns/tcl/lib/ns-default.tcl 里有设置默认值的,传输距离250米

更改发射功率,或者接收阀值均能改变通信距离,计算公式在mobile/tworayground.cc里

ns-default.tcl 中的代码如下:

Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10

这个是默认的设置,默认的为通信距离为250米

修改步骤:

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.
[compile threshold.cc]
$ cd ns/indep-utils/propagation/
$ g++ -lm threshold.cc -o threshold

[example]
$ 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
$

参靠柯老师网站:
http://140.116.72.80/~smallko/ns2/11b.htm

In NS-2, the default transmitting power Pt is 0.28, and thus the transmission range (TX_range) and physical carrier sensing range (PCS_range) are calculated as 250 meters and 550 meters
p.s. (0.28183815×1.52×1.52) / (2504)=3.652e-10

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值