LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 02-18-2015, 06:37 AM   #16
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled

Quote:
Originally Posted by knudfl View Post
← 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/.


-
sir i must edit .bashrc ?

export PATH=/home/student/ns-allinone-2.34/bin:/home/student/ns-allinone-2.34/tcl8.4.18/unix:/home/student/ns-allinone-2.34/tk8.4.18/unix:$PATH
export LD_LIBRARY_PATH=/home/student/ns-allinone-2.34/otcl-1.13:/home/student/ns-allinone-2.34/lib
export TCL_LIBRARY=/home/student/ns-allinone-2.34/tcl8.4.18/library
export TK_LIBRARY=/home/student/ns-allinone-2.34/tcl8.4.18/library

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

Last edited by emprit; 02-18-2015 at 06:39 AM.
 
Old 02-18-2015, 07:11 AM   #17
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
i have read some ur post at another thread.
u said no need to edit .bashrc because ns orig will be copied on bin,
this work.

but how about .test file?
 
Old 02-18-2015, 09:03 AM   #18
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← 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.


-
 
1 members found this post helpful.
Old 02-18-2015, 10:15 AM   #19
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
← ref. #16, #17.

-
sir i must download if i want to use nam and xgraph?

Download nam : nam-1.14-1.el6.i686.rpm →
https://drive.google.com/file/d/0B7S...ew?usp=sharing
Install nam : # yum localinstall nam-1.14-1.el6.i686.rpm --nogpgcheck

Xgraph : xgraph-12.1-7pclos2011.i586.rpm
https://drive.google.com/file/d/0B7S...ew?usp=sharing

and what name file of name for first test ?
 
Old 02-18-2015, 10:35 AM   #20
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
and this after i start ./test

[root@localhost ns-2.34]# ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...

on this result said 3 node, after i see on my leach_test
alg=pegasis
nn=101 #number of node

why is not same result
 
Old 02-18-2015, 11:20 AM   #21
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← 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.

-
 
Old 02-18-2015, 11:29 AM   #22
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
← 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.
 
Old 02-18-2015, 11:36 AM   #23
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
i have recreate new ns, in /home/student/ns-allinone-2.34 with ur step in post #6
then i search about tclsh84, but no file name tclsh84
 
Old 02-18-2015, 11:47 AM   #24
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
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)
tq sir, time to search another step hahahha
 
Old 02-18-2015, 03:13 PM   #25
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
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

$ tar xvf ns-allinone-2.34.tar.gz
$ cd ns-allinone-2.34/
$ patch -p0 < otcl_ns234_gcc-4.4.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ tar xvf leach+pegasis-ns234-files-2.tar.gz (The updated "patch package")
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ ./install
$ cd ns-2.34/
# make install && exit

diferend with ur post #6 in this thread, this step "$ patch -p0 < otcl_ns234_gcc-4.4.patch" for what?

Last edited by emprit; 02-18-2015 at 03:34 PM.
 
Old 02-18-2015, 07:08 PM   #26
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← 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
Probably use the setup mentioned here, 28 Oct 2014
https://groups.google.com/forum/?fro...w/d-Op29Qg1P0J
→ leach-test__Ubuntu1204.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
ns-allinone-2.34/, rca/
ns-allinone-2.34/{ extras.tcl, ns-2.34/, ns-bsapp.tcl, stats.tcl }
ns-allinone-2.34/ns-2.34/{ leach_test* mit/ tcl/ }

-

Last edited by knudfl; 02-18-2015 at 07:10 PM.
 
Old 02-19-2015, 07:35 AM   #27
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
← ref. #25.

Probably use the setup mentioned here, 28 Oct 2014
https://groups.google.com/forum/?fro...w/d-Op29Qg1P0J
→ leach-test__Ubuntu1204.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
ns-allinone-2.34/, rca/
ns-allinone-2.34/{ extras.tcl, ns-2.34/, ns-bsapp.tcl, stats.tcl }
ns-allinone-2.34/ns-2.34/{ leach_test* mit/ tcl/ }

-
what i must do with that file, i have search the file on pegasis.err, i found it on ns-allinone-2.34/ns2.34/mit/rca/ns-ranode.tcl

maybe i need edit file, and change source with fix localtion

but i got some trouble with grep

idk why after i type grep -Rn xxx not running
 
Old 02-19-2015, 07:53 AM   #28
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
← ref. #27.


$ grep -Rn xxx
... is not a valid command.

Please do :
Code:
$ cd ns-2.34/
$ grep -Rin <expression> *

-
 
Old 02-19-2015, 08:29 AM   #29
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
← 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)
 
Old 02-19-2015, 08:58 AM   #30
emprit
Member
 
Registered: Feb 2015
Location: jl. bogor 1 no 91, malang, jawa timur, indonesia
Distribution: any linux
Posts: 81

Rep: Reputation: Disabled
i have read ur post at http://www.linuxquestions.org/questi...8/#post4300082

but idk that work or not in centos sir?
 
  


Reply

Tags
leach, leach-ex#4, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with running leach protocol in ns2.34 leach.er Mohamed69 Linux - Software 14 04-16-2018 07:10 AM
leach.out total energy increase leach ns2.34 linuxUser123linux Linux - Software 1 07-13-2013 04:54 AM
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 11:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration