LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 05-11-2012, 06:13 AM   #46
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268

@ Shailu (#44)

pp is a function that prints only when a certain flag is set to 1 (unlike puts). This function is described in one of the tcl files in the mit folder.

Please study properly all the tcl and cc files in the mit library before asking these kind of questions.
 
1 members found this post helpful.
Old 07-13-2012, 06:39 PM   #47
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
leach-energy calculation

Hi asrmaster,

I've also tried the code suggested by deepa,but the total expended energy is still much greater than the total initial energy. Could you show me your modified code?

Quote:
Originally Posted by asrmaster View Post
Hi Deepa,

Thanks for your reply, it solved the problem of calculating the energy consumption.

But I still see problems in the results. For ns-2.1b5 simulation results are approximately as follows:

Parameters:
energy: 2j energy per node;
number of nodes: 100;
network area: 100m x 100m;
number of clusters: 5;
distance from the base station: 75m;

Approximate results in ns-2.1b5:
Lifetime: 560
Amount of data being sent: between 62,000 and 64,000;

Approximate results in ns-2.34:
Lifetime: between 480 and 550;
Amount of data being sent: between 45000 and 55000;

That is, the ns-2.34 the results have a greater sway, with much variation. While ns-2.1b5, the results vary less. Moreover, ns-2.1b5, the results are better than the ns-2.34.

Does anyone know how to explain these differences?

NOTE: Please disregard any typos because my English is not very good.
 
Old 07-13-2012, 06:45 PM   #48
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
leach-energy calculation

Hello deepa,

I've tried your code and did make clean and make. However, I still got the total expended energy is much greater than the total initial energy. Did I miss any important step? Really appreciated if you could reply. TQ

Quote:
Originally Posted by deepa_2111 View Post
Hello ,

Thanks for ur replies. I modified the code as well ::

In \mac\Wireless-Phy.cc:
Code:
if (energy_)
	  { 
		if(alive_ != 0) // Deepa
		{
			if (energy_->remove(pktEnergy(Pt_, PXcvr_, ch->size())) != 0) 
			{
		  		printf("alive = 0\n");
		  		alive_ = 0;
			}
		} // Deepa
	  }
i.e., add the <code> if(alive_ != 0) </code> wherever the remove energy function is called,

and in mit\rca\energy.cc :
Code:
int EnergyResource::remove(double amount)
{
  double new_level = energy_level_ - amount;

  if(new_level >= 0 )
  {
  	energy_level_ = new_level;
  	expended_ += amount;
  } // Deepa
check if the new_level is greater or equal to 0. if it is not, energy cant be removed
 
Old 02-15-2013, 01:24 PM   #49
madhudora
LQ Newbie
 
Registered: Feb 2013
Posts: 1

Rep: Reputation: Disabled
number of nodes alive

hello @deepa_2111
i modified the code in energy.cc file and wireless_phy.cc file.. and i got my energy decreased.. but still my number of alive nodes are 4.. Is there any way to increase it?????
 
Old 03-11-2013, 07:48 PM   #50
emma166
LQ Newbie
 
Registered: Mar 2013
Posts: 14

Rep: Reputation: Disabled
Quote:
Originally Posted by nzny View Post
Hi asrmaster,

I've also tried the code suggested by deepa,but the total expended energy is still much greater than the total initial energy. Could you show me your modified code?
i installed leach finally in my ns2.27 according to one of the threads in this site but when i do ./test and verify my energy in leach .out my nergy is > 200 j which is not correct because i have 100 nodes with 2 J each one i did all the modifications i even change my CC=gcc-4.4 and cpp=g++-4.4 in makefile.in i don't know what to do everything seems normal and i got no error when i do
./configure
make clean
make
but my leach.out is false !!
please help this is urgent for my project and i have no more time
 
Old 03-11-2013, 07:52 PM   #51
emma166
LQ Newbie
 
Registered: Mar 2013
Posts: 14

Rep: Reputation: Disabled
Quote:
Originally Posted by deepa_2111 View Post
Hello,

I was analysing the results, and I come across this discrepancy (which I see mentioned on a couple of forum posts as well).

If I start with 2J energy per node, with 100 nodes, the maximum energy that can be expended in the network is 200J.
But, leach.out shows me::

Code:
At 548.60000000005618:
		Total Energy = 373.70924811232476
		Total Data = 56353
		Total Alive = 4

Simulation complete

This is impossible. How can the network expend 373.7J of energy.

Further, the document "Porting and Verifying AROS to NS in Linux/UNIX" (by Francisco José Mosqueira Sáez) (http://www.idt.mdh.se/utbildning/exj...les/TR0509.pdf) mentions this issue on page 33, with an explanation::



How do I go about fixing this ?? Help !!
i installed leach finally in my ns2.27 according to one of the threads in this site but when i do ./test and verify my energy in leach .out my nergy is > 200 j which is not correct because i have 100 nodes with 2 J each one i did all the modifications i even change my CC=gcc-4.4 and cpp=g++-4.4 in makefile.in i don't know what to do everything seems normal and i got no error when i do
./configure
make clean
make
but my leach.out is false !!
i heard about some changes in code in ../uAMPS/stats.tcl about the expended enery when i changed it i got errors and my leach.out is empty so i delete these changes when i simulate the energy is always >200J
please can anyone help this is urgent for my project and i have no more time.thx in advance.
 
Old 07-08-2013, 05:55 AM   #52
DeepaliDeshpande
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Rep: Reputation: Disabled
Leach

Hi
please let me know how leach.out file is created.
let me know the sequence of files to be run in leach patch
 
Old 07-08-2013, 06:05 AM   #53
DeepaliDeshpande
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Rep: Reputation: Disabled
hi,
i getting very difficulty to link between stats.tcl,uamps.tcl and leach.tcl
please let me know their linking since i need to find remaining energy using stats.tcl file
 
Old 07-10-2013, 05:08 AM   #54
DeepaliDeshpande
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Rep: Reputation: Disabled
Leach

Dear all , my final dissertation is very close now so just i want to find remaining energy using stats.tcl.Please help me. In my leach patch not single tcl file is run by ns command i dont know why. when i give command ns stats.tcl nothing happens pls let me know all these things. Specially i request knudlf and deepa_2111. thank u
 
Old 01-08-2014, 03:40 AM   #55
mirbaha
LQ Newbie
 
Registered: Dec 2013
Posts: 3

Rep: Reputation: Disabled
running leach in ns2.34

hi all
I installed ns2 in ubuntu 12.04 and run leach on it without any error(I fixed them)
but there is no valid output I think, I saw this problem later that no one know it.
can any one help me where is the problem?
http://www.4shared.com/file/iEc3lORcba/leach.html


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 == BS)
*** NOTE: no connection pattern specified.
Loading scenario file...
Node 0: (65.745973803916002,92.581722416254564)
Node 1: (21.008649990432268,92.380389195112684)
Node 2: (37.201202259027028,40.606367467253641)
Node 3: (71.218022131928251,61.297971318148988)
Node 4: (35.003944130150579,11.288995440718249)
Node 5: (34.146372151629237,98.076752432657756)
.
.
.
Node 99: (44.071560420129238,10.71598111219517)
Max Distance for this Simulation is 139.0
Load complete...
Starting Simulation...
THRESH = 0.050000000000000003
0: *******************************************
THRESH = 0.050000000000000003
1: *******************************************
THRESH = 0.050000000000000003
2: *******************************************
THRESH = 0.050000000000000003
3: *******************************************
THRESH = 0.050000000000000003
4: *******************************************
THRESH = 0.050000000000000003
5: *******************************************
THRESH = 0.050000000000000003
.
.
.

THRESH = 0.050000000000000003
99: *******************************************
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
0: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
1: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
2: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
3: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
4: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
.
.
.
99: Warning!!! No Cluster Head ADVs were heard!
Data being sent to the Base Station
Data was sent to the base station
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
.
.
.
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning dst_ is no longer being supported in NS. dst_ 0xffffffff
Use dst_addr_ and dst_port_ instead
Warning! There are no nodes in this cluster (11)!
Data being sent to the Base Station
Data was sent to the base station
Warning! There are no nodes in this cluster (26)!
Data being sent to the Base Station
Data was sent to the base station
.
.
Node 0 is DEAD!!!!
Node 1 is DEAD!!!!
Node 2 is DEAD!!!!
Node 3 is DEAD!!!!
Node 4 is DEAD!!!!
Node 5 is DEAD!!!!
.
.
.
Node 94 is DEAD!!!!
Node 95 is DEAD!!!!

At 1.0999999999999999:
Total Energy = 30125.543246939353
Total Data = 0
Total Alive = 4

Simulation complete.

num_nodes is set 101
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 222.8



as we see , at end Total data is 0 and all of the nodes dead!!!
help plsss
 
Old 02-07-2014, 07:59 AM   #56
michou_87
LQ Newbie
 
Registered: Feb 2012
Posts: 7

Rep: Reputation: Disabled
Smile

@Maytamer
Hello; I didn't found the awk file please sent it to this email" bejaouichaima@gmail.com" thank you
 
Old 02-26-2014, 03:58 PM   #57
nasgelicvijay
LQ Newbie
 
Registered: Oct 2013
Posts: 12

Rep: Reputation: Disabled
Error in tmix.cc

Following error comes when i am performing make command.


In function `Tmix:icktcp()':
tmix.cc.text+0xc87): undefined reference to `agentFactory(Tmix, char, char)'
tmix/tmix.o: In function `Tmix::setup_connection()':
tmix.cc.text+0x18ea): undefined reference to `typeinfo for TmixOneWayAgent'
tmix.cc.text+0x18f2): undefined reference to `typeinfo for TmixAgent'
tmix.cc.text+0x1e8e): undefined reference to `typeinfo for TmixAgent'
collect2: ld returned 1 exit status
make: [ns] Error 1



please help me to solve this Error.

Vijay
 
Old 02-26-2014, 04:46 PM   #58
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
# 57, @nasgelicvijay.

Which code did you add to ns-2.xx ? LEACH ? ( This thread is leach only ! )
Which version of ns-allinone-2.xx is it about ? ?

Which Ubuntu version ? And please show the reply from $ uname -m <Enter>

-
 
Old 02-27-2014, 02:28 AM   #59
nasgelicvijay
LQ Newbie
 
Registered: Oct 2013
Posts: 12

Rep: Reputation: Disabled
e

Yes sir, I have added "mannasim patch" and "ns-234-leach patch" simuntaneously.
But i have deleted the ns-234-leach patch now.
I am using ns-allinone-2.35 version.
My ubuntu version is ubuntu-12.04

Thanks for reply sir.
 
Old 04-07-2014, 11:54 PM   #60
abhi.samyak
LQ Newbie
 
Registered: May 2012
Posts: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by deepa_2111 View Post
Have you noticed that LEACH-C performs worse than LEACH though actually it is supposed to give better performance ? In a previous post, I see someone has mentioned this same observation ... not sure if it has been rectified though.
I am not getting how to simulate normal LEACH and C-LEACH ... please help me with this Thanking in advance
 
  


Reply

Tags
leach, leach ns235, ns2, tcl-pp



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
installing leach patch in ns2.34 in ubuntu9.10 g_vaibh Ubuntu 19 04-09-2015 09:43 AM
how to install leach patch in ns2.34 in ubuntu 9.10 anjon.sunny Linux - Newbie 9 04-30-2014 04:05 AM
LEACH protocol installation on NS2.27 Scofield Linux - General 255 03-08-2012 05:19 PM
Leach Installation on NS2 Asmaa Seyam Linux - General 3 10-19-2010 12:31 PM
[SOLVED] NS2 LEACH make problem dkpcad Linux - Wireless Networking 2 10-02-2010 09:04 AM

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

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