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/)

pon 09-06-2014 08:47 AM

Hi Knudfl
Kindly take a relax look on this and help me on solution
on executing ./test
i got following err
Quote:

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/chase/ns234/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
I probably finding the answer for this error in following links:
http://www.linuxquestions.org/questi...2-34-a-870368/
[post #2]


and
http://www.linuxquestions.org/questi...368/page9.html
[post # 134]

when i run sudo gedit /etc/apt/sources.list
in sources.list file i m getting as follows,

Quote:

#deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release i386 (20130213)]/ precise main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ precise main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise universe
deb-src http://in.archive.ubuntu.com/ubuntu/ precise universe
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise multiverse
deb http://in.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu precise-security main restricted
deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
deb http://security.ubuntu.com/ubuntu precise-security universe
deb-src http://security.ubuntu.com/ubuntu precise-security universe
deb http://security.ubuntu.com/ubuntu precise-security multiverse
deb-src http://security.ubuntu.com/ubuntu precise-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu precise partner
# deb-src http://archive.canonical.com/ubuntu precise partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
you told to add 'hardy' and post#134 says to add 'maverick' but in that places already i have precise
and also i am not seeing any lines in sources.list like
deb http://76.73.4.58/ubuntu/ ...
deb http://76.73.4.58/ubuntu/ ...

I m not getting exactly what to add and where to add

Thanks

Pon

knudfl 09-06-2014 09:59 AM

# 871 .

No old Ubuntu compilers will work on a contemporary Ubuntu.
So : No `hardy´ (or `maverick´) can be added.
! Do not use old instructions when you have Ubuntu 12.04.

How to build a »leach + ns234« that works ...
http://www.linuxquestions.org/questi...-4175504301/#2

Info : http://www.linuxquestions.org/questions/tags/pegasis/
. http://www.linuxquestions.org/questions/tags/leach/

-

knudfl 09-06-2014 10:07 AM

#867, @pon.
Quote:

when i tried to execute uamps.tcl , it is showing following error
"uamps.tcl" is not a simulation file.

pon 09-09-2014 03:51 AM

hi i used pegesis patch, upon executing test in ns-2.34 directory i am getting error in pegasis.err . but in the following post knudfl mentioned to see err and output in mit/leach_sims/test_simulations/leach/,
mit/leach_sims/test_simulations/leach_2, but there are more files.there is one file leach.err-save in that i am seeing following
mac/chanel.cc: INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!, but upon executing ./test , there is no changes in this file.
Pls tell me exactly where to see output and error in pegasis patched ns-2.34. Are pegasis.err pegasis.out right to see?

Quote:

Originally Posted by knudfl (Post 4969172)
# 471 : Well, you could 1) read the above thread.

2) Have a look in the mit/ folder.

3) Or use the find command : a) $ cd ns-allinone-2.34/
b) $ find ns-2.34/ -name "leach.err"
→ → ./mit/leach_sims/leach.err
b1) $ find ns-2.34/ -name "leach.out"
→ → ./mit/leach_sims/leach.out

If you are using the pegasis patch / files, then leach.err + leach.out
can be found in : mit/leach_sims/test_simulations/leach/,
mit/leach_sims/test_simulations/leach_2/

-


knudfl 09-09-2014 04:30 AM

Ref. #874 .

Selecting simulations : See `leach_test', line 4 - 5 :
#This is the algorithm that we are going to run. 1. leach 2. leach_c 3. pegasis
alg=<algorithm>

I.e. to run pegasis, edit line 5 to alg=pegasis

The results are : ns-allinone-2.34/ns-2.34/mit/leach_sims/ \
{ pegasis.alive, pegasis.alive.txt, pegasis.data, pegasis.data.txt,
pegasis.energy, pegasis.energy.txt, pegasis.err, pegasis.out }.

The file pegasis.err should be two lines :
mac/chanel.cc: INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!

* Please read post #870.

-

pon 09-09-2014 05:49 AM

i am getting err in pegasis.err, since more than 10 days i stuck in this.:scratch:
invalid command name "Resource/Energy"
i am using ubuntu 12.04 and ns-2.34,the following quote suggested to have gcc-4.1.2
is it possible me to install gcc 4.1.2 ?
is it mandatory to get rid of this err. or is there anyother way? almost i read all threads in thread.


Quote:

Originally Posted by knudfl (Post 5085192)
Post # 628, @rajamanjulasetty : Welcome to LQ.

That's a failed build. Better use gcc/g++ version 4.1.2 .

Please read posts #555, #566, #584.



-

Thanks
Pon

pon 09-09-2014 06:00 AM

@ #874 Mr.knudfl,

Already i have alg=pegasis only, i am seeing pegasis.err pegasis.out in mit/leach_sims. but there is no pegasis.alive, pegasis.alive.txt, pegasis.data, pegasis.data.txt,pegasis.energy, pegasis.energy.txt

my leach_test file
Quote:

#!/bin/bash
# This file runs a generic LEACH protocol simulation.

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

#Topology
# This file is the scenario that we are going to
# This file can be editted manually if you are very careful to create
# a predefined topology. To generate a random topology go to the
# ./mit/uAMPS/sims directory and run 'ns genscen'.
topology_file="mit/uAMPS/sims/100nodes_random.txt"

tsabran 10-04-2014 05:33 AM

Similar PEGASIS problem
 
Hi pon
I wonder, did you find any solution to the pegasis problem your facing? My pegasis.out generates incorrect output as the energy stays the same yet the data remains 0 and nodes stays 100.
Thanks!

Quote:

Originally Posted by pon (Post 5234900)
@ #874 Mr.knudfl,

Already i have alg=pegasis only, i am seeing pegasis.err pegasis.out in mit/leach_sims. but there is no pegasis.alive, pegasis.alive.txt, pegasis.data, pegasis.data.txt,pegasis.energy, pegasis.energy.txt

my leach_test file


NAYEFALDAUIS 10-30-2014 08:40 AM

Help in MIT code NS
 
pleas, can anyone make short describe for this files
ns-ranode.tcl
extras.tcl
ns-bsapp.tcl

thanks !

knudfl 10-30-2014 11:57 AM

Post #879, @NAYEFALDAUIS : Welcome to LQ.

* mit/rca/ns-ranode.tcl, mit/uAMPS/extras.tcl, mit/uAMPS/ns-bsapp.tcl
.. are configuration files for running a leach simulation.
Like all files.tcl, they are text files, easy readable.


A) mit/rca/ns-ranode.tcl : .. part of the MIT SPIN project.
. http://spinroot.com/spin/Workshops/w...0_paper_13.pdf
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
. https://drive.google.com/file/d/0B7S...ew?usp=sharing

B) mit/uAMPS/extras.tcl : .. MIT uAMPS
. http://www-mtl.mit.edu/researchgroups/icsystems/uamps/
. https://www.google.com/webhp?hl=all&...+uAMPS+project
§1) Functions to calculate distances.
§2) Computational energy dissipation model
... for beamforming num signals of size bytes / signal.
§3) Miscellaneous printing (output) functions.

C) mit/uAMPS/ns-bsapp.tcl : .. MIT uAMPS
§1) Base Station Application.
§2) Helper Functions.
§3) Receiving Functions
§4) Sending Functions

-

reenkamal 12-11-2014 03:09 AM

problem in leach.out and leach.tr file
 
Hello every body
I have installed ns2.34 in ubuntu 14.04 and then i added leach patch into ns2.34.But when i run command ./leach_test,the generated leach.out and leach.tr simulation is only for 1.09 secs, whereas in ./leach_test file simulation time is set to 3600 secs.
Please help me asap.
thank you.

NAYEFALDAUIS 12-11-2014 04:09 AM

thank you
 
Quote:

Originally Posted by knudfl (Post 5261948)
Post #879, @NAYEFALDAUIS : Welcome to LQ.

* mit/rca/ns-ranode.tcl, mit/uAMPS/extras.tcl, mit/uAMPS/ns-bsapp.tcl
.. are configuration files for running a leach simulation.
Like all files.tcl, they are text files, easy readable.


A) mit/rca/ns-ranode.tcl : .. part of the MIT SPIN project.
. http://spinroot.com/spin/Workshops/w...0_paper_13.pdf
. https://drive.google.com/file/d/0B7S...ew?usp=sharing
. https://drive.google.com/file/d/0B7S...ew?usp=sharing

B) mit/uAMPS/extras.tcl : .. MIT uAMPS
. http://www-mtl.mit.edu/researchgroups/icsystems/uamps/
. https://www.google.com/webhp?hl=all&...+uAMPS+project
§1) Functions to calculate distances.
§2) Computational energy dissipation model
... for beamforming num signals of size bytes / signal.
§3) Miscellaneous printing (output) functions.

C) mit/uAMPS/ns-bsapp.tcl : .. MIT uAMPS
§1) Base Station Application.
§2) Helper Functions.
§3) Receiving Functions
§4) Sending Functions

-

thank you so much >>> relay very helpful

knudfl 12-11-2014 04:29 AM

← Ref. post #881 .

`leach_test' →
Line 25 : # stop is the time to stop the simulation if it is still running
Line 26 : stop=3600
( The latest update :
leach+pegasis-ns234-files-2.tar.gz by @exidus : stop=50 ).

As you can read in line 25 : 3600 (or 50) is just the maximum time.
* The files are ancient.
./test, ./leach_test may have run for a longer time 15 years ago.
Different version of ns2. Slower computers.
With ns-2.34 and a modern computer, and with default parameters :
It's 1 .. 2 seconds.

-

reenkamal 12-11-2014 08:21 PM

[QUOTE=knudfl;5282913]← Ref. post #881 .

Hello sir
I added leach+pegasis patch into ns2.34.firstly everything was going correct but soon i observed that in my trace file leach.tr number of received packets are double or even more than the number of packets sent.
Please tell me why this is happening.
thank you

emprit 02-22-2015 10:34 AM

Quote:

Originally Posted by deepa_2111 (Post 4830794)
@ forco,

eq_energy means that all nodes are allotted the same amount of energy (init_energy). I think the reason why your code is not printing values could be that all nodes are trying to transmit at the same time, leading to collisions and thereby huge energy expenditure. How many nodes do you have in the network ? If you have 100, max energy can only be 200.

Also, note that increasing no. of nodes to beyond 300 causes the LEACH code to stop working/run improperly.

i still confuse with eq_energy, u mean if i have 101node and i need all node get same amount of energy, so i must input eq_energy = 101?


All times are GMT -5. The time now is 12:31 AM.