LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to install leach patch in ns2.34 in ubuntu 9.10 (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-install-leach-patch-in-ns2-34-in-ubuntu-9-10-a-825970/)

anjon.sunny 08-13-2010 04:44 AM

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

knudfl 08-13-2010 06:40 AM

1 Attachment(s)
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
..

anjon.sunny 08-14-2010 03:00 AM

Quote:

Originally Posted by knudfl (Post 4065076)
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.

knudfl 08-14-2010 05:31 PM

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.
..

anjon.sunny 08-15-2010 03:47 AM

Quote:

Originally Posted by knudfl (Post 4065076)
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 ?

anjon.sunny 08-15-2010 05:06 AM

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$

knudfl 08-15-2010 05:34 AM

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
..

knudfl 08-15-2010 01:09 PM

"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.
..

shahidz 04-30-2014 01:48 AM

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

knudfl 04-30-2014 04:05 AM

# 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

-


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