@ Heylos,
I didnt understand. With 100 nodes, even 350J is wrong. Max you can get is 200. I am getting about 199 in all my simulations. What initial conditions are you talking about ? Try leach_test. That is the starting script (initial conditions) |
HI @deepa_2111,
I also made your changes in files \mac\Wireless-Phy.cc (2 places were made a change) and mit\rca\energy.cc (1 place), but total energy is still higher than 200J with 100 nodes. Did you change other files or something else? Thank you for your help |
@Exidus,
Hey ! Can you please post the changes you made ? Let me check with the code I have now. Please post your changes here |
@deepa_2111 I don't understand something. Why if i run ./test for several times i get different energy consumption without changing initial conditions? Is it normal to have always different results?
|
@deepa_2111
Here are changed files. File /mac/wireless-phy.cc - changes are commmented with comment change 1 and change 2 Code:
/* -*- Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*- Code:
/************************************************************************* Thanks. |
@ Heylos,
Yes that is norma. Because, on each run of ./test, the clusters formed are different, and hence the entire output will be different. @ Exidus, Let us try debugging this step by step. 1. after every change to '.cc' or '.h' files, you have to do a 'make' (at times i do a 'make clean', 'make depend' and 'make' also). 2. try reducing the number of nodes (in ./leach_test), and in energy.cc, put a 'printf' to check the 'amount' value in int EnergyResource::remove(double amount){} 3. What is your leach.alive file like ? what outputs do you get there ? |
@ deepa_2111
I reduced number of nodes to 50 and created a new topology file for 50 nodes with genscen. In file energy.cc i added this Code:
int EnergyResource::remove(double amount) Code:
10 0 1 |
@ Exidus,
yes ! now, try printing out the value of amount, and note what happens when 'new_level' falls below 0. |
@ deepa_2111
I dont know how to print out the value of amount. Can you help me with this? I noticed that total energy from leach.out is a sum of energy from all nodes from file leach.energy at the end of simulation. Every node has this number higher than 2. |
@ Exidus,
That is the problem. the simulation is counting the nodes' energy even after it dies. After uncommenting the print statement, rebuild. and then run. check leach.out file. The printed values will be there. |
@exidus Can you please tell me the steps to reduce the number of nodes to 50 and create a new topology file for 50 nodes with genscen?
|
@deepa_2111
I still can not find values of amount in leach.out. @helyos 1. You can create a new topology file with a file mit/uAmps/genscen. Change these lines in this file Code:
set outf [open "your_new_file.txt" w] 3. Change lines in the file leach_test Code:
topology_file="mit/uAMPS/sims/your_new_file.txt" Code:
# Number of nodes. WARNING! This should be 1 higher then the number |
Thank you @exidus . I will try.
|
look at the bottom of the page ... it shoud be there.
Have you integrated all the changes from the MIT Code ? |
Can be the output of LEACH seen in nam(network animator) somehow?
|
Sorry about the late reply.
@deepa_2111 I see only data which are send, total energy, total data and total alive in leach.out file, but I cant see amount energy. Can you please send me email with your changed MIT files on tomas.takacs@gmail.com ? Thanks @helyos I think no. |
Hi guys.
I have one question. Is here somebody who tried to simulate a protocol PEGASIS in ns2? Thanks for answer. @deepa_2111 Can you please send me your changed MIT files. Thanks a lot. |
Permission denied
I run the steps of installing Leach protocol, but I face the below error when I run this command : ./test
error is : bash: ./test: Permission denied what I should to do for solve this problem? Thank you for your time and reply. |
Post # 118 @ssohrab2003 : Welcome to LQ.
Well, if the file isn't executable, it can be run with : 'sh test'. I guess, you wouldn't have come as far as to using the 'test' script, if you had no /bin/bash. |
Permission denied leach protocol in ns2
Thank you for your reply,
How can I have bash file? I couldn't found it in the bin folder. |
# 120 : Please read http://linuxsilo.net/docs/smart-questions_en.html
I.e. please tell, which Linux OS, you are using, like CentOS6, Fedora 11 etc. And look for bash with the which command : which bash I assume you already have used one of these commands : ./install , make. Then bash is most possibly in use too. And by the way, did the 'sh test' command work ? ? .. |
having the same error
Hellow everyody
me too i had the same error melokuhle had when i tried to setup the leach on ns2.34 using above steps: trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope trace/cmu-trace.cc: At global scope: trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’ make: *** [trace/cmu-trace. Can anyone help me asap please as i need it badly |
Dears,
I had the same problem mealokuhle had when i tried to install leach on ns2.34 using above steps, the errors are: trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope trace/cmu-trace.cc: At global scope: trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’ make: *** [trace/cmu-trace. can anyone help plz asap as i need it badly thanks in advance |
@monazEssam
Hi, you must have these pieces of code (lines between #ifdef and #endif) in file trace/cmu-trace.cc Code:
... Code:
#ifdef MIT_uAMPS |
Thanks exidus, it's working now, the make file executed without errors but when i type ./test and try to run the .nam file i found there are only 3 nodes and there is no connection between them, so i need to know how can i see the simulation of the leach i mean i need to see the clusters and cluster heads formed and sending we receiving the packets after the clusters formed
also if i want to add something to the packets sent and received in leach , where should i add my code? |
Dears,
I got this error in leach.err file when i run the test file: can't read "env(RCA_LIBRARY)": no such variable while executing "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 "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) Can anyone help? |
@monazEssam
Answer for your problem is in post #58 You must change path to sources in file /mit/uAMPS/sims/umaps.tcl For example you must change all 7 sources from this: source $env(RCA_LIBRARY)/ns-ranode.tcl to this source /your_path_to_ns2/ns-2.34/mit/rca/ns-ranode.tcl |
@exidus: thank you exidus for your support to me. thanks GOD the leach now is running without errors but i have 2 questions:
The first question is: there are some files in mit/leach_sims i don't know their structure and can't understand their content and i tried to search for them in leach files to know when and where they are filled but i can't find anything: Leach.Data leach.alive Leach.save1 Leach.save2 the second question that i want to add a security to all leach packets/messages. i mean i want to encrypt all sent messages in leach protocol before they are sent and decrypt them on receiving, could you tell me where exactly(in which files) i can add my code for encryption & decryption at each sent and receive function in leach protocol thanks in advance |
Dears,
i want to know the name of the trace file i should analyze it when running the leach using ./test as i found alto of .tr (like out.tr, 694demo.tr and leach.tr ) files and i don't know which one i should analyze it for leach performance also the name file names 694demo.nam when i run it , it simulated 2 nodes with no connection , while in leach_test file the used topology is :topology_file="mit/uAMPS/sims/100nodes.txt". which contains 100 nodes not only 3 and i can't see the clusters formation in the nam simulation, how can i see it? Thanks in advance, Mona Essam |
dears,
Has anyone an awk script for energy consumption, throuhput and the packets delay for leach trace files? |
Leach
HI,
I am trying to add LEACH to NS2.35 on Cygwin by following these steps but I am getting this error when I make: Code:
queue/priqueue.cc: In member function `virtual void PriQueue::recv(Packet*, Hand Thanks Quote:
|
@monazEssam
1. Main output file is leach.out. There are information about which file is a cluster head, which node send a message etc. You can see total spend energz at the end of file. Can you check a number of total energy at the end of simulation when you simulate 100 nodes? 2. If you want to add security to leach packets, I think that a good place for it will be a files mit/rca/rcagent.cc and mit/uAMPS/bsagent.cc. There are function for sending and receiving packets. But I am not sure if my idea is correct. 3. Trace file is for leach_test file is leach.tr in ns-2.34 directory. I think that nam file is not created for leach_test. |
Leach
Thank you. I have managed to implement LEACH on ns2.34. However, I don't know how to use the test output files such as leach.energy and leach.data, etc. Is there any recommended resource that explains them?
Regards Quote:
|
It worked Thanks all.
---------- Post added 08-25-11 at 08:49 PM ---------- Thanks a lot all mates. I have created a simple how to, called: "Installing NS and LEACH on ubuntu" in PDF format and I want to share my experinces collected from this usefull site: Code:
I suppose that you have: |
Hi everyone, I followed the tips here and got ns-2.34 + leach working (I guess hehehe) but my leach.out has some warnings?
Code:
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff |
@ jimctu
I searched the mit directory by simple "grep dst_" and I found there are 3 files use this old method: ns-bsapp.tcl ns-leach.tcl ns-mte.tcl To get rid off this warning open them with any text editor like gedit, ctrl+h search dst_ and replace with dst_addr_ They are located in mit/uAMPS. |
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? |
Quote:
At 525.70000000005098: Total Energy = 290.75993866236303 Total Data = 50473 Total Alive = 4 |
yes! Exactly this Farab...it shouldn't be below 200J? As my network configuration has 100 nodes with 2J each.
|
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 ? |
Quote:
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. |
I don't now farab...
tomorrow I'll have a look at how the energy consumption is made... but i still think there is something wrong with this... by the way, can you send me your awk scripts? =) |
# 142 @farab
Quote:
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.) Thank you. . |
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:
Code:
source $env(uAMPS_LIBRARY)/ns-leach.tcl Code:
source mit/uAMPS/ns-leach.tcl |
@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 thanks in advance |
@jimctu
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. |
Thank you Exidus!
forgot the make install... now it worked perfectly! =D |
Quote:
thank you... |
All times are GMT -5. The time now is 10:31 AM. |