LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   LEACH connection pattern file not working (https://www.linuxquestions.org/questions/linux-newbie-8/leach-connection-pattern-file-not-working-4175469160/)

linuxUser123linux 07-10-2013 11:19 AM

LEACH connection pattern file not working
 
I installed LEACH: http://buddharaj14.wordpress.com/201...-on-ubuntu-10/

I run ./test at the prompt. The problem is the connection pattern file in the wireless.tcl file. When I leave it as "", the simulation is running and completes. However, when I change the connection pattern file to -
set opt(cp) "../mobility/scene/cbr-50-20-4-512" ;# connection pattern file, or my own communication file

I get:

Creating sensor nodes...
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 (150 == BS)
Loading connection pattern...
num_nodes is set 151

I need to get the file that specifies the communication between the nodes. It does not make sense that a blank file is producing 'correct' output, while any other connection file is just giving the fact that nodes are created and then just the number of nodes! I searched for the pattern file but am not getting lucky.

I am wondering why a specified connection pattern file is not working? and why is only the blank "" working?

linuxUser123linux 07-10-2013 04:54 PM

Got the answer!
 
the relative path was broken somewhere in the long chain, so used set opt(cp) "/home/<name>/ns-allinone-2.34/ns-2.34/tcl/mobility/scene/cbr-50-20-4-512" instead. But now have problem:

ns: _o26 send_now 0xffffffff 1 0 16 1084.0 1: wrong # args: should be "_o26 self class proc mac_dst link_dst type msg data_size dist code"
(Application/LEACH send_now line 1)
invoked from within
"_o26 send_now 0xffffffff 1 0 16 1084.0 1"
num_nodes is set 151
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 1737.5

linuxUser123linux 07-10-2013 08:58 PM

Found solution
 
A weakness in the current clusterhead based algorithm is that it depends on a somewhat uniform sensor field to create the network topology.

http://ns2.blogspot.com/2004/07/prob...script-is.html

knudfl 07-11-2013 02:56 AM

# 3 .

Interesting. Could you please fill out the missing parts in the link ..
? http://ns2.blogspot.dk/2004/07/ → → ?
EDIT : Probably http://ns2.blogspot.dk/2004/07/probl...script-is.html

I.e. no valid link in post #3


-

linuxUser123linux 07-11-2013 09:49 PM

Post #3 fix link error
 
Hyperlink is not working. Should be:
EDIT : Probably http://ns2.blogspot.dk/2004/07/probl...script-is.html

linuxUser123linux 07-11-2013 09:50 PM

Still not working so use knudfl link that was posted #3
 
Today 02:56 AM

knudfl 07-12-2013 01:27 AM

# 3 .
Quote:

Still not working ..
! No, the links in #3 and #5 will never work. Not valid links !
They are "half a copy of half a link".

How to copy a link address :
→ Do a right click on a valid link. Select »Copy Link Address« ,,
.... then you can paste a valid link.

-

linuxUser123linux 07-12-2013 12:53 PM

LEACH total energy error????
 
I am now getting increase in total energy values when I run LEACH in ns2.34.

This is in two files leach.out and leach.energy.

This is strange as the total energy value of the network is supposed to decrease over time.

Can someone tell me how to understand why this is occurring and how to fix this error?

linuxUser123linux 07-12-2013 01:45 PM

Problem
 
total energy
68
120.346
300.506
464.28
551.866
641.406
769.706
798.109
838.914
849.66
915.611
973.924
1006.277

Given that I started with 300J of energy. The LEACH results shows that I expended 1006.3J of energy. This is not realistic. Where is the error. I checked the stats.tcl and found

set total_energy [expr $total_energy + $expended]

This is reasonable, where the file prints the total energy. I tried to print the $expended energy and got very small decimal values and when removed the total energy is zero. This is ok as each node expends little energy and without any expenditure there will be zero total energy.

But the problem remains in printing the residual network energy values.

linuxUser123linux 07-13-2013 02:54 PM

Suggestion by me
 
My problem seems to be getting the energy values. One way is by using timers in c++ ns2 files. However, I cannot find which .cc and .h files are used by LEACH. I see two folders after running leach-setup.sh: (1) mit and (2)ns-234-leach

I added output statements to find which files are used by LEACH, for example in /mit/rca/energy.cc and /ns-234-leach/mac/mac-sensor-timers.cc, but got no output. This seems strange as LEACH must be using some c++ code.

I want to put my timers in the c++ code to obtain the total energy as the leach.energy is not giving the proper values (stated above). I also saw many online posts where persons got similar questions regarding the increase in total energy:
http://permalink.gmane.org/gmane.net...ator.isi/35257 and a solution which I do not understand
http://hi.baidu.com/jerry916/item/33...77ddc72e8ec288

Due to this I want to calculate my own values in c++ files. Can anyone please direct me??

linuxUser123linux 07-15-2013 09:15 PM

Solved
 
Check this link for solution on previous point, not the timers questions. I abandoned this idea.

http://hi.baidu.com/jerry916/item/33...77ddc72e8ec288


All times are GMT -5. The time now is 11:30 PM.