how to integrate the "Resource/Energy" leach class into NS-2.34?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
@mhmdmahdi, hey i tried as u said..but it gives error as ns-pegasis:command not found.I hav checked for ns-pegasis execution file in ns2.34 folder but it is absent.i think the error is due to it only.i have installed exidus-pegasis-leach-ns234-patch.2 not the your package i.e. pegasis-ns-2.34-ubuntu10_i386.deb. Is it for leach protocol? and is it give correct output of leach protocol..if yes..please provide that package here and also tell me steps to install it..please i have spent lots of days to get correct output but still facing problems..please help..
please install the package "pegasis-ns-2.34-ubuntu10_i386.deb" first before you made a change on leach_test file.
the package created by Sir Knudfl, and can be found on post #584 here: http://www.linuxquestions.org/questi...68/page39.html
@mhmdmahdi and @knudfl
hello i just installed pegasis-ns-2.34-ubuntu10_i386.deb package in my ubuntu 12.04 OS and warnings are gone now. but in leach.output the simulation stops at 50 only though 95 nodes are still alive.what is the reason behind it? here is some snapshot of output file please check it and tell me.help please..
Hmmm ... Am not very sure if what he said is right. If you are using LEACH, even in a big network, nodes will belong to clusters whose CH is within the line of sight distance (~ 87 units).
Maybe he has some other algorithm or ideas in mind.
Quote:
Originally Posted by mhmdmahdi
yes, i agree with you. but i don't know, my prof. asked me to analyse that.
he said multi-hop will be useful in a big size network.. still need to prove his opinion right or wrong.
thanks for your answer anyway
@deepa
hey deepa..can u check my output file in post #679..n tell me is it correct output? why m asking is coz though still 95 nodes are alive..simulation stops..wht is the problem here?
this is my code to select a vice cluster head among cluster nodes, according to their energy, the cluster head chooses among its member , the node with the highest energy . this is the code
# Set the TDMA schedule and send it to all nodes in the cluster.
set TDMA $clusterNodes_
set Ei 0
set nodeID [$self nodeID]
set element $nodeID
foreach element $TDMA {
set E [[$self getER] query]
puts " energy est $E "
if { $Ei < $E } {
set Ei $E
}
}
set SCH $element
puts " le vice cluster de CH $chID est $SCH "
-->the result (energy nodes of each cluster are equal)
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
energy est 1.4088472606115843
the vice cluster head of CH 7 is 23
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
energy est 1.3976149376339855
the vice cluster head of CH 10 is 42
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
energy est 1.4792380219880841
the vice cluster head of CH 25 is 53
energy est 1.3267670010478381
energy est 1.3267670010478381
energy est 1.3267670010478381
energy est 1.3267670010478381
the vice cluster head of CH 56 is 27
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
energy est 1.5025911961133158
the vice cluster head of CH 59 is 88
please, I want to extract residual energy, node alive and dead node, so how can I add the script in wireless.tcl. Please help me
Hi;
I install leach in ns2.34, and when I simulate ./leach_test I got this error in leach.err:
no such variable
(read trace on "env(RCA_LIBRARY)")
invoked from within
"source $env(RCA_LIBRARY)/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 9)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "/home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/$opt(rp).tcl"
(file "/home/cheima/ns-allinone-2.34/ns-2.34/ns-234-leach/tcl/ex/wireless.tcl" line 187)
I change the uamps.tcl but I got the same problem, I don't know why. Please help me I'm stuck.
Please upload your leach.out ?
This looks like a mofified version of leach.out.
Quote:
Originally Posted by keepwalking123
@deepa
hey deepa..can u check my output file in post #679..n tell me is it correct output? why m asking is coz though still 95 nodes are alive..simulation stops..wht is the problem here?
@michou_87,
This has already been asked far too many times in this forum, and replied to as well. Please refer earlier posts in this thread.
Quote:
Originally Posted by michou_87
Hi;
I install leach in ns2.34, and when I simulate ./leach_test I got this error in leach.err:
no such variable
(read trace on "env(RCA_LIBRARY)")
invoked from within
"source $env(RCA_LIBRARY)/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 9)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "/home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/$opt(rp).tcl"
(file "/home/cheima/ns-allinone-2.34/ns-2.34/ns-234-leach/tcl/ex/wireless.tcl" line 187)
I change the uamps.tcl but I got the same problem, I don't know why. Please help me I'm stuck.
[COLOR="Silver"]
Last edited by deepa_2111; 01-24-2014 at 01:13 PM.
@ Deepa
hi, what is the distance parameter i.e in between CH and node in leach.out file? is it actual distance or communication distance?
why i m asking because m not clear in difference between them.actually i know that energy consumption is directly proportional to distance.but is it physical or communication distance then?
@nmmn134
Hi, I also install exidus-pegasis_ns-234-leach.tar of exidus but I got this problem in leach.err:
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/home/cheima/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/cheima/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/cheima/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 30)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "/home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /home/cheima/ns-allinone-2.34/ns-2.34/tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
@deepa
hi deepa, actually i want to modify leach protocol now.so can u please tell me which files i need to modify along with ns-leach.tcl? please..and how can i understand exact flow of program so that i can modify code..help please..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.