根据《Modeling the Underwater Acoustic Channel in ns2》将uiuc的代码整合进ns-2.34代码中, 验证论文实验结果;
以前并无添加,Channel、Physical、 Propagation等model的经验, 所以参考另外一篇文章《Understanding
the implementation of IEEE MAC 802.11 standard in NS-2》,这篇文章介绍了向ns2添加MAC 802.11标准实现的过程。
1.总体结构
对于单个节点所包括的组件,自底向上可以分为以下:
(1) Channel:底层信道模块,本实验主要是放置于 ~/ns2.34/mac/underwater{.h,. cc}文件中UnderwaterChannel类, 继承自Channel类(channel{.cc,.h} 文件中);
(2) Network Interface(netif):物理层模块,主要是放置于~ /ns2.34/mac/underwater-phy{.h, .cc}文件中UnderwaterPhy类,继承自Phy类( phy{.cc,.h}文件中);
(3) Propagation Model:传输模块,主要是放置于~/ns2.34/ mobile/underwater{.h,.cc} 文件中Underwater类
(4) Media Access Control(MAC):未涉及
(5) Outgoing Queue:未涉及
(6) Link Layer:未涉及
(7) Network Layer:未涉及
2.修改配置
在~/ns2.34/tcl/lib/ns-default. h文件中添加phy变量
Phy/UnderwaterPhy set CPThresh_ 10.0
Phy/UnderwaterPhy set CSThresh_ 20.0
Phy/UnderwaterPhy set RXThresh_ 30.0
Phy/UnderwaterPhy set bandwidth_ 2e5
#pt_ less than 120 please
Phy/UnderwaterPhy set Pt_ 97
Phy/UnderwaterPhy set freq_ 914e+6
Phy/UnderwaterPhy set L_ 1.0
3.运行结果
通过修改普通脚本的Channel, Propagation, Phy模块进行验证。
未完待续。。。
以前并无添加,Channel、Physical、
1.总体结构
对于单个节点所包括的组件,自底向上可以分为以下:
(1) Channel:底层信道模块,本实验主要是放置于 ~/ns2.34/mac/underwater{.h,.
(2) Network Interface(netif):物理层模块,主要是放置于~
(3) Propagation Model:传输模块,主要是放置于~/ns2.34/
(4) Media Access Control(MAC):未涉及
(5) Outgoing Queue:未涉及
(6) Link Layer:未涉及
(7) Network Layer:未涉及
2.修改配置
在~/ns2.34/tcl/lib/ns-default.
Phy/UnderwaterPhy set CPThresh_ 10.0
Phy/UnderwaterPhy set CSThresh_ 20.0
Phy/UnderwaterPhy set RXThresh_ 30.0
Phy/UnderwaterPhy set bandwidth_ 2e5
#pt_ less than 120 please
Phy/UnderwaterPhy set Pt_ 97
Phy/UnderwaterPhy set freq_ 914e+6
Phy/UnderwaterPhy set L_ 1.0
3.运行结果
通过修改普通脚本的Channel, Propagation, Phy模块进行验证。
未完待续。。。
Segmentation fault