LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Networking (http://www.linuxquestions.org/questions/forumdisplay.php?f=3)
-   -   VanetMobiSim/ ns2 (http://www.linuxquestions.org/questions/showthread.php?t=934471)

khedidja 03-14-2012 04:05 PM

VanetMobiSim/ ns2
 
salaam,
I am working with VanetMobiSim. Can anyone specify any guide/example/tutorial where I can able to find how to generate traffic movement files for NS2 (file .tcl)?

knudfl 03-15-2012 05:22 AM

Traffic movement : TraNS and SUMO ?
http://lca.epfl.ch/projects/trans

General info : Google .. ns2 generate traffic movement mobisim ..
http://www.google.dk/webhp#hl=da&scl...w=1600&bih=710

Example = the first hit
http://www.cs.odu.edu/~mweigle/cours...bility-Sim.pdf

khedidja 03-15-2012 05:36 PM

thanks brother, I found this:
<extension class="de.uni_stuttgart.informatik.canu.mobisim.extensions.NSOutput" output="ns_trace.txt"/>

khedidja 03-19-2012 03:55 PM

salaam,

I found this command to generate movement file as like as with VanetMobiSim

cd ~/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/setdest
./setdest -v 1 -n 100 -p 0 -M 50.0 -t 1000 -x 1000 -y 10000 > scen-100-test #100 nodes with 50.0 m/s as maximum speed and the name of #movement file is scen-100-test


then, we can generate the traffic file with this command

cd ~/ns-allinone-2.34/ns-2.34/indep-utils/cmu-scen-gen/
ns cbrgen.tcl -type tcp -nn 100 -seed 1.0 -mc 19 -rate 4.0> tcp-100-test #tcp-100-test is the name of traffic

to execute the simulation we create the simulation file nsSim.tcl

#nsSim.tcl
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) CMU/DropTail/PriQueue
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(seed) 0.0
set val(adhocRouting) DSR
set val(nn) 100 ;# how many nodes are simulated
set val(cp) "~/exempleVanet/tcp-100-test"
set val(sc) "~/exempleVanet/scen-100-test"
set val(stop) 1000.0 ;# simulation time


set ns_ [new Simulator]

set ftrace [open out.tr w]
$ns_ trace-all $ftrace

set fnam [open out.nam w]
$ns_ namtrace-all-wireless $fnam $val(x) $val(y)

set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)

set god_ [create-god $val(nn)]


# Create channel #1 and #2
set chan_1_ [new $val(chan)]
set chan_2_ [new $val(chan)]

$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 $chan_1_ \
-topoInstance $topo \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF

for {set i 0} {$i < $val(nn) } {incr i} {
set node_($i) [$ns_ node ]
$node_($i) random-motion 0 ;# 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
for {set i 0} {$i < $val(nn)} {incr i} {

# 20 defines the node size in nam, must adjust it according to your
# scenario size.
# The function must be called after mobility model is defined
$ns_ initial_node_pos $node_($i) 100
}

puts $ftrace "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)"
puts $ftrace "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)"
puts $ftrace "M 0.0 prop $val(prop) ant $val(ant)"

#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $val(nn) } {incr i} {
$ns_ at 1000.0 "$node_($i) reset";
}
$ns_ at 1000.0001 "stop"
$ns_ at 1000.0002 "puts \"NS EXITING...\" ; $ns_ halt"

proc stop {} {
global ns_ ftrace fnam
$ns_ flush-trace
close $ftrace $fnam
}

puts "Starting Simulation..."
$ns_ run


but, the pb is wihle I execute ns nsSim.tcl, I have this errorinvalid command name "-llType"
while executing
"-llType $val(ll)\
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
..."
(file "nsSim.tcl" line 38

any one can help me???? please.

khedidja 03-30-2012 01:57 AM

errors found:

1) ./setdest -v 1 -n 100 -p 0 -M 50.0 -t 1000 -x 1000 -y 10000 > scen-100-test # replace -y 10000 by -y 1000
2) $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 $chan_1_ \
-topoInstance $topo \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF

we must take this
$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 $chan_1_ \
-topoInstance $topo \
-agentTrace ON \
-routerTrace OFF \
-macTrace OFF

info_mimi 12-28-2012 07:08 AM

problem with ns2 VanetMobiSIm
 
hi , help me plz , how can i integrate output file from VanetMobiSim in ns2


All times are GMT -5. The time now is 10:23 AM.