LEACH Protocol in NS3 .

4045 views
Skip to first unread message

homaei

unread,
Apr 28, 2012, 11:44:28 PM4/28/12
to ns-3-users
how can i config leach protocol in NS3 , ?
i work on Energy efficient based Clustering in WSN.
please help me

Hamza ERRACHDI

unread,
Apr 29, 2012, 4:05:59 PM4/29/12
to ns-3-...@googlegroups.com
salam,
here is the code implimenting  LEACH  on C++. you should do some rectifications and it wil work.
Regards.
Leach.cc

Mansouri Djamel

unread,
Apr 30, 2012, 6:10:10 AM4/30/12
to ns-3-...@googlegroups.com
Merci pour le fichier cordialement djamel

2012/4/29 Hamza ERRACHDI <errachd...@gmail.com>
salam,
here is the code implimenting  LEACH  on C++. you should do some rectifications and it wil work.
Regards.

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

rahul hada

unread,
Oct 26, 2012, 9:40:56 AM10/26/12
to ns-3-...@googlegroups.com, errachd...@gmail.com

Thank You for sharing code for leach , could you please let know , is it possible to simulate wormhole attack for wireless sensor network on ns3.


Regards,

Rahul Hada
India

Mansouri Djamel

unread,
Mar 7, 2013, 3:00:13 PM3/7/13
to ns-3-...@googlegroups.com, errachd...@gmail.com
dear all
 I build  LEACH.cc   it does not  work.
when i tried to compile it using ./waf i got this error message
const.h not found. what can I do?
Regards.

2012/10/26 rahul hada <hada....@gmail.com>
--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/2ypKMX4gc1QJ.

rahul hada

unread,
Mar 8, 2013, 11:39:49 AM3/8/13
to ns-3-...@googlegroups.com
Might be you have to add const.h header file in ns3 folder or some where in the linux environment.


Rahul

You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/OGfl-qBIhpg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.

Mansouri Djamel

unread,
Mar 10, 2013, 4:51:33 PM3/10/13
to ns-3-...@googlegroups.com
HI I'm new user in NS 3, can you help me by giving steps  to compil and build leach  project that you send me .Thank's
2013/3/8 rahul hada <hada....@gmail.com>
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.

rahul hada

unread,
Mar 11, 2013, 12:09:37 AM3/11/13
to ns-3-...@googlegroups.com
I have only studied the leach code and didn't run it on my system.
ns3 manual is best to know procedure of compile and run any protocol.


Rahul

Mansouri Djamel

unread,
Mar 12, 2013, 1:15:53 PM3/12/13
to ns-3-...@googlegroups.com
Hi in which derectory  my I   added const.h

2013/3/11 rahul hada <hada....@gmail.com>

nikhil malhotra

unread,
Oct 24, 2013, 11:42:35 AM10/24/13
to ns-3-...@googlegroups.com
was anyone able to run this program?
I tried... had const.h ... issue which got solved by putting const.h file to the same scratch folder with Leach.cc ... but it had some ref to version.h, which was not declared, so declared all the default variables in program itself... but now I am having error with malloc in line:
line:235  network_LEACH = (struct sensor *) malloc(NUM_NODES * sizeof(struct sensor));         and
line:498  network_DIRECT = (struct sensor *) malloc(NUM_NODES * sizeof(struct sensor));
help me in solving this.
If someone had any success with this or if someone has found any other alternate code for LEACH or GEAR (geographical energy aware routing). please refer it to me or share it here.
thanx
Nikhil

nikhil malhotra

unread,
Oct 24, 2013, 2:08:17 PM10/24/13
to ns-3-...@googlegroups.com
hi all,

I have made some changes in the earlier posted file and m attaching the const.h file also along with it, but when I run this program I am getting following error,

error:
double free or corruption (!prev): 0x0000000001caa170 ***

Please help to get rid of the problem...

regards

Nikhil

On Sunday, 29 April 2012 09:14:28 UTC+5:30, homaei wrote:
const.h
Leach.cc

Hamid BNS

unread,
Feb 28, 2014, 5:25:50 PM2/28/14
to ns-3-...@googlegroups.com
hi
i try to build that but i am getting this error:
Build failed
 -> task in 'leach-example' failed (exit status 1):
    {task 41087312: cxxprogram leach-example.cc.1.o -> ns3-dev-leach-example-debug}
['/usr/bin/g++', '-pthread', 'src/leach/examples/leach-example.cc.1.o', '-o', '/home/hamid-bns/workspace/ns-3-allinone/ns-3-dev/build/src/leach/examples/ns3-dev-leach-example-debug', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-L.', '-L.', '-lns3-dev-leach-debug', '-lns3-dev-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm']

can anyone help me

Tommaso Pecorella

unread,
Feb 28, 2014, 5:31:09 PM2/28/14
to ns-3-...@googlegroups.com
Hi,

the error description is in the lines you didn't post ... :(

T.

Parthiban .B

unread,
Aug 17, 2014, 6:37:32 AM8/17/14
to ns-3-...@googlegroups.com
can anyone upload the .config file specified in this program

Parthiban .B

unread,
Aug 17, 2014, 7:12:41 AM8/17/14
to ns-3-...@googlegroups.com, errachd...@gmail.com
can u post the .config file which is specified in this program.


On Monday, April 30, 2012 1:35:59 AM UTC+5:30, Hamza ERRACHDI wrote:

priya_rishi

unread,
Sep 12, 2014, 2:07:31 AM9/12/14
to ns-3-...@googlegroups.com
i m unable to run leach protocol.i m getting the error********8 'build' finished successfully (2.110s)
*** Error in `/home/bandita/Documents/workspace/ns-allinone-3.20/ns-3.20/build/scratch/Leach': double free or corruption (!prev): 0x0000000001d43900 ***
Command ['/home/bandita/Documents/workspace/ns-allinone-3.20/ns-3.20/build/scratch/Leach'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").******
can anybody help me please.....

Ram B. Agnihotri

unread,
Jan 14, 2015, 3:34:57 AM1/14/15
to ns-3-...@googlegroups.com


On Sunday, 29 April 2012 09:14:28 UTC+5:30, homaei wrote:

while i run leach program i find this error

Waf: Entering directory `/home/brijesh/ns-3-allinone/ns-3.16/build'
[1695/1981] cxx: scratch/Leach.cc -> build/scratch/Leach.cc.2.o
../scratch/Leach.cc:26:17: error: ‘DEFAULT_NUM’ was not declared in this scope
../scratch/Leach.cc:28:17: error: ‘DEFAULT_SIZE’ was not declared in this scope
../scratch/Leach.cc:30:17: error: ‘DEFAULT_SIZE’ was not declared in this scope
../scratch/Leach.cc:32:18: error: ‘DEFAULT_POW’ was not declared in this scope
../scratch/Leach.cc:39:26: error: ‘DEFAULT_PERCENT’ was not declared in this scope
../scratch/Leach.cc:44:20: error: ‘DEFAULT_ROUNDS’ was not declared in this scope
../scratch/Leach.cc:50:28: error: ‘LEACH_AD_DISTANCE_DEFAULT’ was not declared in this scope
../scratch/Leach.cc:55:24: error: ‘LEACH_AD_MESSAGE_DEFAULT’ was not declared in this scope
../scratch/Leach.cc:60:28: error: ‘SCHEDULE_DISTANCE_DEFAULT’ was not declared in this scope
../scratch/Leach.cc:66:24: error: ‘SCHEDULE_MESSAGE_DEFAULT’ was not declared in this scope
../scratch/Leach.cc: In function ‘int main(int, char**)’:
../scratch/Leach.cc:170:25: error: ‘BASE_STATION_X_DEFAULT’ was not declared in this scope
../scratch/Leach.cc:171:25: error: ‘BASE_STATION_Y_DEFAULT’ was not declared in this scope
../scratch/Leach.cc:176:19: error: expected ‘;’ before ‘argc’
../scratch/Leach.cc:176:19: error: for increment expression has no effect [-Werror=unused-value]
../scratch/Leach.cc:176:23: error: expected ‘)’ before ‘;’ token
../scratch/Leach.cc:176:28: error: expected ‘;’ before ‘)’ token
../scratch/Leach.cc:161:25: error: unused variable ‘network’ [-Werror=unused-variable]
../scratch/Leach.cc:164:9: error: unused variable ‘j’ [-Werror=unused-variable]
../scratch/Leach.cc:165:9: error: unused variable ‘rounds_LEACH’ [-Werror=unused-variable]
../scratch/Leach.cc:166:9: error: unused variable ‘rounds_DIRECT’ [-Werror=unused-variable]
../scratch/Leach.cc:167:9: error: unused variable ‘found’ [-Werror=unused-variable]
../scratch/Leach.cc:168:12: error: unused variable ‘average_comparison’ [-Werror=unused-variable]
../scratch/Leach.cc:908:1: error: expected ‘}’ at end of input
cc1plus: all warnings being treated as errors
Waf: Leaving directory `/home/brijesh/ns-3-allinone/ns-3.16/build'
Build failed
 -> task in 'Leach' failed (exit status 1):
    {task 145543788: cxx Leach.cc -> Leach.cc.2.o}
['/usr/bin/g++', '-O0', '-ggdb', '-g3', '-Wall', '-Werror', '-Wno-error=deprecated-declarations', '-fstrict-aliasing', '-Wstrict-aliasing', '-pthread', '-pthread', '-fno-strict-aliasing', '-fwrapv', '-fstack-protector', '-fno-strict-aliasing', '-Ibuild', '-I.', '-I.', '-I/home/brijesh/ns-3-allinone', '-I/usr/include/gtk-2.0', '-I/usr/lib/i386-linux-gnu/gtk-2.0/include', '-I/usr/include/atk-1.0', '-I/usr/include/cairo', '-I/usr/include/gdk-pixbuf-2.0', '-I/usr/include/pango-1.0', '-I/usr/include/gio-unix-2.0', '-I/usr/include/glib-2.0', '-I/usr/lib/i386-linux-gnu/glib-2.0/include', '-I/usr/include/pixman-1', '-I/usr/include/freetype2', '-I/usr/include/libpng12', '-I/usr/include/libxml2', '-I/usr/include/python2.7', '-DNS3_ASSERT_ENABLE', '-DNS3_LOG_ENABLE', '-DHAVE_PACKET_H=1', '-DSQLITE3=1', '-DHAVE_IF_TUN_H=1', '-DENABLE_GSL', '-DNDEBUG', '../scratch/Leach.cc', '-c', '-o', 'scratch/Leach.cc.2.o']
 

Ram B. Agnihotri

unread,
Jan 14, 2015, 3:35:23 AM1/14/15
to ns-3-...@googlegroups.com


On Sunday, 29 April 2012 09:14:28 UTC+5:30, homaei wrote:

Ram B. Agnihotri

unread,
Jan 14, 2015, 4:19:17 AM1/14/15
to ns-3-...@googlegroups.com


when I execute leach.cc in ns3 no xml file is generated. there is error like this

./waf --run scratch/Leach1
Waf: Entering directory `/home/brijesh/ns-3-allinone/ns-3.16/build'
Waf: Leaving directory `/home/brijesh/ns-3-allinone/ns-3.16/build'
'build' finished successfully (2.488s)
*** glibc detected *** /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1: double free or corruption (!prev): 0x096f75a8 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xb44e1ee2]
/usr/lib/i386-linux-gnu/libstdc++.so.6(_ZdlPv+0x1f)[0xb472551f]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804cbaf]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804c919]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804c791]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804c356]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x8049a42]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb44854d3]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x80498a1]
======= Memory map: ========
08048000-0804f000 r-xp 00000000 08:07 1205321    /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1
0804f000-08050000 r--p 00006000 08:07 1205321    /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1
08050000-08051000 rw-p 00007000 08:07 1205321    /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1
096a1000-09704000 rw-p 00000000 00:00 0          [heap]
b3f0b000-b3f14000 rw-p 00000000 00:00 0
b3f14000-b3f19000 r-xp 00000000 08:07 135385     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b3f19000-b3f1a000 r--p 00004000 08:07 135385     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b3f1a000-b3f1b000 rw-p 00005000 08:07 135385     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b3f1b000-b3f1c000 rw-p 00000000 00:00 0
b3f1c000-b3f1e000 r-xp 00000000 08:07 135374     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b3f1e000-b3f1f000 r--p 00001000 08:07 135374     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b3f1f000-b3f20000 rw-p 00002000 08:07 135374     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b3f20000-b3f22000 r-xp 00000000 08:07 1970325    /lib/i386-linux-gnu/libutil-2.15.so
b3f22000-b3f23000 r--p 00001000 08:07 1970325    /lib/i386-linux-gnu/libutil-2.15.so
b3f23000-b3f24000 rw-p 00002000 08:07 1970325    /lib/i386-linux-gnu/libutil-2.15.so
b3f24000-b40b6000 r-xp 00000000 08:07 1970317    /lib/i386-linux-gnu/libcrypto.so.1.0.0
b40b6000-b40c5000 r--p 00192000 08:07 1970317    /lib/i386-linux-gnu/libcrypto.so.1.0.0
b40c5000-b40cc000 rw-p 001a1000 08:07 1970317    /lib/i386-linux-gnu/libcrypto.so.1.0.0
b40cc000-b40cf000 rw-p 00000000 00:00 0
b40cf000-b4120000 r-xp 00000000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b4120000-b4121000 ---p 00051000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b4121000-b4123000 r--p 00051000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b4123000-b4127000 rw-p 00053000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b4127000-b4128000 rw-p 00000000 00:00 0
b4128000-b412b000 r-xp 00000000 08:07 1970339    /lib/i386-linux-gnu/libdl-2.15.so
b412b000-b412c000 r--p 00002000 08:07 1970339    /lib/i386-linux-gnu/libdl-2.15.so
b412c000-b412d000 rw-p 00003000 08:07 1970339    /lib/i386-linux-gnu/libdl-2.15.so
b412d000-b4167000 r-xp 00000000 08:07 1963240    /lib/i386-linux-gnu/libpcre.so.3.12.1
b4167000-b4168000 r--p 00039000 08:07 1963240    /lib/i386-linux-gnu/libpcre.so.3.12.1
b4168000-b4169000 rw-p 0003a000 08:07 1963240    /lib/i386-linux-gnu/libpcre.so.3.12.1
b4169000-b416e000 r-xp 00000000 08:07 135559     /usr/lib/i386-linux-gnu/libffi.so.6.0.0
b416e000-b416f000 r--p 00004000 08:07 135559     /usr/lib/i386-linux-gnu/libffi.so.6.0.0
b416f000-b4170000 rw-p 00005000 08:07 135559     /usr/lib/i386-linux-gnu/libffi.so.6.0.0
b4170000-b4196000 r-xp 00000000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b4196000-b4197000 ---p 00026000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b4197000-b4199000 r--p 00026000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b4199000-b419a000 rw-p 00028000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b419a000-b41b9000 r-xp 00000000 08:07 147197     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b41b9000-b41ba000 r--p 0001f000 08:07 147197     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b41ba000-b41bb000 rw-p 00020000 08:07 147197     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b41bb000-b41bc000 rw-p 00000000 00:00 0
b41bc000-b41c4000 r-xp 00000000 08:07 136243     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b41c4000-b41c5000 r--p 00008000 08:07 136243     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b41c5000-b41c6000 rw-p 00009000 08:07 136243     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b41c6000-b41c8000 r-xp 00000000 08:07 135964     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b41c8000-b41c9000 r--p 00001000 08:07 135964     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b41c9000-b41ca000 rw-p 00002000 08:07 135964     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b41ca000-b41f2000 r-xp 00000000 08:07 1963244    /lib/i386-linux-gnu/libpng12.so.0.46.0
b41f2000-b41f3000 r--p 00027000 08:07 1963244    /lib/i386-linux-gnu/libpng12.so.0.46.0
b41f3000-b41f4000 rw-p 00028000 08:07 1963244    /lib/i386-linux-gnu/libpng12.so.0.46.0
b41f4000-b4289000 r-xp 00000000 08:07 135560     /usr/lib/i386-linux-gnu/libpixman-1.so.0.30.2
b4289000-b428e000 r--p 00095000 08:07 135560     /usr/lib/i386-linux-gnu/libpixman-1.so.0.30.2
b428e000-b428f000 rw-p 0009a000 08:07 135560     /usr/lib/i386-linux-gnu/libpixman-1.so.0.30.2
b428f000-b42a2000 r-xp 00000000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b42a2000-b42a3000 ---p 00013000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b42a3000-b42a4000 r--p 00013000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b42a4000-b42a5000 rw-p 00014000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b42a5000-b42a8000 rw-p 00000000 00:00 0
b42a8000-b42c5000 r-xp 00000000 08:07 1963255    /lib/i386-linux-gnu/libselinux.so.1
b42c5000-b42c6000 r--p 0001c000 08:07 1963255    /lib/i386-linux-gnu/libselinux.so.1
b42c6000-b42c7000 rw-p 0001d000 08:07 1963255    /lib/i386-linux-gnu/libselinux.so.1
b42c7000-b42db000 r-xp 00000000 08:07 1963278    /lib/i386-linux-gnu/libz.so.1.2.3.4
b42db000-b42dc000 r--p 00013000 08:07 1963278    /lib/i386-linux-gnu/libz.so.1.2.3.4
b42dc000-b42dd000 rw-p 00014000 08:07 1963278    /lib/i386-linux-gnu/libz.so.1.2.3.4
b42dd000-b42e0000 r-xp 00000000 08:07 136210     /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.4
b42e0000-b42e1000 r--p 00002000 08:07 136210     /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.4
b42e1000-b42e2000 rw-p 00003000 08:07 136210     /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.4
b42e2000-b42e4000 r-xp 00000000 08:07 135383     /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b42e4000-b42e5000 r--p 00001000 08:07 135383     /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b42e5000-b42e6000 rw-p 00002000 08:07 135383     /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b42e6000-b42e8000 r-xp 00000000 08:07 135379     /usr/lib/i386-linux-gnu/libXcomposite.so.1.0.0
b42e8000-b42e9000 r--p 00001000 08:07 135379     /usr/lib/i386-linux-gnu/libXcomposite.so.1.0.0
b42e9000-b42ea000 rw-p 00002000 08:07 135379     /usr/lib/i386-linux-gnu/libXcomposite.so.1.0.0
b42ea000-b42eb000 rw-p 00000000 00:00 0
b42eb000-b42f4000 r-xp 00000000 08:07 135406     /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
b42f4000-b42f5000 r--p 00008000 08:07 135406     /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
b42f5000-b42f6000 rw-p 00009000 08:07 135406     /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
b42f6000-b42fd000 r-xp 00000000 08:07 135394     /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0
b42fd000-b42fe000 r--p 00006000 08:07 135394     /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0
b42fe000-b42ff000 rw-p 00007000 08:07 135394     /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0
b42ff000-b430e000 r-xp 00000000 08:07 135380     /usr/lib/i386-linux-gnu/libXi.so.6.1.0
b430e000-b430f000 r--p 0000e000 08:07 135380     /usr/lib/i386-linux-gnu/libXi.so.6.1.0
b430f000-b4310000 rw-p 0000f000 08:07 135380     /usr/lib/i386-linux-gnu/libXi.so.6.1.0
b4310000-b4312000 r-xp 00000000 08:07 135392     /usr/lib/i386-linux-gnu/libXinerama.so.1.0.0
b4312000-b4313000 r--p 00001000 08:07 135392     /usr/lib/i386-linux-gnu/libXinerama.so.1.0.0
b4313000-b4314000 rw-p 00002000 08:07 135392     /usr/lib/i386-linux-gnu/libXinerama.so.1.0.0
b4314000-b431c000 r-xp 00000000 08:07 135388     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b431c000-b431d000 r--p 00007000 08:07 135388     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b431d000-b431e000 rw-p 00008000 08:07 135388     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b431e000-b431f000 rw-p 00000000 00:00 0
b431f000-b432f000 r-xp 00000000 08:07 135371     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b432f000-b4330000 r--p 0000f000 08:07 135371     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b4330000-b4331000 rw-p 00010000 08:07 135371     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b4331000-b4335000 r-xp 00000000 08:07 135815     /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0
b4335000-b4336000 r--p 00004000 08:07 135815     /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0
b4336000-b4337000 rw-p 00005000 08:07 135815     /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0
b4337000-b4467000 r-xp 00000000 08:07 135972     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b4467000-b4468000 r--p 0012f000 08:07 135972     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b4468000-b446a000 rw-p 00130000 08:07 135972     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b446a000-b446c000 rw-p 00000000 00:00 0
b446c000-b4610000 r-xp 00000000 08:07 1970340    /lib/i386-linux-gnu/libc-2.15.so
b4610000-b4612000 r--p 001a4000 08:07 1970340    /lib/i386-linux-gnu/libc-2.15.so
b4612000-b4613000 rw-p 001a6000 08:07 1970340    /lib/i386-linux-gnu/libc-2.15.so
b4613000-b4616000 rw-p 00000000 00:00 0
b4616000-b462d000 r-xp 00000000 08:07 1970329    /lib/i386-linux-gnu/libpthread-2.15.so
b462d000-b462e000 r--p 00016000 08:07 1970329    /lib/i386-linux-gnu/libpthread-2.15.so
b462e000-b462f000 rw-p 00017000 08:07 1970329    /lib/i386-linux-gnu/libpthread-2.15.so
b462f000-b4631000 rw-p 00000000 00:00 0
b4631000-b464d000 r-xp 00000000 08:07 1963188    /lib/i386-linux-gnu/libgcc_s.so.1
b464d000-b464e000 r--p 0001b000 08:07 1963188    /lib/i386-linux-gnu/libgcc_s.so.1
b464e000-b464f000 rw-p 0001c000 08:07 1963188    /lib/i386-linux-gnu/libgcc_s.so.1
b464f000-b4679000 r-xp 00000000 08:07 1970335    /lib/i386-linux-gnu/libm-2.15.so
b4679000-b467a000 r--p 00029000 08:07 1970335    /lib/i386-linux-gnu/libm-2.15.so
b467a000-b467b000 rw-p 0002a000 08:07 1970335    /lib/i386-linux-gnu/libm-2.15.so
b467b000-b467c000 rw-p 00000000 00:00 0
b467c000-b4754000 r-xp 00000000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b4754000-b4755000 ---p 000d8000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b4755000-b4759000 r--p 000d8000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b4759000-b475a000 rw-p 000dc000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b475a000-b4761000 rw-p 00000000 00:00 0
b4761000-b49c4000 r-xp 00000000 08:07 136646     /usr/lib/libpython2.7.so.1.0
b49c4000-b49c5000 r--p 00263000 08:07 136646     /usr/lib/libpython2.7.so.1.0
b49c5000-b4a1a000 rw-p 00264000 08:07 136646     /usr/lib/libpython2.7.so.1.0
b4a1a000-b4a26000 rw-p 00000000 00:00 0
b4a26000-b4ac8000 r-xp 00000000 08:07 135891     /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
b4ac8000-b4ac9000 r--p 000a2000 08:07 135891     /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
b4ac9000-b4aca000 rw-p 000a3000 08:07 135891     /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
b4aca000-b4acb000 rw-p 00000000 00:00 0
b4acb000-b4c13000 r-xp 00000000 08:07 147041     /usr/lib/i386-linux-gnu/libxml2.so.2.7.8
b4c13000-b4c17000 r--p 00147000 08:07 147041     /usr/lib/i386-linux-gnu/libxml2.so.2.7.8
b4c17000-b4c18000 rw-p 0014b000 08:07 147041     /usr/lib/i386-linux-gnu/libxml2.so.2.7.8
b4c18000-b4c19000 rw-p 00000000 00:00 0
b4c19000-b4d10000 r-xp 00000000 08:07 1962266    /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b4d10000-b4d11000 r--p 000f6000 08:07 1962266    /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b4d11000-b4d12000 rw-p 000f7000 08:07 1962266    /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b4d12000-b4d13000 rw-p 00000000 00:00 0
b4d13000-b4d60000 r-xp 00000000 08:07 131171     /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4
b4d60000-b4d61000 r--p 0004c000 08:07 131171     /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4
b4d61000-b4d62000 rw-p 0004d000 08:07 131171     /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4
b4d62000-b4d94000 r-xp 00000000 08:07 135566     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b4d94000-b4d95000 r--p 00032000 08:07 135566     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b4d95000-b4d96000 rw-p 00033000 08:07 135566     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b4d96000-b4e2b000 r-xp 00000000 08:07 135809     /usr/lib/i386-linux-gnu/libfreetype.so.6.8.0
b4e2b000-b4e2f000 r--p 00094000 08:07 135809     /usr/lib/i386-linux-gnu/libfreetype.so.6.8.0
b4e2f000-b4e30000 rw-p 00098000 08:07 135809     /usr/lib/i386-linux-gnu/libfreetype.so.6.8.0
b4e30000-b4e77000 r-xp 00000000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e77000-b4e78000 ---p 00047000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e78000-b4e79000 r--p 00047000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e79000-b4e7a000 rw-p 00048000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e7a000-b4f41000 r-xp 00000000 08:07 135471     /usr/lib/i386-linux-gnu/libcairo.so.2.11000.2
b4f41000-b4f42000 r--p 000c7000 08:07 135471     /usr/lib/i386-linux-gnu/libcairo.so.2.11000.2
b4f42000-b4f43000 rw-p 000c8000 08:07 135471     /usr/lib/i386-linux-gnu/libcairo.so.2.11000.2
b4f43000-b4f46000 rw-p 00000000 00:00 0
b4f46000-b4f65000 r-xp 00000000 08:07 135586     /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
b4f65000-b4f66000 r--p 0001e000 08:07 135586     /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
b4f66000-b4f67000 rw-p 0001f000 08:07 135586     /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
b4f67000-b4f72000 r-xp 00000000 08:07 135798     /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0.3000.0
b4f72000-b4f73000 r--p 0000a000 08:07 135798     /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0.3000.0
b4f73000-b4f74000 rw-p 0000b000 08:07 135798     /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0.3000.0
b4f74000-b4f9e000 r-xp 00000000 08:07 135800     /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0.3000.0
b4f9e000-b4f9f000 r--p 00029000 08:07 135800     /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0.3000.0
b4f9f000-b4fa0000 rw-p 0002a000 08:07 135800     /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0.3000.0
b4fa0000-b50f3000 r-xp 00000000 08:07 131190     /usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.4Command ['/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").

Ram B. Agnihotri

unread,
Jan 15, 2015, 1:54:39 AM1/15/15
to ns-3-...@googlegroups.com
WHEN I EXECUTE LEACH PROTOCOL IN NS3.16                     I FOUND THAT ERROR PLEASE HELP ME TO REMOVE THIS ERROR---------------------


./waf --run scratch/Leach1
Waf: Entering directory `/home/brijesh/ns-3-allinone/ns-3.16/build'
Waf: Leaving directory `/home/brijesh/ns-3-allinone/ns-3.16/build'
'build' finished successfully (2.439s)
*** glibc detected *** /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1: double free or corruption (!prev): 0x09df05a8 ***
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(+0x75ee2)[0xb44d8ee2]
/usr/lib/i386-linux-gnu/libstdc++.so.6(_ZdlPv+0x1f)[0xb471c51f]

/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804cbaf]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804c919]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804c791]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x804c356]
/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x8049a42]
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0xb447c4d3]

/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1[0x80498a1]
======= Memory map: ========
08048000-0804f000 r-xp 00000000 08:07 1205321    /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1
0804f000-08050000 r--p 00006000 08:07 1205321    /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1
08050000-08051000 rw-p 00007000 08:07 1205321    /home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1
09d9a000-09dfd000 rw-p 00000000 00:00 0          [heap]
b3f02000-b3f0b000 rw-p 00000000 00:00 0
b3f0b000-b3f10000 r-xp 00000000 08:07 135385     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b3f10000-b3f11000 r--p 00004000 08:07 135385     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b3f11000-b3f12000 rw-p 00005000 08:07 135385     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b3f12000-b3f13000 rw-p 00000000 00:00 0
b3f13000-b3f15000 r-xp 00000000 08:07 135374     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b3f15000-b3f16000 r--p 00001000 08:07 135374     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b3f16000-b3f17000 rw-p 00002000 08:07 135374     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b3f17000-b3f19000 r-xp 00000000 08:07 1970325    /lib/i386-linux-gnu/libutil-2.15.so
b3f19000-b3f1a000 r--p 00001000 08:07 1970325    /lib/i386-linux-gnu/libutil-2.15.so
b3f1a000-b3f1b000 rw-p 00002000 08:07 1970325    /lib/i386-linux-gnu/libutil-2.15.so
b3f1b000-b40ad000 r-xp 00000000 08:07 1970317    /lib/i386-linux-gnu/libcrypto.so.1.0.0
b40ad000-b40bc000 r--p 00192000 08:07 1970317    /lib/i386-linux-gnu/libcrypto.so.1.0.0
b40bc000-b40c3000 rw-p 001a1000 08:07 1970317    /lib/i386-linux-gnu/libcrypto.so.1.0.0
b40c3000-b40c6000 rw-p 00000000 00:00 0
b40c6000-b4117000 r-xp 00000000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b4117000-b4118000 ---p 00051000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b4118000-b411a000 r--p 00051000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b411a000-b411e000 rw-p 00053000 08:07 1970316    /lib/i386-linux-gnu/libssl.so.1.0.0
b411e000-b411f000 rw-p 00000000 00:00 0
b411f000-b4122000 r-xp 00000000 08:07 1970339    /lib/i386-linux-gnu/libdl-2.15.so
b4122000-b4123000 r--p 00002000 08:07 1970339    /lib/i386-linux-gnu/libdl-2.15.so
b4123000-b4124000 rw-p 00003000 08:07 1970339    /lib/i386-linux-gnu/libdl-2.15.so
b4124000-b415e000 r-xp 00000000 08:07 1963240    /lib/i386-linux-gnu/libpcre.so.3.12.1
b415e000-b415f000 r--p 00039000 08:07 1963240    /lib/i386-linux-gnu/libpcre.so.3.12.1
b415f000-b4160000 rw-p 0003a000 08:07 1963240    /lib/i386-linux-gnu/libpcre.so.3.12.1
b4160000-b4165000 r-xp 00000000 08:07 135559     /usr/lib/i386-linux-gnu/libffi.so.6.0.0
b4165000-b4166000 r--p 00004000 08:07 135559     /usr/lib/i386-linux-gnu/libffi.so.6.0.0
b4166000-b4167000 rw-p 00005000 08:07 135559     /usr/lib/i386-linux-gnu/libffi.so.6.0.0
b4167000-b418d000 r-xp 00000000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b418d000-b418e000 ---p 00026000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b418e000-b4190000 r--p 00026000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b4190000-b4191000 rw-p 00028000 08:07 1963185    /lib/i386-linux-gnu/libexpat.so.1.5.2
b4191000-b41b0000 r-xp 00000000 08:07 147197     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b41b0000-b41b1000 r--p 0001f000 08:07 147197     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b41b1000-b41b2000 rw-p 00020000 08:07 147197     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b41b2000-b41b3000 rw-p 00000000 00:00 0
b41b3000-b41bb000 r-xp 00000000 08:07 136243     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b41bb000-b41bc000 r--p 00008000 08:07 136243     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b41bc000-b41bd000 rw-p 00009000 08:07 136243     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b41bd000-b41bf000 r-xp 00000000 08:07 135964     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b41bf000-b41c0000 r--p 00001000 08:07 135964     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b41c0000-b41c1000 rw-p 00002000 08:07 135964     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b41c1000-b41e9000 r-xp 00000000 08:07 1963244    /lib/i386-linux-gnu/libpng12.so.0.46.0
b41e9000-b41ea000 r--p 00027000 08:07 1963244    /lib/i386-linux-gnu/libpng12.so.0.46.0
b41ea000-b41eb000 rw-p 00028000 08:07 1963244    /lib/i386-linux-gnu/libpng12.so.0.46.0
b41eb000-b4280000 r-xp 00000000 08:07 135560     /usr/lib/i386-linux-gnu/libpixman-1.so.0.30.2
b4280000-b4285000 r--p 00095000 08:07 135560     /usr/lib/i386-linux-gnu/libpixman-1.so.0.30.2
b4285000-b4286000 rw-p 0009a000 08:07 135560     /usr/lib/i386-linux-gnu/libpixman-1.so.0.30.2
b4286000-b4299000 r-xp 00000000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b4299000-b429a000 ---p 00013000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b429a000-b429b000 r--p 00013000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b429b000-b429c000 rw-p 00014000 08:07 1970326    /lib/i386-linux-gnu/libresolv-2.15.so
b429c000-b429f000 rw-p 00000000 00:00 0
b429f000-b42bc000 r-xp 00000000 08:07 1963255    /lib/i386-linux-gnu/libselinux.so.1
b42bc000-b42bd000 r--p 0001c000 08:07 1963255    /lib/i386-linux-gnu/libselinux.so.1
b42bd000-b42be000 rw-p 0001d000 08:07 1963255    /lib/i386-linux-gnu/libselinux.so.1
b42be000-b42d2000 r-xp 00000000 08:07 1963278    /lib/i386-linux-gnu/libz.so.1.2.3.4
b42d2000-b42d3000 r--p 00013000 08:07 1963278    /lib/i386-linux-gnu/libz.so.1.2.3.4
b42d3000-b42d4000 rw-p 00014000 08:07 1963278    /lib/i386-linux-gnu/libz.so.1.2.3.4
b42d4000-b42d7000 r-xp 00000000 08:07 136210     /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.4
b42d7000-b42d8000 r--p 00002000 08:07 136210     /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.4
b42d8000-b42d9000 rw-p 00003000 08:07 136210     /usr/lib/i386-linux-gnu/libgmodule-2.0.so.0.3200.4
b42d9000-b42db000 r-xp 00000000 08:07 135383     /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b42db000-b42dc000 r--p 00001000 08:07 135383     /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b42dc000-b42dd000 rw-p 00002000 08:07 135383     /usr/lib/i386-linux-gnu/libXdamage.so.1.1.0
b42dd000-b42df000 r-xp 00000000 08:07 135379     /usr/lib/i386-linux-gnu/libXcomposite.so.1.0.0
b42df000-b42e0000 r--p 00001000 08:07 135379     /usr/lib/i386-linux-gnu/libXcomposite.so.1.0.0
b42e0000-b42e1000 rw-p 00002000 08:07 135379     /usr/lib/i386-linux-gnu/libXcomposite.so.1.0.0
b42e1000-b42e2000 rw-p 00000000 00:00 0
b42e2000-b42eb000 r-xp 00000000 08:07 135406     /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
b42eb000-b42ec000 r--p 00008000 08:07 135406     /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
b42ec000-b42ed000 rw-p 00009000 08:07 135406     /usr/lib/i386-linux-gnu/libXcursor.so.1.0.2
b42ed000-b42f4000 r-xp 00000000 08:07 135394     /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0
b42f4000-b42f5000 r--p 00006000 08:07 135394     /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0
b42f5000-b42f6000 rw-p 00007000 08:07 135394     /usr/lib/i386-linux-gnu/libXrandr.so.2.2.0
b42f6000-b4305000 r-xp 00000000 08:07 135380     /usr/lib/i386-linux-gnu/libXi.so.6.1.0
b4305000-b4306000 r--p 0000e000 08:07 135380     /usr/lib/i386-linux-gnu/libXi.so.6.1.0
b4306000-b4307000 rw-p 0000f000 08:07 135380     /usr/lib/i386-linux-gnu/libXi.so.6.1.0
b4307000-b4309000 r-xp 00000000 08:07 135392     /usr/lib/i386-linux-gnu/libXinerama.so.1.0.0
b4309000-b430a000 r--p 00001000 08:07 135392     /usr/lib/i386-linux-gnu/libXinerama.so.1.0.0
b430a000-b430b000 rw-p 00002000 08:07 135392     /usr/lib/i386-linux-gnu/libXinerama.so.1.0.0
b430b000-b4313000 r-xp 00000000 08:07 135388     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b4313000-b4314000 r--p 00007000 08:07 135388     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b4314000-b4315000 rw-p 00008000 08:07 135388     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b4315000-b4316000 rw-p 00000000 00:00 0
b4316000-b4326000 r-xp 00000000 08:07 135371     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b4326000-b4327000 r--p 0000f000 08:07 135371     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b4327000-b4328000 rw-p 00010000 08:07 135371     /usr/lib/i386-linux-gnu/libXext.so.6.4.0
b4328000-b432c000 r-xp 00000000 08:07 135815     /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0
b432c000-b432d000 r--p 00004000 08:07 135815     /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0
b432d000-b432e000 rw-p 00005000 08:07 135815     /usr/lib/i386-linux-gnu/libXfixes.so.3.1.0
b432e000-b445e000 r-xp 00000000 08:07 135972     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b445e000-b445f000 r--p 0012f000 08:07 135972     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b445f000-b4461000 rw-p 00130000 08:07 135972     /usr/lib/i386-linux-gnu/libX11.so.6.3.0
b4461000-b4463000 rw-p 00000000 00:00 0
b4463000-b4607000 r-xp 00000000 08:07 1970340    /lib/i386-linux-gnu/libc-2.15.so
b4607000-b4609000 r--p 001a4000 08:07 1970340    /lib/i386-linux-gnu/libc-2.15.so
b4609000-b460a000 rw-p 001a6000 08:07 1970340    /lib/i386-linux-gnu/libc-2.15.so
b460a000-b460d000 rw-p 00000000 00:00 0
b460d000-b4624000 r-xp 00000000 08:07 1970329    /lib/i386-linux-gnu/libpthread-2.15.so
b4624000-b4625000 r--p 00016000 08:07 1970329    /lib/i386-linux-gnu/libpthread-2.15.so
b4625000-b4626000 rw-p 00017000 08:07 1970329    /lib/i386-linux-gnu/libpthread-2.15.so
b4626000-b4628000 rw-p 00000000 00:00 0
b4628000-b4644000 r-xp 00000000 08:07 1963188    /lib/i386-linux-gnu/libgcc_s.so.1
b4644000-b4645000 r--p 0001b000 08:07 1963188    /lib/i386-linux-gnu/libgcc_s.so.1
b4645000-b4646000 rw-p 0001c000 08:07 1963188    /lib/i386-linux-gnu/libgcc_s.so.1
b4646000-b4670000 r-xp 00000000 08:07 1970335    /lib/i386-linux-gnu/libm-2.15.so
b4670000-b4671000 r--p 00029000 08:07 1970335    /lib/i386-linux-gnu/libm-2.15.so
b4671000-b4672000 rw-p 0002a000 08:07 1970335    /lib/i386-linux-gnu/libm-2.15.so
b4672000-b4673000 rw-p 00000000 00:00 0
b4673000-b474b000 r-xp 00000000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b474b000-b474c000 ---p 000d8000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b474c000-b4750000 r--p 000d8000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b4750000-b4751000 rw-p 000dc000 08:07 135901     /usr/lib/i386-linux-gnu/libstdc++.so.6.0.16
b4751000-b4758000 rw-p 00000000 00:00 0
b4758000-b49bb000 r-xp 00000000 08:07 136646     /usr/lib/libpython2.7.so.1.0
b49bb000-b49bc000 r--p 00263000 08:07 136646     /usr/lib/libpython2.7.so.1.0
b49bc000-b4a11000 rw-p 00264000 08:07 136646     /usr/lib/libpython2.7.so.1.0
b4a11000-b4a1d000 rw-p 00000000 00:00 0
b4a1d000-b4abf000 r-xp 00000000 08:07 135891     /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
b4abf000-b4ac0000 r--p 000a2000 08:07 135891     /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
b4ac0000-b4ac1000 rw-p 000a3000 08:07 135891     /usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
b4ac1000-b4ac2000 rw-p 00000000 00:00 0
b4ac2000-b4c0a000 r-xp 00000000 08:07 147041     /usr/lib/i386-linux-gnu/libxml2.so.2.7.8
b4c0a000-b4c0e000 r--p 00147000 08:07 147041     /usr/lib/i386-linux-gnu/libxml2.so.2.7.8
b4c0e000-b4c0f000 rw-p 0014b000 08:07 147041     /usr/lib/i386-linux-gnu/libxml2.so.2.7.8
b4c0f000-b4c10000 rw-p 00000000 00:00 0
b4c10000-b4d07000 r-xp 00000000 08:07 1962266    /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b4d07000-b4d08000 r--p 000f6000 08:07 1962266    /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b4d08000-b4d09000 rw-p 000f7000 08:07 1962266    /lib/i386-linux-gnu/libglib-2.0.so.0.3200.4
b4d09000-b4d0a000 rw-p 00000000 00:00 0
b4d0a000-b4d57000 r-xp 00000000 08:07 131171     /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4
b4d57000-b4d58000 r--p 0004c000 08:07 131171     /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4
b4d58000-b4d59000 rw-p 0004d000 08:07 131171     /usr/lib/i386-linux-gnu/libgobject-2.0.so.0.3200.4
b4d59000-b4d8b000 r-xp 00000000 08:07 135566     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b4d8b000-b4d8c000 r--p 00032000 08:07 135566     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b4d8c000-b4d8d000 rw-p 00033000 08:07 135566     /usr/lib/i386-linux-gnu/libfontconfig.so.1.4.4
b4d8d000-b4e22000 r-xp 00000000 08:07 135809     /usr/lib/i386-linux-gnu/libfreetype.so.6.8.0
b4e22000-b4e26000 r--p 00094000 08:07 135809     /usr/lib/i386-linux-gnu/libfreetype.so.6.8.0
b4e26000-b4e27000 rw-p 00098000 08:07 135809     /usr/lib/i386-linux-gnu/libfreetype.so.6.8.0
b4e27000-b4e6e000 r-xp 00000000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e6e000-b4e6f000 ---p 00047000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e6f000-b4e70000 r--p 00047000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e70000-b4e71000 rw-p 00048000 08:07 135796     /usr/lib/i386-linux-gnu/libpango-1.0.so.0.3000.0
b4e71000-b4f38000 r-xp 00000000 08:07 135471     /usr/lib/i386-linux-gnu/libcairo.so.2.11000.2
b4f38000-b4f39000 r--p 000c7000 08:07 135471     /usr/lib/i386-linux-gnu/libcairo.so.2.11000.2
b4f39000-b4f3a000 rw-p 000c8000 08:07 135471     /usr/lib/i386-linux-gnu/libcairo.so.2.11000.2
b4f3a000-b4f3d000 rw-p 00000000 00:00 0
b4f3d000-b4f5c000 r-xp 00000000 08:07 135586     /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
b4f5c000-b4f5d000 r--p 0001e000 08:07 135586     /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
b4f5d000-b4f5e000 rw-p 0001f000 08:07 135586     /usr/lib/i386-linux-gnu/libgdk_pixbuf-2.0.so.0.2600.1
b4f5e000-b4f69000 r-xp 00000000 08:07 135798     /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0.3000.0
b4f69000-b4f6a000 r--p 0000a000 08:07 135798     /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0.3000.0
b4f6a000-b4f6b000 rw-p 0000b000 08:07 135798     /usr/lib/i386-linux-gnu/libpangocairo-1.0.so.0.3000.0
b4f6b000-b4f95000 r-xp 00000000 08:07 135800     /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0.3000.0
b4f95000-b4f96000 r--p 00029000 08:07 135800     /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0.3000.0
b4f96000-b4f97000 rw-p 0002a000 08:07 135800     /usr/lib/i386-linux-gnu/libpangoft2-1.0.so.0.3000.0
b4f97000-b50ea000 r-xp 00000000 08:07 131190     /usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.4
b50ea000-b50ec000 r--p 00153000 08:07 131190     /usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.4
b50ec000-b50ed000 rw-p 00155000 08:07 131190     /usr/lib/i386-linux-gnu/libgio-2.0.so.0.3200.4Command ['/home/brijesh/ns-3-allinone/ns-3.16/build/scratch/Leach1'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").



On Sunday, 29 April 2012 09:14:28 UTC+5:30, homaei wrote:

Tommaso Pecorella

unread,
Jan 15, 2015, 2:38:38 AM1/15/15
to ns-3-...@googlegroups.com
The code posted earlier in this thread has severe memory management issues. These are totally independent from ns-3, and they are basic (when not trivial) memory management errors (e.g., allocating a vector of N elements and iterating through the N+1 one).

Since LEACH is an unsupported, non-standard (i.e., not standardized by any standard body) protocol, the best I can suggest is: use a decent debugger (try with the one integrated with Eclipse or Netbeans) and fix them. If you happen to fix the errors, you can post the revised code.

As personal and non-related opinion (today I'm ready to be flamed), LEACH is much like TcpPeach: for the author is good: you have another paper published. For the reader is good: you have a nice set of paper sheets to roll up and use to squash mosquitoes. Or to level that *#@&% table leg.
I.e., I wouldn't use more than half an hour on it, and I already spent that time.

Cheers,

T.

Sukanya Rajkonwar

unread,
Apr 20, 2015, 2:48:28 AM4/20/15
to ns-3-...@googlegroups.com
hi, I tried to run leach protocol in ns3. It is built but the prgram is terminated by SIGNAL SIGSEGV. Wil anyone help me to remove this problem?
const.h
leach.cc

Sukanya Rajkonwar

unread,
Apr 20, 2015, 12:05:21 PM4/20/15
to ns-3-...@googlegroups.com
hi I have run leach protocol in ns3.The program is built but terminated by SIGSEGV. when I tried to run it under gdb debugger I got following error
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
*** glibc detected *** /home/sukanya/ns3/ns-3-allinone/ns-3-dev/build/scratch/leach/leach: double free or corruption (!prev): 0x080df370 ***

Program received signal SIGSEGV, Segmentation fault.
_int_malloc (av=0xb45a4440, bytes=28) at malloc.c:3638
3638    malloc.c: No such file or directory.
      Can anyone help me to solve this problem. Thanks in advance.

Konstantinos

unread,
Apr 20, 2015, 1:03:10 PM4/20/15
to ns-3-...@googlegroups.com
Hi,

The scenario you attached has nothing to do with NS-3 and simulating networks with this tool.
It is just the implementation of LEACH for C++. The scenario does not use any of the NS-3 API to create nodes, setup connections, send packets etc.

Therefore, we can not help you solve your problem which is UNRELATED to NS-3. 
Use a debugger and analyse the problem. Contact the developer of that script privately to provide further help.

Regards,
K.

Tommaso Pecorella

unread,
Apr 20, 2015, 6:59:18 PM4/20/15
to ns-3-...@googlegroups.com
ROFLCOPTER.

I said some times ago that this code wasn't "right". Now I have the proof that something wasn't right.
To anyone reading this and willing to run a LEACH simulation:
Despite the good intentions, the code attached to this thread is not supported by ns-3, and it is not using ns-3 at all.

As today, there's officially no LEACH implementation for ns-3.

T.

Sukanya Rajkonwar

unread,
Apr 22, 2015, 8:46:56 AM4/22/15
to ns-3-...@googlegroups.com
Thanx for your information

Konstantinos

unread,
Apr 29, 2012, 7:21:51 AM4/29/12
to ns-3-...@googlegroups.com
Hi,

LEACH protocol is not available in NS-3.
Contributions are wellcome.

homaei

unread,
Apr 30, 2012, 2:40:19 PM4/30/12
to ns-3-users
Thanx a lot dear friend

On Apr 30, 12:05 am, Hamza ERRACHDI <errachdi.ha...@gmail.com> wrote:
> salam,
> here is the code implimenting  LEACH  on C++. you should do some
> rectifications and it wil work.
> Regards.
>
>  Leach.cc
> 48KViewDownload

sukhi76

unread,
May 14, 2012, 3:29:12 AM5/14/12
to ns-3-users
amazing work..thx for sharing here!

Hamza ERRACHDI

unread,
May 23, 2012, 2:23:36 PM5/23/12
to ns-3-...@googlegroups.com
Hi,
Did any one config this code that i post it in ns3 or did the simulation on NetAnim?
Regards.

Soujanya Venktesh

unread,
Feb 1, 2016, 4:55:42 AM2/1/16
to ns-3-users

Soujanya Venktesh

unread,
Feb 1, 2016, 4:58:54 AM2/1/16
to ns-3-users

hey did you get the leach protocol implementation for ns3? do you have a pseudo code? or an algorithm to write the code ourselves?

Tommaso Pecorella

unread,
Feb 1, 2016, 5:56:14 AM2/1/16
to ns-3-users
Sorry, the answer is no.

T.

Soujanya Venktesh

unread,
Feb 5, 2016, 1:43:38 AM2/5/16
to ns-3-users
we got only one error in the code posted above and it built successfully. so any idea about its not executing. its showing "SIGIOT error"

Tommaso Pecorella

unread,
Feb 5, 2016, 3:17:00 AM2/5/16
to ns-3-users
Hi,

take your time and read all the thread carefully.

The posted code is NOT using ns-3 properly.

Unfortunately we can not remove it rom the archives, but it should be.
Unfortunately there's always somebody, periodically, that will try to make it work, failing miserably.

The only way to implement LEACH is to rewrite everything from scratch. The code posted in this thread is not to be used.

Is this clear enough ?

T.

Khadija Zavery

unread,
Feb 19, 2017, 5:36:41 AM2/19/17
to ns-3-users, errachd...@gmail.com
Hi could you please tell me the recticificatiions needed? I'm getting a malloc memory corruption error.

Konstantinos

unread,
Feb 19, 2017, 7:40:19 AM2/19/17
to ns-3-users, errachd...@gmail.com
Hi,

As we have pointed out numerous times, this proposed LEACH code is NOT ns-3 compliant.

It is a simple C++ program, not related to ns-3.

GURU DARAN

unread,
Oct 16, 2017, 11:13:45 AM10/16/17
to ns-3-users
Hi,

i am also getting the same error can you please support me. Else share the working leach protocol code to me.


On Friday, March 8, 2013 at 1:30:13 AM UTC+5:30, Mansouri Djamel wrote:
dear all
 I build  LEACH.cc   it does not  work.
when i tried to compile it using ./waf i got this error message
const.h not found. what can I do?
Regards.

2012/10/26 rahul hada <hada....@gmail.com>

Thank You for sharing code for leach , could you please let know , is it possible to simulate wormhole attack for wireless sensor network on ns3.


Regards,

Rahul Hada
India


On Monday, April 30, 2012 1:35:59 AM UTC+5:30, Hamza ERRACHDI wrote:
salam,
here is the code implimenting  LEACH  on C++. you should do some rectifications and it wil work.
Regards.

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/ns-3-users/-/2ypKMX4gc1QJ.

To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.

GURU DARAN

unread,
Oct 16, 2017, 11:16:02 AM10/16/17
to ns-3-users
Hi,

i am facing const.h no such a file or directory so can you please support me.

Miss Karim

unread,
Jun 25, 2020, 1:36:47 PM6/25/20
to ns-3-users
Hi, i want to create clusteres WSN in ns3. but ns3 does not support implementation of LEACH. then how is it done? plzz help

sameena musthafa

unread,
Dec 3, 2020, 12:43:59 AM12/3/20
to ns-3-users
how can i config leach protocol in NS3 , ?  Please help 

ID

unread,
Dec 3, 2020, 2:24:52 AM12/3/20
to ns-3-...@googlegroups.com
Sameena, LEACH protocol is not available in NS-3 but you can configure it with the required parameters.First off all you have to make the simple WSN.Then give it required settings.  

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/b687e27d-64e3-4571-8904-e0c6fe0bc7abn%40googlegroups.com.

sameena musthafa

unread,
Dec 3, 2020, 2:34:55 AM12/3/20
to ns-3-...@googlegroups.com
sir 
I am a beginner in ns3. Can you provide any simple clustering algorithm for understanding.

You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/OGfl-qBIhpg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/CAHS5BVbLX3VzVai8TZpJ9_5rZsU%3DzfmvwHkH0WoJpGtThXZ7Qg%40mail.gmail.com.

Saurabh Maurya

unread,
Dec 1, 2021, 4:48:18 AM12/1/21
to ns-3-users
Hello friends i'm working in ns3 leach , i'm creating data set for calculating average energy of nodes , i got failed so can anyone help me please.

Said Ouhmi

unread,
Dec 1, 2021, 5:01:28 AM12/1/21
to ns-3-...@googlegroups.com
You can write to me your question. 


Said Ouhmi

unread,
Dec 1, 2021, 5:01:44 AM12/1/21
to ns-3-...@googlegroups.com

Saurabh Maurya

unread,
Dec 1, 2021, 5:13:20 AM12/1/21
to ns-3-users
Reply all
Reply to author
Forward
0 new messages