Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-23-2015, 04:13 AM   #1
Registered: May 2015
Posts: 45

Rep: Reputation: Disabled
Question terminal doesn't response while trying to run scenario file in TCL script

i m trying to run scenario file for node movement in my tcl script but terminal does not response when i run script,,,actually i dont know file is running successfully or not..i have to wait long then i stop process,,,
dont know y is this happening

ubuntu 12.04 32bit

here is luk of my tcl script

set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(ant) Antenna/OmniAntenna ;# Antenna type
set val(ll) LL ;# Link layer type
set val(ifq) Queue/DropTail/PriQueue ;# Interface queue type
set val(ifqlen) 50 ;# max packet in ifq
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(nn) 3 ;# number of mobilenodes
set val(rp) DSR ;# routing protocol
set val(x) 800
set val(y) 800
#set val(cp) "../mobility/scene/cbr-3-test"
set val(sc) "scene-3-test"
set val(stop) 5.0 ;# simulation time

set ns [new Simulator]

set f [open w]
$ns trace-all $f

set namtrace [open through.nam w]
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

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

create-god $val(nn)

set chan_1 [new $val(chan)]

$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-topoInstance $topo \
-agentTrace OFF \
-routerTrace ON \
-macTrace ON \
-movementTrace OFF \
-channel $chan_1

proc finish {} {
global ns f namtrace
$ns flush-trace
close $namtrace
exec nam through.nam &
exit 0

for {set i 0} {$i < $val(nn) } { incr i } {
set n($i) [$ns node]
$n($i) color "blue"

puts "Loading scenario file..."
source $val(sc)

for {set i 0} {$i < $val(nn)} { incr i } {
$ns initial_node_pos $n($i) 40

set sink2 [new Agent/LossMonitor]

$ns attach-agent $n(2) $sink2

set tcp0 [new Agent/TCP] ;#????
$ns attach-agent $n(0) $tcp0

proc attach-CBR-traffic { node sink size interval } {
set ns [Simulator instance]
set cbr [new Agent/CBR]
$ns attach-agent $node $cbr
$cbr set packetSize_ $size
$cbr set interval_ $interval
$ns connect $cbr $sink
return $cbr

set cbr0 [attach-CBR-traffic $n(0) $sink2 1000 .05]

$ns at 0.0 "$cbr0 start"
$ns at 4.0 "$cbr0 stop"

puts "Starting simulation.."
$ns run

please help
Old 08-24-2015, 12:25 AM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,737

Rep: Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318
Tcl code is supposed to be in 'Code Tags' : [code]code text[/code]
** Please edit post #1 : The 'Edit' button in post #1.

Your file(s) : The file "scene-3-test" is missing.
Please upload 'scene-3-test' to 'Google Docs',
and include a link to scene-3-test in a new post.



ns2, ubuntu 12.04, wirelessnetworking

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] giving path of scenario file in tcl script rc49 Linux - Newbie 1 08-18-2015 08:46 AM
[SOLVED] Desktop entry to run script file in terminal fails andrew.comly Linux - Desktop 19 01-08-2015 08:54 PM
problem with xgraph while trying to run tcl script manjusha029 Linux - Wireless Networking 1 12-30-2013 10:23 PM
[SOLVED] Floating point exception after run TCL script ns2 deVacto Linux - Newbie 7 10-29-2012 12:56 AM
How to start a Tcl/Tk script by simply invoking the script file itself ? cyu021 Programming 2 10-10-2004 12:00 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:59 AM.

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