How to apply leach protocol in Wireless Sensor Network Using NS2?

Prerequisites

(i) Ubuntu 12.04, NS-2.35

(ii) Mannism patch files for NS-2.35.Click http://www.nsnam.com/2013/06/mannasima-sensor-network-simulator-for.html  downloaded the Mannasim.tar.gz file for ns-2.35

Integrating Mannasim with NS-2.35
(i) Install NS-2.35 using ns-allinone-.35.tar.gz

(ii) Now move the extracted “mannasim” folder inside the already installed “ns-allinone-2.35/ns-2.35″.

Screenshot

Apply leach protocol in WSN Using NS2

(iii) Copy these files and paste (replace) them in following locations: 

File Copy to
udp.ccns-allinone-2.35/ns-2.35/apps/
ns-process.hns-allinone-2.35/ns-2.35/common/
packet.ccns-allinone-2.35/ns-2.35/common/
packet.hns-allinone-2.35/ns-2.35/common/
ns-default.tclns-allinone-2.35/ns-2.35/tcl/lib/
ns-lib.tclns-allinone-2.35/ns-2.35/tcl/lib/
Makefile.inns-allinone-2.35/ns-2.35/

 

(iv) Go to the terminal and move to the “ns-allinone-2.35/ns-2.35″ directory. Now run the following commands one by one:

./ configure

make clean

make