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.
Hi all,
I want to implement Leach protocol on ns-2.34.
I installed n-2.34 on Ubuntu 12.04 with GCC 4.6.3. It works ok.
But when i do ./leach_test command in /opt/ns-allinone-2.34/ns-2.34 directory then check the leach.err. It shows that:
Code:
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
while executing
"source.orig tcl/lib/ns-mobilenode.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/lib/ns-mobilenode.tcl"
(file "tcl/ex/wireless.tcl" line 184)
And there is empty in leach.out.
Please help me resolved this issue.
Sorry about my English.
Thanks in advance.
Last edited by Do Tuan Anh; 10-30-2013 at 04:40 AM.
change the addresses (after source) like: /location/of/file/file.tcl for example you have file in the folder say "/usr/local/ns-allinone2.34/ns2.34/tcl/lib/ns-mobilenode.tcl" then put the whole address...
do follow the previous posts... same and similar problems are mentioned in the same thread itself ... search thoroughly and you'll get almost all the solution for running leach in the same thread.
@nik.dan
I've changed the absolute link like "source /opt/ns-allinone-2.34/ns-2.34/tcl/lib/ns-mobilenode.tcl" in wireless.tcl line 184 (/opt/ns-allinone-2.34/ns-2.34/tcl/ex/wireless.tcl) then retype ./leach_test but the leach.out and leach.err have no change.
Plz help me.
@do tuan anh
please check the previous posts in the same thread, this has been a very common problem and has been solved in this thread itself...
copy paste your problem in google, it'll give results of this thread and you can directly look at the post... rather my advise is to go through all of it n u wont get any problem what so ever in doing leach...
Haha. Many many many thanks knudfl and nik.dan.
Today, i restart test leach and have a issue the same as #55 and following #56 to solve it.
At last, the leach.out file have:
Code:
At 1.0999999999999999:
Total Energy = 30125.042791162676
Total Data = 0
Total Alive = 4
Simulation complete.
Now i have to change some parameters and re-simulate.
Once more, thanks u guys.
to all users facing with the following error in their leach.out
Code:
Warning!!! No Cluster Head ADVs were heard!
the problem is with the GCC version.
after many test and tries, I've solved this problem by downgrading my Ubuntu (and consequently my GCC version).
but I'm still facing another problem:
as mentioned in Heinzelman thesis, in leach algorithm the first node dies after about 450 seconds. (figure 4.7-a page 101)
but in all leach.out samples published in this thread or other websites or even in ns234.leach.tar.gz, the first node dies after 20 seconds (the first round).
can anyone explain the cause? or does anybody experienced expected results?
Usually the node dies after 20 sec when none of the nodes receive broadcasts, and each node has to send data directly to the BS. This also leads to increased probability of collisions.
As you can see, in this thread, most users had a problem with the nodes not receiving ADV, and thereby they send their directly to the BS directly.
Quote:
Originally Posted by toprix
to all users facing with the following error in their leach.out
Code:
Warning!!! No Cluster Head ADVs were heard!
the problem is with the GCC version.
after many test and tries, I've solved this problem by downgrading my Ubuntu (and consequently my GCC version).
but I'm still facing another problem:
as mentioned in Heinzelman thesis, in leach algorithm the first node dies after about 450 seconds. (figure 4.7-a page 101)
but in all leach.out samples published in this thread or other websites or even in ns234.leach.tar.gz, the first node dies after 20 seconds (the first round).
can anyone explain the cause? or does anybody experienced expected results?
Just FYI, I ran LEACH on ns-2.35. I used the ns2.34 files that Tarik had uploaded (about 2 years ago), and modified them to run on ns2.35.
I had to use ns2.35 and no other ns version as I was running ns on cyqwin.
So, the compatibility of Windows7 + cyqwin + ns meant that I could have only a certain version of cywin, and ns2.35 was the only one that installed successfully for me.
So, I had to modify the LEACH code to run on ns2.35
Mentioned this just to let you know that LEACH can be made to run on ns2.35
Quote:
Originally Posted by knudfl
# 532 .
The "May Tamer leach" files that you are using are for ns-2.34 .
May not work in ns-2.35 .
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 550 .
Quote:
Mentioned this just to let you know that LEACH can be made to run on ns2.35
Yes we know that, and I have referred several times to your original post,
where you told about ns-2.35.
And advised the members to contact you for the ns235 patch.
Is it possible that you still have the files ?
It would be very nice if you could upload the
"patch package" / {the edited ns235 files}.
Alternatively the edited ns-2.35/ : Can be made to about 12 MB,
with 'make clean', and with the "tcl/test/" folder deleted.
I.e. as a bzip2 compressed package "leach-ns235-patched.tar.bz2".
You can also mail the files to me, and I will upload to 'Google Drive'.
Hi;
Here is some of my experiences with leach.out results:
1- when the BS is located at 50,175 (75 meters from the last node), the first node dies after 20~40 seconds, and the whole simulation continues for about 400 seconds.
2- when the BS is located at 50,50, the first node dies after 330~420 seconds, and the whole simulation continues for about 600 seconds.
but I think these results are far away from heinzelman thesis results. the expected results are as the following:
BS location: 50,175 - nn: 100 - Size of field: 100*100 - first node dies: 410~450 sec - last node dies: 620~650 sec
so anybody else that demonstrated leach protocol successfully; please run your code with referred settings and share results with others.
thank you.
After run Leach_test for Leach-C Protocol The output of Energy file divided into three columns first one for time,second one for node number and the third one for the amount of dissipated Energy
it suppose that all node has init_energy=2 # Each node has 2 joul of energy
so why I see some nodes have energy dissipated more than 2 like 10 and 13 and so on
hi all, i'm trying to install leach for my research.
i'm using ubuntu 12.04..
when i used "make" command i got an error just like post #26 and solved the error with the solution given by our friend deepa_2111 on post #29.
but when i used "make" command again, i got another error.
Quote:
trace/cmu-trace.cc:1531:9: error: stray ‘\342’ in program
trace/cmu-trace.cc:1531:9: error: stray ‘\200’ in program
trace/cmu-trace.cc:1531:9: error: stray ‘\230’ in program
trace/cmu-trace.cc:1531:9: error: stray ‘\342’ in program
trace/cmu-trace.cc:1531:9: error: stray ‘\200’ in program
trace/cmu-trace.cc:1531:9: error: stray ‘\231’ in program
trace/cmu-trace.cc:1535:9: error: stray ‘\342’ in program
trace/cmu-trace.cc:1535:9: error: stray ‘\200’ in program
trace/cmu-trace.cc:1535:9: error: stray ‘\230’ in program
trace/cmu-trace.cc:1535:9: error: stray ‘\342’ in program
trace/cmu-trace.cc:1535:9: error: stray ‘\200’ in program
trace/cmu-trace.cc:1535:9: error: stray ‘\231’ in program
trace/cmu-trace.cc:1539:9: error: stray ‘\342’ in program
trace/cmu-trace.cc:1539:9: error: stray ‘\200’ in program
trace/cmu-trace.cc:1539:9: error: stray ‘\230’ in program
trace/cmu-trace.cc:1539:9: error: stray ‘\342’ in program
trace/cmu-trace.cc:1539:9: error: stray ‘\200’ in program
trace/cmu-trace.cc:1539:9: error: stray ‘\231’ in program
trace/cmu-trace.cc: In member function ‘void CMUTrace::format_rca(Packet*, int)’:
trace/cmu-trace.cc:1531:14: error: ‘A’ was not declared in this scope
trace/cmu-trace.cc:1535:14: error: ‘R’ was not declared in this scope
trace/cmu-trace.cc:1539:14: error: ‘D’ was not declared in this scope
make: *** [trace/cmu-trace.o] Error 1
can anybody help me how to solve this problem?
thanks in advance.
Using, Ubuntu example :
Please start from scratch with $ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/ && tar xvf exidus-pegasis-leach-ns234-patch.2.tar.gz
$ export CC=gcc41 CXX=g++41 && ./install
** ** Which Ubuntu 12.04 are you using ? i686 ? x86_64 ? : $ uname -m
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.