[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] Bus Error (core dump) Problem




Hi All,
  
   I am new to NS. I was trying to  simulate  the following code  and
I am getting  the  error:

num_nodes is set 12
Loading connection pattern...
Loading scenario file...
Starting Simulation...
Bus error (core dumped)

Let me include some thing....the following code tries to simulate TORA
for 12 nodes.... the same code works fine for  other protocols.

Could some one please help me with it. I am running this in ns-2.1b7a.
The installation of Ns was  okay.. it didnt show any error.


The code :

========================================================================
set val(chan)       Channel/WirelessChannel
set val(prop)       Propagation/TwoRayGround
set val(netif)      Phy/WirelessPhy
set val(mac)        Mac/802_11
set val(ifq)        Queue/DropTail/PriQueue
set val(ll)         LL
set val(ant)        Antenna/OmniAntenna
set val(x)              670   ;# X dimension of the topography
set val(y)              670   ;# Y dimension of the topography
set val(ifqlen)         150            ;# max packet in ifq
set val(seed)           0.0
set val(adhocRouting)   TORA
set val(nn)             12             ;# how many nodes are simulated
set val(cp)          "/home/ns/spshah/cbr-12-scn" 
set val(sc)         "/home/ns/spshah/mov-12-test" 
set val(stop)           300.0           ;# simulation time

#
=====================================================================
# Main Program
#
======================================================================

#
# Initialize Global Variables
#

# create simulator instance

set ns_		[new Simulator]

# setup topography object

set topo	[new Topography]

# create trace object for ns and nam

$ns_ use-newtrace

set tracefd	[open ToraTest12-out.tr w]
set namtrace    [open ToraTest12-out.nam w]

$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)

# define topology
$topo load_flatgrid $val(x) $val(y)

#
# Create God
#
set god_ [create-god $val(nn)]

#
# define how node should be created
#
set chan1 [new $val(chan)]
#global node setting

$ns_ node-config -adhocRouting $val(adhocRouting) \
                 -llType $val(ll) \
                 -macType $val(mac) \
                 -ifqType $val(ifq) \
                 -ifqLen $val(ifqlen) \
                 -antType $val(ant) \
                 -propType $val(prop) \
                 -phyType $val(netif) \
                 -channel  $chan1 \
		 -topoInstance $topo \
		 -agentTrace ON \
                 -routerTrace OFF \
                 -macTrace OFF 

#
#  Create the specified number of nodes [$val(nn)] and "attach" them
#  to the channel. 

for {set i 0} {$i < $val(nn) } {incr i} {
	set node_($i) [$ns_ node]	
	$node_($i) random-motion 0		;# disable random
motion
}


# 
# Define node movement model
#
puts "Loading connection pattern..."
source $val(cp)

# 
# Define traffic model
#
puts "Loading scenario file..."
source $val(sc)


# Define node initial position in nam

for {set i 0} {$i < $val(nn)} {incr i} {

    # 20 defines the node size in nam, must adjust it according to
your scenario
    # The function must be called after mobility model is defined
    
    $ns_ initial_node_pos $node_($i) 20
}


#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
    $ns_ at $val(stop).0 "$node_($i) reset";
}

$ns_ at  $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
$ns_ at  $val(stop).0002 "puts \"NS EX"

puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp
$val(adhocRouting)"
puts $tracefd "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"

puts "Starting Simulation..."
$ns_ run


=============================================================



Thanks...in Advance for help.....

Subodh
=========================
[email protected]
Graduate Student
University Of Florida.
=========================