LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Problem with ns2 (https://www.linuxquestions.org/questions/programming-9/problem-with-ns2-404429/)

vivekr 01-17-2006 07:57 AM

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.

Hai,
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


Code:

[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 out.name &
  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

IBall 01-18-2006 01:32 AM

Have you tried running the example scripts in the ns2 tutorial. http://www.isi.edu/nsnam/ns/tutorial/index.html

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...

--Ian

vivekr 01-18-2006 05:15 PM

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

bangoram 07-22-2006 02:07 AM

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 ...

XavierP 07-22-2006 06:48 AM

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.

http://www.linuxquestions.org/rules.php

"Urgent" is no excuse.


All times are GMT -5. The time now is 06:58 AM.