error blackholeAODV

153 views
Skip to first unread message

thành nguyễn trọng

unread,
Mar 28, 2023, 8:31:33 AM3/28/23
to Network Simulator 2 (NS2)
help me!! please



error: 
num_nodes is set 20
Creating nodes...
INITIALIZE THE LIST xListHead

    (_o455 cmd line 1)
    invoked from within
"_o455 cmd addr"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o455" line 2)
    (SplitObject unknown line 2)
    invoked from within
"_o455 addr"
    ("eval" body line 1)
    invoked from within
"eval $node addr $args"
    ("default" arm line 2)
    invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
    (procedure "_o3" line 14)
    (Simulator create-wireless-node line 14)
    invoked from within
"_o3 create-wireless-node"
    ("eval" body line 1)
    invoked from within
"eval $self create-wireless-node $args"
    (procedure "_o3" line 23)
    (Simulator node line 23)
    invoked from within
"$ns_ node"
    ("for" body line 2)
    invoked from within
"for {set i 20} {$i < 21} {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;#disable random motion
$ns_ at 0.01 "$node_($i) label \"blac..."
    (file "bhAODV.tcl" line 57)




file tcl:
# Define options
set val(chan) Channel/WirelessChannel ;#Channel Type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 150 ;# max packet in ifq
set val(nn) 20 ;# total number of mobilenodes
set val(nnaodv) 19 ;# number of AODV mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 750 ;# X dimension of topography
set val(y) 750 ;# Y dimension of topography
set val(cstop) 451 ;# time of connections end
set val(stop) 500 ;# time of simulation end
#set val(cp) "/home/tclfiles/scenarios/scen1forAODV-n20-t500-x750-y750" ;#Connection Pattern
set val(cc) "/home/tclfiles/scenarios/cbr/cbr" ;#CBR Connections
# Initialize Global Variables
set ns_ [new Simulator]
$ns_ use-newtrace
set tracefd [open sim1forBlackHole.tr w]
$ns_ trace-all $tracefd
set namtrace [open sim1forBlackHole.nam w]
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# set up topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
# Create God
create-god $val(nn)
# Create channel #1 and #2
set chan_1_ [new $val(chan)]
set chan_2_ [new $val(chan)]
# configure node, please note the change below.
$ns_ node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON \
-channel $chan_1_
# Creating mobile AODV nodes for simulation
puts "Creating nodes..."
for {set i 0} {$i < 20} {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;#disable random motion
}
# Creating Black Hole nodes for simulation
$ns_ node-config -adhocRouting blackholeAODV
for {set i 20} {$i < 21} {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;#disable random motion
$ns_ at 0.01 "$node_($i) label \"blackhole node\""
}
# Adding connection pattern which is created using setdest, parameters shown below
# ./setdest -n 20 -p 1.0 -M 20.0 -t 500 -x 750 -y 750 > scen1forAODV-n20-t500-x750-y750
puts "Loading random connection pattern..."
set god_ [God instance]
#source $val(cp)
source $val(cc)
# Define initial node position
for {set i 0} {$i < 21 } {incr i} {
$ns_ initial_node_pos $node_($i) 30
}
# CBR connections stops
for {set i 0} {$i < 9 } {incr i} {
$ns_ at $val(cstop) "$cbr_($i) stop"
}
# Tell all nodes when the simulation ends
for {set i 0} {$i < 21 } {incr i} {
$ns_ at $val(stop).000000001 "$node_($i) reset";
}
# Ending nam and simulation
$ns_ at $val(stop) "finish"
$ns_ at $val(stop).0 "$ns_ trace-annotate \"Simulation has ended\""
$ns_ at $val(stop).00000001 "puts \"NS EXITING...\" ; $ns_ halt"
proc finish {} {
global ns_ tracefd namtrace
$ns_ flush-trace
close $tracefd
close $namtrace
exec nam sim1forBlackHole.nam &
exit 0
}
puts "Starting Simulation..."
$ns_ run
Message has been deleted

knudfl

unread,
Mar 28, 2023, 3:35:31 PM3/28/23
to Network Simulator 2 (NS2)
1.   ns2 has no blackholeAODV or Agent/blackholeAODV by default
      ( line 56:   $ns_ node-config -adhocRouting blackholeAODV )

Build example  "blackholeAODV"
tar xvf ns-allinone-2.35_gcc5.tar.gz
https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing&resourcekey=0-EyPhoScBFDb7ul0VFk6FZQ
cd ns-allinone-2.35/
blackholeaodv2013-ns235_1.patch
https://drive.google.com/file/d/0B7S255p3kFXNWWVDZzd2ZC14akE/view?usp=sharing
export CC=gcc-4.8 CXX=g++-4.8 && ./install
cd ns-2.35/
cp ns ns-black
sudo cp ns-black /usr/local/bin/
-----------  Simulation  -----------------------
ns-black file.tcl

blackholeaodv2005-2013-examples-1119.tar.gz
https://drive.google.com/file/d/1yCVjXWBmnYA3QJYzgxzNGmzizZQTPlzb/view?usp=sharing
______________________________________________

2.  The file bhAODV.tcl  has never worked as is.
     E.g. lines 17, 18 must be edited to actual location of files cbr, scen1forAODV-n20-t500-x750-y750
     (Smart is when {cbr, scen1forAODV-n20-t500-x750-y750} are kept in the same folder as bhAODV.tcl)
An edited bhAODV.tcl →  →  nguyent__bhAODV.tcl  is here .....
https://drive.google.com/drive/folders/1xPZrcg0UdFfhjbSg8GiNbe2uzIgT32Gv?usp=share_link

knudfl

unread,
Mar 29, 2023, 4:02:46 PM3/29/23
to Network Simulator 2 (NS2)
Correction :

Is to be
patch -p0 < blackholeaodv2013-ns235_1.patch
Message has been deleted

thành nguyễn trọng

unread,
Apr 2, 2023, 7:03:45 PM4/2/23
to Network Simulator 2 (NS2)
Dear Sir
I followed this prebuilt code file, but it doesn't run and error like above. Do you know why? and how to fix it. The cbr files and the scen1forAODV-n20-t500-x750-y750 files I put together with the bAODV.tcl file in the ns-2.35 directory.
Vào lúc 23:02:46 UTC+3 ngày Thứ Tư, 29 tháng 3, 2023, knudfl đã viết:

knudfl

unread,
Apr 3, 2023, 4:55:05 AM4/3/23
to Network Simulator 2 (NS2)
Hi.

The command is :     $ ns-black nguyent__bhAODV.tcl
Not like    $ ns bAODV.tcl

-

thành nguyễn trọng

unread,
Apr 7, 2023, 7:36:46 PM4/7/23
to Network Simulator 2 (NS2)
This means successfully running the blackhole protocol AODV, right sir? Do you know how to install NAM?.  I don't understand why I can't run ns file.tcl but need ns-black.
hhihih.png

Vào lúc 11:55:05 UTC+3 ngày Thứ Hai, 3 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 8, 2023, 3:32:32 AM4/8/23
to Network Simulator 2 (NS2)
ns-black : See post of Mar 28, 2023, 9:35:31 PM ... how to create ns-black.
ns-black file.tcl  means   ns-black nguyent__bhAODV.tcl       .. or any nother valid example.

nam :      continue with the answer of  Mar 28, 2023, 9:35:31 PM :
cd ns-allinone-2.35/nam-1.15/
sudo make install

Note:  The nam you can get with    sudo apt install nam
....   is corrupt in the most versions of Debian / Ubuntu
-
Message has been deleted
Message has been deleted

thành nguyễn trọng

unread,
Apr 8, 2023, 7:13:10 PM4/8/23
to Network Simulator 2 (NS2)
Hi sir
Sir, can you guide me to analyze the file trace (packet ratio, throughput..) 
This is my blackholeAODV trace file. is it correct?
Vào lúc 10:32:32 UTC+3 ngày Thứ Bảy, 8 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 9, 2023, 4:13:11 AM4/9/23
to Network Simulator 2 (NS2)
Hi.

INFO, please see my post of  Apr 8, 2023, 9:58:18 AM  https://groups.google.com/g/ns-users/c/VlSEAtLeYPw

sim1forBlackHole1.tr  .... examples

$ awk -f metrics.awk sim1forBlackHole1.tr
--------METRICS-----------
Total Packets Sent              :       16037
Total Packets Received          :       13810
Total Packets Dropped           :       2397
Total Packets Forwarded         :       18367
Packet Delivery Ratio           :       86.11%
The total hop counts are        :       35165
Average Hop Count               :       2 hops
Routing Overhead                :       0
Normalized Routing Load         :       0.0000
Througphut of the network(KBps) :       6.9050
Average End to End Delay        :0.198744579 ms
Total Energy Consumed           :500000.000000
Protocol Energy Consumption     :100.000000

$ awk -f Avg_Tput.awk sim1forBlackHole1.tr
       startTime:  2
        stopTime:  452
    receivedPkts:  13810
   avgTput[kbps]:  130.636
Message has been deleted
Message has been deleted

thành nguyễn trọng

unread,
Apr 9, 2023, 5:17:16 AM4/9/23
to Network Simulator 2 (NS2)
hi sir
Can I use the all.awk file sir?
why  Routing Overhead =0
Do you have a tutorial on Reverse-AODV?

Vào lúc 11:13:11 UTC+3 ngày Chủ Nhật, 9 tháng 4, 2023, knudfl đã viết:

knudfl

unread,
Apr 9, 2023, 7:37:30 AM4/9/23
to Network Simulator 2 (NS2)
1.   Suggest  all-2.awk

$ awk -f all-2.awk sim1forBlackHole1.tr  
cbr s:16037 r:13810, f:175988  
avg_end_to_end_delay: 0.0096
Packet Delivery ratio: 86.1134
Packet Drop ratio: 0.1389

2.   Routing Overhead =0    ... please try out some other "Overhead" files
      .... Routing Overhead =0     is not unusual, I think.
**** Overhead ******
1Ayu-energy_wireless.awk
analysis-Eddie.awk
analysis-technoclass.awk
analysis-yahya.awk
avg_throughput.awk
avg_throughput-zigbee.awk
ControlOverhead__Normalized-routing-overhead.awk
energy_wireless.awk
en_wi.awk
genstats.awk
mcast_totals2.pl
metrics.awk
Normalized.Routing.Overhead.pl
PacketDeliveryFraction.awk
packet-PDF.awk
PaDeFr.awk
parameter-au.awk
parameters2007.awk
parameters_cbr1.awk
PDR-End2endDel-RoutingPackets.awk
Performance-Metrics.pl
perl-all.pl
ro.awk
statistics.awk
Statistics__perl_script.pl

3.   I have no information about "Reverse-AODV".
Reply all
Reply to author
Forward
0 new messages