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.
you can change the distance over which the ADV_CH are transmitted. Thats what I did.
Changing RXTresh wont help as the transmitting node transmits with enough power for all nodes to hear
Quote:
Originally Posted by nzny
dear all,
in Leach, when the CHs broadcast their ADV_CH, it assumed that all nodes can hear ADV_CH from all CHs. How do I limit the transmission range so that only close nodes can hear ADV_CH from corresponding CH? I've tried to change the RXThresh in wireless-phy.cc and uamps.tcl. However, it seemed the changes didnot give any effect to the clusterChoices_.
if anyone has any idea, hope you can share...thank you...
Hi all ! @deepa_2111
When I move leach.tr in directory "home/ns-allinone-2.34/ns-2.34" to other path and then I make command ./test . In leach.err show the following content :
Quote:
couldn't open "/tarik/leach.tr": no such file or directory
while executing
"open $opt(tr) w"
invoked from within
"set tracefd [open $opt(tr) w]"
(file "tcl/ex/wireless.tcl" line 219)
I think this error cause I've changed the directory of leach.tr . But when I move leach.tr to initial position and make ./test command again, the above error still occurs.
please someone*helps*me*about*this*problem ! Thanks !
Hi all ! @deepa_2111
When I move leach.tr in directory "home/ns-allinone-2.34/ns-2.34" to other path and then I make command ./test . In leach.err show the following content :
I think this error cause I've changed the directory of leach.tr . But when I move leach.tr to initial position and make ./test command again, the above error still occurs.
please someone*helps*me*about*this*problem ! Thanks !
How much is your energy? i mean init_energy in leach_test.
the init_energy is 2
the eq_energy is 1
(what is eq_energy ??? )
I have not do any modification on the code,,
also, can you help me in understanding the output files?
this is my understanding, please tell me if its incorrect,
leach.alive = [time] [node] [0 means dead, 1 means alive]
leach.data = [time] [node] [data sent] --> in my file, the data sent is all zeros
leach.energy = [time] [node] [???]
startup.energy = [time] [node] [???]
leach.save1 = ???
leach.save2 = ???
do you mean that I need to change the max_dist in instproc advertiseClusterHead?
Quote:
Originally Posted by deepa_2111
@ nzny,
you can change the distance over which the ADV_CH are transmitted. Thats what I did.
Changing RXTresh wont help as the transmitting node transmits with enough power for all nodes to hear
Instead of using the max_dist value, give your own value (I used 86 as this is the max distance over which the energy consumption is proportional to square power of distance). Do not change the max_dist value without verifying how it is used further in the code.
Quote:
Originally Posted by nzny
@deepa_2111,
do you mean that I need to change the max_dist in instproc advertiseClusterHead?
eq_energy means that all nodes are allotted the same amount of energy (init_energy). I think the reason why your code is not printing values could be that all nodes are trying to transmit at the same time, leading to collisions and thereby huge energy expenditure. How many nodes do you have in the network ? If you have 100, max energy can only be 200.
Also, note that increasing no. of nodes to beyond 300 causes the LEACH code to stop working/run improperly.
Quote:
Originally Posted by forco
the init_energy is 2
the eq_energy is 1
(what is eq_energy ??? )
I have not do any modification on the code,,
also, can you help me in understanding the output files?
this is my understanding, please tell me if its incorrect,
leach.alive = [time] [node] [0 means dead, 1 means alive]
leach.data = [time] [node] [data sent] --> in my file, the data sent is all zeros
leach.energy = [time] [node] [???]
startup.energy = [time] [node] [???]
leach.save1 = ???
leach.save2 = ???
@forco
leach.alive = [time] [node] [0 means dead, 1 means alive]
leach.data = [time] [node] [all data sent from nodes toward CH and BS]
leach.energy = [time] [node] [energy dissipation of node]
startup.energy = [time] [node] [startup energy]
leach.save1 = I think is a backup file of leach.out!!
Hi all
and @deepa
How can I calculate latency?
time of send data and recieve data is in leach.out
but I need such file like leach.latency
pleas guide me
tnx so much
You can modify the receiver function for the BS (forgot the tcl file name) so that it prints the latency experienced by each CH. This is possible as the BS received packets with the node ID and the time at which the transmission was done by the CH
Quote:
Originally Posted by ni_saghari
Hi all
and @deepa
How can I calculate latency?
time of send data and recieve data is in leach.out
but I need such file like leach.latency
pleas guide me
tnx so much
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.