Can';t在ubuntu14.04中的ns-2.35上运行dymoum test_2n.tcl文件
成功应用后,Can';t在ubuntu14.04中的ns-2.35上运行dymoum test_2n.tcl文件,tcl,ns2,Tcl,Ns2,成功应用后,/home/uday/ns-allinone-2.35/ns-2.35/DYMO-03-all\u ns235.补丁 当我尝试运行以下dymoum/ns/test/test\u 2n.tcl代码时,它给出了错误,我无法解决该错误。我尽了最大努力,但失败了…请查看代码并帮助我解决错误。测试代码如下: # ====================================================================== # Define options # ==
/home/uday/ns-allinone-2.35/ns-2.35/DYMO-03-all\u ns235.补丁
当我尝试运行以下dymoum/ns/test/test\u 2n.tcl
代码时,它给出了错误,我无法解决该错误。我尽了最大努力,但失败了…请查看代码并帮助我解决错误。测试代码如下:
# ======================================================================
# Define options
# ======================================================================
set opt(chan) Channel/WirelessChannel ;# channel type
set opt(prop) Propagation/TwoRayGround ;# radio-propagation model
set opt(netif) Phy/WirelessPhy ;# network interface type
set opt(mac) Mac/802_11 ;# MAC type
set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type
set opt(ll) LL ;# link layer type
set opt(ant) Antenna/OmniAntenna ;# antenna model
set opt(ifqlen) 50 ;# max packet in ifq
set opt(nn) 2 ;# number of mobilenodes
set opt(adhocRouting) DYMOUM ;# routing protocol
set opt(cp) "" ;# connection pattern file
set opt(sc) "" ;# node movement file.
set opt(x) 400 ;# x coordinate of topology
set opt(y) 600 ;# y coordinate of topology
set opt(seed) 0.0 ;# seed for random number gen.
set opt(stop) 40 ;# time to stop simulation
set opt(cbr-start) 10.0
# ============================================================================
#
# check for random seed
#
if {$opt(seed) > 0} {
puts "Seeding Random number generator with $opt(seed)\n"
ns-random $opt(seed)
}
#
# create simulator instance
#
set ns_ [new Simulator]
#
# control DYMOUM behaviour from this script
#
Agent/DYMOUM set debug_ true
Agent/DYMOUM set no_path_acc_ true
Agent/DYMOUM set reissue_rreq_ false
Agent/DYMOUM set s_bit_ true
Agent/DYMOUM set hello_ival_ 1
#
# open traces
#
set tracefd [open test_2n.tr w]
set namtrace [open test_2n.nam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)
#
# create topography object
#
set topo [new Topography]
#
# define topology
#
$topo load_flatgrid $opt(x) $opt(y)
#
# create God
#
create-god $opt(nn)
#
# configure mobile nodes
#
$ns_ node-config -adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channelType $opt(chan) \
-topoInstance $topo \
-wiredRouting OFF \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF
for {set i 0} {$i < $opt(nn)} {incr i} {
set node_($i) [$ns_ node]
}
#
# positions
#
$node_(0) set X_ 200.0
$node_(0) set Y_ 200.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 300.0
$node_(1) set Y_ 200.0
$node_(1) set Z_ 0.0
#
# setup UDP connection
#
set udp [new Agent/UDP]
set null [new Agent/Null]
$ns_ attach-agent $node_(0) $udp
$ns_ attach-agent $node_(1) $null
$ns_ connect $udp $null
set cbr [new Application/Traffic/CBR]
$cbr set packetSize_ 512
$cbr set rate_ 20Kb
$cbr attach-agent $udp
$ns_ at $opt(cbr-start) "$cbr start"
#
# print (in the trace file) routing table and other
# internal data structures on a per-node basis
# TODO: implement this
#$ns_ at 15.0 "[$node_(0) agent 255] print_rtable"
#
# source connection-pattern and node-movement scripts
#
if { $opt(cp) == "" } {
puts "*** NOTE: no connection pattern specified."
set opt(cp) "none"
} else {
puts "Loading connection pattern..."
source $opt(cp)
}
if { $opt(sc) == "" } {
puts "*** NOTE: no scenario file specified."
set opt(sc) "none"
} else {
puts "Loading scenario file..."
source $opt(sc)
puts "Load complete..."
}
#
# define initial node position in nam
#
for {set i 0} {$i < $opt(nn)} {incr i} {
$ns_ initial_node_pos $node_($i) 20
}
#
# tell all nodes when the simulation ends
#
for {set i 0} {$i < $opt(nn) } {incr i} {
$ns_ at $opt(stop).0 "$node_($i) reset";
}
$ns_ at $opt(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at $opt(stop).0001 "stop"
proc stop {} {
global ns_ tracefd namtrace
$ns_ flush-trace
close $tracefd
close $namtrace
}
#
# begin simulation
#
puts "Starting Simulation..."
$ns_ run
参考stackoverflow→
cd-ns-allinone-2.35/
贴片-p0
您的错误:似乎您使用了错误的ns副本,即没有动态的“ns”。。。或者您的构建失败。安全的方法是:使用系统路径=/usr/local/bin/中存在的可执行文件“ns name”
Dymoum模拟示例:Dymoum-examples.tar.gz
参考注释1.:在硬盘上安装Ubuntu 14.04-amd64后,可以。test_2n.nam(89.5kB)、test_2n.tr(64kB)和486行文本输出的文件大小相同:
参考注释2-3.:新补丁
Dymo-blackhole-idsAODV_ns235.补丁
新的可执行文件ns235_Dymo-blackhole-idsAODV
通过Dymoum模拟测试正常,blackholeaodv2005~2013-examples-05.17.tar.gz,idsAODV-examples-05.17.tar.gz应用上述命令后,它成功显示ns存在,但在收到未知消息时给出输出节点1:hello\u send:sending hello node 0:generic\u process\u message:nsif中从1节点0接收到未知消息类型9:uerr\u发送:将uerr发送到24节点0:uerr\u发送:无法将uerr发送到24,因为没有合适的路由如何解决此错误?如何删除ns-2.35中的错误修补程序文件?先生,如何使用ns2.35中的Dymoum实施障碍孔攻击?是否可以在ns-2.35中为Dymoum应用ID?添加1。错误:可能是由Ubuntu引起的。我会测试的。您可以同时安装任意数量的ns-allinone-2.xx。但是,永远不要向.bashrc添加任何*路径文本。不需要。只需将所有“ns name”保存在/usr/local/bin/中即可。因此,只需在新目录中设置另一个“ns-allinone-2.35_gcc5.tar.gz”。加2。黑洞:如果可能,我会测试。(不明白为什么不)加3<代码>aodvIDS
:可能。我会测试并让您知道。如何从ns-2.35中删除过时的修补程序文件?
invalid command name "Agent/DYMOUM"
while executing
"Agent/DYMOUM set debug_ true"
(file "test_2n.tcl" line 42)
tar xvf ns-allinone-2.35_gcc5.tar.gz
cd ns-allinone-2.35/
patch -p0 < DYMO-03-all__ns235.patch
./install
cd ns-2.35/
cp ns ns235-dymo
sudo cp ns235-dymo /usr/local/bin/
------------ Simulation ------------
ns235-dymo test_2n.tcl
num_nodes is set 2
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
*** NOTE: no connection pattern specified.
*** NOTE: no scenario file specified.
Starting Simulation...
DYMOUM agent started in node 0
no_path_acc=1
reissue_rreq=0
s_bit=1
hello_ival=1
node 0: hello_send: sending HELLO
DYMOUM agent started in node 1
no_path_acc=1
reissue_rreq=0
s_bit=1
hello_ival=1
node 1: hello_send: sending HELLO
.
.
node 0: process_data: route to dst 1 updated
node 1: tap: route to src 0 updated
NS EXITING...