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.
its gving error lyk dis............
........................................................................................
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
while executing
"source.orig tcl/lib/ns-mobilenode.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/lib/ns-mobilenode.tcl"
(file "wireless.tcl" line 184)
could anyone pls help me out how to get rid out of this error. (I download MIT/uAMPS leach file)
I am using ubuntu 13.04 (64 bit, lower versions are not compatible)
I have installed ns-2.35 and ns-234-leach and changed all the addresses in leach-setup.sh, which worked without errors.
when I had run wireless.tcl after making changes in x,y,number of nodes etc it gave me some results when PROTOCOL = DSDV, but when I changed it to LEACH, it gave me the same error as post #1.
Quote:
invalid command name "Resource/Energy"
I have gone through the procedure that followed... I installed GCC-4.3/g++-4.3 manually, but to no use.
when I "make" it, it gave me an error:
Quote:
queue/priqueue.cc: In member function ‘virtual void PriQueue::recv(Packet*, Handler*)’:
queue/priqueue.cc:94:8: error: ‘PT_MDART’ was not declared in this scope
make: *** [queue/priqueue.o] Error 1
and also after making changes in Makefile and Makefile.in as CC=gcc-4.3 and CPP=g++-4.3, when I ./configure, it changes back to CC=gcc and CPP=g++
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
#529, #530 .
'gcc-4.3' used to work some years ago. ( Old Ubuntu's ).
Updates changed that.
Please use gcc / g++ version 4.1.2 or 3.4.6 .
#529, Ubuntu 13.04 - 64 :
No gcc-4.1 / g++-4.1, use gcc/g++ version 3.4.6 .
Or better : Install a 32bits OS : ! ns2 is for a 32bits OS !
A 64bits OS will cause reduced functionality /
Inferior validate result.
** gcc34 / g++34, 64bits → post #11 here : http://www.linuxquestions.org/questi...4175453599/#11
I follwed the instructions given in the link provided by you, but there were two issues:
I could not find a line with "./configure --build" in the "install file, which I could edit, (though I have ns2.35 installed already)...
then after installing both the gcc ang g++ given in the links provided in the post, i did
Quote:
export CC=gcc34 CXX=g++34 && ./install
which ended in the error, which i have already specified above
Quote:
queue/priqueue.cc: In member function `virtual void PriQueue::recv(Packet*, Handler*)':
queue/priqueue.cc:94: error: `PT_MDART' was not declared in this scope
make: *** [queue/priqueue.o] Error 1
Ns make failed!
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 534.
No leach patch or leach+pegasis patch seem to work in ns-2.35 :
Use ns-2.34 ! The good news :
You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time.
But ! Do not add any path text to .bashrc !
thanks knudfl...
I'll try that and would let you know about the same... and one more thing...do I need to uninstall ns-2.35, if not then while giving ns command how would i know which ns version am i working on? and does it work properly on ubuntu 13.04 as I cannot come down to a 32 bit ubuntu, as my dual boot windows machine do not recognize it tried the installation with ubuntu 12.04 but failed.
Last edited by nik.dan; 10-15-2013 at 10:40 AM.
Reason: hadn't completed the query
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 536 .
Quote:
do I need to uninstall ns-2.35
No. But you can rename / save the executable 'ns' as e.g. 'ns235'.
The idea of having multiple ns2 installs is that you have :
/usr/local/{ ns ns235 ns-<name1> ns-<name2> ns-<name3> } etc.
.. And better delete what you added to .bashrc.
LEACH is an exception : Requires an executable by name 'ns'.
( Unless you edit the test scripts to ns-<new-name> ).
Quote:
does it work properly on ubuntu 13.04
No problem compiling "leach-pegasis" in Ubuntu 13.04 - 64.
I tested that a couple of days ago :
exidus-pegasis-leach-ns234-patch.2.tar.gz
The gcc34 / g++34, 64bits was used. See #531.
Dear Friend,
I Know this could be silly question for all of you but i am little bit confuse between both them.
I want to know that LEACH Routing Protocol is only use over sensor network or mobile adhoc network or we can use leach for both.
thanks kundfl,
now it seems to be working after following all the above mentioned instructions and after making changes in the paths and variables... but when I run the wireless.tcl it gives me following error, copying everything:
it was opt(max_dist) before I changed it to $max_dist and gave a value as
Quote:
set max_dist 1000
but when I do that it gives me an error
Quote:
ns: _o194 advertiseClusterHead: wrong # args: should be "set varName ?newValue?"
while compiling
"set max_dist 626 #set by nik as greater than diagonal of the topology = 605*root2"
(compiling body of proc "_o194", line 5)
(Application/LEACH advertiseClusterHead line 5)
invoked from within
"_o194 advertiseClusterHead"
got the last issue solved, the problem was $max_dist was local vaiable and was needed to be chages at 3 places (I did it only once)
got a beautiful line below saying " simulation complete"
Quote:
At 0.59999999999999998: - mit/uAMPS/stats.tcl
Total Energy = 1.2724140225999991
Total Data = 0
Total Alive = 4
Simulation complete. - mit/uAMPS/stats.tcl
thank you for your timely help (specially knudfl) ...
(might need more help in a short while...)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.