How many successful implementations of LEACH on NS2
Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello everybody
As we know the cluster-head in leach agregates data to send it to the base .
And it also implements redundancy .
Where can i see that in the code ? In which .tcl ?
Thank you
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
idk, but agregates data for leach at ns-leach.tcl
Code:
Application/LEACH instproc recvDATA {msg} {
global ns_ opt
$self instvar TDMAschedule_ receivedFrom_ dataReceived_
set chID [$self nodeID]
set nodeID [lindex $msg 0]
pp "CH $chID received data ($msg) from $nodeID at [$ns_ now] - ns-leach.tcl"
set receivedFrom_ [lappend receivedFrom_ $nodeID]
set last_node [expr [llength $TDMAschedule_] - 1]
if {$chID == [lindex $TDMAschedule_ $last_node]} {
set last_node [expr $last_node - 1]
}
if {$nodeID == [lindex $TDMAschedule_ $last_node]} {
# After an entire frame of data has been received, the cluster-head
# must perform data aggregation functions and transmit the aggregate
# signal to the base station.
pp "CH $chID must now perform comp and xmit to BS. - ns-leach.tcl"
set num_sigs [llength $TDMAschedule_]
set compute_energy [bf $opt(sig_size) $num_sigs]
pp "\tcompute_energy = $compute_energy - ns-leach.tcl"
[$self getER] remove $compute_energy
set receivedFrom_ [lappend receivedFrom_ $chID]
set dataReceived_ $receivedFrom_
set receivedFrom_ ""
$self SendDataToBS
}
}
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
@knudfl
sir i have problem, when i set 13 cluster my leach-c finish to early at 20s.
Code:
t 20: - mit/uAMPS/stats.tcl
Total Energy = 27.862826740743788
Total Data = 1935
Total Alive = 96
BS Received data 40 , 10.362460469054881 from 40 at time 20.027104310090241 - mit/uAMPS/ns-bsapp.tcl
This represents data from nodes: 25 61 64 72 76 97 40 - mit/uAMPS/ns-bsapp.tcl
Only received info from 0 nodes. - mit/uAMPS/ns-bsapp.tcl
There are currently 96 alive ==> 14 cluster-heads needed. - mit/uAMPS/ns-bsapp.tcl
At 20.029599999999999: - mit/uAMPS/stats.tcl
Total Energy = 27.867691302444101
Total Data = 1942
Total Alive = 96
Simulation complete. - mit/uAMPS/stats.tcl
node alive
at alive.txt
at time 20.029599999999999 total node alive 96
Hello am back after a few edits on the mit.tar leach i got some inconsistent results in the leach.out file , there are multiple instances of this error line 311, 418-
Code:
311 Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
although the simulation is runnung to the end and giving results i noticed @Knudfl your recent run does not have these warnings infact the 2 files are different
I have attached my file and the comparison one, Do the warning have any effect and how do I remove them??? Kindly assist
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Re #84.
""edits on the mit.tar"" :
Which edits ? Which `mit.tar' ? ? mit.tar = unknown file.
(There are no edits to do with `leach+pegasis-ns234-files-2.tar.gz'.)
""311 Warning dst_ is no longer being supported""
A warning can be ignored. Is just an informational text.
But : The errors at the file end (leachout.txt.out?) are crucial :
Code:
At 502.30000000004571: - mit/uAMPS/stats.tcl
Total Energy = 328.286714546854
Total Data = 51150
Total Alive = 4
ns: _o1442 checkAlive: can't read "sens_energy": no such variable
while executing
"close $sens_energy"
(procedure "sens_close_stats" line 8)
invoked from within
"sens_close_stats"
(procedure "sens_finish" line 4)
invoked from within
"sens_finish"
(procedure "_o1442" line 41)
(Application/LEACH checkAlive line 41)
invoked from within
"_o1442 checkAlive"
After fiddling around i got this one to work... I did side by side comparison with @exidus files, i then appended the extra code for producing results leach.alive.txt, leach.data.txt and leach.energy.txt,
I think that is responsible for the last lines in the leach.out
My setup is
Ubuntu 10.04 32bit /// also working on Centos 6.6
gcc 3.3.6 "manual install from author site"
ns2.27
@knudfl could you please share with me your latest run results of the @exidus these file conditions.txt leach.out, leach.alive.txt, leach.data.txt and leach.energy.txt (maybe just the entire folder) and the leach-c results, I juss want to reconcile my results and compare graphs
Last edited by wellytg; 05-08-2015 at 09:22 AM.
Reason: wrong wording
No script ns-2.34/test ?
When you do 1) $ cd ns-allinone-2.34/
2) $ tar xvf leach+pegasis-ns234-files-2.tar.gz
... then you will get ns-2.34/{ test, leach_test, mit/ }.
-
<-- 18#
sir, knudfl
what the differennt "leach_test" and "test"?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.