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 08-26-2013, 12:03 PM   #526
adventurousman
LQ Newbie
 
Registered: Jun 2013
Posts: 5

Rep: Reputation: Disabled

Any one can explain the following code in detail
I want to help please


Application/LEACH instproc mac {} {
return [[$self node] set mac_(0)]
}


Sorry to prolong Thanks
 
Old 09-20-2013, 06:08 AM   #527
anaveen69
LQ Newbie
 
Registered: Sep 2013
Posts: 1

Rep: Reputation: Disabled
when i typed the command : ns wireless.tcl....

its gving error lyk dis............
........................................................................................
couldn't read file "tcl/lib/ns-mobilenode.tcl": no such file or directory
while executing
"source.orig tcl/lib/ns-mobilenode.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/lib/ns-mobilenode.tcl"
(file "wireless.tcl" line 184)



could anyone pls help me out how to get rid out of this error. (I download MIT/uAMPS leach file)
 
Old 09-20-2013, 09:57 AM   #528
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
# 527

$ cd ns-2.34/tcl/ex/ && ns wireless.tcl
mandatory arguments : [-x MAXX] [-y MAXY]

I.e. you will have to run that file from the /ex/ folder.
And use the right options.
Example : $ ns wireless.tcl -x 300 -y 300

-
 
Old 10-12-2013, 06:15 PM   #529
nik.dan
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
hi

I am using ubuntu 13.04 (64 bit, lower versions are not compatible)
I have installed ns-2.35 and ns-234-leach and changed all the addresses in leach-setup.sh, which worked without errors.
when I had run wireless.tcl after making changes in x,y,number of nodes etc it gave me some results when PROTOCOL = DSDV, but when I changed it to LEACH, it gave me the same error as post #1.
Quote:
invalid command name "Resource/Energy"
I have gone through the procedure that followed... I installed GCC-4.3/g++-4.3 manually, but to no use.
when I "make" it, it gave me an error:
Quote:
queue/priqueue.cc: In member function ‘virtual void PriQueue::recv(Packet*, Handler*)’:
queue/priqueue.cc:94:8: error: ‘PT_MDART’ was not declared in this scope
make: *** [queue/priqueue.o] Error 1
and also after making changes in Makefile and Makefile.in as CC=gcc-4.3 and CPP=g++-4.3, when I ./configure, it changes back to CC=gcc and CPP=g++
 
Old 10-13-2013, 04:06 AM   #530
ganesh20000
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
Problem while make command in GCC working with ns-2.34 in red hat enterprise linux

when i m putting make command i got the error like
make: g++-4.3:Command not found
make: ***[tools/random.o] Error 127

what is this error
 
Old 10-13-2013, 05:41 AM   #531
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
#529, #530 .

'gcc-4.3' used to work some years ago. ( Old Ubuntu's ).
Updates changed that.
Please use gcc / g++ version 4.1.2 or 3.4.6 .

#529, Ubuntu 13.04 - 64 :
No gcc-4.1 / g++-4.1, use gcc/g++ version 3.4.6 .
Or better : Install a 32bits OS : ! ns2 is for a 32bits OS !
A 64bits OS will cause reduced functionality /
Inferior validate result.
** gcc34 / g++34, 64bits → post #11 here :
http://www.linuxquestions.org/questi...4175453599/#11

#530 : # yum install compat-gcc-34-c++
#529, #530 : Building ns2 : (not ns-2.35)
$ export CC=gcc34 CXX=g++34 && ./install

-

Last edited by knudfl; 10-13-2013 at 08:28 AM.
 
Old 10-13-2013, 07:38 AM   #532
nik.dan
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
hey knudfl, thanx for replying.

I follwed the instructions given in the link provided by you, but there were two issues:
I could not find a line with "./configure --build" in the "install file, which I could edit, (though I have ns2.35 installed already)...
then after installing both the gcc ang g++ given in the links provided in the post, i did
Quote:
export CC=gcc34 CXX=g++34 && ./install
which ended in the error, which i have already specified above
Quote:
queue/priqueue.cc: In member function `virtual void PriQueue::recv(Packet*, Handler*)':
queue/priqueue.cc:94: error: `PT_MDART' was not declared in this scope
make: *** [queue/priqueue.o] Error 1
Ns make failed!
 
Old 10-13-2013, 08:27 AM   #533
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
# 532 .

The "May Tamer leach" files that you are using are for ns-2.34 .
May not work in ns-2.35 .

Ubuntu 13.04 , ns-2.35 : Please use gcc-4.4 / g++-4.4 :
$ sudo apt-get install g++-4.4

Building ns-allinone-2.35 :
$ export CC=gcc-4.4 CXX=g++-4.4 && ./install

-
 
1 members found this post helpful.
Old 10-13-2013, 09:39 AM   #534
nik.dan
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
that I have already tried, I had gcc4.4 and g++4.4, though tried again.
gave the same error
Quote:
queue/priqueue.cc:94: error: ‘PT_MDART’ was not declared in this scope
make: *** [queue/priqueue.o] Error 1
Ns make failed!
 
Old 10-14-2013, 07:16 AM   #535
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
# 534.

No leach patch or leach+pegasis patch seem to work in ns-2.35 :
Use ns-2.34 ! The good news :
You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time.
But ! Do not add any path text to .bashrc !

Latest and most versatile is the leach+pegasis patching :
Starts in this thread, post #289.
All "Pegasis" http://www.linuxquestions.org/questions/tags/pegasis/

Leach-pegasis, latest = exidus-pegasis-leach-ns234-patch.2.tar.gz
https://docs.google.com/file/d/0B7S2...it?usp=sharing


-

Last edited by knudfl; 10-14-2013 at 08:16 AM.
 
Old 10-15-2013, 10:30 AM   #536
nik.dan
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
thanks knudfl...
I'll try that and would let you know about the same... and one more thing...do I need to uninstall ns-2.35, if not then while giving ns command how would i know which ns version am i working on? and does it work properly on ubuntu 13.04 as I cannot come down to a 32 bit ubuntu, as my dual boot windows machine do not recognize it tried the installation with ubuntu 12.04 but failed.

Last edited by nik.dan; 10-15-2013 at 10:40 AM. Reason: hadn't completed the query
 
Old 10-15-2013, 11:12 AM   #537
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
# 536 .
Quote:
do I need to uninstall ns-2.35
No. But you can rename / save the executable 'ns' as e.g. 'ns235'.
The idea of having multiple ns2 installs is that you have :
/usr/local/{ ns ns235 ns-<name1> ns-<name2> ns-<name3> } etc.
.. And better delete what you added to .bashrc.

LEACH is an exception : Requires an executable by name 'ns'.
( Unless you edit the test scripts to ns-<new-name> ).


Quote:
does it work properly on ubuntu 13.04
No problem compiling "leach-pegasis" in Ubuntu 13.04 - 64.
I tested that a couple of days ago :
exidus-pegasis-leach-ns234-patch.2.tar.gz
The gcc34 / g++34, 64bits was used. See #531.

-

Last edited by knudfl; 10-15-2013 at 11:13 AM.
 
1 members found this post helpful.
Old 10-15-2013, 12:55 PM   #538
Shivjay
LQ Newbie
 
Registered: Apr 2011
Location: Gwalior
Posts: 6

Rep: Reputation: 0
Dear Friend,
I Know this could be silly question for all of you but i am little bit confuse between both them.
I want to know that LEACH Routing Protocol is only use over sensor network or mobile adhoc network or we can use leach for both.
 
Old 10-16-2013, 04:30 PM   #539
nik.dan
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
thanks kundfl,
now it seems to be working after following all the above mentioned instructions and after making changes in the paths and variables... but when I run the wireless.tcl it gives me following error, copying everything:
Quote:
num_nodes is set 51
Creating sensor nodes... - uAMPS.tcl
mac/chanel.cc: INITIALIZE THE LIST xListHead
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 == BS) - uAMPS.tcl
*** NOTE: no connection pattern specified. - wireless.tcl
Loading scenario file... - wireless.tcl
Load complete... - wireless.tcl
Starting Simulation... - wireless.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
0: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
1: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
2: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
3: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
4: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
5: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
6: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
7: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
8: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
9: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
10: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
11: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
12: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
13: ******************************************* - ns-leach.tcl
13: Is a cluster head at time 0 - ns-leach.tcl
Cluster_count_ is 0 now
THRESH = 0.10000000000000001 - ns-leach.tcl
14: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
15: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
16: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
17: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
18: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
19: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
20: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
21: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
22: ******************************************* - ns-leach.tcl
22: Is a cluster head at time 0 - ns-leach.tcl
Cluster_count_ is 1 now
THRESH = 0.10000000000000001 - ns-leach.tcl
23: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
24: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
25: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
26: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
27: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
28: ******************************************* - ns-leach.tcl
28: Is a cluster head at time 0 - ns-leach.tcl
Cluster_count_ is 2 now
THRESH = 0.10000000000000001 - ns-leach.tcl
29: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
30: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
31: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
32: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
33: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
34: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
35: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
36: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
37: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
38: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
39: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
40: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
41: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
42: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
43: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
44: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
45: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
46: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
47: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
48: ******************************************* - ns-leach.tcl
THRESH = 0.10000000000000001 - ns-leach.tcl
49: ******************************************* - ns-leach.tcl
Cluster Head 13 broadcasting ADV at time 3.7190283461096827e-05 - ns-leach.tcl
ns: _o338 advertiseClusterHead: can't read "max_dist": no such variable
while executing
"$self send $mac_dst $link_dst $ADV_CH $msg $datasize $max_dist $code_"
(procedure "_o338" line 17)
(Application/LEACH advertiseClusterHead line 17)
invoked from within
"_o338 advertiseClusterHead
it was opt(max_dist) before I changed it to $max_dist and gave a value as
Quote:
set max_dist 1000
but when I do that it gives me an error
Quote:
ns: _o194 advertiseClusterHead: wrong # args: should be "set varName ?newValue?"
while compiling
"set max_dist 626 #set by nik as greater than diagonal of the topology = 605*root2"
(compiling body of proc "_o194", line 5)
(Application/LEACH advertiseClusterHead line 5)
invoked from within
"_o194 advertiseClusterHead"
I looked for the error and followed http://mailman.isi.edu/pipermail/ns-...ay/068103.html
but it also gave me the same error...
 
Old 10-18-2013, 01:59 PM   #540
nik.dan
LQ Newbie
 
Registered: Oct 2013
Posts: 10

Rep: Reputation: Disabled
eureka eureka eureka !!!!!

hey,

got the last issue solved, the problem was $max_dist was local vaiable and was needed to be chages at 3 places (I did it only once)
got a beautiful line below saying " simulation complete"

Quote:
At 0.59999999999999998: - mit/uAMPS/stats.tcl
Total Energy = 1.2724140225999991
Total Data = 0
Total Alive = 4

Simulation complete. - mit/uAMPS/stats.tcl
thank you for your timely help (specially knudfl) ...
(might need more help in a short while...)
 
  


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:20 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