GIDForums  

Go Back   GIDForums > Computer Forums > Computer Software Forum - Linux
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 03-Oct-2006, 23:11
newbie06 newbie06 is offline
New Member
 
Join Date: Oct 2006
Posts: 21
newbie06 is on a distinguished road

run script command on ns2.26


Hi everybody,

I am still new in linux as well as the network simulator. I am now developing a project about mobile IP (an enhancement of mobile IP) and i'm using ns2.26 as a simulator. I have installed this ns2 version successfully in my pc. The problem is, when i was trying to run any example from the example given, it return an error message such as "bash: ns: command not found". I have tried many different types of commands such as:

./ns2.26 simple.tcl, ns simple.tcl, &ns simple.tcl, ns ./simple.tcl, etc..

but it doesn't work. Does anybody know what is the problem? Is it something wrong with my installation setup? or do I made mistake in the command? can anybody tell me the true command to run the code for this ns2 version? I really need help on this since i have more complicated task to do after this. thank you in advance for your help.
  #2  
Old 04-Oct-2006, 08:59
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 6,147
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: run script command on ns2.26


Quote:
Originally Posted by newbie06


ns simple.tcl
.
.
it doesn't work
If you get the bash message "ns not found", then bash can't find an executable named ns.


What Linux distribution are you using? How did you install the ns package? Where did the installation put the executable? The default would be in /usr/local/bin; at least it is with my installation of ns-2.30. I did a completely conventional installation of ns, nam and otcl. That is, I used defaults for configure and make to compile from source, then (as root) I did make install for each.

Regards,

Dave
  #3  
Old 04-Oct-2006, 23:28
newbie06 newbie06 is offline
New Member
 
Join Date: Oct 2006
Posts: 21
newbie06 is on a distinguished road

Re: run script command on ns2.26


Hi dave,

Many thanks for your reply. I'm using ns2.26 allinone package (from isi website) in which i have extracted all the necessary files on the root folder. Is that mean that I have to uninstall it and re-extract it again to the /usr/local/bin? is there any other way to do it. I think I have made the same thing as yours during the installation setup (if i'm not mistaken).

regards

newbie
  #4  
Old 05-Oct-2006, 09:49
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 6,147
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: run script command on ns2.26


Quote:
Originally Posted by newbie06
Hi dave,

Many thanks for your reply. I'm using ns2.26 allinone package (from isi website) in which i have extracted all the necessary files on the root folder.

regards

newbie

I would extract the files to a folder under your home directory. It's generally a bad idea to put any source or other user stuff under the /root directory. (It's generally a bad idea to do anything as root user unless you have to do it in order to install something there.)

Depending on what distribution you have (you didn't tell us), and what installation options you selected, you may find that you already have tcl/tk installed (as I did). So I only installed the individual packages that I indicated in my previous post.

When you unzip/untar the file that you downloaded, it puts source files in various sub-directories. There should be a README file or some such thing at the top level of the unzipped stuff. The reason it is named README is that you are expected to READ it. Instructions in the README file may be very complete, or they may refer you to other files (sometimes the README file just tells you to read another file, named INSTALL).

Anyhow for allinone, I seem to recall it tells you just to enter ./install at that level and everything gets installed. (Sometimes it tells you to su to root first, or maybe gives other instructions.)

Since I wanted to see and know exactly what gets installed, I did something like the following: (The '$' is the prompt for user == me, the '#' is the prompt for user == root.)

$ cd ns-2.30
$ ./configure
$ make
$ su
(Asked for password, which I gave it)
$ make install
$ exit

The "make install" puts the files in a location whose default directory may be /usr/local/bin (and may be changed by command line switches to configure and/or make). That's why you have to be the "root" user in order to carry out that step.

If there are any messages indicating problems, then you have to fix them. It's not the easiest thing to learn, but the above sequence will be what I try for just about everything I install these days. (I presently have Fedora Core 5 on most of my Linux systems, but these general instructions should work on just about any decently packaged software on just about any Linux system.)


No one was born knowing this stuff, you know. And I know it too, so just try to follow instructions from the home page; look at README or other files with interesting names; ask if you don't "get it".

If, like me, you are using Fedora Core 5, and when you do the "./configure" for one of the packages and it says something like "Can't find tcl installation", and you know that you have tcl installed, then you might have to install the tcl development package. (The basic tcl package has run-time stuff for tcl, but not the headers and library files that might be required to compile new stuff using the tcl librareis. The tcl-devel package contains the extra stuff that might be needed). Here's how I did it with yum:


$ su
(password stuff)
# yum install tcl-devel
# exit
$

That's one reason that I asked what Linux distribution you are using: each has slightly different (or grossly different) ways of installing and updating system and applications software.

Regards,

Dave
  #5  
Old 05-Oct-2006, 19:52
newbie06 newbie06 is offline
New Member
 
Join Date: Oct 2006
Posts: 21
newbie06 is on a distinguished road

Re: run script command on ns2.26


Hi Dave,

sorry for not mentioning what linux distribution that i'm using. i'm using RedHat. thanks a lot for your details explaination. i'm trying to understand and i really appreciate it. hope this time it will work.
  #6  
Old 19-Oct-2006, 00:59
peeves peeves is offline
New Member
 
Join Date: Oct 2006
Posts: 1
peeves is on a distinguished road

Re: run script command on ns2.26


hi !!
I installs NS-2.30 (allinone package) on Fedora Core 5 (run ./install)
Quote:
Nam has been installed successfully.
Ns-allinone package has been installed successfully.
Here are the installation places:
tcl8.4.13: /tmp/ns-allinone-2.30/{bin,include,lib}
tk8.4.13: /tmp/ns-allinone-2.30/{bin,include,lib}
otcl: /tmp/ns-allinone-2.30/otcl-1.12
tclcl: /tmp/ns-allinone-2.30/tclcl-1.18
ns: /tmp/ns-allinone-2.30/ns-2.30/ns
nam: /tmp/ns-allinone-2.30/nam-1.12/nam
xgraph: /tmp/ns-allinone-2.30/xgraph-12.1
gt-itm: /tmp/ns-allinone-2.30/itm, edriver, sgb2alt, sgb2ns, sgb2comns, sgb2hierns

----------------------------------------------------------------------------------

Please put /tmp/ns-allinone-2.30/bin:/tmp/ns-allinone-2.30/tcl8.4.13/unix:/tmp/ns-allinone-2.30/tk8.4.13/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.
IMPORTANT NOTICES:

(1) You MUST put /tmp/ns-allinone-2.30/otcl-1.12, /tmp/ns-allinone-2.30/lib,
into your LD_LIBRARY_PATH environment variable.
If it complains about X libraries, add path to your X libraries
into LD_LIBRARY_PATH.
If you are using csh, you can set it like:
setenv LD_LIBRARY_PATH <paths>
If you are using sh, you can set it like:
export LD_LIBRARY_PATH=<paths>

(2) You MUST put /tmp/ns-allinone-2.30/tcl8.4.13/library into your TCL_LIBRARY environmental
variable. Otherwise ns/nam will complain during startup.

(3) [OPTIONAL] To save disk space, you can now delete directories tcl8.4.13
and tk8.4.13. They are now installed under /tmp/ns-allinone-2.30/{bin,include,lib}
(The installation is successful???)
But when i use ns commands, i get the message "bash: ns: command not found" (like newbie), though i cd into the ns direction that contains ns file.
How can i set the PATH environment variable ?
  #7  
Old 19-Oct-2006, 09:46
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 6,147
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: run script command on ns2.26


Quote:
Originally Posted by peeves
hi !!
I installs NS-2.30 (allinone package) on Fedora Core 5 (run ./install)

How can i set the PATH environment variable ?

Here's the bad news: Since the installation program didn't put things in "normal" places like /usr/bin and /usr/lib, you have to do a little more work.

Here's the good news: Since the installation program didn't put things in "normal" places like /usr/bin and /usr/lib, it is unlikely that any other functionality of your system will be damaged in case something didn't go as expected. And--- it's not that much more work. And --- it's a learning opportunity, not just another barely endurable annoyance that leaves you and your machine at the mercy of a closed operating system and proprietary (and expensive) software.

That is you can remove all traces of these packages just by removing the directories and files that were obtained when you expanded the tarball. No mysterious "registry" entries to remove; no "uninstall" program necessary. Man, what a relief it is! That feeling that you can be in charge of your machine!

OK, I'll start from scratch with using my Fedora Core 5 system.

1. My advice is never (never) use /tmp for anything other than temporary stuff. Some day you will find that your /tmp directory is full of gigabytes worth of junk from who-knows-where, and you will go through it trying to figure out what can be deleted. Since there is so much junk there, you will then simply do something like "rm -rf *" from the /tmp directory, and everything possible will be deleted.

Well, maybe you won't, but I have done this many times, and I think that anything in a directory named /tmp or /temp should be considered as non-permanent (that's what "tmp" or "temp" means to me).

I respectfully suggest that you put downloaded files somewhere under your home directory. My home directory is /home/dave. That's where console windows always open. You can always get to your home directory by entering "cd" in a console window (you don't need to enter the quotes, of course).

2. Always (always) log in as a non-root user and do all possible things as non-root. That way you are less likely to screw up system files that shouldn't be touched. You should have been prompted for a username as part of the Fedora installation process. You are that user. Log in as that user. Stay that way as much as possible. With the allinone installation, nothing has to be done as root. So don't be root. (They used to call the "root" user "superuser", but in the wildly iconoclastic anti-establishment new wave of democracy of the late 60's, it was decided to deprecate the elitist nomenclature of "superuser" in favor of "root".)

2. Under your home directory enter the following:

mkdir ns

4. Put the ns-allinone-2.30.tar.gz there, and untar it:

tar zxvf ns-allinone-2.30.tar.gz

5. Then enter the following:

cd ns-allinone-2.30
./install

6. If everything goes OK, you will get messages like this (with your username nstead of "dave", obviously):
Code:
Please put /home/dave/ns/ns-allinone-2.30/bin:/home/dave/ns/ns-allinone-2.30/tcl8.4.13/unix:/home/dave/ns/ns-allinone-2.30/tk8.4.13/unix into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph. . . (1) You MUST put /home/dave/ns/ns-allinone-2.30/otcl-1.12, /home/dave/ns/ns-allinone-2.30/lib, into your LD_LIBRARY_PATH environment variable. If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH. If you are using csh, you can set it like: setenv LD_LIBRARY_PATH <paths> If you are using sh, you can set it like: export LD_LIBRARY_PATH=<paths> (2) You MUST put /home/dave/ns/ns-allinone-2.30/tcl8.4.13/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.

Now go back to your home directory.
There is a file there named .bashrc (note that the first character is a dot)

cd
cp .bashrc .bashrc.save

You have made a copy of .bashrc that you can use to restore it to its original state in case something gets screwed up in doing the next step.

Now, edit .bashrc and put in the following three lines at the end (Except with your username instead of "dave", obviously):
Code:
PATH=/home/dave/ns/ns-allinone-2.30/bin:/home/dave/ftp/ns/ns-allinone-2.30/tcl8.4.13/unix:/home/dave/ns/ns-allinone-2.30/tk8.4.13/unix:$PATH LD_LIBRARY_PATH=/home/dave/ns/ns-allinone-2.30/otcl-1.12:/home/dave/ns/ns-allinone-2.30/lib:$LD_LIBRARY_PATH TCL_LIBRARY=/home/dave/ns/ns-allinone-2.30/tcl8.4.13/library:$TCL_LIBRARY

Note: do not put spaces before or after the '=' or ':' in these lines.


Now, keep that console window open and open another console window. If you get some message about something with "no such file or directory", go back and make sure that you made the entries exactly as shown (no spaces anywhere). Close the new window and open another one. If it still isn't right, and if it seems hopless, then close the new window, and go back to the window where you originally edited .bashrc, and copy the saved version back to the original and start again with the .bashrc editing

cp .bashrc.save .bashrc

However, if everything is OK so far:

In the newly opened window, enter the following:


echo $PATH
echo $LD_LIBRARY_PATH
echo $TCL_LIBRARY

You should see a colon-delimited list of directories in each case, with your new stuff at the beginning of the list. The $TCL_LIBRARY and $LD_LIBRARY_PATH stuff may just have your stuff followed by a colon, since they may not have had a value previously; that's OK). The $PATH should show your stuff followed by a colon and some other files, including /usr/bin /bin and other very important stuff. If for some reason your $PATH doesn't show these things, then not much else will work, and you go back to your original .bashrc and try again.

Now, if things are OK so far, then, in the newly opened window, enter:

which ns

and you should see something like

~/ns/ns-allinone-2.30/bin/ns

(The '~' is the bash's shorthand for your home directory.)

If you just enter

ns

You should see the friendly ns command prompt

%

Exit from ns (by entering "exit" --- you don't need the quotes, of course).

Now: ready for action!

Regards,

Dave

"It's not a problem; it's a learning opportunity."
---My old pal Jorge Rivera (Where are you, Jorge?)
Last edited by davekw7x : 19-Oct-2006 at 10:52.
  #8  
Old 31-Oct-2006, 22:26
capricorn capricorn is offline
New Member
 
Join Date: Oct 2006
Posts: 5
capricorn is on a distinguished road

Re: run script command on ns2.26


hi !
My installation was successful but i m facing problem on solaris 10.
bash-3.00# which ns
/software/nss/ns-allinone-2.30/bin/ns
bash-3.00# ns
ld.so.1: ns: fatal: libtk8.4.so: open failed: No such file or directory
Killed.
libtk8.4.so is located at bash-3.00# /usr/local/lib/libtk8.4.so and i added this path to my all default paths.

My path settinngs are
bash-3.00# /usr/local/lib/libtk8.4.so
bash-3.00# cat .profile
PATH=$PATH:/usr/sbin:/usr/bin:/usr/local/lib:/software/nss/ns-allinone-2.30/lib:/usr/openwin/bin:/usr/ucb:/usr/ccs/bin:/usr/local/bin:/usr/sfw/bin/software/nss/ns-allinone-2.30/bin:/software/nss/ns-allinone-2.30/tcl8.4.13/unix:/software/nss/ns-allinone-2.30/tk8.4.13/unix;
export PATH

PATH=/software/nss/ns-allinone-2.30/bin:/software/nss/ns-allinone-2.30/tcl8.4.13/unix:/software/nss/ns-allinone-2.30/tk8.4.13/unix:$PATH

LD_LIBRARY_PATH=/software/nss/ns-allinone-2.30/otcl-1.12:/usr/local/lib:/software/nss/ns-allinone-2.30/lib:$LD_LIBRARY_PATH

TCL_LIBRARY=/software/nss/ns-allinone-2.30/tcl8.4.13/library:$TCL_LIBRARY

bash-3.00# which ns
/software/nss/ns-allinone-2.30/bin/ns
bash-3.00# /software/nss/ns-allinone-2.30/bin/ns
ld.so.1: ns: fatal: libtk8.4.so: open failed: No such file or directory

i also run the ./validate script n i got errors
bash-3.00# ./validate
(Validation can take 1-30 hours to run.)
Wed Nov 1 09:59:08 PKT 2006
*** ./test-all-simple
Tests: tahoe1 tahoe1Bytes tahoe1RED tahoe1REDbytes tahoe2 tahoe3 tahoe3RED tahoe4 no_bug bug reno1 reno renoA reno2 reno3 reno4 reno4a reno5 reno5_nobug telnet delayed phase phase1 phase2 timers manyflows stats statsECN stats1 stats1Bytes stats1a stats1aBytes statsHeaders stats2 stats3 stats4 statsTFRC
Running test tahoe1:
../../ns test-suite-simple.tcl tahoe1 QUIET
ld.so.1: ns: fatal: libtk8.4.so: open failed: No such file or directory
Killed
Running test tahoe1Bytes:
../../ns test-suite-simple.tcl tahoe1Bytes QUIET
ld.so.1: ns: fatal: libtk8.4.so: open failed: No such file or directory
Killed
Running test tahoe1RED:
../../ns test-suite-simple.tcl tahoe1RED QUIET
ld.so.1: ns: fatal: libtk8.4.so: open failed: No such file or directory
Killed.
Secondly how can i run Ns-2 GUI ?

Need help
Thanks.
  #9  
Old 01-Nov-2006, 17:45
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 6,147
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: run script command on ns2.26


Quote:
Originally Posted by capricorn
hi !
My installation was successful but i m facing problem on solaris 10.
Then it wasn't successful.

The instructions that I gave worked for me on various versions of Fedora Linux (core 4, 5 and now core 6). Actually I didn't originally install the allinone package; I just added the couple of things in the distribution that weren't already on my system. (And I put them in the "normal" places, like /usr/lib.)

For purposes of testing the procedure for the Original Poster, I temporarily installed the allinone from a fresh download, and everything seemed to work as advertised.

I have no access to or knowledge of Solaris systems. I don't think that my trying to guess would be productive. Sorry.


Maybe someone else can pitch in with practical advice.

Regards,

Dave
  #10  
Old 01-Nov-2006, 22:45
capricorn capricorn is offline
New Member
 
Join Date: Oct 2006
Posts: 5
capricorn is on a distinguished road

Re: run script command on ns2.26


I gave me successful installation message. The problem is due to environmental variables n its not reading me library libtak8.4.so as checked by this command

ldd -s /software/nss/ns-allinone-2.30/bin/ns

find object=libtk8.4.so; required by /software/nss/ns-allinone-2.30/ns-2.30/ns
search path=../tclcl-1.18:../otcl-1.12:../lib:/usr/sfw/lib (RPATH from file /software/nss/ns-allinone-2.30/ns-2.30/ns)
trying path=../tclcl-1.18/libtk8.4.so
trying path=../otcl-1.12/libtk8.4.so
trying path=../lib/libtk8.4.so
trying path=/usr/sfw/lib/libtk8.4.so
search path=/lib:/usr/lib (default)
trying path=/lib/libtk8.4.so
trying path=/usr/lib/libtk8.4.so
libtk8.4.so => (file not found)


The only problem is
ld.so.1: ns: fatal: libtk8.4.so: open failed: No such file or directory

I asked you about NS2 GUI. should i install it separately or its installed with this allinone-2.30 n how to execute it ?.
 
 

Recent GIDBlogCompress Your Web Site by gidnetwork

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Web stats fcolor Web Design Forum 10 12-Jul-2007 08:48
Need Free Website Templates sam_dezine Web Design Forum 8 06-Sep-2006 03:25
Who Is A Web Designer ? alicehopkins Web Design Forum 1 13-Jun-2006 02:56
HTML Code amgujral Web Design Forum 0 07-Apr-2006 09:46
Two virtual hosts, cgi script behaves differently on each blimbo Apache Web Server Forum 0 04-Aug-2004 09:35

Network Sites: GIDNetwork · GIDApp · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 02:50.


vBulletin, Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.