LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-18-2011, 11:01 AM   #1
Aden09
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Rep: Reputation: 0
Problem installing ns2 on Ubuntu


Hi,

I am trying to install ns2 on my Ubuntu machine and I followed the steps as mentioned on:
http://nsnam.isi.edu/nsnam/index.php..._on_Ubuntu7.04

After I set the path variables, (I did change the your/path), I tried executing the ns command.

I should have gotten a % in return but i get the following text.


Usage: host [-v] [-a] [-t querytype] [options] name [server]
Listing: host [-v] [-a] [-t querytype] [options] -l zone [server]
Hostcount: host [-v] [options] -H [-D] [-E] [-G] zone
Check soa: host [-v] [options] -C zone
Addrcheck: host [-v] [options] -A host
Listing options: [-L level] [-S] [-A] [-p] [-P prefserver] [-N skipzone]
Common options: [-d] [-f|-F file] [-I chars] [-i|-n] [-q] [-Q] [-T] [-Z]
Other options: [-c class] [-e] [-m] [-o] [-r] [-R] [-s secs] [-u] [-w]
Special options: [-O srcaddr] [-j minport] [-J maxport]
Extended usage: [-x [name ...]] [-X server [name ...]]

What am I doing wrong?

Thanks,
Aden
 
Old 04-18-2011, 01:38 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,749

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Welcome to LQ.

The mentioned error happens sometimes. You are not the first asking for a solution.
I have never experienced it here, I think, with a hundred ns2 installs done OK.
Besides that, you may not need the % prompt. The most commands are done with :
'ns file.tcl'.

What happens if you do : 'cd ns-allinone-2.34/ns-2.34/ && ./ns' ?


About setting a path : Usually not required since ns-2.26.
'cd ns-allinone-2.34/ns-2.34/ && sudo make install' copies 'ns' to /usr/local/bin.
cd ../nam-<version>/ && sudo make install : nam is copied to /usr/local/bin.
Then 'ns' and 'nam' are in a system PATH.

Today ns and nam are statically compiled, and depend on libs in /usr/lib/ only.
And /usr/lib/ is already in the LD_LIBRARY_PATH.

Also : If you had 2 or 3 versions of ns2 installed,
adding a path to the .bashrc wouldn't work.

..

Last edited by knudfl; 04-18-2011 at 01:40 PM.
 
Old 04-18-2011, 02:20 PM   #3
Aden09
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Hey,
Knudfl

When i run 'cd ns-allinone-2.34/ns-2.34/ && ./ns' I get %.! Yay..!

I was looking into other forums and it turns out that when I ran "ns" I was running the name service and not network simulator.

I then tried creating and running a simple tcl and I am getting an error. I can see the tcl file in the directory but when i run "$ns xxx.tcl" I keep getting the error " xxx.tcl does not exist, try again ".

Any ideas about whats going wrong?
 
Old 04-18-2011, 02:27 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,749

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
May be this will help :

1) The first command is : pwd
It will tell your location.

2) cd <path-to-folder-with-xxx.tcl>/

3) ns xxx.tcl
 
Old 04-18-2011, 02:45 PM   #5
Aden09
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
I was running "ns xxx.tcl" in the correct directory. It gives an error with "ns xxx.tcl" but works fine with "./ns xxx.tcl".

Whats the difference between just "ns" and "./ns" ?

Thanks for all your help
 
Old 04-18-2011, 03:23 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,749

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Did you install ( or copy ) 'ns' to /usr/local/bin/ ?

And what is your location of ns-allinone-2.34/ ?
Default is : /home/<user-name>/ns(2)/ns-allinone-2.34/
( Or any other folder in /home/<user-name>/ ).

The above location for the binary 'ns' and for the application
is usually the safe choice.
( And you can't do './ns2' in all locations, unless you have a link
or a copy of 'ns' in all the used directories.)

..

Last edited by knudfl; 04-18-2011 at 03:27 PM.
 
Old 04-18-2011, 04:21 PM   #7
Aden09
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
The location of my ns-allinone-2.34 is /home/Aden/Desktop/ns-allinone-2.
I unzipped and installed everything here.

I did run this line, which said it would allow me to run "ns" from everywhere.

"$ sudo ln -s /home/Aden/Desktop/ns-allinone-2.34/ns-2.34/ns/usr/bin/ns" from http://vanitdiscovery.blogspot.com/2...buntu-904.html
 
Old 04-18-2011, 06:01 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,749

Rep: Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551Reputation: 2551
Quote:
sudo ln -s /home/Aden/Desktop/ns-allinone-2.34/ns-2.34/ns/usr/bin/ns
Except that a <space> is missing. It should be :

sudo ln -s /home/Aden/Desktop/ns-allinone-2.34/ns-2.34/ns /usr/bin/ns

And : /usr/bin/ or /usr/local/bin/, not that important.
But it is /usr/local/bin/, that is meant for your own files,
i.e. software, which is not installed with the Package Manager.
Never used links like that. May work.
Still : The safe method is : cd ns-2.34/ && sudo make install

Also have in mind, that you can never know, how experienced the author is when
he/she writes a blog. Some write a HOWTO right after installing their first ns2.

..
 
  


Reply


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
problem installing ns2 drdang Linux - Networking 2 02-18-2011 04:30 PM
urgent -- error installing ns2 on ubuntu 7.04 king2k Linux - Newbie 8 02-02-2011 05:28 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
[SOLVED] problem in installing ns2.33 in ubuntu 8.10 neeraj.dwivedi Linux - Newbie 18 09-12-2009 08:00 AM
Problem Installing NS2 in Ubuntu 7.10 smetya Linux - Software 5 04-27-2008 08:27 AM


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

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