LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-15-2017, 06:18 AM   #1006
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled

Quote:
Originally Posted by koshy1222 View Post
Hi deepa_2111, thank you so much for your reply. I checked both the mac/wireless-phy.cc and mit/rca/energy.cc files, but the changes have been made already. Yet, I keep getting the same error: No Cluster Head ADVs were heard. Also, my Total Data is always zero.
From the results, I can see that non-CH nodes do not wait for the CH to advertise. Instead, they send data directly to BS (but, Total Data = 0). Non-CH nodes received ADV only after some time. I am running LEACH Protocol using ns-2.35 on Ubuntu 14.04. Please help me. My dateline is nearing and my work is nowhere close to complete.
Can someone please help me? I have tried so many times, but I still get the same errors. I even tried using ns-2.34 on Ubuntu 14.04 and ns-2.34 on Ubuntu 10.04 based on the recommendations from this thread. Please help me. Any help would be much appreciated. Thank you.
 
Old 12-15-2017, 10:37 AM   #1007
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,190

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Re #1006, @koshy1222.

Leach, ns-2.34, for a 32bits OS : leach+pegasis_ns234.patch.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
  • Seems to be OK with Ubuntu 10.04 - i386 :
leach-sims__results-12.2017_Ubuntu1004-32bit.tar.gz
https://drive.google.com/file/d/1cIB...ew?usp=sharing
... But: This Ubuntu 10.04.4 is an old install. No latest updates.
May be different with a new install: Only the latest "10.04 libc6" is available now.

Results, Ubuntu 7.04 - 32bits: leach_sims__results-Ubuntu704-2015+2017.tar.gz
https://drive.google.com/file/d/1BBG...ew?usp=sharing

Note : leach+pegasis is by @exidus, see post #289.


-

Last edited by knudfl; 12-15-2017 at 10:58 AM.
 
Old 12-15-2017, 11:26 PM   #1008
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
Another option could be to increase the time nodes wait before they send ADV to the BS. I rember changimg some parameters. You will find them in uAmps.tcl

[QUOTE=koshy1222;5793456]Can someone please help me? I have tried so many times, but I still get the same errors. I even tried using ns-2.34 on Ubuntu 14.04 and ns-2.34 on Ubuntu 10.04 based on the recommendations from this thread. Please help me. Any help would be much appreciated. Thank you.[5/QUOTE]
 
Old 12-16-2017, 08:16 AM   #1009
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,190

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
leach.out overview

Re #1006, #1007.

32bits OS, Ubuntu 10.04 - i386
Code:
310  Cluster Head 57 broadcasting ADV at time 0.0001322872972694632 - ns-leach.tcl98 rcvd ADV_CH 311  from 57 at 0.00035830450834389382 - ns-leach.tcl

410  0: Current cluster-head is 57, code is 1,  dist is 83.498489614922264 - ns-leach.tcl
411  1: Current cluster-head is 57, code is 1,  dist is 26.687569529545996 - ns-leach.tcl
412  2: Current cluster-head is 57, code is 1,  dist is 63.600471802918442 - ns-leach.tcl
413  3: Current cluster-head is 57, code is 1,  dist is 24.944129067352225 - ns-leach.tcl
414  4: Current cluster-head is 57, code is 1,  dist is 76.022434908308568 - ns-leach.tcl
415  5: Current cluster-head is 57, code is 1,  dist is 64.065343972088044 - ns-leach.tcl

511  57 received notice of node 47 at time 0.0027860821328720333 - ns-leach.tcl
512  41: sending Join-REQ to 57 (dist = 72.588379079412292) at time 0.0038925070963709181 - ns-leach.tcl

553  57 received notice of node 74 at time 0.1781001829132364 - ns-leach.tcl
554  59: sending Join-REQ to 57 (dist = 29.914135775696586) at time 0.18762542380220509 - ns-leach.tcl

12790  CH 14 received data (36 , 49.984074274542714) from 36 at 49.99231654908543 - ns-leach.tcl
12791  2 sending data {2 , 49.992474272749291} to 14 at 49.992474272749291 (dist = 81.824787016827656) - ns-leach.tcl

12793  At 50: - mit/uAMPS/stats.tcl
		Total Energy = 9.7546154058771677
		Total Data = 5143
		Total Alive = 97

       Simulation complete. - mit/uAMPS/stats.tcl

       num_nodes is set 101
mac/channel.cc: sendUp - Calc highestAntennaZ_ and distCST_
mac/channel.cc: highestAntennaZ_ = 1.5,  distCST_ = 221.2
64bits OS, Ubuntu 10.04 - amd64
Code:
308  0: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl
309  Data being sent to the Base Station - ns-leach.tcl
310  Node 0 sending {{0 , 0.00116}} to BS at time 0.0058740592638002985 - ns-leach.tcl
312  1: Warning!!! No Cluster Head ADVs were heard! - ns-leach.tcl

13266  CH 66 received data (31 , 49.981546062686377) from 31 at 49.989788125372876 - ns-leach.tcl
       13 sending data {13 , 49.989946169545028} to 66 at 49.989946169545028 (dist = 50.863543835784704) - ns-leach.tcl
       CH 66 received data (13 , 49.989946169545028) from 13 at 49.998188339090177 - ns-leach.tcl
       59 sending data {59 , 49.998346093305116} to 66 at 49.998346093305116 (dist = 27.991570581630736) - ns-leach.tcl

       At 50: - mit/uAMPS/stats.tcl
		Total Energy = 194.8620576666672
		Total Data = 303
		Total Alive = 17

       Simulation complete. - mit/uAMPS/stats.tcl
You can of course get a worse result than this with a different patch or a later OS.

-
 
Old 12-17-2017, 11:12 PM   #1010
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
@knudfl, @deepa_2111, thank you both so much for the suggestions. I'll definitely try them out and keep you updated. Thank you once again, really appreciate your help.
 
Old 12-25-2017, 05:30 AM   #1011
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #1006, @koshy1222.

Leach, ns-2.34, for a 32bits OS : leach+pegasis_ns234.patch.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing
  • Seems to be OK with Ubuntu 10.04 - i386 :
-
Hello @knudfl, right now I'm trying to download ns-2.34 on Ubuntu 10.04 32 bits. However, I'm facing another problem installing the packages. I know this is not related to this thread. But, I keep getting errors as below for all the packages. Could I have been installing wrongly? Or have the packages become obsolete? Please forgive me for the long post. Please help me, I could not move forward in my work due to this.

Code:
[email protected]:~$ sudo apt-get install libx11-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libpthread-stubs0 libpthread-stubs0-dev libxau-dev libxcb1-dev libxdmcp-dev
  x11proto-core-dev x11proto-input-dev x11proto-kb-dev xtrans-dev
The following NEW packages will be installed:
  libpthread-stubs0 libpthread-stubs0-dev libx11-dev libxau-dev libxcb1-dev
  libxdmcp-dev x11proto-core-dev x11proto-input-dev x11proto-kb-dev xtrans-dev
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,873kB of archives.
After this operation, 7,717kB of additional disk space will be used.
Do you want to continue [Y/n]? y
WARNING: The following packages cannot be authenticated!
  x11proto-core-dev libxau-dev libxdmcp-dev x11proto-input-dev x11proto-kb-dev
  xtrans-dev libpthread-stubs0 libpthread-stubs0-dev libxcb1-dev libx11-dev
Install these packages without verification [y/N]? y
Err http://archive.ubuntu.com/ubuntu/ lucid/main x11proto-core-dev 7.0.16-1
  404  Not Found [IP: 91.189.88.149 80]
Err http://archive.ubuntu.com/ubuntu/ lucid/main libxau-dev 1:1.0.5-1
  404  Not Found [IP: 91.189.88.149 80]
Err http://archive.ubuntu.com/ubuntu/ lucid/main libxdmcp-dev 1:1.0.3-1
  404  Not Found [IP: 91.189.88.149 80]
..............

Failed to fetch http://archive.ubuntu.com/ubuntu/poo...0.16-1_all.deb  404  Not Found [IP: 91.189.88.149 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/poo...0.5-1_i386.deb  404  Not Found [IP: 91.189.88.149 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/poo...0.3-1_i386.deb  404  Not Found [IP: 91.189.88.149 80]
.............
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
 
Old 12-25-2017, 12:09 PM   #1012
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,190

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Re #1011

Please replace /etc/apt/sources.list with
Code:
deb http://old-releases.ubuntu.com/ubuntu/ lucid main restricted
deb http://old-releases.ubuntu.com/ubuntu/ lucid multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ lucid-updates main restricted
deb http://old-releases.ubuntu.com/ubuntu/ lucid-updates multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ lucid-backports main restricted
deb http://old-releases.ubuntu.com/ubuntu/ lucid-backports multiverse universe
deb http://old-releases.ubuntu.com/ubuntu/ lucid-security main restricted
deb http://old-releases.ubuntu.com/ubuntu/ lucid-security multiverse universe
Repeat : A newly installed Ubuntu 10.04 may not provide a perfect Leach result, as the latest update of the 10.04 libc6 / libc6-dev isn't very ns2 friendly.

-
 
Old 12-27-2017, 06:18 AM   #1013
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Hello, @knudfl and @deepa_2111, it finally worked! Thanks to you both! I did everything as you both suggested and now I could run leach protocol in ns-2.34 smoothly. I'm indebted to both of you. Thank you so much for guiding me when I needed it. I'm sure I'll need more guidance after this, too. And, I know where to turn for help. Thank you once again.
 
Old 01-02-2018, 08:14 AM   #1014
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Hello @knudfl and @deepa_2111, may I know how to integrate mobility model, let's say Random Waypoint, into LEACH Protocol? I read that SETDEST command can be used to do that, but I am unsure as to which files should I configure to include the mobility model. Please help me. Thank you in advance.
 
Old 01-02-2018, 08:56 AM   #1015
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,190

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Re #1014.

Some hints ....

-sc, the "scenario file" is defined in `leach_testī, line 38.
And : "sc" is a definition in tcl/ex/wireless.tcl, line 53.


-
 
Old 01-04-2018, 04:44 AM   #1016
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #1014.

Some hints ....

-sc, the "scenario file" is defined in `leach_testī, line 38.
And : "sc" is a definition in tcl/ex/wireless.tcl, line 53.
-
Hello sir, thank you for the hints. I tried understanding the link between these two files. The sc file defined in leach_test overrides the sc file defined in wireless.tcl. Hence, when running leach_test, the sc defined in it is used instead. This is what I understand (Please correct me if I'm wrong). I have also read that a mobility file can be generated using the setdest command and thus, I generated a random waypoint model using this command. The result is as below (I couldn't attach it as the file is very big in size). I tried to integrate this file to leach_test, so that LEACH uses RWP model for simulation. But, I failed to integrate it. I even tried editing the sc file defined in leach_test, but it didn't work. Is there a way I could integrate the mobility file to leach_test? Because right now, I think the nodes are static since the cluster formation time appears to be identical every time simulation is ran with different parameters.

Code:
# nodes: 100, speed type: 1, min speed: 1.00, max speed: 5.00
# avg speed: 2.47, pause type: 1, pause: 1.00, max x: 1000.00, max y: 1000.00
#
$node_(0) set X_ 134.860148898072
$node_(0) set Y_ 647.768335821064
$node_(0) set Z_ 0.000000000000
$node_(1) set X_ 260.684548230466
$node_(1) set Y_ 859.697101129451
$node_(1) set Z_ 0.000000000000
...................................
$ns_ at 0.000000000000 "$node_(0) setdest 357.031819937429 14.377081764497 3.105040083138"
$ns_ at 0.000000000000 "$node_(1) setdest 300.724583806171 1.564808498481 1.767338527275"
...................................
$god_ set-dist 0 1 1
$god_ set-dist 0 2 3
...................................
$ns_ at 0.232267930666 "$god_ set-dist 21 22 2"
$ns_ at 0.232267930666 "$god_ set-dist 22 41 2"
...................................
# Destination Unreachables: 0
#
# Route Changes: 62338
#
# Link Changes: 12268
#
# Node | Route Changes | Link Changes
#    0 |          1430 |          126
#    1 |          1215 |          191
#    2 |          1548 |          252
....................................
#   99 |           984 |          292
 
Old 01-06-2018, 04:30 AM   #1017
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Ref #1016: If anyone could help me, it'll be really great and much appreciated. Thank you in advance.
 
Old 01-06-2018, 05:17 AM   #1018
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Re #1014.

Some hints ....

-sc, the "scenario file" is defined in `leach_testī, line 38.
And : "sc" is a definition in tcl/ex/wireless.tcl, line 53.
-
Hello @knudfl sir, after reading further, I changed the sc files defined in both wireless.tcl and leach_test. But, there are still some errors in leach.out documented as below:

Code:
ns: _o2594 advertiseClusterHead: can't read "opt(max_dist)": no such element in array
    while executing
"$self send $mac_dst $link_dst $ADV_CH $msg $datasize $opt(max_dist) $code_"
    (procedure "_o2594" line 15)
    (Application/LEACH advertiseClusterHead line 15)
    invoked from within
"_o2594 advertiseClusterHead"
opt(max_dist) is a variable defined in the original sc file of leach_test. How do I eliminate this error? Where am I making the mistake? Please help me.
 
Old 01-07-2018, 01:39 AM   #1019
koshy1222
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Please help me, I really need this to work.
 
Old 01-07-2018, 06:45 AM   #1020
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,190

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Re #1018.

You will have to some way use the settings / definitions required by the connected scripts ,,, in your new scripts.

max_dist : uAMPS/ns-leach.tcl
Code:
[uAMPS]$ grep -n max_dist ns-leach.tcl 
374:  # Send beacons opt(max_dist) meters so all nodes can hear.
375:  $self send $mac_dst $link_dst $ADV_CH $msg $datasize $opt(max_dist) $code_
389:    set dist_ $opt(max_dist)
461:  $self send $mac_dst $link_dst $JOIN_REQ $msg $datasize $opt(max_dist) $code_
uAMPS/sims/nodescen.tcl
Code:
set opt(max_dist) [expr ceil([expr sqrt([expr \
					pow([expr $max_x - $min_x],2) +  \
					pow([expr $max_y - $min_y],2)])])]
puts "Max Distance for this Simulation is $opt(max_dist)"
I.e. the setting "opt(max_dist)" is: lines 27 .. 29 , nodescen.tcl

-
 
  


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 08:53 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration