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.
Thank you Farab! Now the warnings are gone...
but I still get that energy consumption above 200J even though I have made the changes suggested by deepa =T
there was another thing that should have been done to solve this?
Thank you Farab! Now the warnings are gone...
but I still get that energy consumption above 200J even though I have made the changes suggested by deepa =T
there was another thing that should have been done to solve this?
Do you mean the energy in lines like this in leach.out?
At 525.70000000005098:
Total Energy = 290.75993866236303
Total Data = 50473
Total Alive = 4
I think this is not the sum of the nodes energy. maybe it shows the total energy consumed by network as it shows the total data transfered in line after. or maybe it considered the ack packes from BS too.
I dont know...
have you ns-2.27 or ns-2.25 installed? if yes test the result there.
@exidus:
Thanks for you support to me but i still have a question we are running the leach using the test file in ns2.34 folder and in this file "wireless-demo-csci694.tcl" file is used where in it the Number of nodes is 100 nodes and the trace file used is "694demo.tr "
but in the test file , the "./leach_test" is run and if you open it you will find it use "tcl/ex/wireless.tcl" as its tcl file and if you open "tcl/ex/wireless.tcl" file you will find the number of nodes is 51 nodes and the trace file is "out.tr"
so I got confused about which tcl and trace files should i take in my consideration when i run the leach ?
@exidus:
Thanks for you support to me but i still have a question we are running the leach using the test file in ns2.34 folder and in this file "wireless-demo-csci694.tcl" file is used where in it the Number of nodes is 100 nodes and the trace file used is "694demo.tr "
but in the test file , the "./leach_test" is run and if you open it you will find it use "tcl/ex/wireless.tcl" as its tcl file and if you open "tcl/ex/wireless.tcl" file you will find the number of nodes is 51 nodes and the trace file is "out.tr"
so I got confused about which tcl and trace files should i take in my consideration when i run the leach ?
Your should always run leach by "./leach_test" and if you take a look at leach_test itself, you see for example the number of node (nn) or other parameters that will push to "tcl/ex/wireless.tcl" and force it to ignore its preset values and use these parameters instead.
finally your simulation result is in : /mit/leach_sims
I have made some awk and script and graphs for energy consummation and number and alive nodes that I can share them with anyone who interested in.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 142 @farab
Quote:
I have made some awk and script and graphs for energy consummation and number
and alive nodes that I can share them with anyone who interested in.
Suggest : Put the scripts in a folder ( leach-scripts ) and tar
the folder ( tar -cf ).
... And upload the "leach-scripts.tar" to Google Docs ( Shared ),
so everybody can download the scripts.
( Please include a text file in the folder telling what they are used for.)
Here is all trace file of LEACH protocol on ubuntu 11.04.
Notes:
1. You shold have "Evince" installed as document reader for .eps files.
2. You shold have Last version of "xgraph". You can download it here: http://xgraph.org/linux/xgraph_1.39.tar.gz
root login and extract xgraph_1.39.tar.gz into /usr/bin.
more info: http://xgraph.org.
3. Simply run "energy", "alive" and "dead" by "./" or "sh" in terminal or double click and select "Run".
4. You can copy them to your leach_sims folder and test them on your result of simulation.
5. More updates is on the way.
6. farabf33@gmail.com for any questions.
I noticed something weird...
when I modify any leach file I should go to the ns-2.34 and I do a make clean and make commands
but I think the changes I made are not being executed...there is anything else it must be done after you change the files?
when I tried to run the Leach-c, I got this error:
Code:
can't read "env(uAMPS_LIBRARY)": no such variable
while executing
"source $env(uAMPS_LIBRARY)/ns-leach.tcl"
(file "tcl/mobility/leach-c.tcl" line 7)
invoked from within
"source.orig tcl/mobility/leach-c.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)
so I changed the file leach-c.tcl that was like this
it should have solved my problem, but I still keep getting the same error above, even after I changed the file and there is no more env(uAMPS_LIBRARY) on it.
@farab
thanks for your replay, i want u to send me the awk file for computing the average consumption in leach and if you have any other awk scripts on my Email: monaz.essam@gmail.com
also i have another question, I'd like to use some encryption functions from cryptopp library but i can't add it to the NS2, so can anyone plz help me with specified steps what should i do to add this library to ns2?
plzzz if anyone can help, replay me as soon as possible as i need it badly
I had a problem with energy comsumption too and I have already done changes from deepa too. I found out that if you change .cc or .h file, then it is necessary to do these commands: make clean
make depend
make sudo make install
After this you can see changes. I hope that this will be helpful for you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.