LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2012, 04:05 PM   #1
khedidja
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Rep: Reputation: Disabled
Question 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)?
 
Old 03-15-2012, 05:22 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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
 
Old 03-15-2012, 05:36 PM   #3
khedidja
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
thanks brother, I found this:
<extension class="de.uni_stuttgart.informatik.canu.mobisim.extensions.NSOutput" output="ns_trace.txt"/>
 
Old 03-19-2012, 03:55 PM   #4
khedidja
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Angry

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.
 
Old 03-30-2012, 01:57 AM   #5
khedidja
LQ Newbie
 
Registered: Mar 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-28-2012, 07:08 AM   #6
info_mimi
Member
 
Registered: Dec 2012
Posts: 31

Rep: Reputation: Disabled
problem with ns2 VanetMobiSIm

hi , help me plz , how can i integrate output file from VanetMobiSim in ns2 ¿
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
want to install ns2.29.3 along with mannasim patch for ns2.29 jeevanpinto Linux - Software 4 10-02-2013 12:09 AM
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 05:53 PM
Help with NS2.34 MounaRM Linux - Networking 0 05-05-2011 09:35 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
weight throwing protocol using ns2 code,diffusion based protocol using ns2 code rajrupa Linux - Networking 1 05-27-2010 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration