LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-22-2012, 12:08 PM   #361
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled

@deepa, thank you

i've tried:

[code]
[$self node] neighbors
[\code]

it returns nothing.

I also tried to define a new function in ns-ranode.tcl, similar to getER for energy:

[code]
MobileNode/ResourceAwareNode instproc getNR {} {
$self instvar ResourceManager_

set nr [$ResourceManager_ getResourceByType Resource/NeighborResource]
return $nr
}
[\code]

then I called:

[code]

[[$self getNR] query_ext nodeID]

[\code]

it returns "". I think this is because I didn't define the ID correctly as stated here:

[code]
# Querying for a specific ID returns the descriptor for that ID
# and the distance, if the desc is a wireless neighbor.
# If that ID is not available, we return "".

[code]
Resource/NeighborResource instproc query_ext id {
$self instvar neighbor_list_

if {$id == "all"} {
return $neighbor_list_
}

foreach n $neighbor_list_ {
if {$id == [$n setId]} {
return $n
}
}

return ""
}
[\code]

if you have time, really appreciate if you could suggest how to set the ID or any related args...thank you
 
Old 11-22-2012, 12:13 PM   #362
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
@deepa, thank you

i've tried:

Code:
[$self node] neighbors
it returns nothing.

I also tried to define a new function in ns-ranode.tcl, similar to getER for energy:

Code:
MobileNode/ResourceAwareNode instproc getNR {} {
    $self instvar ResourceManager_
      
    set nr [$ResourceManager_ getResourceByType Resource/NeighborResource] 
    return $nr
}
then I called:

Code:
[[$self getNR] query_ext nodeID]
it returns "". I think this is because I didn't define the ID correctly as stated here:

Code:
# Querying for a specific ID returns the descriptor for that ID
# and the distance, if the desc is a wireless neighbor.
# If that ID is not available, we return "".


Resource/NeighborResource instproc query_ext id {
    $self instvar neighbor_list_

    if {$id == "all"} {
      return $neighbor_list_
    }
    
    foreach n $neighbor_list_ {
      if {$id == [$n setId]} {
        return $n 
      }
    }

    return ""
}
really appreciate if you could suggest how to set the ID or any related args...thank you
 
Old 11-22-2012, 01:51 PM   #363
minhntbkhn
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Rep: Reputation: Disabled
Hi all !
Please someone can explain the meaning of these parameters, they are in condition.txt. Thanks !
Quote:
Energy Model:
RXThresh = 6e-9
CSThresh = 1e-9
Rb = 1e6
Excvr = 50e-9
Efriss_amp = 9.6741659015025702e-12
Etwo_ray_amp = 1.3037037037037037e-15
Ebf = 5e-9
Pidle = 0
Psleep = 0
 
Old 11-22-2012, 08:34 PM   #364
nzny
LQ Newbie
 
Registered: Jan 2012
Posts: 22

Rep: Reputation: Disabled
@minhntbkhn

those parameters are defined in uamps.tcl together with their description...u can check in that file..

Quote:
Originally Posted by minhntbkhn View Post
Hi all !
Please someone can explain the meaning of these parameters, they are in condition.txt. Thanks !
 
1 members found this post helpful.
Old 11-22-2012, 11:17 PM   #365
deepa_2111
Member
 
Registered: Apr 2011
Distribution: -
Posts: 185

Rep: Reputation: 268Reputation: 268Reputation: 268
@ nzny (#362),

Why not try printing the value of "neighbor_list_" in "query_ext" function. We can debug from there and see.
 
1 members found this post helpful.
Old 11-27-2012, 09:42 AM   #366
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
@minhntbkhn & @deepa_2111
thanks minhntbkhn for pegasis, its very helpful
I wanna to add security on leach
for example I want to encrypt packets and then send
my first question is where can I add codes of encryption algorithm (tcl files or ...)?
and second, this algorithms dissipate energy of node,where can I consider the energy dissipation?
please help me,plzzzzzzz
 
Old 01-12-2013, 03:42 AM   #367
rakeshpanchiwala
LQ Newbie
 
Registered: Dec 2012
Posts: 12

Rep: Reputation: Disabled
hello sir,
I have installed leach in ns2.34 in ubuntu12.04.
when i ran ./test file i got

num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...

but i didn't get any nam file....
and also i got many warnings in leach.out file.

so please tell me how to generate nam file......
 
Old 01-12-2013, 07:49 AM   #368
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
@rakeshpanchiwala
removing warnings run these lines in terminal

Quote:
cd work/ns-allinone-2.34/ns-2.34/mit/uAMPS/
perl -p -i -w -e 's/dst_/dst_addr_/g;' *.tcl


cd work/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims
perl -p -i -w -e 's/dst_/dst_addr_/g;' *.tcl
and finally
Quote:
sh leach_test
you have no warning in leach.out
 
Old 01-14-2013, 06:51 AM   #369
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
hi every one..

i have installed ns-2.34 and leach patch on it. it was working fine few days back. but now
whenever i try ./test
it shows

./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::E_elec

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

warning: no class variable Phy/WirelessPhy::e_mp

warning: no class variable Phy/WirelessPhy::e_fs

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

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

warning: no class variable Phy/WirelessPhy::e_mp

warning: no class variable Phy/WirelessPhy::e_fs

warning: no class variable Phy/WirelessPhy::E_elec

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

warning: no class variable Phy/WirelessPhy::e_mp

warning: no class variable Phy/WirelessPhy::e_fs

Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Attempting to cancel timer at 0x2d770c8 which is not scheduled


plz help me
 
Old 01-14-2013, 06:52 AM   #370
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
alos my leach.out file is empty. while
leach.err file has these errors

invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/root/ns2/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
invoked from within
"source.orig /root/ns2/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source /root/ns2/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl"
(file "mit/uAMPS/sims/uamps.tcl" line 24)
invoked from within
"source.orig mit/uAMPS/sims/uamps.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source mit/uAMPS/sims/uamps.tcl"
(file "tcl/mobility/leach.tcl" line 18)
invoked from within
"source.orig tcl/mobility/leach.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig[list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig[list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 187)
 
Old 01-14-2013, 11:57 AM   #371
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
@engr
to solve errors in leach.err :
open uamps.tcl from work/ns-allinone-2.34/ns-2.34/mit/uAMPS/sims
Add these codes in it(after "global opt bs" line):
Quote:
#source $env(RCA_LIBRARY)/ns-ranode.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/rca/ns-ranode.tcl

#source $env(uAMPS_LIBRARY)/ns-bsapp.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/uAMPS/ns-bsapp.tcl

#source $env(uAMPS_LIBRARY)/extras.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/uAMPS/extras.tcl

#source $env(uAMPS_LIBRARY)/stats.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/uAMPS/stats.tcl

#Uncomment these lines to use gdb to debug the c code
#source mit/uAMPS/ns-bsapp.tcl
#source mit/uAMPS/extras.tcl
#source mit/uAMPS/stats.tcl

#source $env(RCA_LIBRARY)/resources/ns-resource-manager.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-resource-manager.tcl

#source $env(RCA_LIBRARY)/resources/ns-energy-resource.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl

#source $env(RCA_LIBRARY)/resources/ns-neighbor-resource.tcl
source ~/work/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-neighbor-resource.tcl
 
1 members found this post helpful.
Old 01-14-2013, 11:59 AM   #372
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
hi ni..saghari
thnx for the reply.. i have changed them already. but errors are still there
 
Old 01-14-2013, 12:04 PM   #373
ni_saghari
LQ Newbie
 
Registered: Oct 2012
Posts: 16

Rep: Reputation: Disabled
I did these changes and solved error
when I want to run leach,I use this command :
Quote:
sh leach_test
in ns-2.34 directory

and when you go in leach-sims folder,files are making in about 5 minute
with no errors in leach.err
 
1 members found this post helpful.
Old 01-20-2013, 04:30 PM   #374
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
hi friends.. i need to calculate the means energy of each cluster in leach.. can anyone help me how can i define this function?
one more thing do i need to write new .cc and .h files for my modification in leach or its better to modify the existing leach.tcl files? kindly reply me asap
 
Old 01-21-2013, 10:03 AM   #375
engr
Member
 
Registered: Jan 2012
Posts: 33

Rep: Reputation: Disabled
hi every one.. i need to calculate the average energy for each cluster how can i add this in the leach code.. can anyone plz guide me
reply here asap.
regards
 
  


Reply

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



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 01:18 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