Subject: [manet] Error in ns-2 simulation of AODV?

From: Frank Kargl <[email-masked]>
Date: Thu, 20 Mar 2003 13:51:26 +0100

Hi all ...

I have a quite basic AODV simulation script (see below) that yields
strange results. When I use a scenario file on an area of 500x500m I get
a delivery ratio of 99%, when I enlarge the area to 1500x300m, the
delivery ratio drops to something like 70%. I can not reproduce results
published by others that get 99% delivery ratio on areas of 1500mx300m.

This happens on ns-2.1b9a and ns-2.26 for the original AODV as well as
AODV-UU. The scenarios are generated with 50 nodes, random waypoint,
1m/s, 0 pause time like in a lot of other simulations published.

Any idea what goes wrong?

Regards ... Frank

Here is the script I use:
# ===================================================
# Define options
# ===================================================

set val(rp)         AODV        ;# routing protocol
set val(ll)         LL
set val(mac)        Mac/802_11
set val(ifq)        Queue/DropTail/PriQueue
set val(ifqlen)     50            ;# max packet in ifq
set val(ant)        Antenna/OmniAntenna
set val(prop)       Propagation/TwoRayGround
set val(phy)        Phy/WirelessPhy
set val(chan)       Channel/WirelessChannel
set val(seed)       1.0
set val(x)          800   ;# X dimension of the topography
set val(y)          800   ;# Y dimension of the topography
set val(nn)         50    ;# how many nodes are simulated
set val(cp)         "./scen/fscen2"
set val(sc)         "./scen/cbr-n50-s1"
set val(stop)       240.0           ;# simulation time

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

#
# Initialize Global Variables
#
set ns_         [new Simulator]
set tracefd     [open wir-m1.tr w]
$ns_ trace-all $tracefd
set tracenamfd     [open wir-m1.nam w]
$ns_ namtrace-all-wireless $tracenamfd $val(x) $val(y)
$ns_ use-newtrace

# setup topography object
set topo        [new Topography]

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

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

#
# define how node should be created
#

#global node setting

puts "Calling ns"
set chan_ [new $val(chan)]

$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(phy) \
~                 -topoInstance $topo \
~                 -channel $chan_ \
~                 -agentTrace ON \
~                 -routerTrace ON \
~                 -macTrace ON \
~                 -movementTrace OFF

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

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

$node_(1) color red

#
# 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"

# 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)"

proc stop {} {
~    global ns_ tracefd
~    $ns_ flush-trace
~    close $tracefd
}

puts "Starting Simulation..."
$ns_ run

- --
- -----------------------------------------------------------------------
~ Frank Kargl          Multimedia Computing, University of Ulm, Germany
~ Mail:[email-masked] http://www.uni-ulm.de/~fkargl/
- -----------------------------------------------------------------------
~   Use the SOURCE, Luke !  I feel a great disturbance in the SOURCE.
~            But beware of the Microsoft side of the SOURCE !
- -----------------------------------------------------------------------
	  --->   CFP HICSS-37 Wireless PANs Minitrack:   <---
	  --->  http://crystal.uta.edu/~zaruba/hicss37/  <---

_______________________________________________
manet mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/manet