Subject: [manet] Problem with wireless simulation of adhoc network in ns-2.27, Urgent Help needed!

From: "srgopal" <[email-masked]>
Date: Mon, 29 Nov 2004 23:30:09 -0600

Dear all,

I was trying to simulate an ad hoc network carrying voice
calls in ns-2.27 to analyze the call carrying capacity of
the network. I did the tutorials given by Mr. Marc Greis.
Then i have written a tcl script for simulating 50 node
network and have invoked 12 voice calls between different
source-destination pairs. When i run the tutorials i can see
the "exp" exponential packets being exchanged between the
nodes, but for my code i do not see any "exp" packets being
exchanged between the nodes except the "message" type of
packets which i think are control packets.

I am hereby attaching my tcl script for your kind reference.
Please have a look at it and tell me where is the mistake,
if any. I really appreciate any help in this regard and also
this is very urgent fro me as i have to submit a project
report on it.

Kindly do the needful at the earliest. Thanks in advance.

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(ifq)             CMUPriQueue                ;#
interface queue
type
set val(ll)             LL                         ;# link
layer type
set val(ant)            Antenna/OmniAntenna        ;#
antenna model
set val(x)              1000   ;# X dimension of the
topography
set val(y)              1000  ;# Y dimension of the
topography
set val(ifqlen)         50                         ;# max
packet in ifq
set val(nn)             50                          ;#
number of
mobilenodes
set val(rp)             DSDV                      ;# routing
protocol
set val(seed)           0.0
set val(stop)           300.0           ;# simulation time

#Create a simulator object
set ns [new Simulator]
#Open the output files
set tracefd [open p11.tr w]
$ns use-newtrace
$ns trace-all $tracefd

# set up topography object
set topo       [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)

$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 OFF \
                         -routerTrace OFF \
                         -macTrace ON \
                         -movementTrace OFF
Mac/802_11 set dataRate_ 2e6
for {set i 0} {$i < $val(nn) } {incr i} {
                set node_($i) [$ns node]
                $node_($i) random-motion 0              ;#
disable
random motion        }
for { set i 0} {$i < $val(nn) } {incr i} {
    $node_($i) set X_ [expr {rand()*$val(x)}]
    $node_($i) set Y_ [expr {rand()*$val(y)}]
    $node_($i) set Z_  0
}
puts "POSITIONS DONE!"
#Source-Destination pair
proc attach-expoo-traffic { node sink size burst idle rate }
{
        #Get an instance of the simulator
        set ns [Simulator instance]
        #Create a UDP agent and attach it to the node
        set source [new Agent/UDP]
        $ns attach-agent $node $source
        #Create an Expoo traffic agent and set its
configuration
parameters
        set traffic [new Application/Traffic/Exponential]
        $traffic set packetSize_ $size
        $traffic set burst_time_ $burst
        $traffic set idle_time_ $idle
        $traffic set rate_ $rate
        #$traffic set interval_ $interval
        # Attach traffic source to the traffic generator
        $traffic attach-agent $source
        #Connect the source and the sink
        $ns connect $source $sink
        return $traffic
}
set sink30 [new Agent/Null]

$ns attach-agent $node_(30) $sink30
#Create three traffic sources
set source0 [attach-expoo-traffic $node_(0) $sink30 160
1.004s 1.587s
32k ]
ns at 0.0 "$source0 start"
ns at 40.0 "$source0 stop"

#Call the finish procedure after 300 seconds simulation time
for {set i 0} {$i < $val(nn) } {incr i} {
    $ns at 300.0 "$node_($i) reset";
}
$ns at 300.0 "finish"
$ns at 300.0 "puts \"NS EXITING...\" ; $ns halt"
proc finish {} {
        #global f0
        global ns tracefd
        $ns flush-trace
        close $tracefd
        #Close the output files
        #close $f0
        #Call xgraph to display the results
        #exec xgraph tout0.tr -geometry 800x400 &
        exit 0
}
#Run the simulation
puts "Starting simulation ........"
$ns run

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