How to change number of nodes for LEACH in NS 2.34
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
How to change number of nodes for LEACH in NS 2.34
Hi everyone,
I have final year project related to the LEACH routing protocol. I want to change the number of nodes for LEACH? As for existing package, it is already 100 nodes, and i want to change it to 80 nodes and below..what should I do?
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
Welcome to LQ.
The files used in the leach simulation :
$ export RCA_LIBRARY=/<name>/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test
... are : { test, leach_test, tcl/ex/wireless.tcl, mit/uAMPS/sims/nodescen,
mit/uAMPS/sims/100nodes.txt, tcl/mobility/{mte.tcl, stat-clus.tcl} }, etc. etc.
The file `100nodes.txt´ was generated with mit/uAMPS/sims/genscen ,
like $ ns genscen
* Edit a copy of genscen (genscen-50) to 50 nodes , and $ ns genscen-50
... will create the file "new50nodes.txt".
Now edit line 35 in 'leach_test', nn=101 ,,, to : nn=51
.. and line 17, topology_file="mit/uAMPS/sims/100nodes.txt"
..to : topology_file="mit/uAMPS/sims/new50nodes.txt"
-
I've already follow your instruction..but the output still showing 100nodes or can be said nothing changes..i dont know what else did i missed..can u share your wireless.tcl file?..it is default wireless.tcl file right?anyway my dimension is 100*100..
this is what appear on my terminal:
num_nodes is set 61
INITIALIZE THE LIST xListHead
*** NOTE: no connection pattern specified.
Loading scenario file...
Load complete...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 50.5
SORTING LISTS ...DONE!
NS EXITING...
why there is no connection pattern specified?
Last edited by Faez; 05-17-2014 at 10:14 PM.
Reason: adding question
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 3 .
Quote:
... share your wireless.tcl file ?
I used the "leach+pegasis-ns234-files-2.tar.gz" setup. (By @exidus.)
So that's "my wireless.tcl".
Be aware that post #2 doesn't claim to get the result "50 nodes".
It's just some hint's. There may be more files to edit.
Please read all the leach tcl files in mit/ and tcl/mobility/.
The three versions of wireless.tcl I can think of are attached →
a) @MayTamer (classic mit)
b) Leach + pegasis, by @exidus
c) The @deepa_2111 ns-2.35+leach project.
-
I'm also implementing several scenarios with various number of nodes, I've followed what knudfl had suggested in post #2 but I'm wondering where does the result from running the new leach_test exist? Since my leach.out still shows 100 nodes as it usually is.
Thanks mates!
---------- Post added 09-20-14 at 06:15 PM ----------
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.