LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-30-2013, 11:40 AM   #586
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22

Hi deepa_2111 and knudfl,
I'm still working on my problem "Warning!!! No Cluster Head ADVs were heard!". Tried to find the answer from the internet and ask some peoples but i'm not yet found someone who can solve the problem and the reason why this problem occurs. So I started to think how about we do some change on simulation code.
This is my idea, please comment and tell me if I'm wrong. Thanks

Okay, like I say before on my previous post. I think the problem started from the nodes aren't waiting CH ADV and send their data directly to BS.
I founded this part in file leach.tcl (mit/uAMPS/sims/) but I don't understand it.

Code:
...
# Parameters for distrbuted cluster formation algorithm
                                          ;# RA Time (s) for CH ADVs
set opt(ra_adv)       [TxTime [expr $opt(hdr_size) + 4]]  
                                          ;# Total time (s) for CH ADVs
                                          ;# Assume max 4(nn*%) CHs
set opt(ra_adv_total) [expr $opt(ra_adv)*($opt(num_clusters)*4 + 1)]
                                          ;# RA Time (s) for nodes' join reqs
set opt(ra_join)      [expr 0.01 * $opt(nn_)]             
                                          ;# Buffer time for join req xmittal
set opt(ra_delay)     [TxTime [expr $opt(hdr_size) + 4]]         
                                          ;# Maximum time required to transmit 
                                          ;# a schedule (n nodes in 1 cluster)
set opt(xmit_sch)     [expr 0.005 + [TxTime [expr $opt(nn_)*4+$opt(hdr_size)]]]
                                          ;# Overhead time for cluster set-up
set opt(start_xmit)   [expr $opt(ra_adv_total) + $opt(ra_join) + $opt(xmit_sch)]
...
Is there a section in piece of source code above where nodes adjust "waiting time" for CH ADV?
Because in file ns-leach.tcl (mit/uAMPS/) here is a part where the non-CH nodes decide the best cluster to join. And I don't see where the nodes have to wait the CH ADV before deciding to send their data directly to BS on this part.

Quote:
...
# If node is not a CH, find the CH which allows minimum transmit
# power for communication. Set the code and "distance" parameters
# accordingly.
if {$clusterChoices_ == ""} {
puts "$nodeID: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl"
set currentCH_ $opt(nn)
$self SendMyDataToBS
return
}
...


---------- Post added 12-01-13 at 12:41 AM ----------



If there is no "the waiting time" adjusted on code above, how about we forced the node to wait the CH ADV and ONLY send their data direcly to BS IF waiting is over AND/OR no CH ADV received. Maybe in simple algorithm, the code will look like this:

Quote:
...
set the waiting time

if (waiting time is over and/or no CH ADV received) {
send data to BS
}
...
That's my idea. Can you help me to implement my idea? I don't really understand about tcl programming.
Thanks, waiting for your respond

Last edited by mhmdmahdi; 11-30-2013 at 11:52 AM.
 
Old 11-30-2013, 11:44 PM   #587
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
@ mhmdmahdi (#586),

Ok. Let us take this step by step.

First of all, opt(ra_adv_total) is the total time required to receive all the CH ADVs.
Next, in ns-default.tcl, look at functions:
1. advertiseClusterHead
2. recv
3. recvADV_CH

In these 3 functions, enable the print statements and check if a CH is indeed broadcasting its CH ADV, and if it does, check if the non-CH nodes receive the CH ADV.










Quote:
Originally Posted by mhmdmahdi View Post
Hi deepa_2111 and knudfl,
I'm still working on my problem "Warning!!! No Cluster Head ADVs were heard!". Tried to find the answer from the internet and ask some peoples but i'm not yet found someone who can solve the problem and the reason why this problem occurs. So I started to think how about we do some change on simulation code.
This is my idea, please comment and tell me if I'm wrong. Thanks

Okay, like I say before on my previous post. I think the problem started from the nodes aren't waiting CH ADV and send their data directly to BS.
I founded this part in file leach.tcl (mit/uAMPS/sims/) but I don't understand it.

Code:
...
# Parameters for distrbuted cluster formation algorithm
                                          ;# RA Time (s) for CH ADVs
set opt(ra_adv)       [TxTime [expr $opt(hdr_size) + 4]]  
                                          ;# Total time (s) for CH ADVs
                                          ;# Assume max 4(nn*%) CHs
set opt(ra_adv_total) [expr $opt(ra_adv)*($opt(num_clusters)*4 + 1)]
                                          ;# RA Time (s) for nodes' join reqs
set opt(ra_join)      [expr 0.01 * $opt(nn_)]             
                                          ;# Buffer time for join req xmittal
set opt(ra_delay)     [TxTime [expr $opt(hdr_size) + 4]]         
                                          ;# Maximum time required to transmit 
                                          ;# a schedule (n nodes in 1 cluster)
set opt(xmit_sch)     [expr 0.005 + [TxTime [expr $opt(nn_)*4+$opt(hdr_size)]]]
                                          ;# Overhead time for cluster set-up
set opt(start_xmit)   [expr $opt(ra_adv_total) + $opt(ra_join) + $opt(xmit_sch)]
...
Is there a section in piece of source code above where nodes adjust "waiting time" for CH ADV?
Because in file ns-leach.tcl (mit/uAMPS/) here is a part where the non-CH nodes decide the best cluster to join. And I don't see where the nodes have to wait the CH ADV before deciding to send their data directly to BS on this part.





---------- Post added 12-01-13 at 12:41 AM ----------



If there is no "the waiting time" adjusted on code above, how about we forced the node to wait the CH ADV and ONLY send their data direcly to BS IF waiting is over AND/OR no CH ADV received. Maybe in simple algorithm, the code will look like this:



That's my idea. Can you help me to implement my idea? I don't really understand about tcl programming.
Thanks, waiting for your respond
 
2 members found this post helpful.
Old 11-30-2013, 11:56 PM   #588
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
Hi knudfl,

I found a version of the leach code on ns 2.35 that I used.
Since my laptop crashed & I can't find my USBs, this is the only version I have. But it has a lot of additions I made both to get it running + for my subsequent research.
If possible, can you please send me the leach on ns2.34 (I think) by Tarik which was my base reference. Am unable to download it now.
I shall diff and upload the leach code alone.
 
1 members found this post helpful.
Old 12-01-2013, 12:06 AM   #589
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
Hi MhmdMahdi,

To give you a quick start, look at the ns-default.tcl file.
Code execution starts from the function "start" (around line#77).
It calls the function "decideClusterHead".
In function "decideClusterHead", you can see that the node waits from now till $opt(ra_adv_total) before calling the function "findBestCluster".

What you need to understand is that, ns2 is not like the usual compiler/simulator. It schedules events in time. So, imagine ns2 to be a task scheduler. A function is called some time in the future. IF you do not specify when a function is to be called, it is called instantly, and that defeats the purpose of using a simulator like ns2.

So, you do not need a wrapper to wait for a certain period of time before checking if a node has received a CH ADV.
The use of "$ns_ at [expr $now_ + $opt(ra_adv_total)]" ensures that the "findBestCluster" is called after $opt(ra_adv_total) units of time.
However, do print out the value of "$opt(ra_adv_total)" .. maybe that could be a problem ?
 
2 members found this post helpful.
Old 12-01-2013, 12:58 AM   #590
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Quote:
Originally Posted by deepa_2111 View Post
First of all, opt(ra_adv_total) is the total time required to receive all the CH ADVs.
Next, in ns-default.tcl, look at functions:
1. advertiseClusterHead
2. recv
3. recvADV_CH

In these 3 functions, enable the print statements and check if a CH is indeed broadcasting its CH ADV, and if it does, check if the non-CH nodes receive the CH ADV.
Quote:
Originally Posted by deepa_2111 View Post
To give you a quick start, look at the ns-default.tcl file.
Code execution starts from the function "start" (around line#77).
It calls the function "decideClusterHead".
In function "decideClusterHead", you can see that the node waits from now till $opt(ra_adv_total) before calling the function "findBestCluster".
do print out the value of "$opt(ra_adv_total)" .. maybe that could be a problem ?
Hi deepa, thanks for your response
I'm sorry i missed to look at that ns-default.tcl file.

$opt(ra_adv_total) associated with num_clusters value i used at leach_test file, right?
should I change num_clusters value every time I use different number of nodes? what is the num_clusters value i should use if i want to simulate leach with 80 nodes, 100 nodes, 135 nodes, 160 nodes and 200 nodes?
i used "num_clusters = 5" on my leach_test file, but it gaves me poor/weird output.

about do print statements on function advertiseClusterHead, recv, recvADV_CH, and value of $opt(ra_adv_total), i will try it tonight and post an update later. I'm away from my simulation pc right now.
Thanks again for your response, really appreciate it.

Last edited by mhmdmahdi; 12-01-2013 at 01:04 AM.
 
Old 12-02-2013, 08:45 AM   #591
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
--- update ---

Hi deepa,
first, a little correction, advertiseClusterHead, recv, recvADV_CH functions can be found in file ns-leach.tcl (not ns-default.tcl)

i have done everything you told me yesterday, i add four line on ns-leach.tcl file to print out the time and value of $opt(ra_adv_total). This is what i add to ns-leach file on function decideClusterHead and findBestCluster (bold line):

Quote:
...
Application/LEACH instproc decideClusterHead {} {
...
...
puts "now = [$ns_ now] "
puts "ra_adv_total = $opt(ra_adv_total) "


$ns_ at [expr $now_ + $opt(ra_adv_total)] "$self findBestCluster"
}
...
Application/LEACH instproc findBestCluster {} {
...
...
puts "now + ra_adv_total = [$ns_ now] "
puts "now = [$ns_ now] "


if {$clusterChoices_ == ""} {
...
and here is the simulation results from leach.out (please see the time I bold in quote below)

Quote:
...
now = 0
ra_adv_total = 0.0048719999999999996

Cluster Head 16 broadcasting ADV at time 3.2891064394680351e-05 - ns-leach.tcl
Cluster Head 36 broadcasting ADV at time 9.8245811359140008e-05 - ns-leach.tcl
...
Cluster Head 24 broadcasting ADV at time 0.00022064360092051495 - ns-leach.tcl
now + ra_adv_total = 0.0048719999999999996
now = 0.0048719999999999996

0: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 0 sending {{0 , 0.0048719999999999996}} to BS at time 0.0088862670199341444 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
...
38 rcvd ADV_CH from 16 at 0.11122689792472935 - ns-leach.tcl
68 rcvd ADV_CH from 16 at 0.11122690702571597 - ns-leach.tcl
...
14 rcvd ADV_CH from 16 at 0.11122691688225936 - ns-leach.tcl
26 rcvd ADV_CH from 16 at 0.11122691897354271 - ns-leach.tcl
...
what i see from my simulations result:
1. did CH nodes broadcast CH_ADV? YES
2. did non-CH nodes receive CH_ADV? YES, but there is a problem here.

time when CH nodes broadcast CH_ADV = 3.2891064394680351e-05
time when to call function findBestCluster = 0.0048719999999999996
time when the non-CH nodes receive CH_ADV = 0.11122689792472935

time interval between CH nodes broadcast their CH_ADV and non-CH nodes receive the CH_ADV is so long and more than time to call function findBestCluster.
it makes when the simulator call funtion findBestCluster, non-Ch nodes doesn't yet have clusterChoices so their send data directly to BS.

this is my opinion, please tell me if i'm wrong
And only if i'm right, what do you think the reasons why the time interval between the broadcasts CH nodes their CH_ADV and non-CH nodes receive it is taking so long?

i also attached file from my simulations, please check them if you don't mind.
thanks deepa
Attached Files
File Type: txt leach.out.txt (67.1 KB, 23 views)
File Type: txt leach_test80.txt (1.5 KB, 19 views)
File Type: txt ns-leach.tcl.txt (22.9 KB, 21 views)

Last edited by mhmdmahdi; 12-02-2013 at 08:53 AM.
 
Old 12-02-2013, 01:05 PM   #592
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
You are right. You do indeed have a problem with the receiving time / time at which nodes send their data to the BS.
I think the issue is related to the MAC layer/channel.
Have you added the required changes to the MAC folder ? I forget what exactly, but there were a couple of MAC/channel related changes that had to be added in the c/c++ code.

Before that, can you try modifying the value of $opt(ra_adv_total) ?
In tcl/leach.tcl, set it as : set opt(ra_adv_total) [expr $opt(ra_adv)*($opt(num_clusters)*4 + 1)*100]

Quote:
Originally Posted by mhmdmahdi View Post
--- update ---

and here is the simulation results from leach.out (please see the time I bold in quote below)

what i see from my simulations result:
1. did CH nodes broadcast CH_ADV? YES
2. did non-CH nodes receive CH_ADV? YES, but there is a problem here.

time when CH nodes broadcast CH_ADV = 3.2891064394680351e-05
time when to call function findBestCluster = 0.0048719999999999996
time when the non-CH nodes receive CH_ADV = 0.11122689792472935

time interval between CH nodes broadcast their CH_ADV and non-CH nodes receive the CH_ADV is so long and more than time to call function findBestCluster.
it makes when the simulator call funtion findBestCluster, non-Ch nodes doesn't yet have clusterChoices so their send data directly to BS.

this is my opinion, please tell me if i'm wrong
And only if i'm right, what do you think the reasons why the time interval between the broadcasts CH nodes their CH_ADV and non-CH nodes receive it is taking so long?

i also attached file from my simulations, please check them if you don't mind.
thanks deepa

Last edited by deepa_2111; 12-02-2013 at 01:09 PM.
 
1 members found this post helpful.
Old 12-02-2013, 01:43 PM   #593
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Hi deepa,

Quote:
Originally Posted by deepa_2111 View Post
I think the issue is related to the MAC layer/channel.
Have you added the required changes to the MAC folder ? I forget what exactly, but there were a couple of MAC/channel related changes that had to be added in the c/c++ code.
here a list of file from exidus simulation I copy and replaced to mac folder:

Quote:
channel.cc
ll.h
mac-sensor-timers.cc
mac-sensor-timers.h
mac-sensor.cc
mac-sensor.h
mac.cc
phy.cc
phy.h
wireless-phy.cc
wireless-phy.h
any hints what I should be looking on that files?

Quote:
Originally Posted by deepa_2111 View Post
Before that, can you try modifying the value of $opt(ra_adv_total) ?
In tcl/leach.tcl, set it as : set opt(ra_adv_total) [expr $opt(ra_adv)*($opt(num_clusters)*4 + 1)*100]
if i change that, whether it will affect the others?
 
Old 12-03-2013, 02:18 AM   #594
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
---- update ----

Hi deepa,
I changed the value of ra_adv_total on the simulation but the results showed that the simulation never complete (stop while in progres)

Code:
...
THRESH = 0.0625 - ns-leach.tcl
0: ******************************************* - ns-leach.tcl
THRESH = 0.0625 - ns-leach.tcl
1: ******************************************* - ns-leach.tcl
...
THRESH = 0.0625 - ns-leach.tcl
79: ******************************************* - ns-leach.tcl
Cluster Head 32 broadcasting ADV at time 7.1484436094520815e-05 - ns-leach.tcl
Cluster Head 21 broadcasting ADV at time 0.00015622779249224242 - ns-leach.tcl
Cluster Head 45 broadcasting ADV at time 0.00018947617925585999 - ns-leach.tcl
Cluster Head 58 broadcasting ADV at time 0.00021310269695385485 - ns-leach.tcl
Cluster Head 63 broadcasting ADV at time 0.00022093699894330324 - ns-leach.tcl
13 rcvd ADV_CH from 32 at 0.10308950439565649 - ns-leach.tcl
49 rcvd ADV_CH from 32 at 0.10308951119437239 - ns-leach.tcl
...
71 rcvd ADV_CH from 63 at 0.21035124413805048 - ns-leach.tcl
10 rcvd ADV_CH from 63 at 0.21035125338998531 - ns-leach.tcl
0: Current cluster-head is 63, code is 2,  dist is 26.991143093118019 - ns-leach.tcl
1: Current cluster-head is 63, code is 2,  dist is 32.345542473452383 - ns-leach.tcl
...
78: Current cluster-head is 32, code is 1,  dist is 57.767035235117916 - ns-leach.tcl
79: Current cluster-head is 63, code is 2,  dist is 35.470761048834603 - ns-leach.tcl
75: sending Join-REQ to 32 (dist = 15.080192092669723) at time 0.2495257144931097 - ns-leach.tcl
14: sending Join-REQ to 32 (dist = 20.299923009950657) at time 0.26437503306556076 - ns-leach.tcl
6: sending Join-REQ to 63 (dist = 60.584791863442916) at time 0.30878986913220485 - ns-leach.tcl
50: sending Join-REQ to 63 (dist = 12.927467325584995) at time 0.31432007140966134 - ns-leach.tcl
65: sending Join-REQ to 63 (dist = 64.826896115965909) at time 0.31665342600429308 - ns-leach.tcl
30 rcvd ADV_CH from 45 at 0.32759949003397393 - ns-leach.tcl
59 rcvd ADV_CH from 45 at 0.32759949794873316 - ns-leach.tcl
...
51 rcvd ADV_CH from 45 at 0.32759979881496676 - ns-leach.tcl
70 rcvd ADV_CH from 45 at 0.32759979987579751 - ns-leach.tcl
63 received notice of node 6 at time 0.32837607108151046 - ns-leach.tcl
9: sending Join-REQ to 32 (dist = 23.258900397360275) at time 0.33014281802429202 - ns-leach.tcl
32 received notice of node 9 at time 0.33080889555396004 - ns-leach.tcl
31: sending Join-REQ to 63 (dist = 48.640670920358922) at time 0.33778357515242674 - ns-leach.tcl
...
19: sending Join-REQ to 63 (dist = 69.313586185076829) at time 0.36126099179878318 - ns-leach.tcl
...
64: sending Join-REQ to 32 (dist = 45.543514104138687) at time 0.43024518287381774 - ns-leach.tcl
63 received notice of node 31 at time 0.43875373728799649 - ns-leach.tcl
63 received notice of node 1 at time 0.43933449355932663 - ns-leach.tcl
63 received notice of node 5 at time 0.4404480880142233 - ns-leach.tcl
26: sending Join-REQ to 32 (dist = 22.072482953785567) at time 0.44720505629694696 - ns-leach.tcl
32 received notice of node 16 at time 0.45587569056896365 - ns-leach.tcl
33: sending Join-REQ to 32 (dist = 13.009074686134296) at time 0.5118206794391259 - ns-leach.tcl
...
22: sending Join-REQ to 32 (dist = 39.612008291565559) at time 0.54956818679223596 - ns-leach.tcl
32 received notice of node 72 at time 0.56081879020497549 - ns-leach.tcl
63 received notice of node 19 at time 0.59588722284407047 - ns-leach.tcl
66: sending Join-REQ to 32 (dist = 17.155182380939983) at time 0.61036091548030491 - ns-leach.tcl
3: sending Join-REQ to 63 (dist = 32.805034823090466) at time 0.61285055207710837 - ns-leach.tcl
...
11: sending Join-REQ to 63 (dist = 6.9403563852773091) at time 0.69441885570328821 - ns-leach.tcl
63 received notice of node 50 at time 0.70992211450121911 - ns-leach.tcl
...
77: sending Join-REQ to 63 (dist = 49.538177045845472) at time 1.0414779325313075 - ns-leach.tcl
Warning!  There are no nodes in this cluster (21)! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 21 sending {{21 , 1.0436000000000001}} to BS at time 1.0500666651126309 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
32 sending TDMA schedule: 9 16 72 30 13 4 78 8 26 at time 1.0436000000000001 - ns-leach.tcl
Packet size is 144. - ns-leach.tcl
Warning!  There are no nodes in this cluster (45)! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 45 sending {{45 , 1.0436000000000001}} to BS at time 1.0445959300192986 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
Warning!  There are no nodes in this cluster (58)! - ns-leach.tcl
Data being sent to the Base Station - ns-leach.tcl
Node 58 sending {{58 , 1.0436000000000001}} to BS at time 1.0486126374862217 - ns-leach.tcl
Data was sent to the base station - ns-leach.tcl
63 sending TDMA schedule: 6 31 1 5 19 50 3 7 0 25 2 42 at time 1.0436000000000001 - ns-leach.tcl
Packet size is 192. - ns-leach.tcl
num_nodes is set 81
mac/channel.cc: sendUp - Calc highestAntennaZ_ and distCST_
mac/channel.cc: highestAntennaZ_ = 1.5,  distCST_ = 221.2
Maybe the only way to solve the problem is to fix the issue related to the MAC layer/channel like you said yesterday, but i don't know what should i do to fix it?


---- update ----

do you think this error related to function advertiseClusterHead?

Code:
...
Application/LEACH instproc advertiseClusterHead {} {

  global ns_ opt ADV_CH MAC_BROADCAST LINK_BROADCAST BYTES_ID
  $self instvar currentCH_ code_ 

  set chID [$self nodeID]
  set currentCH_ $chID
  pp "Cluster Head $currentCH_ broadcasting ADV at time [$ns_ now] - ns-leach.tcl"
  set mac_dst $MAC_BROADCAST
  set link_dst $LINK_BROADCAST
  set msg[list $currentCH_]
  set datasize [expr $BYTES_ID * [llength $msg]]

  # Send beacons opt(max_dist) meters so all nodes can hear.
  $self send $mac_dst $link_dst $ADV_CH $msg $datasize $opt(max_dist) $code_
}
...

Last edited by mhmdmahdi; 12-03-2013 at 09:52 AM.
 
Old 12-04-2013, 09:00 AM   #595
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
@mhmdmahdi,

Is this where the simulation stops ? Looks like now the nodes are receiving the CH_ADV.
Can you attach the full leach.out here ?
 
1 members found this post helpful.
Old 12-04-2013, 10:17 AM   #596
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Yes, the simulation stops (but don't complete).
non-CH nodes receive CH_ADV, send Join Req, but the simulation stop when CH nodes trying to send TDMA schedule.

i will attach my full leach.out later, can't do it now since i'm away from my simulation pc.
thanks for helping deepa.
10 days since the first time I got this error and still no progress
my deadline is getting closer

Quote:
Originally Posted by deepa_2111 View Post
@mhmdmahdi,

Is this where the simulation stops ? Looks like now the nodes are receiving the CH_ADV.
Can you attach the full leach.out here ?

Last edited by mhmdmahdi; 12-06-2013 at 09:24 AM. Reason: remove email
 
Old 12-04-2013, 05:10 PM   #597
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
@deepa_2111

here are my leach.out after i changed ra_adv_total value and exidus-leach.out (as reference)

leach.out
exidus-leach.out

Sorry, can't upload it here.
Thanks deepa

Last edited by mhmdmahdi; 12-05-2013 at 04:28 AM.
 
Old 12-05-2013, 12:03 PM   #598
mhmdmahdi
Member
 
Registered: Nov 2013
Location: Indonesia
Distribution: Ubuntu 12.04
Posts: 41

Rep: Reputation: 22
Thanks God.
And thanks for your help knudfl and deepa_2111.
Finally i can get my simulation results as I expected.

I don't know exactly the reason why "Warning!!! No Cluster Head ADVs were heard!" appears on my simulation output yesterday, but maybe this warning appears because i made a mistake when I build NS on my computer. I will explain how I can solve this problem and i hope you can tell me my mistakes.

A few days ago knudfl help me to created a binary package: pegasis-ns-2.34-ubuntu10_i386.deb (post #584)
I install those package but I wasn't using it since I was really focusing on my weird simulation output.
These days when I almost gave up, I just remembered about the package so I changed a line on my leach_test file (ns-allinone-2.34/ns2.34/)

ns tcl/ex/wireless.tcl ->> ns-pegasis tcl/ex/wireless.tcl

And voila, the problems on simulation results gone forever.
To be honest, I feel so stupid now. Can you tell me my mistakes that cause this problem?
Maybe your answer could help other people who face this problem in the future.

Thank you so much.
 
1 members found this post helpful.
Old 12-06-2013, 05:24 AM   #599
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,383

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
# 598 .
Quote:
Can you tell me my mistakes that cause this ..
The "exidus-pegasis" is the latest version of LEACH.
And may be @exidus has included all the file edits suggested by @deepa_2111 and others ?

** The fact is that the "exidus-pegasis LEACH" works very well.

P.S. : Other comment :
Old ns2 (ns-2.26 ... ns-2.29) will only supply the optimal result with Ubuntu 10.10 .
And some versions / patches : Also with CentOS / Scientific.Linux version 5.x .
( The statistics based on more than 500 ns2 builds ! )
The Ubuntu packages that I create, are usually done with Ubuntu 10.10 for all ns2,
including ns-2.30...ns-2.34, to be usable with all Ubuntu versions : 10.04 ... 13.**.
And Ubuntu 10.10 may also sometimes provide a better result for ns-2.30...ns-2.34 .


-

Last edited by knudfl; 12-06-2013 at 05:48 AM.
 
1 members found this post helpful.
Old 12-06-2013, 06:32 AM   #600
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
@ mhmdmahdi (598)

Congratulations !

I opened my last copy of leach_test and found this :

"ns tcl/ex/wireless_leach.tcl".

Now, I recollect that the steps included replacing the wireless.tcl file with the wireless_leach.tcl file. Was it not there in the instructions you followed ?

Anyway, to answer your question, the reason why it is working now is as follows :

The problem was related to your MAC layer, or the channel. If you parse the wireless_leach file, you'll see the following :

Code:
source tcl/lib/ns-mobilenode.tcl
This is absent in the older wireless.tcl file. This line specifies the type of node to be used. Further,
Code:
#
#  Create the specified number of nodes $opt(nn) and "attach" them
#  the channel.
#  Each routing protocol script is expected to have defined a proc
#  create-mobile-node that builds a mobile node and inserts it into the
#  array global $node_($i)
#

if { [string compare $opt(rp) "dsr"] == 0} { 
	for {set i 0} {$i < $opt(nn) } {incr i} {
		dsr-create-mobile-node $i
	}
} elseif { [string compare $opt(rp) "dsdv"] == 0} { 
	for {set i 0} {$i < $opt(nn) } {incr i} {
		dsdv-create-mobile-node $i
	}
} elseif { [string compare $opt(rp) "leach"] == 0} { 
	for {set i 0} {$i < $opt(nn) } {incr i} {
		leach-create-mobile-node $i
	}
} elseif { [string compare $opt(rp) "leach-c"] == 0} { 
	for {set i 0} {$i < $opt(nn) } {incr i} {
		leach-create-mobile-node $i
	}
} elseif { [string compare $opt(rp) "stat-clus"] == 0} { 
	for {set i 0} {$i < $opt(nn) } {incr i} {
		leach-create-mobile-node $i
	}
} elseif { [string compare $opt(rp) "mte"] == 0} { 
	for {set i 0} {$i < $opt(nn) } {incr i} {
		leach-create-mobile-node $i
	}
}


#
# Source the Connection and Movement scripts
#
if { $opt(cp) == "" } {
	puts "*** NOTE: no connection pattern specified."
        set opt(cp) "none"
} else {
	puts "Loading connection pattern..."
	source $opt(cp)
}


#
# Tell all the nodes when the simulation ends
#
for {set i 0} {$i < $opt(nn) } {incr i} {
    $ns_ at $opt(stop).000000001 "$node_($i) reset";
}
$ns_ at $opt(stop).00000001 "puts \"NS EXITING...\" ; $ns_ halt"


if { $opt(sc) == "" } {
	puts "*** NOTE: no scenario file specified."
        set opt(sc) "none"
} else {
	puts "Loading scenario file..."
	source $opt(sc)
	puts "Load complete..."
}

puts $tracefd "M 0.0 nn $opt(nn) x $opt(x) y $opt(y) rp $opt(rp)"
puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)"
puts $tracefd "M 0.0 prop $opt(prop) ant $opt(ant)"

puts "Starting Simulation..."
$ns_ run
enables the creation of the proper wireless channel and thereby the network for LEACH.
 
2 members found this post helpful.
  


Reply

Tags
leach, leach-warning50, ns2, ns2 ns234, pegasis


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
ns:"error when calling class OldSim"&tclsh:"invalid command+child process exits abn." shojaru Linux - Newbie 0 03-05-2009 04:23 AM
labview stopped at "init tmp resource files" on FC4 baosheng Linux - Software 2 09-28-2007 11:02 AM
ORiNOCO WLAN card not working - "failed to allocate resource" hauneboo Linux - Laptop and Netbook 1 11-29-2005 09:08 AM
What "kernel opts" allow PC to power down with "turning energy off"? kornerr Linux - General 1 03-10-2005 12:07 PM
nvidia insmod: "Device or resource busy" w/GeForce 4 MX KeithSpook Linux - Hardware 4 03-03-2004 12:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:50 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