-   Linux - Wireless Networking (
-   -   Leach-c eq_energy=0 condition simulation problem (

kguerilla 01-23-2011 05:26 AM

Leach-c eq_energy=0 condition simulation problem
Hi, LQ members.

I have installed ns-2.27 and ns-2.34 on Ubuntu 9.10.

I have a successful running ns-2 and I found no problems in leach_test simulation.

But, it does dead-lock operation in the leach-c algorithm simulation environment variable change to eq_energy=0.

Firsr time, I have successful simulation results.

It is represented the message in the file "leach-c.out" line 430 to 443 contents below.


BS received info: (2.466682112993059 57.526273074339272 2) from Node 98
BS received: 63
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
num_nodes is set 101
Min_cost = 156085.562447
last_iter = 15
CH are:
37.124910        58.355159        50
90.080040        75.238376        60
1.707347        95.379759        40
93.097224        85.045951        20
8.297679        59.088131        10
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff

I can't see the line 434 "num_nodes is set 101" that after the successful simulation.

The simulator may be dead but remain the process.

So, I have to killed the process then it has gone.

How can I solve the problem?

yueling 09-14-2012 10:06 AM

Hi kguerilla,

I have installed ns-2.27 on windows xp, and i want to running leach-c..

first time, i have installed mit.tar.gz..

How can i get source code leach-c? can u help me, please?

Thank you.

knudfl 09-14-2012 10:45 AM

Post # 2, @yueling : Welcome to LQ.

Do you mean leach-c.tcl ? It's a text file.
And is part of the package mit.tar.gz
> post #4.


yueling 09-18-2012 08:06 AM

post #3, @knudfl: hello...thank you for reply my post..

i have leach-c.tcl from part of the package mit.tar.gz, but i need and leach-c.h or leach-c.o..
how can i get it?

thank you.

knudfl 09-18-2012 11:13 AM

# 4

AFAIK no files are named, leach-c.h
( Or, leach.h ).

The name "leach-c.tcl" is a random name for a tcl file :
A tcl file is something you write as pure text.
There is no source code for a text file.


yueling 09-20-2012 01:17 AM


if no files named or leach-c.h , can i running leach-c.tcl without it files?

thank you :)

knudfl 09-20-2012 02:39 AM

Post # 6 and files.h are used, when you run './install'
and / or 'make' : To build the binary 'ns'. That's it.
No .cc or .h files are required ever again !

Not sure that just 'ns leach-c.tcl' will do anything.
Most of the files in mit/** are probably used in connection with other tcl files.
Like the simulation example command, you can read in leach_test, lines 37..51


yueling 09-20-2012 10:59 AM


okay, i see.. i think if i want to begin simulation about leach-c, i must get and files.h before..
so i can use the other files in mit to make simulation, right?

your post is very helpful =)
thank you.

yueling 09-21-2012 11:00 AM

#7 @knudfl

how to compile other files for energy,node setting, etc in mit using leach-c.tcl?

thank you.

knudfl 09-21-2012 11:52 AM

# 9

Not much to find about using the "mit files" : Google .. ns2 leach simulations ..

Have you read the two "long LEACH threads" ?


All times are GMT -5. The time now is 06:39 AM.