LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to integrate the "Resource/Energy" leach class into NS-2.34? (https://www.linuxquestions.org/questions/linux-software-2/how-to-integrate-the-resource-energy-leach-class-into-ns-2-34-a-870368/)

tuongpx 02-27-2015 08:49 PM

Hi all,
I have a issues when run the "./test" command. It's show error "bash: ./test: Permission denied
".
Please help me.
Thanks

Rizwanamalek 02-28-2015 11:21 AM

Code:

[root@localhost ex]# ns wireless-demo-csci694.tcl
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_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...
[root@localhost ex]#

What you mean by starting command in test and leach_test ?

tuongpx 02-28-2015 08:17 PM

Quote:

tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless.tcl
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)
Hi I have fixed that issue, but then i got problem with "ns wireless.tcl" command. Please help me.

emprit 03-01-2015 02:48 AM

Code:

tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless.tcl
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)

dont use ns wireless.tcl
but use ./test
why ? because ./test will start scrip leach_test
on leach_test include
Code:

#This is the algorithm that we are going to run. Type leach, leach-c, stat-clus or pegasis
alg=leach-c
#dirname, filename = 
#  The directory and filename that we want our output to be written.
dirname="mit/leach_sims"
filename=$alg

and
Code:

ns tcl/ex/wireless.tcl  \
-sc mit/uAMPS/sims/nodescen.tcl \
-rp $alg \
-x $x \
-y $y \
-nn $nn \
-stop $stop \
-eq_energy $eq_energy \
-init_energy $init_energy \
-filename $filename \
-dirname $dirname \
-topo $topology_file \
-num_clusters $num_clusters \
-bs_x $bs_x \
-bs_y $bs_y 2>$dirname/$filename.err 1>$dirname/$filename.out &

u see $filename=$alg , so if u start wireless.tcl alone this mean $filename is empty

so almost at all value in wireless.tcl include from leach_test in ./test

Aska123 03-07-2015 04:55 AM

Again facing Resource/Energy problem
 
Quote:

Originally Posted by knudfl (Post 4300082)
Welcome to LQ.

Add 'hardy' to /etc/apt/sources.list : g++-3.3....gcc-4.2((g++-4.2)) will be available.
sudo gedit /etc/apt/sources.list ; sudo apt-get update
Code:

deb http://76.73.4.58/ubuntu/ hardy-updates main
deb http://76.73.4.58/ubuntu/ hardy universe
deb http://security.ubuntu.com/ubuntu hardy-security main
deb http://security.ubuntu.com/ubuntu hardy-security universe

A missing "Resource/Energy" : It was not compiled into ns.
All new objects must be added to 'Makefile' ( Makefile.in ).
Patch ns234-leach.tar.bz2 https://docs.google.com/uc?id=0B7S25...CJzYt5QP&hl=en
May be compare the Makefile with the original ns-2.27 LEACH Makefile :
https://docs.google.com/uc?id=0B7S25...CNPCuaYP&hl=en

EDIT : See post # 22

..

Hello friends
I am facing Resource/Energy problem when I tried to run ./leach_test in ns-2.34.
I have tried to install
deb http://76.73.4.58/ubuntu/ hardy-updates main
deb http://76.73.4.58/ubuntu/ hardy universe
deb http://security.ubuntu.com/ubuntu hardy-security main
deb http://security.ubuntu.com/ubuntu hardy-security universe

but error 404 no page found.

Some one please help me to install leach on ns-2.34 with ubuntu 10.04

Thanks

Aska123 03-07-2015 05:28 AM

Some one please help to install Leach package in ns-2.34 on ubuntu 10.04.

I am getting resource/energy error in leach.err file.
my compiler is 4.4.3

Thanks

Aska123 03-07-2015 06:40 AM

how to add hardy Heron to ubuntu 10.04?
 
Quote:

Originally Posted by knudfl (Post 4571705)
# 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

? Are you talking about the edited cmu-trace.h in post #9 here ?
http://www.linuxquestions.org/questi...ra13-907076/#9

..

I have tried to add hardy Heron to ubuntu 10.04.I tried with synaptic manager. But it is asking for http:// address. Please help.

Thanks

Aska123 03-07-2015 06:44 AM

Hardy problem
 
Quote:

Originally Posted by knudfl (Post 4557567)
# 173.

Which link ? Suggest : use g++-4.2

Add Hardy in Synaptic :
Settings > Repositories > Other Software
... Tick the 3 Hardy entries, and then "Reload".

Then you can install 'g++-4.2' with Synaptic.

.

I tried this method but error
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the list directory

Please help
Thanks

knudfl 03-07-2015 07:03 AM

Ref. posts #890 ... #893.
Quote:

resource/energy error in leach.err file
You are using the wrong executable 'ns'.
$ cd ns-2.34/ && sudo make install
And delete any 'ns' PATH settings you may have in .bashrc.

You could also have a failed build.
If you are using old code, like post #5.
The updated code is leach+pegasis-ns234-files-2.tar.gz

gcc-4.4.x should be OK.
( Instructions from 2011 - 2013 are not valid any more.
Better read new posts http://www.linuxquestions.org/questions/tags/pegasis/ )
cd ns-allinone-2.34/
patch -p0 otcl_ns234_gcc-4.4.patch
tar xvf leach+pegasis-ns234-files-2.tar.gz
./install

-

Aska123 03-07-2015 07:09 AM

Thanks a lot Kundafi.

I was eagerly waiting for your reply.

I am facing problems in downloading Hardy heron to ubuntu 10.04.

I have tried synaptic manager. but error 404, not found appears.

Aska123 03-07-2015 07:14 AM

Quote:

Originally Posted by knudfl (Post 5328280)
Ref. posts #890 ... #893.

You are using the wrong executable 'ns'.
$ cd ns-2.34/ && sudo make install
And delete any 'ns' PATH settings you may have in .bashrc.

You could also have a failed build.
If you are using old code, like post #5.
The updated code is leach+pegasis-ns234-files-2.tar.gz

gcc-4.4.x should be OK.
( Instructions from 2011 - 2013 are not valid any more.
Better read new posts http://www.linuxquestions.org/questions/tags/pegasis/ )
cd ns-allinone-2.34/
patch -p0 otcl_ns234_gcc-4.4.patch
tar xvf leach+pegasis-ns234-files-2.tar.gz
./install

-

after sudo make install in ns-2.34 I got this
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
rohini@ubuntu:~/opt/ns-allinone-2.34/ns-

knudfl 03-07-2015 07:25 AM

<<< ref. post #896.

Please do not quote entire posts. A "one word reference" will do.

? Why show the usual / normal / OK output from 'make install' ?

<<< #895 : No Hardy packages are required.
Please stop using outdated information.
Instructions were valid the day the were written.
OSs are updated, old links disappear : New instructions must be used.


-

Aska123 03-07-2015 09:56 AM

Quote:

Originally Posted by knudfl (Post 5328280)
Ref. posts #890 ... #893.

You are using the wrong executable 'ns'.
$
And delete any 'ns' PATH settings you may have in .bashrc.

-

After deleting ns path from .bashrc, my leach set up is running successfully. I have results in leach.out

Thanks a lot again.

Thanks

tuongpx 03-11-2015 10:56 PM

Quote:

Originally Posted by emprit (Post 5324995)
Code:

tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns wireless.tcl
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)

dont use ns wireless.tcl
but use ./test
why ? because ./test will start scrip leach_test
on leach_test include
Code:

#This is the algorithm that we are going to run. Type leach, leach-c, stat-clus or pegasis
alg=leach-c
#dirname, filename = 
#  The directory and filename that we want our output to be written.
dirname="mit/leach_sims"
filename=$alg

and
Code:

ns tcl/ex/wireless.tcl  \
-sc mit/uAMPS/sims/nodescen.tcl \
-rp $alg \
-x $x \
-y $y \
-nn $nn \
-stop $stop \
-eq_energy $eq_energy \
-init_energy $init_energy \
-filename $filename \
-dirname $dirname \
-topo $topology_file \
-num_clusters $num_clusters \
-bs_x $bs_x \
-bs_y $bs_y 2>$dirname/$filename.err 1>$dirname/$filename.out &

u see $filename=$alg , so if u start wireless.tcl alone this mean $filename is empty

so almost at all value in wireless.tcl include from leach_test in ./test

Hi emprit,
I had implemented with your command but I has another issue. Please help me.

Quote:

tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ ns tcl\ex\wireless.tcl \
> -sc mit/uAMPS/sims/nodescen.tcl \
> -rp $alg \
> -x $x \
> -y $y \
> -nn $nn \
> -stop $stop \
> -eq energy $eq_energy \
> -init _energy $init_energy \
> -filename $filename \
> -dirname $dirname \
> -topo $topology_file \
> -num_clusters $num_clusters \
> -bs_x $bs_x \
> -bs_y $bs_y 2>$dirname/$filename.err 1>$dirname/filename.out &
[1] 2345
tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$ bash: /.err: Permission denied

[1]+ Exit 1 ns tcl\ex\wireless.tcl -sc mit/uAMPS/sims/nodescen.tcl -rp $alg -x $x -y $y -nn $nn -stop $stop -eq energy $eq_energy -init _energy $init_energy -filename $filename -dirname $dirname -topo $topology_file -num_clusters $num_clusters -bs_x $bs_x -bs_y $bs_y 2> $dirname/$filename.err > $dirname/filename.out
tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34/tcl/ex$

tuongpx 03-11-2015 11:18 PM

Quote:

Originally Posted by Rizwanamalek (Post 5324754)
Code:

[root@localhost ex]# ns wireless-demo-csci694.tcl
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_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...
[root@localhost ex]#

What you mean by starting command in test and leach_test ?

Hi Rizwanamalek,

I had try with "ns wireless-demo-csci694.tcl" and the result similar to your result. But when I try with the bellow command, it show "Permission denied". Can you help me !
Quote:


tuongpx@ubuntu:~/ns-allinone-2.34/ns-2.34$ ./test
bash: ./test: Permission denied



All times are GMT -5. The time now is 03:44 AM.