Download your favorite Linux distribution at LQ ISO.
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 10-10-2015, 03:41 AM   #1
Registered: May 2015
Posts: 45

Rep: Reputation: Disabled
giving scenario file at terminal in ns2.35

system specifications
ubuntu 12.04 32 bit
network simulator 2.35

i want to give topology file at run time in ns2.35
working on random scenarios,, so have to run numerous simulations for statistics but every time running topology ,,i have to rewrite topology file name in TCL script which is very time consuming
this is what i was doing before

in myscript.tcl i write following lines
# myscript.tcl
set val(sc) "./t1"            ;# t1 is nodes topology/scenario file
source $val(sc)

it is running successfully ,,, but so as to run numerous various topologies i have to rewrite file name i.e t1..assuming rest of the parameters are same..
i want to give topology file at terminal such as
ns myscript.tcl < t1
for this i add some lines in my tcl script
set vals [read stdin]
puts "I am valued as "
but it is only reading the file,,,topology is not actually executed by simulator.. nodes are not placed at the positions as mentioned in scenario file

i tried one thing more so as to source the instance of variable
set v "[ read stdin]"
source $v
it is running without any error but toplogy still not executed...nodes are not positioned at the XY positions mentioned in scenario file
dont know ..which step i missed....

Last edited by rc49; 10-10-2015 at 03:41 AM. Reason: adding commands


ns2, tcl-ns2, ubuntu 12.04

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] terminal doesn't response while trying to run scenario file in TCL script rc49 Linux - Newbie 1 08-24-2015 12:25 AM
[SOLVED] giving path of scenario file in tcl script rc49 Linux - Newbie 1 08-18-2015 08:46 AM
How to create a nam file to see the scenario of leach protocol in NS2 ? Mehedi Hasan Linux - Newbie 1 09-01-2014 10:44 AM
NS2 Simulation/scenario help nadeempitafi Linux - Newbie 2 12-28-2012 03:20 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:36 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