LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-13-2010, 04:44 AM   #1
anjon.sunny
LQ Newbie
 
Registered: Aug 2010
Posts: 4

Rep: Reputation: 0
how to install leach patch in ns2.34 in ubuntu 9.10


I am working on wsn security. I need to include the leach protocol as my model is hierarchial.

I have found many threads about patching leach in ns2.27...

But i need to know how can i include patch of leach in ns2.34 in ubuntu 9.10 ????

sunny
 
Old 08-13-2010, 06:40 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ. .. .. ..

Build instructions, ns-allinone-2.27, Ubuntu 9.XX, post #3 :
http://www.linuxquestions.org/questi...10-a-782356/#3

LQ member @ emtarik05 has ported the leach code (mit.tar.gz) to ns-2.34.
EDIT : Latest package + instructions + install script, #5 here, by @MayTamer
http://www.linuxquestions.org/questi...34-a-870368/#5

(( Patch / package name, old version : tarik-ns234-leach.tar.bz2 ))
EDIT : see above. (( https://docs.google.com/leaf?id=0B7S...ut=list&num=50 ))

The @emtarik05 posts : #68, #78, #88
http://www.linuxquestions.org/questi...379/page6.html
..
Attached Files
File Type: txt README-leach-ns234.html.txt (3.0 KB, 120 views)

Last edited by knudfl; 04-05-2011 at 12:37 PM.
 
Old 08-14-2010, 03:00 AM   #3
anjon.sunny
LQ Newbie
 
Registered: Aug 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
Welcome to LQ. .. .. ..

Build instructions, ns-allinone-2.27, Ubuntu 9.XX, post #3 :
http://www.linuxquestions.org/questi...10-a-782356/#3

LQ member @ emtarik05 has ported the leach code (mit.tar.gz) to ns-2.34.
Patch / package name : Tarik_ben__1_9__USTHB_leach_for_NS2.34.tar.bz2
http://rapidshare.com/files/41269753...NS2.34.tar.bz2

The @emtarik05 posts : #68, #78, #88
http://www.linuxquestions.org/questi...379/page6.html
..
I am following the instructions now. I am working on it.
 
Old 08-14-2010, 05:31 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
I am working on it.
Thank you. I have been asked for further instructions by another
LQ member. May be you will write your personal HOWTO in a
follow up post ? That will be very much appreciated.
EDIT : A HOWTO "leach on ns-2.34" is now available
http://www.linuxquestions.org/questi...34-a-870368/#5

Thanks in advance.
..

Last edited by knudfl; 04-05-2011 at 12:41 PM.
 
Old 08-15-2010, 03:47 AM   #5
anjon.sunny
LQ Newbie
 
Registered: Aug 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by knudfl View Post
Welcome to LQ. .. .. ..

Build instructions, ns-allinone-2.27, Ubuntu 9.XX, post #3 :
http://www.linuxquestions.org/questi...10-a-782356/#3

LQ member @ emtarik05 has ported the leach code (mit.tar.gz) to ns-2.34.
Patch / package name : Tarik_ben__1_9__USTHB_leach_for_NS2.34.tar.bz2
http://rapidshare.com/files/41269753...NS2.34.tar.bz2

The @emtarik05 posts : #68, #78, #88
http://www.linuxquestions.org/questi...379/page6.html
..


when i was patching it showed.

sunny@sunny-laptop:~/simulator/ns-allinone-2.27/tk8.4.18$ patch -p0 < tk-8.4-lastevent.patch
patching file generic/tk.h
Hunk #1 FAILED at 635.
1 out of 1 hunk FAILED -- saving rejects to file generic/tk.h.rej



the otcl was patched without prblm.

I installed ns2.27 without any problem.
Then i set the environment variable in ~/.bashrc
I add the variables after the environment variables of ns2.34


Then i became confused.

Should I use

the mit.tar.gz or
Tarik_ben__1_9__USTHB_leach_for_NS2.34

in ns2.27 ?

Then will do the next steps starting from step3 as here:

http://cypress.tistory.com/entry/ns2-227-ubuntu

But again i am saying that should i use

mit.tar.gz or
Tarik_ben__1_9__USTHB_leach_for_NS2.34 ??

Then at step 6 i will do only :
make -f 1-LEACH-Makefile-modified

Then i will

# make clean
# make

Then ./test or ./leach_test


Pls tell me if i am wright or wrong ?

Another question, how i will do this as said following and when :

"the leach modified to run under NS-2.34
create a shortcut of leach.tcl, leach-c.tcl ... and put them on ..\tcl\mobility\"


waiting for you reply eagerly

but in the meantime i am including mit.tar.gz as said in ns2leach.pdf(i think u saw it).

after "make clean" i put the Makefile from http://www.internetworkflow.com/downloads/ns2leach/
in ns2.27 dir and then make, but it showed me an error like this:



sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ make
g++ -c -g -Wall -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -fsigned-char -fno-inline -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_8 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DMIT_uAMPS -I. -I/usr/X11R6/include -I/home/Administrator/ns-allinone-2.27/tclcl-1.15 -I/home/Administrator/ns-allinone-2.27/otcl-1.8 -I/home/Administrator/ns-allinone-2.27/include -I/home/Administrator/ns-allinone-2.27/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./mit/rca -I./mit/uAMPS -o tools/random.o tools/random.cc
In file included from tools/random.cc:40:
./config.h:60:19: error: tclcl.h: No such file or directory
In file included from tools/random.h:42,
from tools/random.cc:41:
tools/rng.h:103: error: expected class-name before ‘{’ token
tools/rng.h:342: error: ‘FILE’ has not been declared
tools/random.cc: In function ‘long int random()’:
tools/random.cc:53: error: ‘printf’ was not declared in this scope
make: *** [tools/random.o] Error 1
sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$



I alse tried as u said :

make -f 1-LEACH-Makefile-modified

It also showed error like this :


sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ make -f 1-LEACH-Makefile-modified
g++33 -c -g -Wall -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR -fsigned-char -fno-inline -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_8 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCL_H -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DMIT_uAMPS -I. -I/usr/X11R6/include -I/home/Administrator/ns-allinone-2.27/tclcl-1.15 -I/home/Administrator/ns-allinone-2.27/otcl-1.8 -I/home/Administrator/ns-allinone-2.27/include -I/home/Administrator/ns-allinone-2.27/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./mit/rca -I./mit/uAMPS -o tools/random.o tools/random.cc
make: g++33: Command not found
make: *** [tools/random.o] Error 127
sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$







What can i do now ?

Last edited by anjon.sunny; 08-15-2010 at 04:28 AM.
 
Old 08-15-2010, 05:06 AM   #6
anjon.sunny
LQ Newbie
 
Registered: Aug 2010
Posts: 4

Original Poster
Rep: Reputation: 0
After make -f 1-LEACH-Makefile-modified(i changed the Administrator to my homedirectory)

it says many things but at last :

bin/string2c.tcl version_string < VERSION > gen/version.c
bin/string2c.tcl: 5: gets: not found
bin/string2c.tcl: 6: puts: not found
make: *** [gen/version.c] Error 127
sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$

But then i run ./test it says:

sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$ ./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...
./test: line 5: ./leach_test: No such file or directory
sunny@sunny-laptop:~/simulator/ns-allinone-2.27/ns-2.27$
 
Old 08-15-2010, 05:34 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Means : OK ( like you probably can see in the below link.)

""./test: line 5: ./leach_test: No such file or directory""
Please use the edited script :
http://www.linuxquestions.org/questi...27-a-785379/#6

And please read all six threads tagged 'leach'.
There may be some good hints. LQ Search > 'Tag Name' = leach
..
 
Old 08-15-2010, 01:09 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
"1 out of 1 hunk FAILED" : It just means, we do not edit this line.
Has already been edited. (I.e. the patch was made for e.g. tk8.4.5).

NS-2.27 : only the "mit.tar.gz" files are used.

NS-2.34 : May be some "mit" files are used ?
Please ask @ nour-eddine or @ emtarik05.
..
 
Old 04-30-2014, 01:48 AM   #9
shahidz
LQ Newbie
 
Registered: Mar 2014
Posts: 16

Rep: Reputation: Disabled
Unhappy leach leachC simulation

sir i changed the file name according to exidus thread #289 but the result of leach-c is not the right one ,leach work well,problem with leach-c
we changed "alg" in leach_test;
#This is the algorithm that we are going to run. Type leach, leach-c, stat-clus or pegasis
alg=leach-c
and
leach-c.err file has mac/chanel.cc: INITIALIZE THE LIST xListHead
and my leach-c.tr file is emty..
Thanks

Last edited by shahidz; 04-30-2014 at 01:55 AM.
 
Old 04-30-2014, 04:05 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 9, @shahidz :

Do not use old threads for your questions.
Read the date, post #8 : 08-15-10, 20:09 → means year 2010.


! Ask a moderator : That's the `Reportī button.
To get your questions in old dead threads moved to a new @shahidz thread.


That includes #11 here http://www.linuxquestions.org/questi...0-a-799883/#11

-
 
  


Reply

Tags
leach, ns2, ns234, wsn



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
installing leach patch in ns2.34 in ubuntu9.10 g_vaibh Ubuntu 19 04-09-2015 09:43 AM
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
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
NS2.34 won't install on ubuntu 9.10 insync Linux - Wireless Networking 1 02-25-2010 02:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:20 PM.

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