LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-25-2014, 06:08 AM   #1
basma
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
error in blackholeaodv


Hello NS Users,

I installed ns2.35 , I am trying to
add a new protocol in NS2.
I followed the steps at:
http://acikarsiv.atilim.edu.tr/eng/b...0/172.pdf?show

After applying changes, I did:
$ make clean
$ make

When I run my tcl script then it gives below error.Creating nodes...
INITIALIZE THE LIST xListHead

(_o433 cmd line 1)
invoked from within
"_o433 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 "_o433" line 2)
(SplitObject unknown line 2)
invoked from within
"_o433 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 $val(nnaodv)} {$i < $val(nn)} {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;#disable random motion
$ns_ at 0.01 "$node_(..."
(file "ex2.tcl" line 57) .


The new protocol name blackhole aodv
TCL script is:# 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) "scenarios/scen1forAODV-n20-t500-x750-y750" ;#Connection Pattern
set val(cc) "scenarios/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 < $val(nnaodv)} {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 $val(nnaodv)} {$i < $val(nn)} {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)
# ################### CBRGEN GENERATE SAME CODE #############################
# set j 0
#
# for {set i 0} {$i < 18} {incr i} {
#
# #Create a UDP and NULL agents, then attach them to the appropriate nodes
# set udp_($j) [new Agent/UDP]
# $ns_ attach-agent $node_($i) $udp_($j)
# set null_($j) [new Agent/Null]
# $ns_ attach-agent $node_([expr $i + 1]) $null_($j)
#
# #Attach CBR application;
# set cbr_($j) [new Application/Traffic/CBR]
# puts "cbr_($j) has been created over udp_($j)"
# $cbr_($j) set packet_size_ 512
# $cbr_($j) set interval_ 1
# $cbr_($j) set rate_ 10kb
# $cbr_($j) set random_ false
# $cbr_($j) attach-agent $udp_($j)
# $ns_ connect $udp_($j) $null_($j)
# puts "udp_($j) and null_($j) agents has been connected each other"
# $ns_ at 1.0 "$cbr_($j) start"
#
# set j [expr $j + 1]
# set i [expr $i + 1]
# }
# ############################################################################
# CBR Connections generated by cbrgen
source $val(cc)
# Define initial node position
for {set i 0} {$i < $val(nn) } {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 < $val(nn) } {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
attached.
Please guide me to fix the issue.
 
  


Reply

Tags
blackhole, idsaodv, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal error in MPI_Init: Other MPI error, error stack:gethostbyname failed(errno 1) shilpiiitr Linux - Software 0 01-13-2014 02:44 PM
error while executing blackholeAODV tcl k_kimo Linux - Wireless Networking 5 06-27-2013 03:07 AM
Error 502 : Display Fatal Error Message, Error pushing image, dbpaCT failed! HaloCheng Linux - Newbie 1 09-12-2012 12:02 PM
[SOLVED] php5 ./configure error: (FILENAME=- FNR=27) fatal error: internal error richinsc Linux - Software 2 07-08-2010 09:20 AM
Sendmail: eocket wedge , 504 error , dsn error, mail relay connection error djcs Debian 0 03-03-2009 12:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration