LinuxQuestions.org
Review your favorite Linux distribution.
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-17-2012, 10:15 AM   #346
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled

dear deepa,

could you please give me some hints how to do that?thanks

Quote:
Originally Posted by deepa_2111 View Post
Yes, you can
 
Old 11-17-2012, 11:00 AM   #347
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
@ deepa
thanks alot for your reply
if you remember tcl file name pleas tell me
another question
where the output file like leach.data or leach.alive create? in which tcl file
i wanna to modify some,can I?!
 
Old 11-17-2012, 11:28 PM   #348
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
I don't remember the file name.
You can modify whatever you want in the tcl files ... please go through the entire set of tcl files for a good understanding of the LEACH flow

Quote:
Originally Posted by ni_saghari View Post
@ deepa
thanks alot for your reply
if you remember tcl file name pleas tell me
another question
where the output file like leach.data or leach.alive create? in which tcl file
i wanna to modify some,can I?!


---------- Post added 11-18-12 at 01:29 AM ----------

Please go through the wireless_phy.c file. the functions with comments are in that file.

Quote:
Originally Posted by nzny View Post
dear deepa,

could you please give me some hints how to do that?thanks
 
Old 11-18-2012, 11:20 PM   #349
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
but I don't know how to access the value from ns-leach.tcl..

Quote:
Originally Posted by deepa_2111 View Post
Please go through the wireless_phy.c file. the functions with comments are in that file.
 
Old 11-20-2012, 08:28 AM   #350
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
@ nzny,

For accessing from the tcl file, you'll have to create a bounded variable (a variable accessible both in c and tcl), and when updated call it in tcl. I think the RXthresh etc are bounded variables. In the tcl file, you just need to call it with the right structure. for e.g. $mac RXThresh etc.

Quote:
Originally Posted by nzny View Post
but I don't know how to access the value from ns-leach.tcl..
 
1 members found this post helpful.
Old 11-20-2012, 10:42 AM   #351
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
@deepa_2111,

really appreciate your reply. thanks...I've solved that part.

do you have any idea how do I get the information of one-hop and 2-hop neighbours for every node? I noticed that there are some functions related to neighbourhood management in ns-neighbor-resource.tcl and ns-ranode.tcl. but I don't know which function should I call to get the neighbor_list.


Quote:
Originally Posted by deepa_2111 View Post
@ nzny,

For accessing from the tcl file, you'll have to create a bounded variable (a variable accessible both in c and tcl), and when updated call it in tcl. I think the RXthresh etc are bounded variables. In the tcl file, you just need to call it with the right structure. for e.g. $mac RXThresh etc.
 
Old 11-20-2012, 11:48 AM   #352
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
Hello deepa_2111
MIT produced a pack for LEACH and some others like leach-c,...
I installed it correctly and now I wanna other routing protocol in WSN
but I don't know where can I find
if you have references,could you tell me or any guides
I really need it
please help me out
thanks
 
Old 11-20-2012, 12:48 PM   #353
minhntbkhn
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Rep: Reputation: Disabled
@ni_saghari
Quote:
Originally Posted by ni_saghari View Post
Hello deepa_2111
MIT produced a pack for LEACH and some others like leach-c,...
I installed it correctly and now I wanna other routing protocol in WSN
but I don't know where can I find
if you have references,could you tell me or any guides
I really need it
please help me out
thanks
Do you need Pegasis, Mte and Stat-Clus ?
 
Old 11-20-2012, 01:11 PM   #354
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
@minhntbkhn
thank you for your reply
This pack have leach,leach-c,mte,stat-clus,dsr and dsdv
but I need more!
like pegasis or TEEN-APTEEN or other version of leach
if u have any document or suggestion,please help me
thanks so much
 
Old 11-20-2012, 02:07 PM   #355
minhntbkhn
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Rep: Reputation: Disabled
@ni_saghari
Quote:
Originally Posted by knudfl View Post
A new link for the "exidus-pegasis_ns-234-leach" ( See post # 289 )
https://docs.google.com/open?id=0B7S...XQ3UmlOeWQ2ZXM.
This is modified version by @exidus. There is pegasis protocol. To see the way @exidus modified, please see post #289 ^^
 
1 members found this post helpful.
Old 11-21-2012, 09:31 AM   #356
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
@ nzny,

I am not very sure about the 2-hops in the LEACH algorithm. As I see it, the LEACH algorithm works on the principle of 1 hop transmission.

If you see the tcl file ns-ranode (in tcl\mobility\ or in the mit folder), there is a function

Code:
#
# This function queries the ResourceManager to determine the current 
# neighbors for this node.
#
MobileNode/ResourceAwareNode instproc neighbors {} {
    $self instvar ResourceManager_
  
    set nr [$ResourceManager_ getResourceByType Resource/NeighborResource] 
    return [$nr query all]
}
Maybe you can incorporate a call to this function in your code ?


Quote:
Originally Posted by nzny View Post
@deepa_2111,

really appreciate your reply. thanks...I've solved that part.

do you have any idea how do I get the information of one-hop and 2-hop neighbours for every node? I noticed that there are some functions related to neighbourhood management in ns-neighbor-resource.tcl and ns-ranode.tcl. but I don't know which function should I call to get the neighbor_list.
 
Old 11-21-2012, 09:45 PM   #357
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
@deepa_2111,

thank you for your reply..

Quote:
Originally Posted by deepa_2111 View Post
@ nzny,

If you see the tcl file ns-ranode (in tcl\mobility\ or in the mit folder), there is a function

Code:
#
# This function queries the ResourceManager to determine the current 
# neighbors for this node.
#
MobileNode/ResourceAwareNode instproc neighbors {} {
    $self instvar ResourceManager_
  
    set nr [$ResourceManager_ getResourceByType Resource/NeighborResource] 
    return [$nr query all]
}
Maybe you can incorporate a call to this function in your code ?
actually, i've tried to call neighbors function from ns-ranode.tcl. the code is as follows. the function query_ext is called from ns-neighbor-resource.tcl.

Code:
Application/LEACH instproc newFunc {} {
	$self instvar neigh_list
	
	set id [$self nodeID]
	set neigh_list [[$self neighbors] query_ext $id]
	#puts "zzzz $neigh_list"	
}
how ever, i got this error:

Code:
"_o26 cmd neighbors"
    invoked from within
"catch "$self cmd $args" ret"
    invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
    (procedure "_o26" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$self neighbors"
    (procedure "_o26" line 5)
    (Application/LEACH newFunc line 5)
i think may be i should put some args, but i don't know what args are they...could you please advice..thank you
 
Old 11-21-2012, 11:29 PM   #358
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
@ nzny,

I don't think you can call

Code:
[$self neighbors]
in LEACH application as "neighbors" is not defined in Application\LEACH

I think you might need to use something like
Code:
 set ResourceManager_ [new ResourceManager]
 $ResourceManager_ Register [new Resource/NeighborResource]
and then call query.

Am not sure of the exact structures, but i think it goes along these lines ..
 
Old 11-21-2012, 11:38 PM   #359
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
I think you might have to create an instance variable "neighbours" in the MobileNode structure
See how the different variables are initialied in "MobileNode/ResourceAwareNode instproc add-interface"




Quote:
Originally Posted by deepa_2111 View Post
@ nzny,

I don't think you can call

Code:
[$self neighbors]
in LEACH application as "neighbors" is not defined in Application\LEACH

I think you might need to use something like
Code:
 set ResourceManager_ [new ResourceManager]
 $ResourceManager_ Register [new Resource/NeighborResource]
and then call query.

Am not sure of the exact structures, but i think it goes along these lines ..
 
Old 11-21-2012, 11:46 PM   #360
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 179

Rep: Reputation: 261Reputation: 261Reputation: 261
@ nzny ..

I think I got it ...

Try
Code:
[$self node] neighbors
rather than
Code:
 
$self neighbors
Not sure if it'll work .. just trying out various possibilities
 
  


Reply

Tags
leach, leach-deepa#774, leach-warning50, 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


All times are GMT -5. The time now is 09:16 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration