---------------------------- Original Message ----------------------------
Subject: Ad Hoc in Point-to-Multipoint with CBR
From:    [EMAIL PROTECTED]
Date:    Fri, July 28, 2006 10:31 am
To:      ns-users@isi.edu
--------------------------------------------------------------------------

Hello,

I am working with AODV, DSDV and DSR in point-to-multipoint and
multipoint-to-point scenario with 11 nodes.

In the multipoint-to-point scenario, the senders starts a CBR traffic to
the receiver with 1 second interval and, after 11 seconds, as expected,
there are 10 simultaneous flows.

The problem occurs in the point-to-multipoint scenario. The sender starts
a CBR traffic to all receivers with 1 second interval, so after 11
seconds, there supposed to be 10 flows from the sender to the receivers,
but in fact, there are only 3 simultaneous flows. Does anyone know the
reason?

I am appending a shell script file and the TCL file.

Thanks in advance.

Etienne Oliveira.

Shell Script
------------------------------------------------------------------
ns DSR-11n-1s-10r.tcl
for i in 1 2 3 4 5 6 7 8 9 10
do
a=`grep "_${i}_ AGT" DSR-11n-1s-10r.tr | grep "^r" | grep cbr | wc -l`
at=`grep "_${i}_ AGT" DSR-11n-1s-10r.tr | grep "^r" | grep "cbr 200" |
tail -1 | cut -d" " -f2`
echo " _${i}_ --> AGT=$a  ends in $at"
done
------------------------------------------------------------------


TCL FILE
------------------------------------------------------------------
set val(chan)           Channel/WirelessChannel
set val(prop)           Propagation/TwoRayGround
set val(netif)          Phy/WirelessPhy
set val(mac)            Mac/802_11
set val(ifq)            CMUPriQueue
set val(ll)             LL
set val(ant)            Antenna/OmniAntenna
set val(x)              670     ;# X dimension of the topography
set val(y)              670     ;# Y dimension of the topography
set val(ifqlen)         50      ;# max packet in ifq
set val(nn)             11      ;# number of nodes - 1sender - 10receivers
set val(seed)           0.0
set val(stop)           40      ;# simulation time
set val(tr)             "DSR-11n-1s-10r.tr"     ;# trace file

set val(adhocRouting)   DSR             ;# protocol for ad-hoc network
set val(receivers)      10              ;# receivers

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

#
# Initialize Global Variables
#

# set date rate

$val(mac) set dataRate_ 11Mb
$val(mac) set basicRate_ 11Mb

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

#
# Initialize Global Variables
#

set ns_         [new Simulator]
set topo        [new Topography]

set tracefd     [open $val(tr) w]
$ns_ trace-all $tracefd

$topo load_flatgrid $val(x) $val(y)
set god_ [create-god $val(nn)]

#global node setting

$ns_ node-config -adhocRouting $val(adhocRouting) \
                 -llType $val(ll) \
                 -macType $val(mac) \
                 -ifqType $val(ifq) \
                 -ifqLen $val(ifqlen) \
                 -antType $val(ant) \
                 -propType $val(prop) \
                 -phyType $val(netif) \
                 -channel [new $val(chan)] \
                 -topoInstance $topo \
                 -agentTrace ON \
                 -routerTrace OFF \
                 -macTrace ON \
                 -movementTrace OFF

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

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

#
# Define initial position - Scennario File
#

$node_(0) set X_ 250.00
$node_(0) set Y_ 250.00
$node_(0) set Z_ 0.0
$node_(1) set X_ 420.09
$node_(1) set Y_ 197.19
$node_(1) set Z_ 0.0
$node_(2) set X_ 391.55
$node_(2) set Y_ 399.22
$node_(2) set Z_ 0.0
$node_(3) set X_ 355.82
$node_(3) set Y_ 198.78
$node_(3) set Z_ 0.0
$node_(4) set X_ 267.61
$node_(4) set Y_ 284.11
$node_(4) set Z_ 0.0
$node_(5) set X_ 238.89
$node_(5) set Y_ 276.98
$node_(5) set Z_ 0.0
$node_(6) set X_ 238.70
$node_(6) set Y_ 214.44
$node_(6) set Z_ 0.0
$node_(7) set X_ 282.39
$node_(7) set Y_ 256.70
$node_(7) set Z_ 0.0
$node_(8) set X_ 376.11
$node_(8) set Y_ 358.10
$node_(8) set Z_ 0.0
$node_(9) set X_ 317.86
$node_(9) set Y_ 358.65
$node_(9) set Z_ 0.0
$node_(10) set X_ 70.80
$node_(10) set Y_ 303.48
$node_(10) set Z_ 0.0

#
# Define traffic model and startup and shutdown node (connection pattern)
#

# (1) one sender
for {set i 1} {$i <= $val(receivers) } {incr i} {
        set udp_($i) [new Agent/UDP]
        $ns_ attach-agent $node_(0) $udp_($i)
        set cbr_($i) [new Application/Traffic/CBR]
        $cbr_($i) attach-agent $udp_($i)
        $udp_($i) set packetSize_ 200
        $udp_($i) set rate_ 150Kb

        set null_($i) [new Agent/Null]
        $ns_ attach-agent $node_($i) $null_($i)
        $ns_ connect $udp_($i) $null_($i)
        $ns_ at $i.0 "$cbr_($i) start"
}

#
# 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).0 "stop"
$ns_ at $val(stop).01 "puts \"NS EXITING...\" ; $ns_ halt"

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

puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)
$val(stop) seconds"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant) ifq $val(ifq)"

puts "Starting Simulation..."
$ns_ run
------------------------------------------------------------------


Reply via email to