LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-29-2013, 11:54 AM   #1
ishugopalan
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Rep: Reputation: Disabled
new simulator problem


Hi all,
my tcl code begins with
set ns [new Simulator]

while executing this line throws an error for invalid command "new"
help me out in solving the issue..if there s any flaw in setting env variable or improper installation

thanks
 
Old 10-29-2013, 01:00 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
Welcome to LQ.

Looks like a typo ?
Shouldn't it be :
Code:
set ns_   [new Simulator]
 
1 members found this post helpful.
Old 11-07-2013, 09:53 AM   #3
ishugopalan
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks for ur reply....

Also,Im new to NS2 and working on tcl scripts..i got below error message..can u plz check n help me in sorting out my error...
file name-demo.tcl:

num_nodes is set 50

(_o14 cmd line 1)
invoked from within
"_o14 cmd addr"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o14" line 2)
(SplitObject unknown line 2)
invoked from within
"_o14 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" arm line 2)
invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns node"
invoked from within
"set node_(0) [$ns node]"
(file "demo.tcl" line 72)
 
Old 11-07-2013, 01:08 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,735

Rep: Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317Reputation: 3317
# 3 .

There may be a chance to find some errors in "demo.tcl",
if you attach the file as demo.tcl.txt, to a new post.

Attachments : The paper clip tool in the Advanced Editor.

-
 
1 members found this post helpful.
Old 12-21-2013, 03:11 AM   #5
ishugopalan
LQ Newbie
 
Registered: Oct 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks for ur reply...
could you please help in writing awk script to generate xgraph based on x co-ordinate = time
y-co-ordinate = throughput

sample output in trace file:

s 10.000000000 _1_ AGT --- 0 tcp 40 [0 0 0 0] ------- [1:0 4:0 32 0] [0 0] 0 0
r 10.000000000 _1_ RTR --- 0 tcp 40 [0 0 0 0] ------- [1:0 4:0 32 0] [0 0] 0 0
s 10.000000000 _1_ RTR --- 0 AODV 48 [0 0 0 0] ------- [1:255 -1:255 30 0] [0x2 1 1 [4 0] [1 4]] (REQUEST)
r 10.000988490 _2_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [1:255 -1:255 30 0] [0x2 1 1 [4 0] [1 4]] (REQUEST)
r 10.000988501 _5_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [1:255 -1:255 30 0] [0x2 1 1 [4 0] [1 4]] (REQUEST)
r 10.000988515 _3_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [1:255 -1:255 30 0] [0x2 1 1 [4 0] [1 4]] (REQUEST)
r 10.000988813 _7_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [1:255 -1:255 30 0] [0x2 1 1 [4 0] [1 4]] (REQUEST)
s 10.001869717 _2_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
r 10.003018050 _7_ RTR --- 0 AODV 48 [0 ffffffff 2 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
r 10.003018084 _3_ RTR --- 0 AODV 48 [0 ffffffff 2 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
r 10.003018188 _5_ RTR --- 0 AODV 48 [0 ffffffff 2 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
r 10.003018207 _1_ RTR --- 0 AODV 48 [0 ffffffff 2 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
r 10.003018212 _6_ RTR --- 0 AODV 48 [0 ffffffff 2 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
r 10.003018290 _4_ RTR --- 0 AODV 48 [0 ffffffff 2 800] ------- [2:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
s 10.003018290 _4_ RTR --- 0 AODV 44 [0 0 0 0] ------- [4:255 1:255 30 2] [0x4 1 [4 4] 10.000000] (REPLY)
s 10.004118430 _7_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [7:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)
s 10.005400235 _5_ RTR --- 0 AODV 48 [0 ffffffff 1 800] ------- [5:255 -1:255 29 0] [0x2 2 1 [4 0] [1 4]] (REQUEST)

Many thanks in advance
 
  


Reply


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
new simulator problem Nanda27 Linux - Newbie 40 04-05-2015 10:03 AM
problem with code in ns-3 simulator cornacuore Linux - Newbie 0 06-06-2012 08:38 PM
ns2- network simulator problem vivekr Linux - Networking 5 02-16-2011 01:25 PM
problem with the installation of NS-2 Simulator pavan_p Linux - Newbie 2 11-16-2009 11:30 AM
joystick problem with gl-117 flight simulator vaisarger Linux - Games 1 07-06-2006 05:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration