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.
hi! i think i have 64 bit os of ubuntu 10.10.
i am working on leach protocol so plz can u find the link which supports 64 bit
this the following error
moin@moin-Inspiron-N5010:~$ sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb
dpkg: error processing gcc41-compat-4.1.2_i386.deb (--install):
package architecture (i386) does not match system (amd64)
dpkg: error processing g++41-compat-4.1.2_i386.deb (--install):
package architecture (i386) does not match system (amd64)
Errors were encountered while processing:
gcc41-compat-4.1.2_i386.deb
g++41-compat-4.1.2_i386.deb
hi! i think i have 64 bit os of ubuntu 10.10.
i am working on leach protocol so plz can u find the link which supports 64 bit
this the following error
moin@moin-Inspiron-N5010:~$ sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb
dpkg: error processing gcc41-compat-4.1.2_i386.deb (--install):
package architecture (i386) does not match system (amd64)
dpkg: error processing g++41-compat-4.1.2_i386.deb (--install):
package architecture (i386) does not match system (amd64)
Errors were encountered while processing:
gcc41-compat-4.1.2_i386.deb
g++41-compat-4.1.2_i386.deb
You need to add a declaration of format_rca in cmu-trace.h
Code:
void format_imep(Packet *p, int offset);
void format_aodv(Packet *p, int offset);
void format_aomdv(Packet *p, int offset);
#ifdef MIT_uAMPS
void format_rca(Packet *p, int offset);
#endif
// This holds all the tracers added at run-time
static PacketTracer *pktTrc_;
};
where this lines should be added in cmu-trace.h
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 182.
The 64bits g++-4.1 compiler from Ubuntu Hardy can be installed:
Synaptic : Settings > Archives > Other Software, and then tick
these entries : "Hardy Heron", + the two "Important security updates"
below the 'Hardy Heron' line.
Next : sudo apt-get update && sudo apt-get install g++-4.1
Note : You will get a reduced result with any ns2, on any 64bits OS :
Some more tests will fail, when you do './validation
#184
Quote:
? where this lines should be added in cmu-trace.h ?
h! i am getting the error in leach.err
can u plz find this soln to me ASAP
can't read "env(RCA_LIBRARY)": no such variable
while executing
"source $env(RCA_LIBRARY)/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 9)
invoked from within
"source.orig mit/uAMPS/sims/uamps.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 mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.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/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
i need to run leach in ns2 for my project . i have installed fedora2 and ns2.29. i have patched ns2 with mannasim patch. but its not working. i went through most of the posts in this forum. can i install ns2.34 in fedora2 and then the patch files. Will ns2.34 work in fedora2.
if i have to install ns2.34 , have i to uninstall ns2.29.
Thank you all for your help.
I have followed all the steps mentioned in Post#5.
After make clean and make commands,
In /home/jignya/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims , I found in leach.out following warnings:
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
At 494.80000000004401:
Total Energy = 327.82507706058254
Total Data = 44146
Total Alive = 4
Simulation complete.
What do i need to do? Are these simulation results correct?
I suppose that ns-2.34 is installed with the compiler gcc-4.3.
The home directory of ns-2.34 is "/opt/ns-allinone-2.34"
1- download the package "ns-234-leach.tar.gz" into the directory "/opt/ns-allinone-2.34/ns-2.34". https://docs.google.com/uc?id=0BzLWx...CNWG1NQK&hl=en
2- download the bash file "leach-setup.sh" into the directory "/opt/ns-allinone-2.34/ns-2.34". https://docs.google.com/uc?id=0BzLWx...CJSU5ZYG&hl=en
3- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the file "leach-setup.sh".
4- move to the directory "/opt/ns-allinone-2.34/ns-2.34" and patch the file "leach-setup.sh"
wsn@ubuntu:~$ cd /opt/ns-allinone-2.34/ns-2.34/
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh
5- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the follwoing two files:
- "Makefile" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34".
- "Makefile.in" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34".
6. Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.3
CPP = g++-4.3
7- run the following commands
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./configure
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make clean
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make
7- If the previous commands passed successfully then you are ready to test your "Leach" by running ./test:
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./test
8. check the file "leach.err", if no error reported then go to "leach.out" and enjoy your results!
@maytamer post #5
i got d followin error aftr followin ur steps..
trace/cmu-trace.cc:1531: error: ‘ADV_CHAR’ was not declared in this scope
trace/cmu-trace.cc:1535: error: ‘REQ_CHAR’ was not declared in this scope
trace/cmu-trace.cc:1539: error: ‘DATA_CHAR’ was not declared in this scope
make: *** [trace/cmu-trace.o] Error 1
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 191
Sorry. Ubuntu 10.04 :
Used to be OK with the default g++-4.4 compiler.
After some updates : It seems now to require g++-4.3 for ns-2.34 :
sudo apt-get install g++-4.3
cd ns-allinone-2.34/ && export CC=gcc-4.3 CXX=g++-4.3 && ./install
I suppose that ns-2.34 is installed with the compiler gcc-4.3.
The home directory of ns-2.34 is "/opt/ns-allinone-2.34"
1- download the package "ns-234-leach.tar.gz" into the directory "/opt/ns-allinone-2.34/ns-2.34". https://docs.google.com/uc?id=0BzLWx...CNWG1NQK&hl=en
2- download the bash file "leach-setup.sh" into the directory "/opt/ns-allinone-2.34/ns-2.34". https://docs.google.com/uc?id=0BzLWx...CJSU5ZYG&hl=en
3- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the file "leach-setup.sh".
4- move to the directory "/opt/ns-allinone-2.34/ns-2.34" and patch the file "leach-setup.sh"
wsn@ubuntu:~$ cd /opt/ns-allinone-2.34/ns-2.34/
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh
5- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the follwoing two files:
- "Makefile" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34".
- "Makefile.in" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34".
6. Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.3
CPP = g++-4.3
7- run the following commands
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./configure
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make clean
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make
7- If the previous commands passed successfully then you are ready to test your "Leach" by running ./test:
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./test
8. check the file "leach.err", if no error reported then go to "leach.out" and enjoy your results!
@MayTamer and all,
In step #7, how do we know that all the commands have passed successfully? In my case, I got
Code:
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/zahariahmanap/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/ucb'
after hitting make command.
Then, when I tried to run ./test, I got "Permission denied".
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
# 193.
The directories "indep-utils/**" are not cleaned by 'make clean'.
"Nothing to be done for `all'" means : Everything has been built.
Is OK, and has nothing to do with LEACH.
Permission denied for ./test : No available '/bin/bash' command ? ?
You may also get 'Permission denied' if some commands were run
by using 'sudo <command>'
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.