Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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)]
# 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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.