LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (http://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   NS2 simulation to implement LEACH protocol (http://www.linuxquestions.org/questions/linux-wireless-networking-41/ns2-simulation-to-implement-leach-protocol-4175450095/)

Pavith 02-14-2013 01:44 AM

NS2 simulation to implement LEACH protocol
 
Im trying to implement Leach protocol in ns2.34. i dont know much about this protocol.Is it possible to implement it in ns 2.34 ? and i need an example program which i could execute using ns 2.34 and understand this protocol.

knudfl 02-14-2013 01:55 AM

Welcome to LQ.

LEACH : LQ Search → Tag = leach
http://www.linuxquestions.org/questi...34-a-870368/#5
ns-234-leach.tar.gz https://docs.google.com/uc?id=0BzLWx...CNWG1NQK&hl=en

cmutrace.h http://www.linuxquestions.org/questi...ra13-907076/#9

Setup leach in /home/<name>/ >>> leach-HOME-setup234.sh >>>
http://www.linuxquestions.org/questi...a13-907076/#11

? Any questions ? Then please specify your OS. Name and version, please.
Note : ns2 is for a 32bits OS (i686).

-

Pavith 02-14-2013 02:04 AM

Thank u!
 
i m using fedora.. 32- bit..
i m not sure abt which version this is

Pavith 02-14-2013 02:15 AM

thank u again!!!
 
i m using fedora 16...

and i wish to uninstall ns2, because i think it is not working properly..
and install it again..

can u tel me how to uninstall it?

goldking123 06-25-2013 11:51 PM

Needed Help to install Leach
 
Quote:

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

LEACH : LQ Search → Tag = leach
http://www.linuxquestions.org/questi...34-a-870368/#5
ns-234-leach.tar.gz https://docs.google.com/uc?id=0BzLWx...CNWG1NQK&hl=en

cmutrace.h http://www.linuxquestions.org/questi...ra13-907076/#9

Setup leach in /home/<name>/ >>> leach-HOME-setup234.sh >>>
http://www.linuxquestions.org/questi...a13-907076/#11

? Any questions ? Then please specify your OS. Name and version, please.


Note : ns2 is for a 32bits OS (i686).

-

Dear sir,
Please help me. i installed ns 2.34 successfully and configured all files as you said. but when i try to execute ./configure file it shows access denied in configure file line number 1520 and 1530. please rectify my error.

my os is ubuntu 12.04 and my system 64bit processor.

knudfl 06-26-2013 06:27 AM

# 5 .

"access denied in configure file line number 1520" :
Maybe you have used a "sudo command" for something ?

Solution : Start from scratch in a new directory like /home/name/ns2/,
and $ cd ns2/ ; tar xvf ns-allinone-2.34.tar.gz ; Etc. etc.
... And do not use sudo for any command :
All ns2 commands are "unprivileged user commands".
( Except 'sudo make install' ).

-

goldking123 06-27-2013 06:42 AM

Executed successfully but no output
 
1 Attachment(s)
Dear sir,

The leach finally configured successfully but after giving ./test nothing is made change in screen. no leach_test.out is created. no leach_test.err file also created. at the time of make in only saw some warning as in below.

and for ./test also it shows nothing error.

please help me in this regards.

if you have time means please give me a complete step by step procedure to install it correctly. and also tell to me how i can use that out file to get the simulation because i am new to ns2 sir. i am very kind of you.

knudfl 06-27-2013 07:40 AM

# 7 .

The output from './test' is : ns-2.34/mit/leach_sims/{leach.err, leach.out}.
Quote : " ./test nothing is made change in screen."
Please rephrase : What do you mean ? What did you expect to appear ?
And please do not write everything in one line .... :
Quote:

The leach finally configured successfully.
But after giving $ ./test ,
nothing is made change in screen.
No leach_test.out is created.
No leach_test.err file also created.
At the time of make in only saw some warning as in below.
This is a test in an ns-2.34/, patched with pegasis + leach :
Code:

$ ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl                                                                                           
warning: no class variable Phy/WirelessPhy::alive_
see tcl-object.tcl in tclcl for info about this warning.
.
.
Loading connection pattern...
Loading scenario file...
Starting Simulation...
mac/channel.cc: sendUp - Calc highestAntennaZ_ and distCST_
mac/channel.cc: highestAntennaZ_ = 1.5,  distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...

The "exidus-pegasis-leach-ns234.patch.tar.gz" is the latest LEACH for ns-2.34.
And it's my impression that it will provide the best "leach build".
Suggest : Set up another ns-allinone-2.34/ in a new folder, and try it out.
Pegasis + leach http://www.linuxquestions.org/questions/tags/pegasis/

-

goldking123 06-27-2013 08:33 AM

my leach.err file data
 
Dear sir,

i am getting the following error in the leach_test.err file. please help me.

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/kraj/ns234/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/kraj/ns234/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/kraj/ns234/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 30)
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)


what can i do now?

thanks in advance.

knudfl 06-27-2013 04:17 PM

# 9 .
Quote:

invalid command name "Resource/Energy"
That's why I suggest "The other leach patch".
"Exidus-pegasis-leach" was carefully built by LQ member @exidus :
#289 here http://www.linuxquestions.org/questi...68/page20.html
.. And # 425, same link. Etc. etc.

Easier to use / build. No errors.
The original "leach only" : A failed build is quite common.

Exidus-pegasis-leach :
ns-2.34/mit/leach_sims/test_simulations/leach/leach.err has this text :
"mac/chanel.cc: INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!!"

-

goldking123 06-28-2013 02:58 AM

How to install the file sir : leach and leach c
 
Dear sir,

For installation i can follow the same step like leach installation ?

please suggest me the steps to install sir.

Thanks in advance.

knudfl 06-28-2013 04:03 AM

# 11 .

When you follow the link in post # 8
http://www.linuxquestions.org/questions/tags/pegasis/
... then you will find ..
http://www.linuxquestions.org/questi...219/page2.html
>> post # 17 : With the very easy build instructions.

-

goldking123 06-28-2013 04:38 AM

unable to understand the step help me sir
 
Dear sir,

please give me direction to install step by step

i am little bit confused by seeing the steps.

whether i want install ns2 or not?

whether i place the exidus code inside ns2.34 folder or outside itself because there written as place in ns_allone folder itself.

please help me sir.

finally i tried with same leach procedure but i got the following error.


kraj@ubuntu:~/Desktop/ns234/ns-allinone-2.34/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...
./leach_test: line 37: mit/leach_sims/pegasis.err: No such file or directory

help me please

knudfl 06-28-2013 05:56 AM

# 13 .

1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/
3) tar xvf exidus-pegasis-leach-ns234.patch.tar.gz
Or 3a)
.. If you have exidus-pegasis-leach-ns234.patch.tar.gz in another location :
tar xvf <path-to-folder-with-exidus*>/exidus-pegasis-leach-ns234.patch.tar.gz
4) export CC=gcc41 CXX=g++41
5) ./install

-

goldking123 06-28-2013 07:07 AM

how to use pegasis.out file
 
Dear sir,

Thank you for your more valuable helps. i am very kind of you.

now i executed successfully without any issues.please one more help.

i dont know how to use *.out file to see the simulation and graph. please help me sir.

thanks in advance.


All times are GMT -5. The time now is 10:44 PM.