LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-19-2009, 05:03 AM   #1
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Rep: Reputation: 0
new simulator problem


Hi all i hav problem in NS2. whenever creating an new simulator it shows an error for invalid command name "new". how to solve this problem plz help me

Thanks in advance

Nanda
 
Old 05-20-2009, 08:16 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
Welcome to LQ.

A command in ns2 would be

'ns file.tcl'

Or what have you got, and which command are you doing ? ?
 
Old 05-21-2009, 05:16 AM   #3
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
New simulator problem

set ns [new Simulator] - in this line throws an error for invalid command "new"

set n0 [$ns node]

set n1 [$ns node]

$ns duplex-link $n0 $n1 1Mb 2ms DropTail


set udp0 [new Agent/UDP]

$ns attach-agent $n0 $udp0

set cbr0 [new Application/Traffic/CBR]

$cbr0 attach-agent $udp0


set null0 [new Agent/Null]

$ns attach-agent $n1 $null0


$ns connect $udp0 $null0


$ns at 1.0 “$cbr0 start”
$ns run

why this happening and what software i need to install for this plz help me

thanks..
Nanda
 
Old 05-21-2009, 08:43 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
Example ( Template )
http://www.isi.edu/nsnam/ns/tutorial/nsscript1.html

The 'file.tcl' :
Code:
set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf
        exec nam out.nam &
        exit 0
}

$ns at 5.0 "finish"

$ns run
And 'ns file.tcl' shows .... see attached file ...

Please try out some of the examples in ns-2.33/tcl/ex/
and also see how they are written.

EDIT : Your code works ? ? .. see attached 'tcl files'
Rename to suffix .tcl before use.
.....
Attached Files
File Type: txt Your-code-modified.tcl.txt (514 Bytes, 38 views)
File Type: txt 2nodes-1link.tcl.txt (306 Bytes, 30 views)

Last edited by knudfl; 11-12-2009 at 02:55 PM.
 
Old 05-21-2009, 09:24 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
The file '3file3.tcl : Please push the play button ... and wait .....
.....
Attached Files
File Type: txt 3file3.tcl.txt (707 Bytes, 32 views)
 
Old 05-22-2009, 05:47 AM   #6
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Ns pblm

I hav installed active tcl only, i hav ns2.33 but i dont no how to install that give me an procedure to install ns2.33

Regards..!

Nanda
 
Old 05-22-2009, 06:55 AM   #7
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
i hav executed ur coding its not working throws an same error. I think i hav problem in my software, can u guide me how to install d ns 2.33.
Codings r correct but problem in only s/w i didnt installed ns and nam
 
Old 05-22-2009, 07:49 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
The commnand 'ns' will work only, when ns-2.33 +
nam-1.13 are compiled with no errors.

Suggest :
Install from source to /usr/local/ , in this order :
otcl-1.13, tclcl-1.19, ns-2.33, nam-1.13 .
cd /home/"user"/tmp
tar xvf <application>
cd <application>
./configure .......
make .. 'su' (or sudo) make install.

The source code for the tcl8.4 + tk8.4 installed on
your OS must be unpacked to the folder with otcl and
tclcl. Please configure otcl with :
'./configure --with-tcl=../tcl8.4(.xx)'
And tclcl :
'./configure --with-tcl=../tcl8.4(.xx) --with-tk=../tk8.4(.xx)'

The build requirements : It is a little different from Fedora's
to various Ubuntu's. Please tell which Linux, name, version,
to be used.
.....
Ubuntu, Debian : (sudo) apt-get install libx11-dev libxmu-dev \
libxmu-headers libxt-dev tcl8.4-dev tk8.4-dev
.....

Last edited by knudfl; 05-22-2009 at 09:50 AM.
 
Old 05-23-2009, 09:08 AM   #9
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Nam pblm

Hi i hav installed ns 2.29.2 with cygwin environment all my commands r working but if i execute $ ns example1b.tcl it throws an following error:

Sathya@server /usr/local/ns-allinone-2.29.2/ns-allinone-2.29/bin
$ ns example1b.tcl

Sathya@server /usr/local/ns-allinone-2.29.2/ns-allinone-2.29/bin
$ nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {..."

Sathya@server /usr/local/ns-allinone-2.29.2/ns-allinone-2.29/bin
 
Old 05-23-2009, 10:35 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
'example1b.tcl' : Where did you find it ?

Please provide location, a link to the code,
or please show the code, attached or in code tags.

http://www.linuxquestions.org/questi....php?do=bbcode
 
Old 05-25-2009, 12:55 AM   #11
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
I got the code from here : http://www.isi.edu/nsnam/ns/tutorial/nsscript1.html. coding has correct but problem in nam only it showing an error for nam could not open msg.
Plz help me..

Thanks and Regards..!

Nanda
Attached Files
File Type: txt example1b.tcl.txt (1.1 KB, 12 views)
 
Old 05-25-2009, 03:33 PM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
Can 'nam' itself be run ?
Please try the command ./nam or nam , depending on
the PATH you have set ... and location, cd nam-1/ ?

'nam' will display the attached image ....
.....
Attached Images
File Type: jpg screen.jpg (35.4 KB, 16 views)
 
Old 05-26-2009, 01:49 AM   #13
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Hi i hav installed ns2 with cygwin environment nam also working fine now thanks for ur kind reply. i need one more help how to transfer file between one computer to another using ns2. if u hav any coding plz attach

Thanks and Regards..!

Nanda
 
Old 05-27-2009, 07:14 AM   #14
Nanda27
LQ Newbie
 
Registered: May 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Hi while running my program it shows an following error:

$ ns tcp.tcl
invalid command name "Application/TCPCNT"
while executing
"Application/TCPCNT create _o65 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new Application/TCPCNT"
("for" body line 17)
invoked from within
"for {set i 0} {$i < $streams} {incr i} {
# 3. Create objects for the TCP sender and receiver and specify maximum
# window sizes
set tcpz($i) [new ..."
(file "tcp.tcl" line 37)
I want to send the file to another computer if u hav any coding plz attach me..!

Thanks and Regards

Nanda
Attached Files
File Type: txt tcp.tcl.txt (2.0 KB, 20 views)
 
Old 05-27-2009, 12:06 PM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,538

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
# 14 : Code bug ?
.....
Have a look at this 'tcp.tcl' ( Attached ) :
http://www.informatik.uni-mannheim.d...xample/tcp.tcl

http://www.informatik.uni-mannheim.d...IP/ns-example/

'ns 2tcp.tcl.txt' will create the file 'out.nam' in the
current directory. 'out.nam' can be used with nam :

'nam' > > File > "Open..." :
will display the simulation, please push "Play", and wait for a minute ...
.....
Attached Files
File Type: txt 2tcp.tcl.txt (1.5 KB, 23 views)

Last edited by knudfl; 11-12-2009 at 02:55 PM.
 
  


Reply

Tags
nam, wimax


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
ns2- network simulator problem vivekr Linux - Networking 5 02-16-2011 12:25 PM
HP UX simulator Rahul Kolan Linux - Software 3 08-08-2008 01:48 AM
Simulator Vampyre_2099 Linux - Games 1 02-27-2008 09:07 AM
joystick problem with gl-117 flight simulator vaisarger Linux - Games 1 07-06-2006 04:12 AM
Problem with insatlling a Simulator-undefined symbol flock invinciblemk Linux - Software 0 03-23-2004 10:06 AM


All times are GMT -5. The time now is 07:10 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration