Subject: [manet] Simulation of Ad Hoc Network

From: "Youngmin Kim" <[email-masked]>
Date: Sat, 21 May 2005 16:52:25 +0900

Hi..
I am simulating ad hoc network.
Nodes are placed on following NxN network with 100m interval.
--------------------------------------------------------------
for {set i 0} {$i < N} {incr i } {
  for {set j 0} {$j < N} {incr j } {
    $node_([expr $i*N+$j]) set X_ [expr 100 * [expr $j + 1]]
    $node_([expr $i*N+$j]) set Y_ [expr 100 * [expr $i + 1]] 
    $node_([expr $i*N+$j]) set Z_ 0.0
  }
}
--------------------------------------------------------------
ns version : 2.27
Routing protocol : basic AODV of ns2.27

Traffic: End points of the diagonal line of the square
  - Source : $ns_ attach-agent $node_(0) $tcp1
  - Destination : $ns_ attach-agent $node_(N*N-1) $sink1

When N is 4 (16 nodes), the network is working well.
When N is 5 (25 nodes), it takes 8 seconds to make a routing path and the
path is changed continuously.
When N is 6 (36 nodes), source node don't send just one packet.
Destination receives RREQ, but don't reply RREP to the source

I doubt if the result of the simulation is correct.
Does same result occur in real ad hoc networks?
Otherwise, what is the problem?

Thanks..

----------------------------------------------------------------------------
# 5x5 network
# Modification from simple-wireless.tcl
# A simple example for wireless simulation

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

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

#
# Initialize Global Variables
#
set ns_  [new Simulator]
set tracefd     [open simple.tr w]
$ns_ trace-all $tracefd

# set up topography object
set topo       [new Topography]

$topo load_flatgrid 1000 1000

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

#
# Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes # for {set
i 0} {$i < 5} {incr i } {
  for {set j 0} {$j < 5} {incr j } {
    $node_([expr $i*5+$j]) set X_ [expr 100 * [expr $j + 1]]
    $node_([expr $i*5+$j]) set Y_ [expr 100 * [expr $i + 1]] 
    $node_([expr $i*5+$j]) set Z_ 0.0
  }
}

# Setup traffic flow between nodes
# TCP connections between node_(0) and node_(1)

set tcp1 [new Agent/TCP]
$tcp1 set class_ 2
set sink1 [new Agent/TCPSink]
$ns_ attach-agent $node_(0) $tcp1
$ns_ attach-agent $node_(24) $sink1
$ns_ connect $tcp1 $sink1
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
$ns_ at 10.0 "$ftp1 start" 
$ns_ at 50.0 "$ftp1 stop" 

#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
    $ns_ at 150.0 "$node_($i) reset";
}
$ns_ at 150.0 "stop"
$ns_ at 150.01 "puts \"NS EXITING...\" ; $ns_ halt"
proc stop {} {
    global ns_ tracefd
    $ns_ flush-trace
    close $tracefd
}

puts "Starting Simulation..."
$ns_ run

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

---

From: Bart Braem <[email-masked]>
Date: Sat, 21 May 2005 13:44:07 +0200

> Otherwise, what is the problem?

These results seem very strange to me, my simulations gave different results, 
setting up a path should not take that long.
You may want to analyse the ns traces for more information...
Another approach could be to use AODV-UU, they also implement AODV in ns.

Bart

---

From: "Mullen, John" <[email-masked]>
Date: Sat, 21 May 2005 09:55:17 -0600

Hi,

I suspect your problems are due to data collisions.

Look at the total traffic on the channel.  

John Mullen

-----Original Message-----
From: [email-masked] on behalf of Youngmin Kim
Sent: Sat 5/21/2005 1:52 AM
To: [email-masked]
Subject: [manet] Simulation of Ad Hoc Network
 
Hi..

Thanks..

#

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

#

# configure node

#

set tcp1 [new Agent/TCP]
$tcp1 set class_ 2

#