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.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 838 .
Quote:
removing Resource/Energy error
The error in "leach.err" : "invalid command ..Resource/Energy"
.. seems to appear on all contemporary Linux OS,
when you are using one of "the classic leach patches".
@exidus seems to have included all the required file editing,
meaning that the only bullet proof patch for all Linux OS's
is "leach+pegasis-ns234-files-2.tar.gz" https://drive.google.com/file/d/0B7S...it?usp=sharing
The main reasons why nodes do not get the schedule:
1. Nodes are asleep and do not hear transmissions.
2. Collisions.
3. Packets are received but not deciphered as the packet ID doesn't match that of the schedule.
First of all, check that the schedule is received if your code isn't added. Comment out the code and check.
Then, verify the time at which the packets are sent.
4. Also, I find a major contradiction in your logic. You said:
Quote:
i am checking nodes energy with threshold and if it is greater than it then CH will send TDMA schedule directly to nodes so that nodes can send data to CH.
But, your condition is:
Code:
if{ $E < $TE } {
This is contradictory to what you reasoned.
5. Next, what is your TE value ? Has it been recalculated since the last round ? If not, all nodes are CHs, and thereby there are no clusters, and no non-CH nodes. So check your TE value, and if the node selected has CH has any cluster nodes.
6. How about CH ADV ? Have the elected CHs sent out CH ADV ?
Quote:
Originally Posted by keepwalking123
@deepa
hi deepa..can you please tell me the solution of problem posted in #837..i am really stuck there and not getting any idea..please help me..
Last edited by deepa_2111; 03-31-2014 at 02:49 PM.
@deepa
hi deepa, now TDMA schedule is getting but the problem here is i think node(CH) itself getting that schedule and other cluster nodes are not getting it, thats why the output is different like this.here with i am attaching leach.out file please check it.I have initialized nodes energy to 0.5 hence the round is of 5 second. that means after 5 second the next round will be initiated.To understand i have printed "Hello" there.Here, The threshold value will be IE*0.5 and I have corrected the condition also.In recv schedule function it is printing "Warning!!! node does not have transmit time"..and if i print the node there, it is CH only not other nodes..while in the previous round it works perfect..why this is happening? please help me..
1. Check that the CH has cluster nodes.
2. Check the reason why you get the warning - Check when and at what instant you get this warning. And what transmit time is being talked about here ?
Quote:
Originally Posted by keepwalking123
@deepa
hi deepa, now TDMA schedule is getting but the problem here is i think node(CH) itself getting that schedule and other cluster nodes are not getting it, thats why the output is different like this.here with i am attaching leach.out file please check it.I have initialized nodes energy to 0.5 hence the round is of 5 second. that means after 5 second the next round will be initiated.To understand i have printed "Hello" there.Here, The threshold value will be IE*0.5 and I have corrected the condition also.In recv schedule function it is printing "Warning!!! node does not have transmit time"..and if i print the node there, it is CH only not other nodes..while in the previous round it works perfect..why this is happening? please help me..
Currently working on WSNs. I was looking for a protocol using clustering, and already implemented on ns2. I found many people using leach. I have installed successfuly on Ns-2.34 (after weeks of hard time!, btw thank you all for your posts/comments/questions/... I have read almost all!)
I my case, I need to arrange my sensors into clusters and test my implemetation on the clustering topology. I am not implementing a new routing protocol or clustering protol.
Do you have any idea on how I can call the clustering function (in other words: I need to use only the clustering part of leach)?
Can you please help me out.
Many thanks! and look forward to hearing from you.
Imy =)
PS: Please do let me know if I am on the wrong threads and orient me to the right one!
You'll need the LEACH functionality upto createSchedule.
Quote:
Originally Posted by imy
Hi Guys,
Currently working on WSNs. I was looking for a protocol using clustering, and already implemented on ns2. I found many people using leach. I have installed successfuly on Ns-2.34 (after weeks of hard time!, btw thank you all for your posts/comments/questions/... I have read almost all!)
I my case, I need to arrange my sensors into clusters and test my implemetation on the clustering topology. I am not implementing a new routing protocol or clustering protol.
Do you have any idea on how I can call the clustering function (in other words: I need to use only the clustering part of leach)?
Can you please help me out.
Many thanks! and look forward to hearing from you.
Imy =)
PS: Please do let me know if I am on the wrong threads and orient me to the right one!
The error in "leach.err" : "invalid command ..Resource/Energy"
.. seems to appear on all contemporary Linux OS,
when you are using one of "the classic leach patches".
@exidus seems to have included all the required file editing,
meaning that the only bullet proof patch for all Linux OS's
is "leach+pegasis-ns234-files-2.tar.gz" https://drive.google.com/file/d/0B7S...it?usp=sharing
-
Actually,for Ubuntu12.04,the leach patches you provide in #838 (and #28) still can not work.
I install Ubuntu12.04(i686) in VMware Workstation 8.0,ns-2.34,and I install gcc-4.1(the source you give in #180)gcc-4.4,gcc-4.5,gcc-4.6(so as g++),but all of these donn't work--there is still error in "leach.err":"invalid command:Resource/Energy...".
After a week's failure,I abandon Ubuntu12.04,and install Ubuntu10.04. Now ,leach works correct! it can also work in Fedora 15(i686).
But still thank you very much! and sorry about my poor English.
@ deepa
hi deepa as u said in post #846 i check the cluters..ch have their members..byt what is happening here is when ch send advertisement msg or data also..it is nt receiving to members..it is received by ch only..what happened here? can u please give me your contact detail so that i can contact you because i want the solution very early as my submission date is close..plzz..thank you
hey, i m facing this error while running "make command in ns2"
trace/cmu-trace.cc: In member function ‘void CMUTrace::format_aodv(Packet*, int)’:
trace/cmu-trace.cc:841:14: error: ‘AODVTYPE_HELLO_ACK’ was not declared in this scope
case AODVTYPE_HELLO_ACK:
^
make: *** [trace/cmu-trace.o] Error 1
please suggest me some solution
and "make depend" is not working properly. its showing an error
make: *** No rule to make target `mac/macngenhanced.cc', needed by `depend'. Stop.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.