[ns] Segmentation fault with reactive routing protocols (AODV and DSR)

2007-04-29 Thread Sourabh Bora

Hi all,
I was trying to simulate a multihop wireless network with a simple topology.
But it gives segmentation fault with AODV and DSR routing and works fine
with DSDV.
The script is simple and hence I am pasting the entire script. In short I
have 7 nodes (802.11 mac ) and 3 nodes send data to one particular node over
multiple hops.
I have the stack dump after the crash. But before going ahead and analyzing
it I would like to know if I am doing anything wrong here in the tcl file.

Any help would be highly appreciated.
Thanks



# ==
# 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/SMAC ;# 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) 10 ;# max packet in ifq
set val(nn) 7 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol

set dist(20m)4.80696e-07
set dist(12m)1.33527e-06

Phy/WirelessPhy set  CSThresh_ $dist(12m)
Phy/WirelessPhy set  RXThresh_ $dist(12m)

# ==
# Main Program
# ==


#
# Initialize Global Variables
#
set ns_[new Simulator]
$ns_ color 1 Blue
$ns_ color 6 Red
$ns_ color 4 Green

$ns_ use-newtrace
set tracefd [open xms.tr w]
$ns_ trace-all $tracefd

# set up topography object
set topo   [new Topography]

$topo load_flatgrid 500 500

#
# Create God
#
create-god $val(nn)

#
#  Create the specified number of mobilenodes [$val(nn)] and attach them
#  to the channel.
#  Here two nodes are created : node(0) and node(1)

# configure node

$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) \
 -channelType $val(chan) \
 -topoInstance $topo \
 -agentTrace ON \
 -routerTrace ON \
 -macTrace ON \
 -movementTrace OFF

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

$node_(0) set X_ 20.0
$node_(0) set Y_ 25.0
$node_(0) set Z_ 0.0


$node_(1) set X_ 10.0
$node_(1) set Y_ 15.0
$node_(1) set Z_ 0.0


$node_(2) set X_ 20.0
$node_(2) set Y_ 35.0
$node_(2) set Z_ 0.0

$node_(3) set X_ 20.0
$node_(3) set Y_ 45.0
$node_(3) set Z_ 0.0



$node_(4) set X_ 30.0
$node_(4) set Y_ 15.0
$node_(4) set Z_ 0.0

$node_(5) set X_ 20.0
$node_(5) set Y_ 15.0
$node_(5) set Z_ 0.0

$node_(6) set X_ 20.0
$node_(6) set Y_ 5.0
$node_(6) set Z_ 0.0

# Setup node 1
set udp1 [new Agent/UDP]
$ns_ attach-agent $node_(1) $udp1
set cbr1 [new Application/Traffic/CBR]
$cbr1 set packetSize_ 500
$cbr1 set rate_ .01Mb
$cbr1 attach-agent $udp1

# Setup node 6
set udp6 [new Agent/UDP]
$ns_ attach-agent $node_(6) $udp6
set cbr6 [new Application/Traffic/CBR]
$cbr6 set packetSize_ 500
$cbr6 set rate_ .01Mb
$cbr6 attach-agent $udp6


# Setup node 4
set udp4 [new Agent/UDP]
$ns_ attach-agent $node_(4) $udp4
set cbr4 [new Application/Traffic/CBR]
$cbr4 set packetSize_ 390
$cbr4 set rate_ .02Mb
$cbr4 attach-agent $udp4

#setup the sink on node 3
set null [new Agent/Null]
$ns_ attach-agent $node_(3) $null

#connect the nodes
$ns_ connect $udp1 $null
$ns_ connect $udp6 $null
$ns_ connect $udp4 $null

#For marking
$udp1 set fid_ 1
$udp6 set fid_ 6
$udp4 set fid_ 4



#$ns_ at 10.0 $cbr1 start
#$ns_ at 11.0 $cbr6 start
$ns_ at 12.0 $cbr4 start


#$ns_ at 20.0 $cbr1 stop
#$ns_ at 21.0 $cbr6 stop
$ns_ at 22.0 $cbr4 stop


#
# Tell nodes when the simulation ends
#
for {set i 0} {$i  $val(nn) } {incr i} {
$ns_ at 30.0 $node_($i) reset;
}
$ns_ at 30.0 stop
$ns_ at 30.01 puts \\ ; $ns_ halt
proc stop {} {
global ns_ tracefd
$ns_ flush-trace
close $tracefd
}

puts Starting Simulation...
$ns_ run




The  topology::


[ns] Help for list of node under ns2

2007-04-29 Thread leticia bela

  Hi all,
 
  Please how can i declare a list of nodes under NS and how  add to this list 
each visited node.

Thanks


 
-
 Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses.


Re: [ns] couldn't execute nam: no such file or directory

2007-04-29 Thread Arturo Servin

Kuheli louha wrote:
 Hi,
 I am using ns-allinone-2.30. I was running the following example.tcl from
 ns-allinone-2.30 using the command /home/where_i_installed ns/ns-
 allinone-2.30/ns-2.30/ns example.tcl but I am getting the following error

 ns: finish: couldn't execute nam: no such file or directory
 while executing
 exec nam out.nam 
 (procedure finish line 5)
 invoked from within
 finish

 I had set by PATH variable as

 /home/louhaki/NS/ns-allinone-2.28/bin:/home/louhake/NS/ns-allinone-2.28/ns-
 2.30:/home/louhaki/NS/ns-allinone-2.28/nam-1.12:/usr/j2se/bin:/home/louhaki/bin:/usr/local/bin:/usr/local/gnu/bin:/usr/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ccs/bin:/usr/sbin:/opt/SUNWspro/bin:/usr/sfw/bin:/usr/sbin:/usr/local/teTeX/bin
 I also included the line
 export PATH=/home/louhaki/NS/ns-allinone-2.28/nam-1.12
 export PATH=$PATH:/home/louhaki/NS/ns-allinone-2.30/ns-2.30
 /bin:/home/louhaki/NS/ns-allinone-2.30/tcl8.4.13/unix:/home/louhaki/NS/ns-
 allinone-2.30/tk8.4.13/unix
  in .bashrc. Yet the problem persists.Can anybody help

 The file is
 set ns [new Simulator]

 set nf [open out.nam w]
 $ns namtrace-all $nf

 proc finish {} {
  global ns nf
  $ns flush-trace
  close $nf
  exec nam out.nam 
  exit 0
  }

 set n0 [$ns node]
 set n1 [$ns node]

 $ns duplex-link $n0 $n1 1Mb 10ms DropTail

 $ns at 5.0 finish
 $ns run


 -
   
May be it is a silly question to ask (you may check this already), 
but it would be the first thing that I would check.

Is nam in any of the directories that you have in your PATH?

-as



[ns] WiMAX tcl scripts

2007-04-29 Thread SERIEN SERIEN

Hi every body
  I'm trying to run WiMAX tcl script using DSR rp, 50 nodes, 1000x1000 
topography, radius=200, simulation time = 900s and the agent trace is only ON. 
The problem is that the trace file generated is in kB while when we run Adhoc 
the trace file is between100 and 300MB. What to do in order to abtain all the 
needed data in the trace file? 

   
-
Ahhh...imagining that irresistible new car smell?
 Check outnew cars at Yahoo! Autos.


[ns] set window

2007-04-29 Thread mberroua

hi,

please what means this command :

$tcp set window_ 100

thanks in advance.



Re: [ns] set window

2007-04-29 Thread Sourabh Bora

Hi,
TCP windowing is a mechanism to avoid congestion.

A TCP window the amount of outstanding (unacknowledged by the recipient)
data a sender can send on a particular connection before it gets an
acknowledgment back from the receiver that it has gotten some of it.

In \ns-2.30\tcp\tcp.cc just search for the word window_ , you will notice
the bindings with TCl objects. You go through this file for complete
understanding of the mechanism.
Hope that helps.

Sourabh Bora
Rochester


Re: [ns] Help for list of node under ns2

2007-04-29 Thread Sourabh Bora

Declaring a list of nodes is pretty straightforward. Please be more specific
with your question. I would like to know what you mean by visited node.
Thanks

Hi all,

 Please how can i declare a list of nodes under NS and how  add to this list
each visited node.

Thanks