LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-26-2014, 06:12 PM   #1
Hassanel2
LQ Newbie
 
Registered: Mar 2014
Posts: 3

Rep: Reputation: Disabled
Smile LEACH in NS2.35


Hi,
How downlaod and install LEACH and PEGASIS into NS2.35
Plz help me
 
Old 03-27-2014, 04:49 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

Please use the well tested code for ns-2.34 :
exidus-pegasis-leach-ns234-patch.2.tar.gz
https://drive.google.com/file/d/0B7S...it?usp=sharing

* You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. But do not add any *PATH text to .bashrc :
Never required.
And : ns-allinone-2.34 is easy to build in any 32bits (i686) Ubuntu XX.xx,
.. by using the gcc41-compat / g++41-compat compilers.

Leach/pegasis http://www.linuxquestions.org/questions/tags/pegasis/

-
 
1 members found this post helpful.
Old 03-27-2014, 05:48 AM   #3
Hassanel2
LQ Newbie
 
Registered: Mar 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
how install ns-235-leach in ns2.35

please give me link for downlaod ns-235-leach.tar.gz
 
Old 03-27-2014, 06:19 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Sorry, "ns-235-leach.tar.gz" is non existing.

There is work done in ns-2.35 / Cygwin , by @deepa_2111, (leach only, no pegasis)
but unfortunately the code doesn't work with any contemporary "genuine Linux OS":
So far I did make a test build with a few OS's.

Ref. http://www.linuxquestions.org/questions/tags/leach/
→ → http://www.linuxquestions.org/questi...2-34-a-870368/
→ #774 http://www.linuxquestions.org/questi...68/page52.html
→ The code → https://drive.google.com/file/d/0B8U...it?usp=sharing

? ? Any particular reason for using ns-2.35 ?

-
 
Old 03-27-2014, 06:32 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The deepa_2111 ns-2.35 / leach, with the permissions changed,
to avoid gtting "30" times "Permission denied" → leach-ns235-deepa.edited.tar.bz2
→ → https://drive.google.com/file/d/0B7S...it?usp=sharing
 
Old 03-28-2014, 09:18 AM   #6
Hassanel2
LQ Newbie
 
Registered: Mar 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
I installed ns2.34 in ubuntu 13.04, but I got an error as follows

In file included from linkstate/ls.cc:67:0:
linkstate/ls.h: In instantiation of ‘void LsMap<Key, T>::eraseAll() [with Key = int; T = LsIdSeq]’:
linkstate/ls.cc:396:28: required from here
linkstate/ls.h:137:20: error: ‘erase’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
linkstate/ls.h:137:20: note: declarations in dependent base ‘std::map<int, LsIdSeq, std::less<int>, std::allocator<std:air<const int, LsIdSeq> > >’ are not found by unqualified lookup
linkstate/ls.h:137:20: note: use ‘this->erase’ instead
make: *** [linkstate/ls.o] Error 1
Ns make failed!
See http://www.isi.edu/nsnam/ns/ns-problems.html for problems

plais help me
 
Old 03-28-2014, 10:04 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 6 .

Well, then delete ns-allinone-2.34/ , and do things in a right way :
First : Install the ns-allinone-2.34 prerequisites → →
The compilers gcc41-compat / g++41-compat for the 32bits (i686) Ubuntu 13.10 :
gcc41.. https://drive.google.com/file/d/0B7S...it?usp=sharing
g++41.. https://drive.google.com/file/d/0B7S...it?usp=sharing
$ sudo dpkg -i gcc41-compat-4.1.2-ubuntu1210_i386.deb g++41-compat-4.1.2_i386.deb
... Then reboot, and the new compilers are ready for use.

Building ns-2.34 with LEACH :
1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/ && tar xvf leach+pegasis-ns234-files-2.tar.gz
https://drive.google.com/file/d/0B7S...it?usp=sharing
3) export CC=gcc41 CXX=g++41 && ./install
4) cd ns-2.34/
5) sudo make install
... That's it :
Don't do anything else, like adding some *PATH text to .bashrc : Never required.

-
 
Old 06-19-2014, 02:22 AM   #8
fusionzhang
LQ Newbie
 
Registered: Jun 2014
Posts: 9

Rep: Reputation: Disabled
hello @knudfl,
Could you tell me what are the ns-allinone-2.34 prerequisites?

I did some job like some orders below,is it enough?
sudo apt-get install build-essential
sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
sudo apt-get install libxmu-dev libxmu-headers
sudo apt-get install xorg-dev g++ xgraph

After I type '3) export CC=gcc41 CXX=g++41 && ./install',there are some mistakes,could you tell me why?

Last edited by fusionzhang; 06-19-2014 at 02:54 AM.
 
Old 06-19-2014, 02:54 AM   #9
fusionzhang
LQ Newbie
 
Registered: Jun 2014
Posts: 9

Rep: Reputation: Disabled
hello @knudfl,
Could you tell me what are the ns-allinone-2.34 prerequisites? I'm using ubuntu13.04 and ns2.34.

I did some job like some orders below,is it enough?
sudo apt-get install build-essential
sudo apt-get install tcl8.4 tcl8.4-dev tk8.4 tk8.4-dev
sudo apt-get install libxmu-dev libxmu-headers
sudo apt-get install xorg-dev g++ xgraph

After I type '3) export CC=gcc41 CXX=g++41 && ./install',there are some mistakes,could you tell me why? But I have installed gcc4.1 and g++ as you told.

Building static library libz.a version 1.2.3 with gcc41.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
gcc41 -O -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o example.o example.c
make: gcc41:命令未找到
make: *** [example.o] 错误 127
Zlib make failed, but it's optional Continue ...

Quote:
Originally Posted by knudfl View Post
# 6 .

Well, then delete ns-allinone-2.34/ , and do things in a right way :
First : Install the ns-allinone-2.34 prerequisites → →
The compilers gcc41-compat / g++41-compat for the 32bits (i686) Ubuntu 13.10 :
gcc41.. https://drive.google.com/file/d/0B7S...it?usp=sharing
g++41.. https://drive.google.com/file/d/0B7S...it?usp=sharing
$ sudo dpkg -i gcc41-compat-4.1.2-ubuntu1210_i386.deb g++41-compat-4.1.2_i386.deb
... Then reboot, and the new compilers are ready for use.

Building ns-2.34 with LEACH :
1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/ && tar xvf leach+pegasis-ns234-files-2.tar.gz
https://drive.google.com/file/d/0B7S...it?usp=sharing
3) export CC=gcc41 CXX=g++41 && ./install
4) cd ns-2.34/
5) sudo make install
... That's it :
Don't do anything else, like adding some *PATH text to .bashrc : Never required.

-

Last edited by fusionzhang; 06-19-2014 at 08:37 PM.
 
  


Reply

Tags
leach, ns2, pegasis, pegasis#7



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 with running leach protocol in ns2.34 leach.er Mohamed69 Linux - Software 14 04-16-2018 07:10 AM
leach.out total energy increase leach ns2.34 linuxUser123linux Linux - Software 1 07-13-2013 04:54 AM
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:49 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