Hello everybody
I have a problem that makes some days I am blocks.
I achieved several scripts of mobility in order to draw the curve: number of
packets received / number of packets gave out according to the mobility.
I generated several scripts with. / setdest,with variable M between 10 and 100.
I notice that the number of packets received / number of packets didn't give
out changes
I give you my script tcl
s1:file of scenario
f1:file of trafic exchange
and we use 10 scenario (M=10,M=20.....M=100)
Please help
# ======================================================================
# Define options
# ======================================================================
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) Queue/DropTail/PriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
set val(x) 1000 ;# X dimension of the topography
set val(y) 1000 ;# Y dimension of the topography
set val(ifqlen) CMUPriqueue ;# max packet in ifq
set val(seed) 0.0
set val(adhocRouting) DSDV
set val(nn) 50 ;# how many nodes are simulated
set val(cp) "f1" ;# connection pattern file
set val(sc) "s1"
set val(rp) DSR
set val(stop) 450.0
# =====================================================================
# Main Program
# ======================================================================
#
# Initialize Global Variables
#
# create simulator instance
set ns_ [new Simulator]
# setup topography object
set topo [new Topography]
# create trace object for ns and nam
set f1 [open f1.tr w]
set f2 [open f2.nam w]
$ns_ trace-all $f1
$ns_ use-newtrace
$ns_ namtrace-all-wireless $f2 $val(x) $val(y)
# 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
$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) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace 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 1 ;# disable random motion
}
#
# 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
#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at $val(stop).0 "$node_($i) reset";
}
################################test###########################################
##############################################################################
$ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
proc finish {} {
puts "je suis en finish"
global ns_ f1
close $f1
# puts "running nam..."
exec nam f2.nam &
exit 0
}
puts "avant TCP"
$ns_ at 400.0 "finish"
# puts $f1 "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)"
puts "Starting Simulation..."
$ns_ run
---------------------------------
Faites de Yahoo! votre page d'accueil sur le web pour retrouver directement
vos services préférés : vérifiez vos nouveaux mails, lancez vos recherches et
suivez l'actualité en temps réel. Cliquez ici.