LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Closed Thread
  Search this Thread
Old 02-11-2012, 01:45 AM   #241
keepwalking
Member
 
Registered: Oct 2010
Posts: 46

Rep: Reputation: 0

Thanks Deepa 211 for your advise. My main challenge is that I don't know how to doing it may any one help me with the example of an Algorithm for selecting a leader maybe for it I can be able to learn from it.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 02-12-2012, 08:50 AM   #242
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
@ keepwalking,

you need a structure with each of the vars in tcl. for example, to you can have a flag/variable 'hasbeenCH' which checks if the node has been a CH in the previous round. So, to go about this, you need the following :

1. a structure with the tcl variables (start with the basic variables. you can add more variables aas you keep going)
2. a function that havs the leader selection algorithm.
3. make an outline design of what you need, or of the logic you wanna implement. then, it becomes easier to write the commands.
 
1 members found this post helpful.
Old 02-14-2012, 01:22 PM   #243
keepwalking
Member
 
Registered: Oct 2010
Posts: 46

Rep: Reputation: 0
Thanks Deepa 2111 for for advise I have came up with C++ code for selecting a leader based on the number that is Randomly generated the but the receiving function is not working. may you please help me to solve this problem I also need to use remaining energy as a criteria for selecting the new leader.

Code:
#include "EECED_packet.h"
#include "EECED.h"


int hdr_EECED::offset_;


// Packet Header Class for EECED address allocation
static class EECEDHeaderClass : public PacketHeaderClass 
{
 	public:
  		EECEDHeaderClass() : PacketHeaderClass("PacketHeader/EECEDHeader", sizeof(hdr_EECED)) 
          {
    		bind_offset(&hdr_EECED::offset_);
          }
} class_EECEDhdr;


static class EECEDClass : public TclClass {
	public:
  		EECEDClass() : TclClass("Agent/EECED") { }
  		TclObject* create(int argc, const char* const* argv) 
		{
    			return (new EECED);
  		}
} class_EECED;

// Tcl interface for EECED Allocation
int EECED::command(int argc, const char* const* argv)
{
  if (argc == 2) 
	{
    		Tcl& tcl = Tcl::instance();
    		if (strcmp(argv[1], "id") == 0) 
		{
      			tcl.resultf("%d", index);
      			return (TCL_OK);
    		}
    		else if (strcmp(argv[1], "start") == 0) 
   		{
				printf("Node %d broadcasts first Hello message \n", index);
				generate();
				sendHello();
  				btimer.resched(700);

      				
			
			return (TCL_OK);		
   		} 
		if (strcmp(argv[1], "goodbye") == 0)
		{


			return (TCL_OK);	
		}
		
		if (strcmp(argv[1], "depart") == 0)
		{
			
			return (TCL_OK);
		}
		
  	}

  else if (argc == 3) 
	{
    		if (strcmp(argv[1], "index") == 0) 
		{
      			index = atoi(argv[2]);
      			return (TCL_OK);
    		}
    		if (strcmp(argv[1], "set-ll") == 0) 
		{
      			NsObject* obj;
      			if ((obj=(NsObject*)TclObject::lookup(argv[2]))== 0) 
			{
				if (debug == 1) printf( "%s lookup of %s failed\n", argv[1], argv[2]);
				return (TCL_ERROR);
      			}
      			ll = obj;
      			return (TCL_OK);
    		}
  }
  return Agent::command(argc, argv);
}


EECED::EECED(void) : Agent(PT_EECED), btimer(this)
{  
  counter = 0;
  packetnum = 0; 
  status  = 1; 
  bind("counter", &counter); 
  bind("leader" , &leader);
  
  
}

void EECEDTimer::expire(Event*)
{
printf(" timer for %d expiring ... : Leader is %d  \n" , agent->index , agent->leader) ;

}
void EECED::sendElectAdv(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

ah->EECED_type = EECED_elect_Adv;
  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();
  ah->electNode = electNode;
  ah->elect_RE = elect_RE;
  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
}

void EECED:: sendEntr_Rep(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

ah->EECED_type = EECED_elect_Adv;
  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();
  ah->node_RE = node_RE;
  ah->node1 = node1;
  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
}
void EECED::sendAdv(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();

  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
 
}

void EECED::generate(void)
{
	node_RE = (Random::integer(65536));
	elect_RE = (Random::integer(65536));
        temp1 = node_RE;
	temp2 = elect_RE;
	originalSource = this->addr();
	
}

void EECED::sendHello(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();

  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr(); 
  printf("Node %d sending Hello Message \n",index);

  ah->EECED_type = EECED_Hello;
  packetnum  = packetnum + 1; 
  ah->packetnumber = packetnum;
  ah->random1  = temp1;
  ah->random2 = temp2;
  ah->source = originalSource; 

   btimer.resched(30);

  Scheduler::instance().schedule(ll, p, 0.3);
}


void EE
CED::recv(Packet* p, Handler*)
{  printf("Node ***********************************************************************************************************************"); 
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  nsaddr_t src = ih->saddr();

  originalSource  = ah->source;    

  temp1 = ah->random1;
  temp2 = ah->random2;
  
  
  switch(ah->EECED_type) {
        case EECED_Hello:
	counter = counter +1;	
	printf("Node %d receiveing Hello Message from %d random1 is %d and random2 is %d \n",index, originalSource, temp1, temp2);
        old =  0; 
 	for (int i=0; i<source.size(); i++) 
	{
		if (source[i] == ah->origin)
		{
			old = 1; 
		}
        }

if (old  == 0)
{
	if (node_RE < ah->random1)
	{
		status = 0; 
		if (highest < ah->random1)
		{
			highest = ah->random1;	
			source.push_back (ah->origin);	  
			sendHello(); 
			
		}
		
	}

	if (node_RE == ah->random1 && status == 1)
	{
		if (elect_RE < ah->random2)
		{
			status = 0;
			highest = ah->random1; 	
			source.push_back (ah->origin);		
			sendHello(); 	
			
		}
		
	}
	
}		
		
	printf(" Node %d receiveing Hello from %d\n", index, src);
			
	Packet::free(p);
case EECED_elect_Adv:
	{
           if  (node_RE > ah->elect_RE)
		{	
			leader = ah->leader;
			sendElectAdv();
		}

		 
	}

case EECED_sendEntr_Rep:
	{
           if  (node_RE > elect_RE)
		{	
			node1 = ah->leader;
			sendEntr_Rep();
		}

		 
	}
	case EECED_Adv:
	{
           if  (leader != ah->leader)
		{	
			leader = ah->leader;
			sendAdv();
		}

		 
	}
	break;

	
    }
}
 
Old 02-15-2012, 07:49 AM   #244
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
Hey keepwalking ...

Errr .... Its too long a thread .. not able to make out the functionality.
Can you point out the function which does the leader selection ?
 
1 members found this post helpful.
Old 02-20-2012, 08:04 AM   #245
keepwalking
Member
 
Registered: Oct 2010
Posts: 46

Rep: Reputation: 0
Im trying to implement and simulate leader selection algorithm on ns2 but I'm get error that say: [code]invalid conversion of MobileNode* to TclObject[code]

Code:
#include "EECED_packet.h"
#include "EECED.h"

//#include <mobilenode.h>
int hdr_EECED::offset_;


// Packet Header Class for EECED address allocation
static class EECEDHeaderClass : public PacketHeaderClass 
{
 	public:
  		EECEDHeaderClass() : PacketHeaderClass("PacketHeader/EECEDHeader", sizeof(hdr_EECED)) 
          {
    		bind_offset(&hdr_EECED::offset_);
          }
} class_EECEDhdr;


static class EECEDClass : public TclClass {
	public:
  		EECEDClass() : TclClass("Agent/EECED") { }
  		TclObject* create(int argc, const char* const* argv) 
		{
    			return (new EECED);
  		}
} class_EECED;

// Tcl interface for EECED Allocation
int EECED::command(int argc, const char* const* argv)
{
  if (argc == 2) 
	{
    		Tcl& tcl = Tcl::instance();
    		if (strcmp(argv[1], "id") == 0) 
		{
      			tcl.resultf("%d", index);
      			return (TCL_OK);
    		}
    		else if (strcmp(argv[1], "start") == 0) 
   		{
				printf("Node %d broadcasts first Hello message \n", index);
				//gEnerate();
				sendHello();
  				btimer.resched(700);

      				
			
			return (TCL_OK);		
   		} 
		if (strcmp(argv[1], "goodbye") == 0)
		{


			return (TCL_OK);	
		}
		
		if (strcmp(argv[1], "depart") == 0)
		{
			
			return (TCL_OK);
		}
		
  	}

  else if (argc == 3) 
	{
    		if (strcmp(argv[1], "index") == 0) 
		{
      			index = atoi(argv[2]);
      			return (TCL_OK);
    		}
    		if (strcmp(argv[1], "set-ll") == 0) 
		{
      			NsObject* obj;
      			if ((obj=(NsObject*)TclObject::lookup(argv[2]))== 0) 
			{
				if (debug == 1){
				//printf(EECED_Elect_NodeAdv "%d lookup of %d failed\n", argv[1], argv[2]);
				return (TCL_ERROR);
					       }
      			}
      			ll = obj;
      			return (TCL_OK);
    		}
  }
  return Agent::command(argc, argv);
}


EECED::EECED(void) : Agent(PT_EECED), btimer(this)
{  
 // int n= 100;
 double nodei_RE = 0.0;
  counter = 0;
  packetnum = 0; 
  status  = 1; 
  bind("counter", &counter); 
  bind("leader" , &leader);
int maximum_RE= 0;
int secondMaximum_RE= 0;

nodei = (MobileNode *)(Node::get_node_by_address(index));
//electNode = (MobileNode *)(Node::get_node_by_address(index)/n);
  
}

void EECEDTimer::expire(Event*)
{
printf(" timer for %d expiring ... : Leader is %d  \n" , agent->index , agent->leader) ;

}
void EECED::sendElectNodeAdv(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

ah->EECED_type = EECED_Elect_NodeAdv;
  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();
  ah->electNode = electNode;
  ah->elect_RE = elect_RE;
  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
}
//*********************************************************************
void EECED::sendEner_Req(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

ah->EECED_type = EECED_Ener_Req;
  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();
  ah->electNode = electNode;
  ah->elect_RE = elect_RE;
  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
}




//*****************************************************


void EECED::sendEner_Rep(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

ah->EECED_type = EECED_Ener_Rep;
  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();
  ah->nodei_RE = nodei_RE;
  //ah->node1 = node1;
  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
}
//*****************************************************
void EECED::sendCH_Adv(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();


  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;
  ah->EECED_type = EECED_Ch_Adv ;
  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr();
//ah->EECED_type = EECED_CH_ADV;
  ah->leader = leader; 
  Scheduler::instance().schedule(ll, p, 0.0);
 
}
//**************************************************

void EECED::update_Energy(void){

Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();

  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr(); 
  //printf("Node %d sending Hello Message \n",index);

  ah->EECED_type = EECED_UpdateEnergy;
  packetnum  = packetnum + 1; 
  ah->packetnumber = packetnum;
  
   btimer.resched(30);

  Scheduler::instance().schedule(ll, p, 0.3);

nodei_RE = nodei-> energy_model()->energy();

}
  

//***************************************************

void EECED::sendHello(void)
{
  Packet* p = Packet::alloc();
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  ch->size() = IP_HDR_LEN + ah->size();

  ch->addr_type() = NS_AF_NONE;
  ch->direction() = hdr_cmn::DOWN;

  ih->daddr() = IP_BROADCAST;
  ih->saddr() =  this->addr(); 
  printf("Node %d sending Hello Message \n",index);

  ah->EECED_type = EECED_Hello;
  packetnum  = packetnum + 1; 
  ah->packetnumber = packetnum;
  
   btimer.resched(30);

  Scheduler::instance().schedule(ll, p, 0.3);
}


void EECED::recv(Packet* p, Handler*)
					{  
printf("Node *******************************"); 
  struct hdr_cmn* ch = HDR_CMN(p);
  struct hdr_ip* ih = HDR_IP(p);
  struct hdr_EECED* ah = HDR_EECED(p);
  nsaddr_t src = ih->saddr();


//*******************************************  
  switch(ah->EECED_type) {

        case EECED_Elect_NodeAdv:

if (nodei_ID == electNode_ID){

		sendEner_Req();

			   }

	Packet::free(p);

//********************************************
case EECED_Ener_Req:
	
{
           while (nodei == electNode)
		{

		if (nodei_RE > ah->electNode_RE){
			 sendEner_Rep();
						}
	    else {	 
			 nodei = none_ch;
	  sendEner_Req();

		}	

		}

		 
	}

//*******************************************
case EECED_Ener_Rep:
	{
           if  (nodei_RE = maximum_RE){	
			nodei = ah->leader;
				     }
		else {
			nodei != ah-> leader;
		sendEner_Rep();
	}

	   if (nodei_RE = secondMaximum_RE) {

			nodei = ah->electNode;
		}
}
//*****************************************************
	
case EECED_Ch_Adv:
	{
           if  (nodei_ID == ah->leader_ID)
		{	
			nodei = ah->leader;
			sendCH_Adv();
		}

		 
	}
	break;

	
    }
}
may any one help me to solve this problem
 
Old 02-23-2012, 05:34 AM   #246
keepwalking
Member
 
Registered: Oct 2010
Posts: 46

Rep: Reputation: 0
Hello every one

may any one help me to solve this following errors I'm trying simulate EECED protocol on ns.

bethel@ubuntu:~/ns-allinone-2.34/ns-2.34/EECED$ ns test.tcl
ns:
[code omitted because of length]
: invalid command name "Agent/EECED"
while executing
"Agent/EECED set DADTrials 0"
bethel@ubuntu:~/ns-allinone-2.34/ns-2.34/EECED$
 
Old 02-26-2012, 04:44 AM   #247
Bhargava Ram Buri
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
Please give stepwise instructions to install LEACH in NS2.35 in Fedora 16
I am having trouble installing ..Please help me.....
 
Old 02-27-2012, 02:56 AM   #248
kinjal_patel
LQ Newbie
 
Registered: Feb 2012
Posts: 9

Rep: Reputation: Disabled
Hi all

I just want a help regarding the usage of .out file.

In Leach protocol leach.out file is generated, how can we plot graph. Hoe can we generate and use trace file
 
Old 02-27-2012, 03:15 AM   #249
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
Post # 247, @ Bhargava Ram Buri : Welcome to LQ.

LEACH instructions for ns-allinone-2.34 :
http://www.linuxquestions.org/questi...dora13-907076/
And http://www.linuxquestions.org/questi...dora13-907076/


LQ member @deepa_2111 created a LEACH for ns-2.35,
but the method was never revealed. Post #6 here
http://www.linuxquestions.org/questi...34-a-860250/#6

Info about LEACH : LQ Search : Tag = leach
Or LQ Search : Keyword = leach

.

Last edited by knudfl; 03-04-2012 at 11:52 AM.
 
1 members found this post helpful.
Old 02-28-2012, 04:05 AM   #250
Bhargava Ram Buri
LQ Newbie
 
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
Leach execution and results in NS2.34

Quote:
Originally Posted by knudfl View Post
Post # 247, @ Bhargava Ram Buri : Welcome to LQ.

LEACH instructions for ns-allinone-2.34 :
http://www.linuxquestions.org/questi...dora13-907076/


LQ member @deepa_2111 created a LEACH for ns-2.35,
but the method was never revealed. Post #6 here
http://www.linuxquestions.org/questi...34-a-860250/#6

Info about LEACH : LQ Search : Tag = leach
Or LQ Search : Keyword = leach

.
Thank you for the help Knfudl .. I am done installing LEACH on NS2.34 ... But after I execute ./test , I get the following :

"[root@project ns-2.34]# ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::alive_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

INITIALIZE THE LIST xListHead
warning: no class variable Phy/WirelessPhy::alive_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

warning: no class variable Phy/WirelessPhy::alive_

see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING..."

Please help me about simulation results ( the right results)

Thank you,
Bhargava Ram Buri
 
Old 02-28-2012, 04:25 AM   #251
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
# 250 : This thread is about ns-2.27. If you have more questions,
please start your own thread.


Your test looks OK. That's the expected result.
Warnings are information. Not errors.
Though the warnings can be avoided, if you modify the code :

The "test" has been discussed in either this thread,
or the "LEACH ns-2.34" thread :
http://www.linuxquestions.org/questi...2-34-a-870368/
Please read both.

.
 
1 members found this post helpful.
Old 02-28-2012, 07:55 AM   #252
khushbushah
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
Post #248

Hi
I want to know the same thing that how to work with leach.out file and leach.tr file
I want to plot graph for avg. energy consumption , network lifetime(no.of rounds after first node dies) avg.delivery ratio, load balancing...etc.....
I didn't have any knowledge that how to get this all results. please help me
 
Old 03-02-2012, 02:05 AM   #253
khushbushah
LQ Newbie
 
Registered: Feb 2012
Posts: 6

Rep: Reputation: Disabled
How to analyse data in leach

Hi ,
Please help me to analyse the output generated by leach protocol
i have leach.out and leach.tr file.
this protocol works for 100 nodes.
I want to simulate for 200 nodes ,300 nodes etc. what should I do?
again want to measure network lifetime(no of.rounds). avg. delay etc.
Please its very urgent
Anybody can help me?
Thanks
 
Old 03-07-2012, 03:06 AM   #254
keepwalking
Member
 
Registered: Oct 2010
Posts: 46

Rep: Reputation: 0
Hello every body

when I'm running my tcl script I'm getting the following error now may you please help me with the advise of how to so it our .
Thanks for co-operation with me.

Code:
meloh-thabiso-setha@ubuntu:~/ns-allinone-2.34/ns-2.34/EECED$ ns test.tcl
num_nodes is set 20
INITIALIZE THE LIST xListHead
invalid command name "Agent/EECED"
    while executing
"Agent/EECED create _o395 0"
    invoked from within
"catch "$className create $o $args" msg"
    invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
    (procedure "new" line 3)
    invoked from within
"new Agent/EECED $i"
    ("for" body line 2)
    invoked from within
"for { set i 0 } { $i < $val(nn) } { incr i } {
    set EECED_($i) [new Agent/EECED $i]
    $ns_ attach-agent $node_($i) $EECED_($i)
    $EECED_($i) in..."
    (file "test.tcl" line 125)
meloh-thabiso-setha@ubuntu:~/ns-allinone-2.34/ns-2.34/EECED$
 
Old 03-08-2012, 09:03 AM   #255
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
@ Keepwalking,

your error is from the statement :

set EECED_($i) [new Agent/EECED $i]

What are you trying to do here ?
I am not sure if this statement is right
 
  


Closed Thread

Tags
leach, leach-ns227, ns2, ns227


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in simulating Black Hole Attack in AODV Protocol through NS2 in FC8 shyan Linux - Newbie 3 02-17-2015 03:21 PM
NS2 installation ds_priyaa Fedora 2 05-28-2008 02:23 AM
NS2 installation eby83 Linux - Newbie 2 06-11-2007 01:08 AM
ns2 installation pranoti Linux - Software 2 06-11-2007 12:45 AM
LXer: Interview with Bernard Leach (iPodLinux) LXer Syndicated Linux News 0 10-31-2006 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:55 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
Open Source Consulting | Domain Registration