LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-30-2012, 08:57 AM   #16
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled

@knudfl:

I started with new unpacked ns-allinone-2.34.tar.gz but i tried it by putting it in /opt/ so that i can install leach (http://www.linuxquestions.org/questi...34-a-870368/#5) then the above problem occurs but if i put ns-allinone-2.34.tar.gz in to my home directory then it worked. Why it behaved like this? Then how can i install leach in ns2.34 using the instructions given by (http://www.linuxquestions.org/questi...-a-870368/#5)?
 
Old 03-30-2012, 09:12 AM   #17
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
# 16.

The latest instructions : Use the script "leach-HOME-setup234.sh", post #11 :
http://www.linuxquestions.org/questi...a13-907076/#11
( And don't forget the new cmu-trace.h : Post # 9 in the above link.)

... It is much more convenient to have all ns2 in /home/<name>/ ,
which is the default location.
All commands can then be done as unprivileged user.

It's just more difficult to handle an ns2 install, not in /home/<name>/.

.
 
Old 03-30-2012, 09:51 AM   #18
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl:
Thanks. I downloaded the leach-HOME-setup234.sh.txt and cmu-trace.h.txt. But when and where i have to use this two files in the instructions given by MayTamer?

In http://www.linuxquestions.org/questi...a13-907076/#11 you told " No manual changing Makefile etc. etc. Does that mean that i can ignore the step 6 of B]MayTamer[/B] instructions if i use above files?
 
Old 03-30-2012, 10:05 AM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
# 18

I guess that a Makefile.in is included. Will generate a new Makefile.
( I am not at a Linux Computer right now, and can't check.)

Using : You have ns-allinone-2.34/, and ns-234-leach.tar* and the script
in /home/<name>/.

Just use the command : sh leach-HOME-setup234.sh(.txt),
and everyting will be copied to the right locations.
( Please read the script.)

.
 
Old 03-31-2012, 03:09 AM   #20
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl:
I followed the following steps:

1. I installed the ns2.34 in /home/<name>. That means the ns-allinone-2.34 folder, ns-234-leach.tar.gz, and leach-HOME-setup234.sh were in /home/<name>.
2. i used the command : sh leach-HOME-setup234.sh in /home/<name>/.
3. i put the cmu-trace.h in /home/<name>/ns-234-leach/trace/
4.i followed the 5,6 and 7(first part) steps of May Tamer

But the problem is that when i use make command then the following error occurs
-------------------------------------------
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
----------------------------------------------------
What is the problem? Could you please help me to solve this?
 
Old 03-31-2012, 05:27 AM   #21
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
#20

Quote:
3. I put the cmu-trace.h in /home/<name>/ns-234-leach/trace/
! cmu-trace.h location : ns-allinone-2.34/ns-2.34/trace/ !

Quote:
4. I followed the 5,6 and 7(first part) steps of May Tamer
Not required. Use :
cd ns-allinone-2.34/ && export CC=gcc41 CXX=g++41 && reboot && ./install

.
 
Old 03-31-2012, 09:51 AM   #22
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl:
successful. Thanks a lot. Without your help it would be very tough for me to complete.Do you have the modified MIT LEACH on NS2.34 by emtarik05 ? (http://www.linuxquestions.org/questi...ml#post3905507). I mailed him but no response.If you have, could you please send me the all necessary documents? Thanks a lot again.
 
Old 03-31-2012, 12:10 PM   #23
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
# 22

Quote:
Do you have the modified MIT LEACH on NS2.34 by emtarik05
You already have the files : ns-234-leach.tar.gz, from May Tamer.
Difference : The original package from emtarik05 :
The files were not sorted into folders. And no Makefile.in ( If I remember right.)
... Please see for yourself ..
https://docs.google.com/open?id=0B7S...emYyZEQ5NWNQZw
>>> tarik-ns234-leach.tar.bz2
 
Old 04-04-2012, 06:03 AM   #24
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl :After visiting and observing several posts in this forum and with your help, I followed the following steps to run ns2.34 and leach on ubuntu 10.10. Please verify my steps whether these are right or wrong.

Steps to install ns2.34 on ubuntu10.10
at first stay into your home directory(/home/kowsar/-- here kowsar is my home folder)
1. use : sudo apt-get install g++ make autoconf automake libtool libxmu-dev
2. use : sudo dpkg -i gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb (for this download gcc41-compat-4.1.2_i386.deb g++41-compat-4.1.2_i386.deb)
3. put ns-allinone-2.34.tar.gz , ns-234-leach.tar.gz, leach-HOME-setup234.sh, cmu-trace.h, tk-8.4-lastevent.patch into /home/kowsar/
4. use : gunzip ns-allinone-2.34.tar.gz
5. use : tar -xvf ns-allinone-2.34.tar
6. goto ns-allinone-2.34 folder by typing: cd ns-allinone-2.34
7. use : export CC=gcc41 CXX=g++41
8. use(configuring nam) : copy tk-8.4-lastevent.patch from home into cd ns-allinone-2.34/tk8.4.18/
a. 'tk' is to be compiled with the 'tk-8.4-lastevent.patch' (patch p0 < tk-8.4-lastevent.patch)
b. the output will be
patching file p0
Hunk #1 FAILED at 635.
1 out of 1 hunk FAILED -- saving rejects to file p0.rej
c. use : cd.. to back to ns-allinone-2.34 folder
9. use : cd nam-1.14/ && sudo make install
Then you get /usr/local/bin/nam
10. use : ./install
11. use the followings in ns-allinone-2.34 folder:
a. use : PATH=$PATH:$HOME/bin:/home/kowsar/ns-allinone-2.34/bin:/home/kowsar/ns-allinone-2.34/tcl8.4.18/unix:/home/kowsar/ns-allinone- 2.34/tk8.4.18/unix (so that you'll be able to run itm/tclsh/wish/xgraph.)
b. use : export LD_LIBRARY_PATH=/home/kowsar/ns-allinone-2.34/otcl-1.13/:/home/kowsar/ns-allinone-2.34/lib
c. use : export TCL_LIBRARY=/home/kowsar/ns-allinone-2.34/tcl8.4.18/library (Otherwise ns/nam will complain during startup.)
12. use : cd ns-allinone-2.34/ns-2.34/ && ./validate to check the installation of ns2.34.
13. Finally the output will be –
validate overall report: all tests passed
I performed all the steps and got the above output (step 13) for the first 2 times but after that in step 9 sudo make install does not work. I think the install file is not found.

Steps to install LEACH on ns2.34 on ubuntu10.10
1. goto home directory(/home/kowsar/) by typing: cd ..
2. use command : bash leach-HOME-setup234.sh
3. use : cd ns-allinone-2.34/ns-2.34/trace/
4. put the cmu-trace.h in trace directory
5. use cd .. to go to ns-2.34
6. Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.3
CPP = g++-4.3
7. run the following commands (into the ns-2.34 folder)
./configure
make clean
make
8. If the previous commands passed successfully then you are ready to test your "Leach" by running ./test : use : chmod +x test
9. now use : ./test

The wireless-demo-csci694.tcl in test file works and i can see the simulation using nam but ./leach_test does not work because the leach.err shows the following error and the leach.out shows nothing in /ns-allinone-2.34/ns-2.34/mit/leach_sims/
----------------------------------------------------------------------------------------------------------------
couldn't read file "/home/kowsar/ns-allinone-2.27/ns-2.27/mit/uAMPS/ns-ranode.tcl": no such file or directory
while executing
"source.orig /home/kowsar/ns-allinone-2.27/ns-2.27/mit/uAMPS/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 $env(uAMPS_LIBRARY)/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 9)
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 might be the problem? are my steps correct? Why the error is /home/kowsar/ns-allinone-2.27/ns-2.27/mit/uAMPS/ns-ranode.tcl ? As i do not use any ns-allinone-2.27? Need your help..

Last edited by auvikuet; 04-04-2012 at 06:05 AM.
 
Old 04-04-2012, 06:24 AM   #25
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
#24

The files were ported from ns-2.27 to ns-2.34.
Some files obviously still use the word "ns-2.27".
Just edit the text to read ns-2.34.

Easy to find files, lines with 'grep' : cd ns-allinone-2.34/ns-2.34/
&& 'grep -in ns-2.27 <path+filename>'
Or : grep -inR ns-2.27 *

.
 
Old 04-04-2012, 06:53 AM   #26
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl :
after using grep -inR ns-2.27 * in ns-allinone-2.34 folder I found the following lines. The first one is a html page and in the last three lines ns-2.27 is in comment.Found nothing that is still using ns-2.27.Need help.

ns-2.34/CHANGES.html:564:<hr> <h3> ns-2.27 Released on Sun Jan 18 11:40:19 PST 2004 </H3>
ns-2.34/tcl/test/test-suite-tmix.tcl:83: Agent/TCP set minrto_ 1; # ns-2.27 value
ns-2.34/tcl/test/test-suite-delaybox.tcl:76: Agent/TCP set minrto_ 1; # ns-2.27 value
ns-2.34/tcl/test/test-suite-packmime.tcl:84: Agent/TCP set minrto_ 1; # ns-2.27 value
 
Old 04-04-2012, 09:05 AM   #27
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,536

Rep: Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506Reputation: 2506
#26 : Quote from post # 24 :
Quote:
11. use the followings in ns-allinone-2.34 folder:
a. use : PATH=$PATH:$HOME/bin:/home/kowsar/ns-allinone-2.34/bin:/home/kowsar/ns-allinone-2.34/tcl8.4.18/unix:/home/kowsar/ns-allinone- 2.34/tk8.4.18/unix (so that you'll be able to run itm/tclsh/wish/xgraph.)
b. use : export LD_LIBRARY_PATH=/home/kowsar/ns-allinone-2.34/otcl-1.13/:/home/kowsar/ns-allinone-2.34/lib
c. use : export TCL_LIBRARY=/home/kowsar/ns-allinone-2.34/tcl8.4.18/library (Otherwise ns/nam will complain during startup.)
Not required on Linux. 'ns' is hard coded to know where its libraries are located.
Imagine having 10 different installs of ns-allinone-2.xx : No paths can be set.
They will nevertheless all work OK.

The "ns-2.27 path / text issue" :
May be you have an old text in your .bashrc from an ns-2.27 install ?

.

Last edited by knudfl; 04-04-2012 at 09:14 AM.
 
Old 04-04-2012, 01:24 PM   #28
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl :
Thank for your suggestion. The above error #24 is solved. Now after running the test file or leach_test file the following error is occurring.How can i solve this?
-------------------------------------------------
can't read "env(RCA_LIBRARY)": no such variable
while executing
"source $env(RCA_LIBRARY)/ns-ranode.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 9)
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)
 
Old 04-05-2012, 10:32 AM   #29
auvikuet
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
@knudfl :
I have the following error in leach.err. need help...
----------------------------------------------------------------
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/kowsar/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /home/kowsar/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/kowsar/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)
 
Old 04-12-2012, 04:39 AM   #30
prajwal.parihar
LQ Newbie
 
Registered: Apr 2012
Posts: 4

Rep: Reputation: Disabled
Leach protocpl

Hi, I am newbie on ns2 please tell me if you can help me with developing LEACH protocol on ns 2.34 environment.I also want to write a code for performing communication between the 50 node using LEACH protocol.
 
  


Reply

Tags
leach, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 05:53 PM
patch for working leach protocol in ns2.34 fedora rajcek Linux - Wireless Networking 4 02-04-2013 06:59 AM
LEACH protocol installation on NS2.27 Scofield Linux - General 255 03-08-2012 05:19 PM
codes for leach protocol in ns2 shaddrack yaw nusenu Linux - Newbie 2 02-23-2011 02:56 PM


All times are GMT -5. The time now is 10:05 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration