LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-14-2013, 01:44 AM   #1
Pavith
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Rep: Reputation: Disabled
Unhappy 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.
 
Old 02-14-2013, 01:55 AM   #2
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
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).

-
 
Old 02-14-2013, 02:04 AM   #3
Pavith
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thumbs up Thank u!

i m using fedora.. 32- bit..
i m not sure abt which version this is
 
Old 02-14-2013, 02:15 AM   #4
Pavith
LQ Newbie
 
Registered: Feb 2013
Posts: 9

Original Poster
Rep: Reputation: Disabled
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?
 
Old 06-25-2013, 11:51 PM   #5
goldking123
LQ Newbie
 
Registered: Jun 2013
Location: Kanpur
Posts: 26

Rep: Reputation: Disabled
Question Needed Help to install Leach

Quote:
Originally Posted by knudfl View Post
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.
 
Old 06-26-2013, 06:27 AM   #6
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
# 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' ).

-
 
1 members found this post helpful.
Old 06-27-2013, 06:42 AM   #7
goldking123
LQ Newbie
 
Registered: Jun 2013
Location: Kanpur
Posts: 26

Rep: Reputation: Disabled
Executed successfully but no output

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.
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2013-06-27 17:11:14.png
Views:	61
Size:	233.1 KB
ID:	12814  

Last edited by goldking123; 06-27-2013 at 07:06 AM.
 
Old 06-27-2013, 07:40 AM   #8
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
# 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/

-

Last edited by knudfl; 06-27-2013 at 07:50 AM.
 
1 members found this post helpful.
Old 06-27-2013, 08:33 AM   #9
goldking123
LQ Newbie
 
Registered: Jun 2013
Location: Kanpur
Posts: 26

Rep: Reputation: Disabled
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.
 
Old 06-27-2013, 04:17 PM   #10
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
# 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!!"

-
 
1 members found this post helpful.
Old 06-28-2013, 02:58 AM   #11
goldking123
LQ Newbie
 
Registered: Jun 2013
Location: Kanpur
Posts: 26

Rep: Reputation: Disabled
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.
 
Old 06-28-2013, 04:03 AM   #12
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
# 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.

-
 
1 members found this post helpful.
Old 06-28-2013, 04:38 AM   #13
goldking123
LQ Newbie
 
Registered: Jun 2013
Location: Kanpur
Posts: 26

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

Last edited by goldking123; 06-28-2013 at 06:13 AM. Reason: want to add
 
Old 06-28-2013, 05:56 AM   #14
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
# 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

-
 
2 members found this post helpful.
Old 06-28-2013, 07:07 AM   #15
goldking123
LQ Newbie
 
Registered: Jun 2013
Location: Kanpur
Posts: 26

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


Reply

Tags
leach, 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
how to implement leach in ns2.34 in fedora13 charanya Linux - Wireless Networking 37 11-24-2013 08:51 AM
Leach Protocol for ns2.34 pushpita Linux - Software 36 07-08-2013 04:06 AM
LEACH protocol in ns2 swtjeeva Linux - Software 3 09-04-2012 12:53 PM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM

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

All times are GMT -5. The time now is 09:32 AM.

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