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.
as per blog mentioned by you , I am unable to find solution for the contents of my leach.err file
can you please provide me the solution please...........
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 766, @mittal_saurabhin
If it's about the error output shown in post #739 :
Quote:
invalid command name "Resource/Energy"
... it's a failed build , or you are using the wrong executable 'ns'.
May be you can't build the old LEACH (ns227..ns234) with your current OS ?
The proof choice for a contemporary OS is still the new patching :
"exidus-pegasis-leach-ns234-patch.2.tar.gz" https://docs.google.com/file/d/0B7S2...it?usp=sharing
I can help you if you have logical questions but I don't think I have the original LEACH set up anymore... If I can find a version (chances are only 10%), I'll upload it.
However, I'd really advise you to try to learn the code flow yourself.
Quote:
Originally Posted by mittal_saurabhin
@deepa @keepwalking
If possible, can you please provide me the tcl file for leach or higher versions so as to run and analyze LEACH......
else
can you please provide me the details of tcl files available in ex folder so that the same can be used for simulating LEACH..
The author explicitly details the steps to be followed. However, MAKE SURE YOU REPLACE THE PATH WITH YOUR CORRECT PATH. DO NOT BLINDLY DO A COPY-PASTE.
Quote:
Originally Posted by mittal_saurabhin
as per blog mentioned by you , I am unable to find solution for the contents of my leach.err file
can you please provide me the solution please...........
From the blog :
""yourpath/ns-allinone-2.34" for the follwoing ..
- "Makefile.in" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34"."
*** Looks like a typo : No path is ever set in Makefile.in .
And : gcc-3.4/g++-3.4 worked with ns2 for a short time in Ubuntu 10.04 three years ago.
Not used any more : Ubuntu 10.04 got updated, only gcc/g++-4.1.2 worked then.
From the blog :
""yourpath/ns-allinone-2.34" for the follwoing ..
- "Makefile.in" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34"."
*** Looks like a typo : No path is ever set in Makefile.in .
And : gcc-3.4/g++-3.4 worked with ns2 for a short time in Ubuntu 10.04 three years ago.
Not used any more : Ubuntu 10.04 got updated, only gcc/g++-4.1.2 worked then.
Please note: This work was done 2 years ago. Not sure if it'll run with the current Ubuntu and compilers.
Please use for a reference only.
Please note : The file is 55 MB. I no longer have Linux installed on my current PC, and hence unable to make clean etc. Also, I'll not be able to build or help with build related issues with my installation.
Please let me know if you are able to extract the files. If not, will tar zip and send the files.
Last edited by deepa_2111; 02-24-2014 at 08:34 AM.
hi deepa, i have one doubt, look at in ns-leach.tcl file..in proc SendDataToBS i have not found any procedure to be called but actually it calls the procedure recvData in ns-bsapp.tcl..from where it is called and where it returns??i put some lines to trace also such as entering and leaving fun to trace out but still cant get this one.. actually i want to return some value from this function but i am unable to do it..please help me..also tell me what is meaning of "pp"..please..
The "send" command calls the required C++ (backend) functions for sending the data.
Similarly, there are C++ functions which enable the node to receive the packets. If the packet ID matches that for DATA packets, "recvData" in the tcl files is called.
Like I said earlier, you cannot just put a print statement and get the results. If you want something to be printed when the data packet is sent, you have to do
Code:
$ns_ at $random_delay "puts ..... "
The time (here "random_delay") at which the action is to be performed has to be specified. Else, the action will be performed at the start of the simulation itself.
Quote:
Originally Posted by keepwalking123
hi deepa, i have one doubt, look at in ns-leach.tcl file..in proc SendDataToBS i have not found any procedure to be called but actually it calls the procedure recvData in ns-bsapp.tcl..from where it is called and where it returns??i put some lines to trace also such as entering and leaving fun to trace out but still cant get this one.. actually i want to return some value from this function but i am unable to do it..please help me..also tell me what is meaning of "pp"..please..
Last edited by deepa_2111; 02-24-2014 at 02:37 PM.
hi deepa..thanx for your reply..i got what u said..as i am modifying the code, i want the clusters formed during first round..for that i write this code-
proc temp1 {name} {
upvar 1 $name x
global data
set data $name
#puts "Nodes data=$data"
#return $data
temp2
}
proc temp2 {} {
global data
puts "final data=$data"
set data_array [lappend data_array $data]
puts "dt_arr=$data_array"
return $data_array
}
where temp1 is called in bs-app.tcl by call by reference as: temp1 $actual_nodes_data
but the problem is it takes only last cluster nodes in array and previous once are getting flushed or overwritten..can u suggest me any solution to this?? please..
hello all..
can anybody provide me package of energy leach protocol..as it is required as base of my project..please awaiting for your replies..please..
Same Query of Post #438_Please give me suggestions!!
/lib -ltk8.5 -L/home/aruna/aruna/ns-allinone-2.35/lib -ltcl8.5 -lXext -lX11 -lnsl -ldl -lm -lm
tmix/tmix.o: In function `Tmix:icktcp()':
tmix.cc.text+0xc87): undefined reference to `agentFactory(Tmix*, char*, char*)'
tmix/tmix.o: In function `Tmix::setup_connection()':
tmix.cc.text+0x18ea): undefined reference to `typeinfo for TmixOneWayAgent'
tmix.cc.text+0x18f2): undefined reference to `typeinfo for TmixAgent'
tmix.cc.text+0x1999): undefined reference to `typeinfo for TmixOneWayAgent'
collect2: ld returned 1 exit status
make: *** [ns] Error 1
please help me to sort it out this problem.
I m using ns-2.35 in ubuntu 12.04.
Hi Aska, a quick question.
In LEACH, nodes are stationary .. So what did you mean by node movement ?
I'm curious about the nam file .. If possible, can you upload a screenshot of the nam file ?
sorry Deepa for late reply
I have not seen your post.
I can show wireless nodes in a nam file I can also show their movements.
To show Movements is easy . There is setdest command for that.
which kind of nam output you want?
Usually I set positions of nodes in tcl file and make exec out.nam.
But in leach protocol leach-test include topology from a .txt file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.