LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 04-20-2010, 04:23 AM   #46
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641

@ WSNs, # 42, welcome to LQ. Suggest: delete your 'email address'.
Email addresses displayed on the internet are used by spammers.
The "Send email to WSNs" is already present in the WSNs Menu.
....... Please do not write three posts for one short message.
Better use the 'Edit' button instead.

Please read LQ threads with a 'leach' Tag.
LQ Search → 'Tag Name' = leach
Ubuntu cannot compile old tcl tk otcl tclcl. Replace with versions
from ns-allinone-2.34 and / or make links as described. The script
'install' will use 'old names' only. Hence the 8.4.5=>8.4.14 etc. links.

LQ Rules > > sms, chatspeak, shorthand like plz/PLZ: not allowed.

@ zeost, # 45, welcome to LQ. The term ' ns_2.35". ' is unknown.
Google will tell. Do you mean ns-allinone-2.34? Be precise, please.
EDIT : Found ns-allinone-2.35-RC3.tar.gz, 'release candidate 3'.
And please read the 6 leach threads. → Lots of info.

http://linuxsilo.net/docs/smart-questions_en.html
.....

Last edited by knudfl; 04-23-2010 at 07:51 AM.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-21-2010, 09:51 AM   #47
btnaveen
LQ Newbie
 
Registered: Apr 2010
Posts: 3

Rep: Reputation: 0
How to run LEach protocol in ns2.34..
 
Old 04-22-2010, 12:06 AM   #48
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 47 @ btnaveen : You don't use ns-2.34 for leach.
'ns-allinone-2.27' is to be used for that. And g++ 3.3.x.

Just read all the above posts, to see how.
And welcome to LQ ....... ..
..
 
Old 04-22-2010, 06:44 AM   #49
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 40, @ sahel_s : about the ns-2.27-gcc410.patch ..

I don't think it works. And when you anyway have to use
a "compat" gcc, g++ : There is no big difference installing
( or using ) version 3.3.x instead of version 4.1.x.

.............. 'g++ 3.3.x' works, we know that for sure.
..
 
Old 04-22-2010, 10:22 AM   #50
WSNs
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Rep: Reputation: 0
Talking Ubuntu 9.10 with ns2.27

Hi all,

In my Ubuntu 9.10 I remove gcc-4.0 and g++-4 then I install gcc-3.3 and g++ and every thing is ok. I install ns-2.27 and its work But after I do modifications to work with LEACH and try to make ns-2.27 it gives me this error:
--------------------------------------
--------------------------------------
Code:
for i in indep-utils/cmu-scen-gen/setdest indep-utils/webtrace-conv/dec indep-utils/webtrace-conv/epa indep-utils/webtrace-conv/nlanr indep-utils/webtrace-conv/ucb; do ( cd $i; make all; ) done
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'
--------------------------------------
Can you help me to solve this error?

Thanck you.

Last edited by WSNs; 04-23-2010 at 06:08 PM.
 
Old 04-23-2010, 02:23 AM   #51
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 50, @WSNs: Which errors ? The only error I see, is :
You removed gcc 4.4.1 and g++ 4.4.1 . Suggest : reinstall.
All 3 or 4 (5) 'gcc, g++' can be installed at the same time.

Also suggest : read the LEACH threads ( again )
Correct is : cd ns-allinone-2.27/ns-2.27/ && make clean
.. and better check indep-utils/<all-folders>/*/* to make
sure that all objects are removed ( binaries + files.o ).
(make clean to be repeated in the folders with a Makefile.)

Next : make -f LEACH-Makefile-modified
Either modified by yourself, or use this.
..

Last edited by knudfl; 04-23-2010 at 02:26 AM.
 
Old 04-23-2010, 02:37 AM   #52
btnaveen
LQ Newbie
 
Registered: Apr 2010
Posts: 3

Rep: Reputation: 0
Thanks
 
Old 04-23-2010, 04:21 AM   #53
nour-eddine
LQ Newbie
 
Registered: Apr 2010
Posts: 13

Rep: Reputation: 1
how to install ns2.27 in ubuntu9.10

hello every bady.
I need to "Patch for compiling NS-2.27 with GCC 4.1.x: ns-2.27-gcc410.patch" to install ns2.27
please where i can fond it?
 
Old 04-23-2010, 07:20 AM   #54
WSNs
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Rep: Reputation: 0
Thank you all
Thank you knudfl

I do what you said and after I make:
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
Code:
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
g++-3.3 -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -DCPP_NAMESPACE=std -I../../.. -o rng.o ../../../tools/rng.cc
g++-3.3 -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -DCPP_NAMESPACE=std  -o setdest.o setdest.cc
setdest.cc:71:1: warning: "INFINITY" redefined
In file included from /usr/include/math.h:40,
                 from setdest.cc:43:
/usr/include/bits/inf.h:27:1: warning: this is the location of the previous definition
g++-3.3 -o setdest setdest.o rng.o -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -DCPP_NAMESPACE=std   \
	-lnsl -ldl -lm 
g++-3.3 -c -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -DCPP_NAMESPACE=std  -o calcdest.o calcdest.cc
g++-3.3 -o calcdest calcdest.o rng.o -Dstand_alone -DSTL_NAMESPACE=@STL_NAMESPACE@ -DCPP_NAMESPACE=std   \
	-lnsl -ldl -lm 
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/cmu-scen-gen/setdest'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o proxytrace.o proxytrace.cc
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o formsquid.o formsquid.cc
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o formtxt.o formtxt.cc
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o my-endian.o my-endian.cc
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o proxytrace2any.o proxytrace2any.cc
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc
g++-3.3  -DCPP_NAMESPACE=std -o dec-tr-stat proxytrace.o formsquid.o formtxt.o my-endian.o proxytrace2any.o tr-stat.o -L/home/naif/ns-allinone-2.27/lib -ltcl8.4  -lnsl -ldl 
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/dec'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
g++-3.3 -c  -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc
g++-3.3 -o epa-tr-stat   -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap tr-stat.o -L/home/naif/ns-allinone-2.27/lib -ltcl8.4  -lnsl -ldl 
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/epa'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I../../.. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc
g++-3.3 -c -DCPP_NAMESPACE=std -I. -I../../.. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o logparse.o logparse.cc
g++-3.3  -DCPP_NAMESPACE=std -o nlanr-tr-stat tr-stat.o logparse.o -L/home/naif/ns-allinone-2.27/lib -ltcl8.4  -lnsl -ldl 
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/nlanr'
make[1]: Entering directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'
g++-3.3 -c  -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o tr-stat.o tr-stat.cc
g++-3.3 -c  -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o logparse.o logparse.cc
g++-3.3 -c  -I. -I/home/naif/ns-allinone-2.27/tclcl-1.15 -I/home/naif/ns-allinone-2.27/otcl-1.8 -I/home/naif/ns-allinone-2.27/include -I/home/naif/ns-allinone-2.27/include -I/usr/include/pcap -o utils.o utils.cc
g++-3.3   -o ucb-tr-stat tr-stat.o logparse.o utils.o -L/home/naif/ns-allinone-2.27/lib -ltcl8.4  -lnsl -ldl 
make[1]: Leaving directory `/home/naif/ns-allinone-2.27/ns-2.27/indep-utils/webtrace-conv/ucb'
----------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------
But after I enter ./test (LEACH):
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Code:
naif@ubuntu:~/ns-allinone-2.27/ns-2.27$ ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
./test: line 5: ./leach_test: No such file or directory
naif@ubuntu:~/ns-allinone-2.27/ns-2.27$
----------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------
Actually, the files test and leach_test in the directory ns-allinone-2.27/ns-2.27

So, What should I do to solve this problem?

Last edited by WSNs; 04-23-2010 at 09:28 AM.
 
Old 04-23-2010, 07:35 AM   #55
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 54, WSNs :

Using "test" , see post # 6. ( The test script must be edited.)
When are you going to read all posts ? Please do not ask questions
already answered in this thread.
....

Last edited by knudfl; 04-23-2010 at 12:12 PM.
 
Old 04-23-2010, 07:47 AM   #56
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post # 53 @ nour-eddine : Welcome to LQ. .. .. .. ..

Well, for a start, please read posts # 41 and 49,
which answers your question.

And next : read all six LEACH threads.
LQ Search → 'Tag Name' = leach
...... Good luck !

Last edited by knudfl; 04-23-2010 at 07:59 AM.
 
1 members found this post helpful.
Old 04-23-2010, 09:39 AM   #57
WSNs
LQ Newbie
 
Registered: Mar 2010
Posts: 10

Rep: Reputation: 0
Thank you very much knudfl
I am so sorry about my code.

Code:
naif@ubuntu:~/ns-allinone-2.27/ns-2.27$ ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
My question is nam does not work:
Code:
naif@ubuntu:~$ nam
nam: 
[code omitted because of length]
: no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
naif@ubuntu:~$
Can you help?
and about leach after I run it how can I deal with it and can I run leach in nam?
Thanks again.
 
Old 04-23-2010, 12:10 PM   #58
btnaveen
LQ Newbie
 
Registered: Apr 2010
Posts: 3

Rep: Reputation: 0
Smile Cluster head in ns-2 sensor network

thanks knudfl
I have installed ns-2.34 without any error and performing simple programs given in "ex" folder.
please any body tell me how to define a cluster head in a network ?
If u have any simple code for that send me .
my id is nvnmtech@gmail.com
thanks in advance..
 
Old 04-23-2010, 12:27 PM   #59
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
WSNs , post 57 : Thank you for editing post # 54. Nice.

The 'nam' issue : cd ns-allinone-2.34/tk8.4.14/
'tk' is to be compiled with the 'tk-8.4-lastevent.patch'
Run ./install in ns-allinone-2.34/, (to make sure, you
don't disturb your new fine ns-2.27.)
cd ns-allinone-2.34/nam-1.13/ && sudo make install.
Then you get /usr/local/bin/nam ,
can be used with all versions of ns2

Read about it all in the 'ns2' threads. Has been answered before.

Last edited by knudfl; 04-23-2010 at 07:01 PM.
 
Old 04-23-2010, 12:40 PM   #60
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,516

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
btnaveen, post # 58 :

May be a solution here http://ns2.blogspot.com/

..

Last edited by knudfl; 06-04-2010 at 11:58 AM.
 
  


Closed Thread

Tags
leach, leach-ns227, ns2, ns227



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in simulating Black Hole Attack in AODV Protocol through NS2 in FC8 shyan Linux - Newbie 3 02-17-2015 03:21 PM
NS2 installation ds_priyaa Fedora 2 05-28-2008 02:23 AM
NS2 installation eby83 Linux - Newbie 2 06-11-2007 01:08 AM
ns2 installation pranoti Linux - Software 2 06-11-2007 12:45 AM
LXer: Interview with Bernard Leach (iPodLinux) LXer Syndicated Linux News 0 10-31-2006 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration