How many successful implementations of LEACH on NS2
Linux - Wireless NetworkingThis forum is for the discussion of wireless networking in Linux.
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.
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
Quote:
Originally Posted by knudfl
← ref. #14.
st #13 :
The executable 'ns' is hard coded to know the location of it´s libraries:
ns-allinone-2.34/{ bin/*, lib/* }, which also means :
Once built as e.g. /home/emprit/ns2/a/ns-allinone-2.34/,
you cannot move ns-allinone-2.34/{ bin/*, lib/* } to another location.
About the executable 'ns' :
# 'make install' will copy 'ns' to the default location for all 'ns-<name>':
/usr/local/bin/.
my process make install
=====
[root@localhost ns-2.34]# make install
for d in /usr/local/man/man1; do \
if [ ! -d $d ]; then \
mkdir -p $d ;\
fi;\
done
/usr/bin/install -c -m 755 ns /usr/local/bin
/usr/bin/install -c -m 644 ns.1 /usr/local/man/man1
#
then how to run the leach? because no file .test found
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← ref. #16, #17.
No reason to set any PATH for 'ns'. Read post #13.
The executable 'ns' is already in a system PATH.
→ → When 'make install' has copied 'ns' to /usr/local/bin/
All the ~15 year old text ...
»Please put .. _PATH/bin: .. ,, IMPORTANT NOTICES:" You MUST put ..«
.. was meant for a `University Computer´ :
I.e. a computer with no write access to /usr/.
No script ns-2.34/test ?
When you do 1) $ cd ns-allinone-2.34/
2) $ tar xvf leach+pegasis-ns234-files-2.tar.gz
... then you will get ns-2.34/{ test, leach_test, mit/ }.
* Remark : No ns2 commands as root please. (Except 'make install'.)
All commands are to be done as unprivileged user. Hence the $ prompt.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← ref. #19.
Quote:
... download if I want to use nam and xgraph ?
What do you mean ? Just download and install the packages :
# yum localinstall nam-1.14-1.el6.i686.rpm --nogpgcheck
# yum localinstall xgraph-12.1-7pclos2011.i586.rpm --nogpgcheck
Be aware that LEACH is not supporting NAM.
No nam files in Leach.
A "pretended" out.nam will show an empty nam display.
← post #20 : »»num_nodes is set 3«« :
Don't know. Always starts the first sequence that way.
Please have a look into the output files, e.g. leach.out
→ My example from today, leach.out__18Feb2015.txt https://drive.google.com/file/d/0B7S...ew?usp=sharing
.... shows all (0 ... 99) nodes.
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
Quote:
Originally Posted by knudfl
← ref. #16, #17.
-
sir i have read pegasis.err
Code:
When configured, ns found the right version of tclsh in /home/student/Desktop/ns-allinone-2.34/bin/tclsh8.4
but it doesn't seem to be there anymore, so ns will fall back on running the first tclsh in your path. The wrong version of tclsh may break the test suites. Reconfigure and rebuild ns if this is a problem.
couldn't read file "/home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-pegasis.tcl": no such file or directory
while executing
"source.orig /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-pegasis.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 /home/tomas/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-pegasis.tcl"
(file "tcl/mobility/pegasis.tcl" line 11)
invoked from within
"source.orig tcl/mobility/pegasis.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)
maybe this my fault, because i have edit .bashrc with export blablabla, but i have remove export blablabla
but i get problem with source ~/.bashrc before
i dont know to remove it.
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
done, error change. whahahhaha
Code:
couldn't read file "../../rca/ns-ranode.tcl": no such file or directory
while executing
"source.orig ../../rca/ns-ranode.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 ../../rca/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 14)
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/pegasis.tcl" line 22)
invoked from within
"source.orig tcl/mobility/pegasis.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)
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
im use root,
if on normal user
[student@localhost ns-2.34]$ ./test
couldn't open "694demo.tr": permission denied
while executing
"open $opt(tr) w"
invoked from within
"set tracefd [open $opt(tr) w]"
(file "wireless-demo-csci694.tcl" line 86)
===================
done with this permission, but problem no such file or directory not solved
couldn't read file "../../rca/ns-ranode.tcl": no such file or directory
while executing
"source.orig ../../rca/ns-ranode.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]
==================================================
@knudfl
sir i have question about this step with ur post in other thread
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511
Rep:
← ref. #25.
» "$ patch -p0 < otcl_ns234_gcc-4.4.patch" for what ? «
Like the text says : To make otcl work with gcc-4.4 .
* Mostly for Ubuntu. May not be required for CentOS. But makes no harm.
Quote:
couldn't read file "../../rca/ns-ranode.tcl": no such file or directory
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81
Rep:
Quote:
Originally Posted by knudfl
← ref. #27.
-
ahahaha, i got it now, just change file uamps.tcl
Code:
#source $env(RCA_LIBRARY)/ns-ranode.tcl
#source $env(uAMPS_LIBRARY)/ns-bsapp.tcl
#source $env(uAMPS_LIBRARY)/extras.tcl
#source $env(uAMPS_LIBRARY)/stats.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/rca/ns-ranode.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-bsapp.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/uAMPS/extras.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/uAMPS/stats.tcl
#Uncomment these lines to use gdb to debug the c code
#source mit/uAMPS/ns-bsapp.tcl
#source mit/uAMPS/extras.tcl
#source mit/uAMPS/stats.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-resource-manager.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl
source /home/student/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-neighbor-resource.tcl
new error time to searching again hahahha
Code:
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/home/student/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/student/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.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 /home/student/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 24)
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/pegasis.tcl" line 22)
invoked from within
"source.orig tcl/mobility/pegasis.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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.