运行无线网络模拟出现的错误与解决方法

来源:互联网 发布:怎样下载英语软件 编辑:程序博客网 时间:2024/06/06 12:43

问题1:

num_nodes is set 2

ns-address.tcl:set-address-format: Unknown address format flat

while executing

"error "ns-address.tcl:set-address-format: Unknown address format $opt""

 (procedure "_o3" line 20)

 (Simulator set-address-format line 20)

 invoked from within

"$self set-address-format $addressType_ "

 (procedure "_o3" line 53)

 (Simulator node-config line 53)

  invoked from within

"$ns node-config -addressType flat "

(file "examplehw2.tcl" line 34)

 

解决方法:

将书中第29行改成:$ns node-config -addressType def/
注意结尾要有个 " / "

 

问题2:

warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
create lookup failed


解决方法:

create-god 3下面定义了一个信道参数
set chan [new $val(chan)]

把节点定义的那行-channeType改成
                          -channel $chan/

见柯志恒http://140.116.72.80/~smallko/ns2/nstutorial_wireless1.htm

 

 

原创粉丝点击