Instead of specifying and controlling each nodes' position and movement pattern, we may use a CMU tool "setdest" to generate large number of nodes and there movements. The tool use a random waypoint model.
Setdest
Setdest tool is used to generate the positions of nodes and their moving speed and moving directions.
The syntax is:
setdest -v 1 -n $numnodes -p $pt -M $maxspeed -t $simtime -x $maxx -y $maxy
for example:
setdest -v 1 -n 50 -p 0 -M 20 -t 900 -x 1500 -y 300
will generate a 1500*300 topology with 50 nodes random distributed labeled by a XY(Z) coordinates.
(Note that, there is a bug in the README file, which gives a wrong option for specifying the speed, we should use "-M" instead of "-s" ).
In the output, you can find that: after the initial positions are given, the nodes are specified with their movement destination and speed. Then, the initial distance (hop counts) information are counted by a GOD.
Currently, the god object is used only to store an array of the shortest number of hops required to reach from one node to an other. The god object does not calculate this on the fly during simulation runs, since it can be quite time consuming. The information is loaded into the god object from the movement pattern file (this file)..
Then, the nodes are going to move during this 900-second simulation scenario. During this, the distance (hop-counts) information is going to change, thus, the following lines are going to show this recent change. Note that the distance is calculated based on a nominal radio range as "250" meters. The god information should not be available to any of the node. Thus, for a routing protocol, it has to discover the distance by itself with some mechanism.
It's possible that a node reaches its destination before the simulation timer ends. Thus, it needs to re-specify a new direction and speed for it. Also, the average pause time is a parameter to allow a node stop to move in a destination before moving again.
Finally, there are some statistics about this movement file? During the simulation, some nodes get isolated from all other nodes which results one count of "destination unreachable". Also, all route changes and link changes are calculated.
# nodes: 50, pause: 0.00, max speed: 20.00, max x: 1500.00, max y: 300.00 # $node_(0) set X_ 1472.239335818631 $node_(0) set Y_ 218.102475038104 $node_(0) set Z_ 0.000000000000 $node_(1) set X_ 266.329091949493 $node_(1) set Y_ 188.988756134562 $node_(1) set Z_ 0.000000000000 ..... $ns_ at 0.000000000000 "$node_(0) setdest 298.258250355189 34.553480936942 5.763540789209" $ns_ at 0.000000000000 "$node_(1) setdest 783.793876303622 280.181784294036 16.832727003192" $ns_ at 0.000000000000 "$node_(2) setdest 978.836090908830 151.467060345492 19.354908025316" $ns_ at 0.000000000000 "$node_(3) setdest 376.126888262665 139.747808400435 11.497476206039" $ns_ at 0.000000000000 "$node_(4) setdest 370.541780738321 185.032792269909 8.002013555825" $ns_ at 0.000000000000 "$node_(5) setdest 1463.652810766312 132.618506062927 17.607998988233" $ns_ at 0.000000000000 "$node_(6) setdest 1020.046295404814 40.982731716802 15.434148765705" ...... $god_ set-dist 0 1 6 $god_ set-dist 0 2 1 $god_ set-dist 0 3 4 $god_ set-dist 0 4 2 $god_ set-dist 0 5 4 $god_ set-dist 0 6 8 $god_ set-dist 0 7 6 ...... $ns_ at 0.141920608238 "$god_ set-dist 17 24 2" $ns_ at 0.165720133690 "$god_ set-dist 3 15 1" $ns_ at 0.263269271549 "$god_ set-dist 1 46 2" $ns_ at 0.263269271549 "$god_ set-dist 7 46 2" $ns_ at 0.263269271549 "$god_ set-dist 12 46 1" $ns_ at 0.263269271549 "$god_ set-dist 25 46 3" $ns_ at 0.263269271549 "$god_ set-dist 46 47 3" $ns_ at 0.314230786054 "$god_ set-dist 5 42 5" ...... $ns_ at 12.602131706040 "$god_ set-dist 16 36 2" $ns_ at 12.623221733243 "$node_(12) setdest 424.679916546080 186.581540202946 5.803287072825" $ns_ at 12.682532746855 "$god_ set-dist 18 40 3" ..... $ns_ at 899.907548331028 "$god_ set-dist 32 40 1"
$ns_ at 899.932142983319 "$god_ set-dist 22 40 1"
$ns_ at 899.991403308054 "$god_ set-dist 3 29 1"
#
# Destination Unreachables: 429
#
# Route Changes: 72037
#
# Link Changes: 11892
#
# Node | Route Changes | Link Changes
# 0 | 2709 | 433
# 1 | 3098 | 467
# 2 | 2651 | 496
# 3 | 3398 | 642Setdest
# 4 | 3036 | 548
# 5 | 2755 | 252
# 6 | 3471 | 601 |
#!/bin/csh
unset noclobber
set outdir = wzb-scen
set maxspeed = 1
set numnodes = 50
set maxx = 1500
set maxy = 300
set simtime = 900
foreach pt (5 10 15 20 25 30 40 50)
foreach scen ( 1 2 3 4 5)
echo scen $scen : setdest -n $numnodes -p $pt -M $maxspeed -t $simtime \
-x $maxx -y $maxy
time ./setdest -n $numnodes -p $pt -M $maxspeed -t $simtime \
-x $maxx -y $maxy \
>$outdir/scen-${maxx}x${maxy}-${numnodes}-${pt}-${maxspeed}-${scen}
echo
end
end |
