LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 01-18-2015, 05:27 AM   #1
wellytg
LQ Newbie
 
Registered: Nov 2014
Location: India
Distribution: Ubuntu 14.04
Posts: 6

Rep: Reputation: Disabled
How many successful implementations of LEACH on NS2


Hello All

In my research LEACH Protocol mostly from this forum I have discovered the following implemented LEACH protocol

1. Classic (Original LEACH) - Wendi B. Heinzelman this uses MIT_uAmps_ns.tar & MIT_uAMPs_changes_ns.tar which is ns2.1b5
found at http://www-mtl.mit.edu/researchgroup...ach_code.shtml


2. the mit.tar.gz on ns2.27 and gcc3.3.6 links to actual mit.tar.gz have expired in this post http://www.linuxquestions.org/questi...9/#post3844042
this post gives solution http://www.linuxquestions.org/questi...5/#post4259311
gcc3.3.6 can be found at http://www.linuxfromscratch.org/blfs...eral/gcc3.html


3. Another classic is ns-234-leach.tar.gz for ns2.34 this require a lot of changes to ns code and gcc4.1
found at http://www.linuxquestions.org/questi...8/#post4310131
gcc4.1 can be found at this post http://www.linuxquestions.org/questi...ml#post4568891


4. Using mannasim version which requires GUI manipulation of the tcl script using NSG or SGT. the simplest install is paulstr
found at http://www.linuxquestions.org/questi...ml#post4970214


5. the most latest update leach+pegasis-ns234-files-2.tar.gz which runs on ns2.34 and gcc4.4
found athttp://www.linuxquestions.org/questi...7/#post5264872

NB: from what I gather the build of LEACH will rely heavily on the OS used i.e. it should be 32Bit Linux OS (i686)

I have only successfully implemented number 5 leach+pegasis-ns234-files-2.tar.gz on Ubuntu 10.04 gcc4.3

My question here is are there any other verified successful implementations of LEACH in NS2
2. what are the perfect builds (Linux OS) for them
3. do they have documentation of how they are built and implemented with expected results, including those in the list I have given
4. I would like to make a comparative analysis of the results so any help on that too is welcome


...regards!
 
Old 01-18-2015, 06:54 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
Add 2) ns-2.27 compiles OK with g++ version 4.1.2 :
By using the patch "ns-2.27-gcc410.patch".
* Your reference : Posts from year 2011 : Outdated.

Add 3) The @MayTamer files : Latest is `leach-ns234-patching.tar.gz´.
.. And the linked gcc41/g++41 is for Ubuntu 10.10, 11.04 only :
* You are looking at some old outdated posts !

Add 4) The @paultsr ns235 : Don't know how the leach part works.

Add 5) The @exidus files :
The only `MIT Leach´ usable as is, on a contemporary OS.
Can do the simulation ,,, with no modifications.


Ubuntu 10.04 + g++-4.1 is OK.
Can also be used : CentOS 6.6 - 32bits.

-
 
Old 01-19-2015, 03:04 AM   #3
wellytg
LQ Newbie
 
Registered: Nov 2014
Location: India
Distribution: Ubuntu 14.04
Posts: 6

Original Poster
Rep: Reputation: Disabled
@kundfl thank you, may you please give the updated links for the leach builds so that I may try a clean install of all

also is there any documentation or sample data on the builds so that I may get a rough idea if my builds fall within standard results

and lastly on the @exidus files build I notice there is leach-c option which runs but performs far much worse than leach i.e. "leach-c dies out at 380 while leach dies out at 520" this opposes the theory... any ideas on that?
 
Old 01-19-2015, 06:10 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
← #3 .

Please read the latest 'leach' posts at LQ Forum´s :
( Say .. May 2014 -- Jan 2015 )
. http://www.linuxquestions.org/questions/tags/leach/
. http://www.linuxquestions.org/questions/tags/pegasis/

Google 'ns-users' Forum, leach threads :
. https://groups.google.com/forum/?fro...w/d-Op29Qg1P0J
. https://groups.google.com/forum/?fro...I/HWQXgdOckdoJ

Output examples, etc. ( All from the ``MIT leach + pegasis´´ ) :
leach-test__Ubuntu1204.tar.gz →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
leach.alive.txt__el6.txt ( CentOS 6 ) →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
leach.alive.txt__pclos2012.txt →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
leach.alive.txt_ubuntu1010.txt →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
leach.alive.txt-other.txt →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
leach.out-el6.txt ( CentOS 6 ) →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
leach.out.gz →
. https://drive.google.com/file/d/0B7S...ew?usp=sharing


-
 
Old 01-19-2015, 06:15 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
← #1, #2 .

Add 4) : LEACH_mannasim.tcl →

https://drive.google.com/file/d/0B7S...ew?usp=sharing
 
Old 02-11-2015, 04:44 AM   #6
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
need help

Quote:
Originally Posted by knudfl View Post
← #1, #2 .

Add 4) : LEACH_mannasim.tcl →

sir i have read thread for leach, and that make me confuse. sometime one of them said use gcc xx and other people said use gcc xx.
im newbie in NS2, but i have project for my study about T-leach and i dont know what i must to do first and what the next step.
my question
1. what good linux and ns version for my project.
2. i want to edit leach, but idk what file i must edit.
a> i want create some node without mobility
b> energy initial
c> change the rules of the rotation change of Cluster Heads
d> what the component file for leach, so i cant save that file if im reinstall NS, or for ducumentation

i have learn tcl, and now im still learn about c++. please help me sir knudfl, maybe u can help me create my project leach step by step about which one i must read first or what i must to do.
 
Old 02-11-2015, 06:37 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
← ref. #6, @emprit.

GCC :
Lots of `Linux OS´ → different names / availability for gcc versions.
And : Instructions from yesterday may not be valid today !
OS´s are updated : Then "yesterday´s" don't work any more.

Ns2 versions :
You can have as many versions of ns-allinone as you want,
installed at the same time. Leach : ns-2.34 .

Add 1) Leach : The only usable OS is `CentOS 6.6 - i686´ :
http://ftp.funet.fi/pub/mirrors/cent...6.6/isos/i386/
http://ftp.funet.fi/pub/mirrors/cent...6-bin-DVD1.iso
→ → CentOS-6.6-i386-bin-DVD1.iso

Add 2) The file leach_test can be edited.

2a : http://www.isi.edu/nsnam/ns/doc/node172.html
* Be aware that leach does not support NAM.
No visual movement.

2d : The only leach patch which can be used "as is" :
leach+pegasis_ns234.patch.gz, by LQ member @exidus →
https://drive.google.com/file/d/0B7S...ew?usp=sharing

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

Build example, CentOS 6 - i686 :
1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/ && tar xvf leach+pegasis-ns234-files-2.tar.gz
3) ./install
4) cd ns-2.34/
5) # make install

-
 
1 members found this post helpful.
Old 02-11-2015, 09:51 AM   #8
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post


2a : http://www.isi.edu/nsnam/ns/doc/node172.html
* Be aware that leach does not support NAM.
No visual movement.

-
so if i need node no movement, i must use random-motion 0 right?
so i can use nam?
 
Old 02-11-2015, 10:45 AM   #9
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
i think this make interesting which pegasis, leach and tleach.
1: pegasis sistem transmit data to neighboard node.
2: leach sistem is every node sent data to ClusterHead directly then CH sent data to BS, and have rotation to change clusterhead node on cluster periodically.
3: T-leach sistem is make threshold to residual energy on clusterhead for change with new clusterhead.
my question is leach+pegasis_ns234.patch.gz this use combine sistem on point 1 and 2?


sorry if my english so bad
 
Old 02-14-2015, 06:20 AM   #10
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post



2d : The only leach patch which can be used "as is" :
leach+pegasis_ns234.patch.gz, by LQ member @exidus →
https://drive.google.com/file/d/0B7S...ew?usp=sharing

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

Build example, CentOS 6 - i686 :
1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/ && tar xvf leach+pegasis-ns234-files-2.tar.gz
3) ./install
4) cd ns-2.34/
5) # make install

-
sir knudfl in 2d is "leach+pegasis_ns234.patch.gz" and in build example use "leach+pegasis-ns234-files-2.tar.gz" then what i must use?
"leach+pegasis_ns234.patch.gz" or "leach+pegasis-ns234-files-2.tar.gz" ? if im use "leach+pegasis_ns234.patch.gz" how command to use it?
 
Old 02-14-2015, 06:40 AM   #11
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
← ref. #10.

Why even think of using the old version ? Looking for trouble ?

Please use `leach+pegasis-ns234-files-2.tar.gz´
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-
 
1 members found this post helpful.
Old 02-14-2015, 08:56 AM   #12
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
← ref.

Why even think of using the old version ? Looking for trouble ?

Please use `leach+pegasis-ns234-files-2.tar.gz´
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-
thanks sir, and i have my answer on ur reply in other thread, about algoritm.....tq so much.

time to read again
 
Old 02-17-2015, 08:42 PM   #13
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post

-
sir i have install, but i getting error
When configured, ns found the right version of tclsh in /home/student/Desktop/ns-allinone-2.34/bin/tclsh8.4
but it doesn't seem to be there anymore, so ns will fall back on running the first tclsh in your path. The wrong version of tclsh may break the test suites. Reconfigure and rebuild ns if this is a problem.
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::alive_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

mac/chanel.cc: INITIALIZE THE LIST xListHead
warning: no class variable Phy/WirelessPhy::alive_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

warning: no class variable Phy/WirelessPhy::alive_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

Loading connection pattern...
Loading scenario file...
Starting Simulation...
mac/channel.cc: sendUp - Calc highestAntennaZ_ and distCST_
mac/channel.cc: highestAntennaZ_ = 1.5, distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...

what wrong with my instalation?

im use centos 6.6 32bit

i have try chmod 777 on my ns forlder
i have check .test use leach_test

Last edited by emprit; 02-17-2015 at 08:51 PM.
 
Old 02-17-2015, 08:54 PM   #14
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
oh yea, i cant make install on my ns

[root@localhost ns-2.34]# make install
make: *** No rule to make target `install'. Stop.

mybe i got wrong step on my installation
im use step instalation on this web http://bhavanme2011.blogspot.com/

and i use step on ur thread in google forum

Last edited by emprit; 02-17-2015 at 10:05 PM.
 
Old 02-18-2015, 04:44 AM   #15
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
← ref. #14.
Quote:
[root@localhost ns-2.34]#
No root please, any ns2 command. (Except 'make install'.)
All commands are to be done as unprivileged user.


Quote:
I'm use step instalation on this web
Old instructions : Don't use.
Be aware that the most "ns2 tutorials" are written by young students.
Who are using a "Linux OS" and ns2 for the first time.
And that the text is a copy of a text written by another young student.

For CentOS 6 : Read post #6.


About your post #13 :
Quote:
When configured, ns found the right version of tclsh
in /home/student/Desktop/ns-allinone-2.34/bin/tclsh8.4
The executable 'ns' is hard coded to know the location of it´s libraries:
ns-allinone-2.34/{ bin/*, lib/* }, which also means :
Once built as e.g. /home/emprit/ns2/a/ns-allinone-2.34/,
you cannot move ns-allinone-2.34/{ bin/*, lib/* } to another location.

About the executable 'ns' :
# 'make install' will copy 'ns' to the default location for all 'ns-<name>':
/usr/local/bin/.


-
 
1 members found this post helpful.
  


Reply

Tags
leach, leach-ex#4, ns2



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 - Networking > Linux - Wireless Networking

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