LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot create nodes in ns-allinone-2.30 using the 'set n0 [$ns node]' command (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-create-nodes-in-ns-allinone-2-30-using-the-set-n0-%5B%24ns-node%5D-command-729204/)

Cataj 05-28-2009 08:36 PM

Cannot create nodes in ns-allinone-2.30 using the 'set n0 [$ns node]' command
 
As per the ns2 tutorial http://www.isi.edu/nsnam/ns/tutorial/ to set up nodes the command set n0 [$ns node] is used, when I try this command I get an error, I can not also open the files including all the code in tutorials that you can use as a base point. The errors I get are as below for setting up the nodes:

% set ns [new Simulator]
_o11
% set nf [open out.nam w]
file4
% $ns namtrace-all $nf
file4
% proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
% set n0 [$ns node]
class Node: constructor failed: invalid command name "_o4 _o11"
% set n1 [$ns node]
class Node: constructor failed: invalid command name "_o4 _o11"


To display the TCL files the following error occurs:

% ns ns-simple.tcl
error when calling class OldSim: ns-simple.tcl

Any help would be greatly appreciated as I need ns2 for my dissertation urgently and I cannot find any way of resolving the issues.

knudfl 05-29-2009 07:05 AM

Welcome to LQ.

Please start here
http://www.isi.edu/nsnam/ns/tutorial/nsscript1.html

And have a look at this thread to see some of the
examples put together into a workable tcl script.
http://www.linuxquestions.org/questi...roblem-726993/
.....
ns-simple.tcl , have a look here
http://nile.wpi.edu/NS/Example/ns-simple.tcl
... open it with 'ns ns-simple.tcl' and click the "Play button" in nam.
http://nile.wpi.edu/NS/simple_ns.html
.....
P.S.: I can't see where you got your file, or what made
you write it in that way ..... a direct link may help.
And please put code into code tags ....
http://www.linuxquestions.org/questi....php?do=bbcode
.....


All times are GMT -5. The time now is 06:19 PM.