I'm doing my final year project on Wireless Ad-Hoc networks and was required to Install NS-2 (Network Simulator) on Ubuntu 9.04 - the Jaunty Jackalope. I thought it would be easy to install NS-2, using the shell script file "Install", but it didn't work and failed. I tried many tricks and searched the web, but didn't find a good tutorial for the same, and thought to write one.

The procedure for installing NS-2 in Ubuntu 9.04
1. Download ns-allinone-2.33.tar from here.
2. Place it in somewhere, e.g. /home/programmer, then extract it.
$ cd /home/programmer
$ tar -xvf ns-allinone-2.33.tar
3. Download & install some packages from repository
$ sudo apt-get install build-essential autoconf automake libxmu-dev
4. Install the ns2
$ cd ns-allinone-2.33
$ ./install
5. Edit some paths
$ gedit ~/.bashrc
Put these lines on that file. Off course, you might change /home/programmer for it depends on where you extract ns-allinone-2.33.tar.
# LD_LIBRARY_PATH
OTCL_LIB=/home/programmer/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/programmer/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB
:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/programmer/ns-allinone-2.33/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/programmer/ns-allinone-2.33/bin:/home/programmer/ns-allinone-2.33/tcl8.4.18/unix:/home/programmer/ns-allinone-2.33/tk8.4.18/unix:/home/programmer/ns-allinone-2.33/xgraph-12.1/
NS=/home/programmer/ns-allinone-2.33/ns-2.33/
NAM=/home/programmer/ns-allinone-2.33/nam-1.13/
export PATH=$PATH:$XGRAPH:$NS:$NAM
6. Validate it (take very long time compare to install process)
$ cd ns-2.33
$ ./validate
7. (Optionally) Create a symlink, so that ns can be called from everywhere
$ sudo ln -s /home/programmer/ns-allinone-2.33/ns-2.33/ns /usr/bin/ns
8. Let it take effect immediately
$ source ~/.bashrc
9. Try to run it (and pray :) )
$ ns
10. If the installation success, you will see % at the command prompt. Type following command to exit
% exit
Testing ns2 Installation
Use the following ns batch command
set ns [new Simulator]
$ns at 1 “puts \“Hello World!\””
$ns at 1.5 “exit”
$ns run
Then,
1. Copy the commands above and paste in the text editor
2. Save the file as simple.tcl
3. Type command in command prompt
$ ns simple.tcl
4. It will show Hello World in the line below
TroubleShooting
1. Problem : The system cannot find Tcl or it tells that Tcl does not install correctly
Solution 1 : Check your ns tcl nam ... version, check folder name. If it is not correct, edit the .bashrc
Solution 2 : run ./install again
2. Problem : nam does not work
Solution 1 : In fact, you need to change that particular file in your Linux manually.
Here is what you should do.
Apply the following patch :
--- tk8.4.18-orig/generic/tkBind.c 2006-07-21 08:26:54.000000000 +0200
+++ tk8.4.18/generic/tkBind.c 2008-07-05 12:17:10.000000000 +0200
@@ -586,6 +586,9 @@
/* ColormapNotify */ COLORMAP,
/* ClientMessage */ 0,
/* MappingNotify */ 0,
+#ifdef GenericEvent
+ /* GenericEvent */ 0,
+#endif
/* VirtualEvent */ VIRTUAL,
/* Activate */ ACTIVATE,
/* Deactivate */ ACTIVATE,
Create a file with the above lines and name it : abc.patch. To apply the patch navigate to ns directory and execute the following command in terminal:
patch -b < abc.patchThen run $ ./install to compile and install ns2 again. Hope this helps, drop in your comment for HELP ! :)
What is RSS ?



Tech Guru is a mobile-friendly website. Simply bookmark 
Thanks dude,
ReplyDeletegreat post.
really helped.
though had to do a bit of googling to find a patch
see this too...
http://wirelesscafe.wordpress.com/2008/12/23/how-to-install-ns2-on-fedora-10-cambridge/
you mention that + sign is for adding and - sign is for delete
ReplyDeletei am confuse: i dont understand what to add and what to delete ?
can u please explain me ??
I have updated the post, this might help you now !
ReplyDeleteHey! thanks for the guide.
ReplyDeleteBut I am having a problem in running simple.tcl
I copy & paste the above Hello program in text editor and save it as text file... but I think it should be in .tcl format to run... but I read some where that in ubuntu there is no need to save as in .tcl
now in command prompt when I run this, I got error:-
user@ubuntu8041:~$ ns simple.tcl
couldn't read file "simple.tcl": no such file or directory
I think it should be saved in .tcl but my text editor don't give me option to save as in .tcl...
Please help me out as soon as possible.
I also found these errors when I open my command prompt:
ReplyDeletebash: LIB:/usr/local/lib: No such file or directory
bash: ns-allinone-2.31/tcl8.4.14/unix:/home/user/ns-allinone-2.31/tk8.4.14/unix:/home/user/ns-allinone-2.31/xgraph-12.1/: No such file or directory
I know that above guide is for ns2.33 but I found ns2.31 commands same as well...but I am encountering these errors after the command:
$ gedit ~/.bashrc
and copy & paste the given code in that file and saved it... please help me out!
(1) It's a good practice to save your file in tcl format, you can change the extension but just renaming the file and changing the extension. Even if you don't want to give tcl ext to file you have to write :
ReplyDeletens simple.txt ( in case file extension is txt )
and not
ns simple.tcl
(2)It gives the errors bcos you might have not supplied correct paths in the bashrc file. Correct them !
While i am executing tcl file with ns I have this error:
ReplyDeletens: finish: couldn't execute "nam": permission denied
while executing
"exec nam out.nam &"
(procedure "finish" line 5)
invoked from within
"finish"
I have put NAM=/home/kamil/ns2/nam-1.14/ in to env varibles.
Any suggestion where is a problem ??
Use sudo with the command you are giving, it will then ask you for root password and hence you will not get permission denied error.
ReplyDeleteThanks, but I still having the error:
ReplyDeletebash: LIB:/usr/local/lib: No such file or directory
and now I saved the exapmle as simple.tcl and now when I run it, this happen:
user@ubuntu8041:~$ ns simple.tcl
(_o5 cmd line 1)
invoked from within
"_o5 cmd at 1 “puts “Hello World!””"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o5" line 2)
(SplitObject unknown line 2)
invoked from within
"_o5 at 1 “puts “Hello World!””"
("eval" body line 1)
invoked from within
"eval $scheduler_ at $args"
(procedure "_o3" line 3)
(Simulator at line 3)
invoked from within
"$ns at 1 “puts \“Hello World!\””"
(file "simple.tcl" line 2)
Now what is happening here? I can't understand this output...
Hey! I run my own code named example.tcl and it was this:
ReplyDelete#Create a simulator object
set ns [new Simulator]
#Open the NAM and Trace file
set nf [open out.nam w]
$ns namtrace-all $nf
set f0 [open out1.tr w]
$ns trace-all $f0
#Define different colors for data flows (for NAM)
$ns color 1 Blue
$ns color 2 Red
#Create six nodes
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set n6 [$ns node]
$ns duplex-link $n1 $n3 2Mb 10ms DropTail
$ns duplex-link $n2 $n3 2Mb 10ms DropTail
$ns duplex-link $n3 $n4 1Mb 10ms DropTail
$ns duplex-link $n4 $n5 2Mb 10ms DropTail
$ns duplex-link $n4 $n6 2Mb 10ms DropTail
$ns duplex-link-op $n1 $n3 orient right-down
$ns duplex-link-op $n2 $n3 orient right-up
$ns duplex-link-op $n3 $n4 orient right
$ns duplex-link-op $n4 $n5 orient right-up
$ns duplex-link-op $n4 $n6 orient right-down
#Set Queue Size of link (n3-n4) to 10
$ns queue-limit $n3 $n4 10
#Monitor the queue for link (n3-n4).
$ns duplex-link-op $n3 $n4 queuePos 0.5
#Setup a TCP connection
set tcp [new Agent/TCP/Reno]
#$tcp set packetsize_ 1000
$ns attach-agent $n1 $tcp
$tcp set class_ 1
set sink [new Agent/TCPSink]
$ns attach-agent $n5 $sink
$ns connect $tcp $sink
#Setup a FTP over TCP connection
set ftp [new Application/FTP]
$ftp attach-agent $tcp
#Setup a UDP connection
set udp [new Agent/UDP]
$ns attach-agent $n2 $udp
$udp set class_ 2
set null0 [new Agent/Null]
$ns attach-agent $n6 $null0
$ns connect $udp $null0
#Setup a CBR over UDP connection
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.01
$cbr0 attach-agent $udp
#Schedule events for the CBR and FTP agents
$ns at 0.0 "$cbr0 start"
$ns at 0.0 "$ftp start"
$ns at 25.0 "$ftp stop"
$ns at 30.0 "$cbr0 stop"
#Define a 'finish' procedure
proc finish {} {
global ns nf f0
$ns flush-trace
#Close the NAM trace file
close $nf
close $f0
#Execute NAM on the trace file
exec nam out.nam &
exit 0
}
$ns at 30.0 "finish"
#Run the simulation
$ns run
I saved it as exapmle.tcl and the run it as:
$ ns example.tcl
Bingo! I got the output in nam and its running perfectly!
I think there may any problem in code of simple.tcl ...
Anyways thanks Shubham NeO ©® for the superb guide line. And those who have problem in running simple.tcl then try my above code and save it as example.tcl =)
X11_LIB=/usr/X11R6/lib is given in step 5. But there is no such path in ubuntu 9.04. in fact there is only one folder(bin) in X11R6 and that too is linked. so proper validation doesnt take place if i include bin.
ReplyDeletecan someone pls help.
Thanks a lot for this guide.
ReplyDeleteInstallation was successful. I saw %.
After i used the command:
$ sudo ln -s /home/programmer/ns-allinone-2.33/ns-2.33/ns /usr/bin/ns
It has stopped to operate. How can i cancel this command?
Please, execuse me for my English. It's not my native language.
@bove I suppose this command should not halt the working of NS as it only creates symbolic link. Anywayz, if it is so then remove the file in /usr/bin/ named ns, if still it does not work, delete your NS folder and reinstall it.
ReplyDelete@bove @bove : You can neglect the validation as far as NS is working fine.
If its not too much trouble can you help me a little further?
ReplyDeleteI've tried some of the tutorial lessons on the ns2 website but I get
the following error.
-----------------------------------------------------------------------------------------------------------------------------------
mehernosh@machine:~$ ns example1a.tcl
mehernosh@machine:~$ nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
bind Listbox {
%W yview scroll [expr {..."
----------------------------------------------------------------------------------------------------------------------------------------
I get this error no matter what script I try, the simple hello world described above or more advanced ones available online. Its not that I am making a mistake in the Tcl code because I am tried using scripts available online at http://www.isi.edu/nsnam/ns/tutorial/index.html .
Help!
I have a problem in the command
ReplyDelete$ source ~/.bashrc
emna@emna-desktop:/usr/local$ source ~/.bashrc
bash: :/usr/X11R6/lib:/usr/local/lib: Aucun fichier ou dossier de ce type
can someone pls help
@bove : You can ignore this error if you are able to get % sign on running ns.
ReplyDeleteI am getting the below lines for any script I write....
ReplyDeleteand I have installed ubuntu 9.10 version...
please help me out to getrid of this....
nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
That was an awesome guide...thanx a lot, Shubham, for posting it...really cool... :)
ReplyDeleteI am writing this because some Ubuntu 9.10 users are also posting here.
But ubuntu 9.10 users might still face some problems (I faced one :(..) while installing ns-2.34 (or probably even the older versions...).
The trouble is that ubuntu 9.10 provides gcc-4.4 while otcl likes gcc-4.3.
So,
1. "sudo apt-get install gcc-4.3 gcc-4.3-base"
2. Navigate to otcl folder. Edit Makefile.in file
in line 7
From :
CC= @CC@
to :
CC= gcc-4.3
3. Then move up one folder and then
'CC=gcc-4.3 ./install'
There is no g++ code in ns folder so there wont be any requirement in installing g++ stuff.
4. ./validate
Actually, there are no more changes except the gcc part. Rest of the procedure remains the same.
Hope it helps...
Excellent post ~NeO~, I used your recipe from top to bottom and with the exception of some additional tweaks here and there due to my Ubuntu 9.10 system, I was able to install ns without "so much trouble". very well written and easy to follow
ReplyDeleteThanks a lot!
Install Network Simulator 2 ( NS2) Within 2 Minutes
ReplyDeleteHi Friendssss.......Now You can Install NS2 in Ubuntu within Two Minutes..No tedious task of Changing environment and all etc.. U just Download the link(.rar file) Provided below.. and Extract the Files and Just Double click on them ..thats it Dudes.. now you have installed Ns2 in Ubuntu in two Minutes.. to Check..it got installed or not just go to terminal and type ns then you will get % Symbol just exit the terminal.. to run a Tcl file go to terminal and type ns example1.tcl.....wow...... now U can see the Nam animator.. Congratsssssssss....
Download Link..
http://suneelshinde.blogspot.com
Hey guys,
ReplyDeleteCan you please help out? After entering the variables and validated, i typed in ns at the prompt but didn't get the % sign. I got this instead:
validate overall report: all tests passed
lamy@lamy-desktop:~/ns-allinone-2.33/ns-2.33$ sudo ln -s /home/lamy/ns-allinone-2.33/ns-2.33/ns/usr/bin/ns
[sudo] password for lamy:
ln: creating symbolic link `./ns': File exists
lamy@lamy-desktop:~/ns-allinone-2.33/ns-2.33$ ns
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 ...]]
lamy@lamy-desktop:~/ns-allinone-2.33/ns-2.33$
Does it have to do with my internet or something?
Hope to hear from you guys soon
Cheers
sir i run the tcl script wireless-test.tcl in ns2.34 verson. it creates two files trace and nam.
ReplyDeletethen i run name file also. i want to save the nam output. but i dont know. plese respond to my question if u know.
Nice post was really helpful, and for those who want to install NS in Ubuntu 9.10 and having some other problem can learn it from
ReplyDeletehttp://pingusays.blogspot.com/2010/03/installing-ns-234-in-ubuntu-910.html
Hi,
ReplyDeleteFound the following error while installing ns2-2.34 on ubuntu 9/04
/home/rvce/Desktop/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1403: error: ‘TkBorder’ has no member named ‘resourceRefCount’
/home/rvce/Desktop/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1405: error: ‘TkBorder’ has no member named ‘objRefCount’
make: *** [tk3d.o] Error 1
tk8.4.18 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com
Please do the needful.
Harsha
hi dears i have installed the simulator but have an error when run example.tcl please help out
ReplyDelete% ns example.tcl
error when calling class OldSim: example.tcl
thanks a lot ... i am done successfully with ubuntu 8.04 and ns 2.34 >(
ReplyDeletewhen i installed and validated it, it was done ok. Then i followed step 7, it was also done but wen i followed step 8, it gave the following output:
ReplyDeletebash: :/usr/X11R6/lib:/usr/local/lib: No such file or directory
can you please help?
hey when I install ns-allinone-2.33 on Ubuntu 9.04 I'm unable to get % sign that indicates successful installed instead I'm getting something like...
ReplyDeleteUsage: 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 ...]]
Plz help me out of this.....
hey i have a source code of (cluster based routing protocol)cbrp implementation. it needs NS with cmu extension.
ReplyDeletecan anybody please help me.
i have got the i have got the ns-src with cmu extention but i have already installed ns2.34 how can i install the ns with cmu extension.
help needed urgently.
hey i have a source code of (cluster based routing protocol)cbrp implementation. it needs NS with cmu extension.
ReplyDeletecan anybody please help me.
i have got the i have got the ns-src with cmu extention but i have already installed ns2.34 how can i install the ns with cmu extension.
help needed urgently.
Hi, Thanks lot. This was really help me. Many Thanks...........................
ReplyDeletehi
ReplyDeleteanynone help me interating cbrp in ns2 and give me file .tcl of cbrp
thank you very much
hey i have a source code of (cluster based routing protocol)cbrp implementation. it needs NS with cmu extension.
ReplyDeletecan anybody please help me.
i have got the i have got the ns-src with cmu extention but i have already installed ns2.34 how can i install the ns with cmu extension.
Hi
ReplyDeletefirst i thanks you about the procedure of installing
How can run multi simulation by using loop(FOR) and in each simulation i want to implement proc.finish which have multi AWk steps and put the result of awk in new output text file for each simulation to use this data later
thanks for this guide
ReplyDeletemy name is ahmed, i need your help
how can i create multi simulation by using loop(For) and save the output of each simulation in a new text file
$ nam: no display name and no $DISPLAY environment variable
ReplyDeletecan anyone help??
while running the sample.tcl file i get the following error :-
ReplyDelete"
warning: using backward compatibility mode
error when calling class OldSim: sample.tcl
"
can u help me plz ???
Greetings Friends i am using ubuntu-10.04.1 and i installed NS-2.34 .and i tried all the steps above its works until the step when i typ $ ns
ReplyDeletenothing happen the following message appear
command not found
can anyone please help me i really need to make it work
I tried to execute a ns2.33 program in ubuntu9.10, i got error only based on NAM file. How to install the nam.
ReplyDeletenam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
hai guys. My name is Sharul. im using ubuntu 10.04 lts and using ns2 2.34. just for info im really new with ns2 and also ubuntu. why am i getting the permission denied when running the simple.tcl example as given in the website. any one can help me with it? Thanks Guys.
ReplyDeleteUse sudo before the command !
ReplyDeleteThanks Shubham for the help
ReplyDelete% ns test-suite-wireless-lan.tcl
ReplyDeletewarning: using backward compatibility mode
error when calling class OldSim: test-suite-wireless-lan.tcl
whene ever i try an example it shows me this : error when calling class OldSim
pleeease can anyone help!!
hey shubham
ReplyDeletei was installing ns2.34 and i got this error
Build OTcl-1.13
install: 498: ./configure: Permission denied
otcl-1.13 configuration failed! Exiting ...
could you please tell me, why this is happening
Use sudo command !
ReplyDeletecan anyone give me the code to create VPN client in ns2
ReplyDeletei have installed ns2 successfully... i am implementing VPN client in adhoc network please can someone provide me with code...
ReplyDeletecouldn't open "out.nam": permission denied
ReplyDeletewhile executing
"open out.nam w"
invoked from within
"set nf [open out.nam w]"
(file "example1b.tcl" line 5)
can anybody suggest solution for it.. I am facing following problem
ReplyDeletecouldn't open "out.nam": permission denied
while executing
"open out.nam w"
invoked from within
"set nf [open out.nam w]"
(file "example1b.tcl" line 5)
@bove Use Sudo Command !
ReplyDeletenice post, was really helpful
ReplyDeletehttp://www.google.com
avi@ravi-desktop:/$ source ~/.bashrc
ReplyDeletebash: allinone-2.34/libX11_LIB=/usr/X11R6/libUSR_LOCAL_LIB=/usr/local/libexport: No such file or directory
bash: 2.34/bin:/home/ravi/ns-allinone-2.34/tcl8.4.18/unix:/home/ravi/ns-allinone-: No such file or directory
bash: 2.34/tk8.4.18/unix:/home/ravi/ns-allinone-2.34/xgraph-12.1/NS=/home/ravi/ns-allinone-2.34/ns-: No such file or directory
bash: 2.34/NAM=/home/ravi/ns-allinone-2.34/nam-1.13/export: No such file or directory
please help me
i used ubuntu 10 nd ns 2.34
ReplyDeletei used ubuntu 10 nd ns 2.34
ReplyDeletehey shubham
ReplyDeletei was installing ns2.34 and i got this error
Build OTcl-1.13
install: 498: ./configure: Permission denied
otcl-1.13 configuration failed! Exiting ...
could you please tell me, why this is happening
I tried to execute a ns2.33 program in ubuntu9.10, i got error only based on NAM file. How to install the nam.
ReplyDeletenam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."
while running the sample.tcl file i get the following error :-
ReplyDelete"
warning: using backward compatibility mode
error when calling class OldSim: sample.tcl
"
can u help me plz ???
$ nam: no display name and no $DISPLAY environment variable
ReplyDeletecan anyone help??
thanks for this guide
ReplyDeletemy name is ahmed, i need your help
how can i create multi simulation by using loop(For) and save the output of each simulation in a new text file
hey i have a source code of (cluster based routing protocol)cbrp implementation. it needs NS with cmu extension.
ReplyDeletecan anybody please help me.
i have got the i have got the ns-src with cmu extention but i have already installed ns2.34 how can i install the ns with cmu extension.
help needed urgently.
when i installed and validated it, it was done ok. Then i followed step 7, it was also done but wen i followed step 8, it gave the following output:
ReplyDeletebash: :/usr/X11R6/lib:/usr/local/lib: No such file or directory
can you please help?
Hi,
ReplyDeleteFound the following error while installing ns2-2.34 on ubuntu 9/04
/home/rvce/Desktop/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1403: error: ‘TkBorder’ has no member named ‘resourceRefCount’
/home/rvce/Desktop/ns-allinone-2.34/tk8.4.18/unix/../generic/tk3d.c:1405: error: ‘TkBorder’ has no member named ‘objRefCount’
make: *** [tk3d.o] Error 1
tk8.4.18 make failed! Exiting ...
For problems with Tcl/Tk see http://www.scriptics.com
Please do the needful.
Harsha
Hey guys,
ReplyDeleteCan you please help out? After entering the variables and validated, i typed in ns at the prompt but didn't get the % sign. I got this instead:
validate overall report: all tests passed
lamy@lamy-desktop:~/ns-allinone-2.33/ns-2.33$ sudo ln -s /home/lamy/ns-allinone-2.33/ns-2.33/ns/usr/bin/ns
[sudo] password for lamy:
ln: creating symbolic link `./ns': File exists
lamy@lamy-desktop:~/ns-allinone-2.33/ns-2.33$ ns
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 ...]]
lamy@lamy-desktop:~/ns-allinone-2.33/ns-2.33$
Does it have to do with my internet or something?
Hope to hear from you guys soon
Cheers
Install Network Simulator 2 ( NS2) Within 2 Minutes
ReplyDeleteHi Friendssss.......Now You can Install NS2 in Ubuntu within Two Minutes..No tedious task of Changing environment and all etc.. U just Download the link(.rar file) Provided below.. and Extract the Files and Just Double click on them ..thats it Dudes.. now you have installed Ns2 in Ubuntu in two Minutes.. to Check..it got installed or not just go to terminal and type ns then you will get % Symbol just exit the terminal.. to run a Tcl file go to terminal and type ns example1.tcl.....wow...... now U can see the Nam animator.. Congratsssssssss....
Download Link..
http://suneelshinde.blogspot.com
Excellent post ~NeO~, I used your recipe from top to bottom and with the exception of some additional tweaks here and there due to my Ubuntu 9.10 system, I was able to install ns without "so much trouble". very well written and easy to follow
ReplyDeleteThanks a lot!
That was an awesome guide...thanx a lot, Shubham, for posting it...really cool... :)
ReplyDeleteI am writing this because some Ubuntu 9.10 users are also posting here.
But ubuntu 9.10 users might still face some problems (I faced one :(..) while installing ns-2.34 (or probably even the older versions...).
The trouble is that ubuntu 9.10 provides gcc-4.4 while otcl likes gcc-4.3.
So,
1. "sudo apt-get install gcc-4.3 gcc-4.3-base"
2. Navigate to otcl folder. Edit Makefile.in file
in line 7
From :
CC= @CC@
to :
CC= gcc-4.3
3. Then move up one folder and then
'CC=gcc-4.3 ./install'
There is no g++ code in ns folder so there wont be any requirement in installing g++ stuff.
4. ./validate
Actually, there are no more changes except the gcc part. Rest of the procedure remains the same.
Hope it helps...
If its not too much trouble can you help me a little further?
ReplyDeleteI've tried some of the tutorial lessons on the ns2 website but I get
the following error.
-----------------------------------------------------------------------------------------------------------------------------------
mehernosh@machine:~$ ns example1a.tcl
mehernosh@machine:~$ nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[string equal [tk windowingsystem] "classic"]
|| [string equal [tk windowingsystem] "aqua"]} {
bind Listbox {
%W yview scroll [expr {..."
----------------------------------------------------------------------------------------------------------------------------------------
I get this error no matter what script I try, the simple hello world described above or more advanced ones available online. Its not that I am making a mistake in the Tcl code because I am tried using scripts available online at http://www.isi.edu/nsnam/ns/tutorial/index.html .
Help!
Thanks a lot for this guide.
ReplyDeleteInstallation was successful. I saw %.
After i used the command:
$ sudo ln -s /home/programmer/ns-allinone-2.33/ns-2.33/ns /usr/bin/ns
It has stopped to operate. How can i cancel this command?
Please, execuse me for my English. It's not my native language.
Thanks, but I still having the error:
ReplyDeletebash: LIB:/usr/local/lib: No such file or directory
and now I saved the exapmle as simple.tcl and now when I run it, this happen:
user@ubuntu8041:~$ ns simple.tcl
(_o5 cmd line 1)
invoked from within
"_o5 cmd at 1 “puts “Hello World!””"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o5" line 2)
(SplitObject unknown line 2)
invoked from within
"_o5 at 1 “puts “Hello World!””"
("eval" body line 1)
invoked from within
"eval $scheduler_ at $args"
(procedure "_o3" line 3)
(Simulator at line 3)
invoked from within
"$ns at 1 “puts \“Hello World!\””"
(file "simple.tcl" line 2)
Now what is happening here? I can't understand this output...
I have updated the post, this might help you now !
ReplyDeletehello,
ReplyDeletei tried your example but the following problem appears:
ns: finish: couldn't execute "nam": no such file or directory
while executing
"exec nam out.nam &"
(procedure "finish" line 15)
invoked from within
"finish"
please help me.
Thanks
Ms Fatima did you get solutions if yes then please guide me for same
Deletenice post, was really helpful
ReplyDeletehttp://www.google.com
Dear all,I am new in working with Linux, and i have to install NS2 for doing a project in Telecommunications.I installed Fedora 7 on my laptop, and then i started with NS 2.31 allinone.The start was ok, and when i type the command ./install something wrong. Here is a part of that:/home/kiki/locale/ns/ns-allinone-/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1164: error: invalid type argument of ‘->’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c: At top level:/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1189: error: static declaration of ‘Intersect’ follows non-static declaration/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:868: error: previous implicit declaration of ‘Intersect’ was here/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c: In function ‘Intersect’:/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1189: error: expected declaration specifiers before ‘XPoint’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1190: error: expected declaration specifiers before ‘XPoint’/home/kiki/locale/ns/ns-allinone-tk8.4.14/unix/../generic/tk3d.c:1206: error: invalid type argument of ‘->’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1211: error: invalid type argument of ‘->’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1231: error: invalid type argument of ‘->’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c: In function ‘Tk_Get3DBorderFromObj’:/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1281: error: ‘Tk_FakeWin’ has no member named ‘atts’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1281: error: ‘TkBorder’ has no member named ‘colormap’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1307: error: ‘Tk_FakeWin’ has no member named ‘display’/home/kiki/locale/ns/ns-allinone-/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1400: error: ‘TkBorder’ has no member named ‘nextPtr’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1403: error: ‘TkBorder’ has no member named ‘resourceRefCount’/home/kiki/locale/ns/ns-allinone-2.31/tk8.4.14/unix/../generic/tk3d.c:1405: error: ‘TkBorder’ has no member named ‘objRefCount’make: *** [tk3d.o] Error 1Can You help me with this? Thank You in advance,Best regards,Kristina Pelivanoska
ReplyDeletehai shubham
ReplyDeletei was installing ns2.34 and i got this error
Build OTcl-1.13
install: 498: ./configure: Permission denied
otcl-1.13 configuration failed! Exiting ...
whats the sudo command to be used
Hi,
DeleteJust use sudo before your command, like sudo
ns: finish: couldn't execute "nam": no such file or directory
ReplyDeletewhile executing
"exec nam out.nam &"
(procedure "finish" line 7)
invoked from within
"finish"
Help me for this step by step please
ubuntu 11.10
Deletehello sir,
ReplyDeleteI have intalled ns2 in ubuntu , nd it works on example properly, but when we make our new routing protocol it compiles properly.
After that, If we run the TCL file it results in error….what should we do….
The error is
num_nodes is set 100
(_o14 cmd line 1)
invoked from within
“_o14 cmd addr”
invoked from within
“catch “$self cmd $args” ret”
invoked from within
“if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error “error when calling class $cls: $args” $…”
(procedure “_o14″ line 2)
(SplitObject unknown line 2)
invoked from within
“_o14 addr”
(“eval” body line 1)
invoked from within
“eval $node addr $args”
(“default” arm line 2)
invoked from within
“switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 “$node start-dsr”
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns node"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(nn) } { incr i } {
set mnode_($i) [$ns node]
}"
(file "wfrp_802_15_4.tcl" line 74)
reply me on piyushraj99@gmail.com
plz help and overcome from me these difficulties.
Thanks in advance
pooja@pooja:~/sim$ sudo apt-get install build-essential autoconf automake libxmu-dev
ReplyDeleteReading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package build-essential
can u help me out
ReplyDeletei m trying to install it from about 6 months but not able to do it .please help me out .this is my first post...........
Respected sir
ReplyDeletei have reached implementation phase of my project ALARM protocol .According to my guide i doing it in NS2. I have written RSA algm code in TCL, only for encryption. I would like to know if implementing it in TCL is appropriate or should i implement in C. Please do help me