NS2节点通信半径修改

上传人:m**** 文档编号:486757108 上传时间:2023-02-23 格式:DOCX 页数:3 大小:9.14KB
返回 下载 相关 举报
NS2节点通信半径修改_第1页
第1页 / 共3页
NS2节点通信半径修改_第2页
第2页 / 共3页
NS2节点通信半径修改_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《NS2节点通信半径修改》由会员分享,可在线阅读,更多相关《NS2节点通信半径修改(3页珍藏版)》请在金锄头文库上搜索。

1、分类:NS22011-12-10 22:27 1656人阅读评论(3)收藏举报iostreamdistanceparameterscommandsystem ns/tcl/lib/ns-default.tcl里有设置默认值的,传输距离250米更改发射功率,或者接收阀值均能改变通信距离,计算公式在mobile/tworayground.cc里ns-default.tcl中的代码如下:Phy/WirelessPhy set CSThresh_ 1.559e-11 /this sensoring radiusPhy/WirelessPhy set RXThresh_ 3.652e-10 /this

2、is the communication radius这个是默认的设置,默认的为通信距离为250米 修改步骤:To set communication radius, you have to set the receiving threshold value, RXThresh_.This can be obtained by running the programns/indep-utils/propagation/threshold.cc(compile using g+ and the option-lm) and specifying the propagation model and

3、 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 dont know how to obtain their values. Some standard value

4、s for Pt_ are: 7.214e-4 for 100m, 8.5872e-4 for 40m. Also note that the effectiveness of theradius depends on the propagation model. While it works perfectly for FreeSpace, it might not work as well for the other two.编译threshold.cc文件的时候需要修改以下几点:#include 修改为#include ,同时加上 using namespace std;再添加头文件:#

5、include compile threshold.cc$ cd ns/indep-utils/propagation/$ g+ -Im threshold.cc -o thresholdexample$ ./threshold -lm TwoRayGround -r 250 250distance = 250propagation model: TwoRayGroundSelected parameters:transmit power: 0.281838frequency: 9.14e+08transmit antenna gain: 1receive antenna gain: 1sys

6、tem loss: 1transmit antenna height: 1.5receive antenna height: 1.5Receiving threshold RXThresh_ is: 3.65262e-10其中的参数说明:-pl -std -Pt -fr -Gt -Gr -L -ht -hr -d0 上面就是默认情况下传感器的设置;如果你想更改你的传感器通信半径只需要用你的半径值去替代 250参数即可。参靠柯老师网站:http:/140.116.72.80/smallko/ns2/11b.htmInNS-2, the default transmitting powerPt is 0.28, and thus thetransmission rangeTX_range) andphysical carrier sensing range (PCS_range) are calculated as 250 meters and 550 metersp.s. (0.28183815x1.52x1.52) / (2504)=3.652e-10

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号