[ns] AODV cannot find a route through intermediate nodes
Semra YILMAZ
SYilmaz at aselsan.com.tr
Fri Apr 4 23:27:42 PDT 2008
Dear all,
I have sent some e-mail about the porblem of aodv, but couldn't get any response. Could you please help me for the following lines of script in which the AODV cannot find a route from source to destination? I cannot find what I am misssing.
Any response will sincerely be appreciated.
Semra
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) 50 ;# max packet in ifq
set val(nn) 4 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 350
set val(y) 350
Phy/WirelessPhy set bandwidth_ 1Mb
# Initialize Global Variables
set ns_ [new Simulator]
$ns_ use-newtrace
set tracefd [open wireless_4nodes_aodv.tr w]
$ns_ trace-all $tracefd
set namtrace [open wireless_4nodes_aodv.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)]
# Create node(0) "attached" to channel #1
# 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 OFF \
-movementTrace OFF \
-channel $chan_1_
for {set i 0} {$i < $val(nn)} {incr i} {
set node_($i) [$ns_ node]
#$node_($i) add-ifq-send-trace
$node_($i) random-motion 0
#$node_($i) start
$ns_ initial_node_pos $node_($i) 20
}
#
# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes
#
$node_(0) set X_ 49.0
$node_(0) set Y_ 127.0
$node_(0) set Z_ 0.0
$node_(1) set X_ 49.0
$node_(1) set Y_ 227.0
$node_(1) set Z_ 0.0
$node_(2) set X_ 199.0
$node_(2) set Y_ 177.0
$node_(2) set Z_ 0.0
$node_(3) set X_ 299.0
$node_(3) set Y_ 177.0
$node_(3) set Z_ 0.0
# Now produce some simple node movements
$ns_ at 0.09 "$node_(0) setdest 50.0 128.0 10.0"
$ns_ at 0.09 "$node_(1) setdest 50.0 228.0 10.0"
$ns_ at 0.09 "$node_(2) setdest 200.0 178.0 10.0"
$ns_ at 0.09 "$node_(3) setdest 300.0 178.0 10.0"
# Setup traffic flow between nodes
# TCP connections between node_(0) and node_(3)
set tcp [new Agent/TCP]
$tcp set class_ 1
set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(0) $tcp
$ns_ attach-agent $node_(3) $sink
$ns_ connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns_ at 0.5 "$ftp start"
# TCP connections between node_(1) and node_(3)
set tcp2 [new Agent/TCP]
$tcp2 set class_ 2
set sink [new Agent/TCPSink]
$ns_ attach-agent $node_(1) $tcp2
$ns_ attach-agent $node_(3) $sink
$ns_ connect $tcp2 $sink
set ftp2 [new Application/FTP]
$ftp2 attach-agent $tcp2
$ns_ at 0.6 "$ftp2 start"
#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at 4.0 "$node_($i) reset";
}
$ns_ at 3.0 "stop"
$ns_ at 3.01 "puts \"NS EXITING...\" ; $ns_ halt"
proc stop {} {
global ns_ tracefd
$ns_ flush-trace
close $tracefd
}
puts "Starting Simulation..."
$ns_ run
######################################################################
Dikkat:
Bu elektronik posta mesaji kisisel ve ozeldir. Eger size
gonderilmediyse lutfen gondericiyi bilgilendirip mesaji siliniz.
Firmamiza gelen ve giden mesajlar virus taramasindan gecirilmekte,
guvenlik nedeni ile kontrol edilerek saklanmaktadir. Mesajdaki
gorusler ve bakis acisi gondericiye ait olup Aselsan A.S. resmi
gorusu olmak zorunda degildir.
######################################################################
Attention:
This e-mail message is privileged and confidential. If you are
not the intended recipient please delete the message and notify
the sender. E-mails to and from the company are monitored for
operational reasons and in accordance with lawful business practices.
Any views or opinions presented are solely those of the author and
do not necessarily represent the views of the company.
######################################################################
More information about the Ns-users
mailing list