LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-10-2013, 11:19 AM   #1
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Rep: Reputation: Disabled
Post 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?
 
Old 07-10-2013, 04:54 PM   #2
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post 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
 
Old 07-10-2013, 08:58 PM   #3
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post 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
 
Old 07-11-2013, 02:56 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 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


-

Last edited by knudfl; 07-11-2013 at 03:00 AM.
 
Old 07-11-2013, 09:49 PM   #5
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post #3 fix link error

Hyperlink is not working. Should be:
EDIT : Probably http://ns2.blogspot.dk/2004/07/probl...script-is.html
 
Old 07-11-2013, 09:50 PM   #6
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Still not working so use knudfl link that was posted #3

Today 02:56 AM
 
Old 07-12-2013, 01:27 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 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.

-
 
Old 07-12-2013, 12:53 PM   #8
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post 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?
 
Old 07-12-2013, 01:45 PM   #9
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post 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.

Last edited by linuxUser123linux; 07-12-2013 at 01:47 PM.
 
Old 07-13-2013, 02:54 PM   #10
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
Post 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??
 
Old 07-15-2013, 09:15 PM   #11
linuxUser123linux
LQ Newbie
 
Registered: Jul 2013
Posts: 22

Original Poster
Rep: Reputation: Disabled
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
 
  


Reply

Tags
leach, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with running leach protocol in ns2.34 leach.er Mohamed69 Linux - Software 14 04-16-2018 07:10 AM
a tcl sample file using leach saeed.m Linux - Software 2 07-15-2013 04:47 AM
patch for working leach protocol in ns2.34 fedora rajcek Linux - Wireless Networking 4 02-04-2013 06:59 AM
[SOLVED] How to replace newline pattern in file by other newline pattern in a shell script XXLRay Linux - Software 9 11-29-2010 07:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration