Visit Jeremy's Blog.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


Closed Thread
  Search this Thread
Old 01-17-2006, 08:57 AM   #1
Registered: Nov 2005
Location: Coimbatore,India
Distribution: Fedora Core4
Posts: 68

Rep: Reputation: 15
Problem with ns2

I am extremely sorry for posting this in more than one section but since this is urgent and am looking for quick response I had no other go than to opt for this section too.

i was a little confused as to where to place my question..
and i decided my q would be more appropriate here ..

so.. after installing ns2.9... without any errors and a perfect validation now the ns spits the error

[vivek@localhost ns-2.29]$ ./ns
% ns example1.tcl
warning: using backward compatibility mode
error when calling class OldSim: example1.tcl
% cat example1.tcl
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 &
  exit 0
set n0 [ $ns node ]
set n1 [ $ns node ]
$ns duplex-link $n0 $n1 10ms DropTail
$ns at 5.0 "finish"
$ns run
I saw a lot of these kind in ns-mailing list with no proper solution.. so i resorted to LQ, my favourite
Old 01-18-2006, 02:32 AM   #2
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 62
Have you tried running the example scripts in the ns2 tutorial.

Also, where did you install ns from - did you dowload it from the above website, or somewhere else.

It appears that you have a newer version of ns than the script was written for.

Aside from that, I can't help other than to say that ns error messages are very unhelpful from my experience...

Old 01-18-2006, 06:15 PM   #3
Registered: Nov 2005
Location: Coimbatore,India
Distribution: Fedora Core4
Posts: 68

Original Poster
Rep: Reputation: 15
Thanks for ur response..
And actually a small error has crept in and I managed to rectify it..
It seems when ns command is used inside the prompt the file will not be executed as a single interrelated file. It operates on each and every line independently. So thats the problem. Thanks to IBell again
Old 07-22-2006, 03:07 AM   #4
Registered: Jan 2006
Posts: 61

Rep: Reputation: 15
Can u add some more info abt this rectification!!

Though its very simple, to add some more clarity to vivekr message...

warning: using backward compatibility mode
error when calling class OldSim: example1.tcl

This warning will occur if you are trying to execute the example1.tcl from %ns prompt..

[root@localhost ns-2.29]# ns example1b.tcl

I have saved the example1.tcl at ns-2.29 direc..and use ns to run the script..

Hope this information will help beginners ...

Last edited by bangoram; 07-22-2006 at 05:52 AM.
Old 07-22-2006, 07:48 AM   #5
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

"Urgent" is no excuse.

Closed Thread

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 01:25 PM
Research with ns2 hafiz Linux - Networking 0 12-09-2005 02:38 AM
Ns2 ConfusedMonkey Linux - Software 3 10-05-2005 12:32 PM
problem with NS2 cain_eve Programming 1 04-17-2005 04:32 PM
how to set path? here a meet the problem with ns2 installation cain_eve Linux - Newbie 12 12-16-2004 06:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:50 PM.

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
Open Source Consulting | Domain Registration