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.
knudfl and deepa_2111, so much thanks for always helping
Quote:
Originally Posted by knudfl
# 598 .
The "exidus-pegasis" is the latest version of LEACH.
And may be @exidus has included all the file edits suggested by @deepa_2111 and others ?
** The fact is that the "exidus-pegasis LEACH" works very well.
-
Maybe I did a mistake when I installed NS on my computer, that caused the problem appears.
And now I think you can suggest other people to install your "pegasis-ns-2.34-ubuntu10_i386.deb" file if they want to run Leach/Pegasis to avoid errors on installation.
Quote:
Originally Posted by deepa_2111
@ mhmdmahdi (598)
Congratulations !
I opened my last copy of leach_test and found this :
"ns tcl/ex/wireless_leach.tcl".
Now, I recollect that the steps included replacing the wireless.tcl file with the wireless_leach.tcl file. Was it not there in the instructions you followed ?
Anyway, to answer your question, the reason why it is working now is as follows :
The problem was related to your MAC layer, or the channel. If you parse the wireless_leach file, you'll see the following :
Code:
source tcl/lib/ns-mobilenode.tcl
i'm using the simulation modified by our friend exidus.
On exidus's wireless.tcl, there's also a line to take TCL scripts from external source just like on wireless_leach.tcl. This is from exidus's wireless.tcl:
Hmm ... never tried this.
I think the best option would be to randomly generate the positions at the start of each round.
To see how the positions were randomly generated, please have a look at the files in the uAMPS folder ( I forget which tcl file, and since I am away from the home PC, I cannot tell you right now.)
I think you can incorporate a similar code at the start of each round.
Quote:
Originally Posted by mhmdmahdi
I have a question, how can I make the nodes mobile (change position each rounds/every 20 seconds). Any hints where to get started?
number of nodes, nodes id and nodes position were generated at the beginning of the simulation based on nodes.txt file, right?
Do you think we can re-generate position of alives nodes on tcl file? do you think it will have an impact on nodes id that determined at the beginning of the simulation?
Quote:
Originally Posted by deepa_2111
@ mhmdmahdi,
Hmm ... never tried this.
I think the best option would be to randomly generate the positions at the start of each round.
I think you can incorporate a similar code at the start of each round.
"I am also working on Leach.I am using mannasim to
implement leach.Although you have not provided the code but according to
what you have mentioned, the following is the explanation,
The energy mentioned is in *mJ(mili).* Initially each node
has 2000mJ of energy. At the end of the simulation (after 542 sec)total
energy is 292mJ i.e (292/100)2.92 mJ per node if all nodes have been
assigned the same Tx/Rx energy including the cluster heads.Total no of nodes
which are alive are 4 which can still transmit/recieve data packets.
The calculation approx is as follows acc to the data,
Total energy=2*100*1000mj=200000mj
Assume Energy to transmit/recieve for each node=3mj
Data packets transmit recived=55934
Therefore,Energy require to Transmit data=55934*3mj=167802mj
Add to this route packets and other overhead transmission of 32000(approx)
TOTAL=199707mj
Therefore Energy left=293mj ,Nodes alive=4.
Hope this solve your problem. "
At 420.02960000000002:
Total Energy = 198.5657698721059
Total Data = 46140
Total Alive = 3
Simulation complete.
but before it was
At 600.02960000000007:
Total Energy = 947.72888309112454
Total Data = 70418
Total Alive = 3
Simulation complete.
but as you can see with apply Deepa solution simulation end at 420 and Total Data = 46140
but before apply Deepa solution simulation end at 600 and Total Data = 70418
and node died quickly
so please what is true please help
Last edited by eng_mohamed_sc; 12-11-2013 at 06:29 AM.
#605 & #606
maybe deepa have an answer for this question.
#608 & #609
desired number of cluster:
number of cluster formed on simulation(5% of total number of nodes based on Wendi's papers). You can change the value desired number of cluster on your leach_test file.
Quote:
num_cluster=5
spreading factor:
highly depend on num_cluster value you use at leach_test file.
you could see leach.tcl file (tcl/mobility/) for spreading factor.
Quote:
set opt(spreading) [expr int([expr 1.5*$opt(num_clusters)])+1]
thanks mhmdmahdi
so I can change spreading factor at conditions.txt file based on nu of CH at leach_test file
eg. if nu of CH=5
so (1.5*5)+1=8.5 so I can put spreading factor =8 at conditions.txt file?
---------- Post added 12-13-13 at 05:09 PM ----------
thanks mhmdmahdi
so I can change spreading factor at conditions.txt file based on nu of CH at leach_test file
eg. if nu of CH=5
so (1.5*5)+1=8.5 so I can put spreading factor =8 at conditions.txt file?
The explanation you pasted in (post #606) is not true. If you read the Heinzelman thesis (as you should have in the first place), you will see that all values in the output files are in terms of Joules, and not mJ. I don't know how mannasim works, but as far as ns2 is concerned, I think it is all in Joules.
If you read the intial posts in the following thread (from post #9), you'll see a reference to a work I pasted, where the author explains clearly why the energy in versions other than ns2.1b crosses 200J. The link is : http://www.linuxquestions.org/questi...0/#post4336330.
I think you can get the code to work as you please. Since the node ids are sequential (0-99), just have a buffer with the locations if you wish to retain the same locations (maybe the buffer is already present, I cannot remember). Else, you can give each node a random location.
Does this answer your question ?
Quote:
Originally Posted by mhmdmahdi
@ deepa_2111
can you help me answer my questions on post #603
thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.