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.
@ Aska123 (#648),
I wrote awk scripts to extract the data required. Then, I imported the generated data to excel and did my calculations.
So, what you need to extract is the time at which the CH sends the data, and time at which the BS receives it. The values are present in the leach.out file.
If by "original Leach", you mean the version by Heizelman et al (on ns2.1b), the code is definitely not going to work.
It was for an ns2 version which is now obsolete. Obsolete because that ns2 version can no longer be run on today's OS.
Their work was done in 1999, so you'll have to use the OS that was in use then to install ns2.1b.
Quote:
Originally Posted by eng_mohamed_sc
I try to run original Leach "neither tarik's nor exidus's"
hello deepa, glad to see u back here..thanx for your reply..please tell me what is the problem in my post #658.Not a single cluster is forming, all nodes are dead n hence total sent data is also showing 0.and also tell how total energy is only 3.29? please help.
@ Aska123 (#648),
I wrote awk scripts to extract the data required. Then, I imported the generated data to excel and did my calculations.
So, what you need to extract is the time at which the CH sends the data, and time at which the BS receives it. The values are present in the leach.out file.
Thanks a lot deepa ji.
Happy to see you here.
I do not know how to write awk.
First i have to learn awk.
can you provide some awk script so that i can learn how to write them specific to leach protocol.
Thanks
Last edited by Aska123; 01-18-2014 at 12:22 AM.
Reason: points
@ASKA123 hey thanx for reply.actually i searched and while searching i came to latest patch file of exidus i.e. exidus-pegasis-leach-ns234-patch.2.tar.so i install that one successfully but in leach.err it shows following error.
couldn't read file "../../rca/ns-ranode.tcl": no such file or directory
while executing
"source.orig ../../rca/ns-ranode.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 ../../rca/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 18)
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 "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig 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 tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
please help.
i have changed path in uAMPS.tcl also.
try to find location of file which is missing and copy file from there and paste in dirctory in which it is showing missing.
hello ASKA123 and deepa,i have solved that problem and successfully installed leach. but now the leach.out is showing result different and i think its somewhat wrong.please check these files and tell me..plzzz..awaiting for your reply..thank you..
Just this is not enough.
You need to make changes to the recv functions (tcl functions) so that a CH can hear ADV from other CHs.
for my thesis, I chose to implement an improved version of EECH to implement a multi hop network, and hence modified the code accordingly.
It is not very difficult to do so.
Like TB0ne says, we cannot write the entire code, and the exercise is pointless if you cannot implement your ideas.
So, to answer ur question, at cluster formation phase, each CH also needs to receive ADV from other CHS, and you need to determine an algorithm to choose which your next hop CH is to be.
hi deepa_2111, i want to implement multi-hop routing on communication between CH node and non-CH nodes, multi-hop only used when non-CH nodes send their data to CH. CH send data to BS using single-hop.
can you give me hint how to make it works?
Quote:
Originally Posted by keepwalking123
hello ASKA123 and deepa,i have solved that problem and successfully installed leach. but now the leach.out is showing result different and i think its somewhat wrong.please check these files and tell me..plzzz..awaiting for your reply..thank you..
I don't understand ... why would you want to implement multi-hop routing on communication between CH node and non-CH nodes ?
non-CH nodes are within line of sight distance with the CH, so why use multi-hop ? It's a waste of energy to use multi-hop in a direct line of sight communication situation.
Quote:
Originally Posted by mhmdmahdi
hi deepa_2111, i want to implement multi-hop routing on communication between CH node and non-CH nodes, multi-hop only used when non-CH nodes send their data to CH. CH send data to BS using single-hop.
can you give me hint how to make it works?
Last edited by deepa_2111; 01-19-2014 at 09:47 AM.
Awk is very easy, and I suggest you learn it as it's gonna help you a lot more in future applications.
You can find really good tutorials on the internet.
It is not specific to leach protocol. You can use awk to do whatever you wish.
Quote:
Originally Posted by Aska123
Thanks a lot deepa ji.
Happy to see you here.
I do not know how to write awk.
First i have to learn awk.
can you provide some awk script so that i can learn how to write them specific to leach protocol.
I haven't used gnuplot or xgraph.
Initially, what I did was to use excel to get the values of energy etc after every 10 sec. You can use textpad etc to seach and select all values in a leach.out.
After that, I realised awk scripts are a better way to extract the energy, data packets received and no. of nodes alive after every 10 sec. A single coomand in awk should do the trick for you.
Please learn awk.
Quote:
Originally Posted by Aska123
@deepa 2111
Hello
I have successfully installed leach on ns2.34
I have no error in leach.err file
I have output in leach.out and leach.tr file.
Please suggest how to plot graph for leach output.
I have installed both gnuplot and xgraph on my system.
I do not know how to select columns from out file.
I also tried Tracegraph software, but it is not loading trace file.
I don't understand ... why would you want to implement multi-hop routing on communication between CH node and non-CH nodes ?
non-CH nodes are within line of sight distance with the CH, so why use multi-hop ? It's a waste of energy to use multi-hop in a direct line of sight communication situation.
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
@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..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.