LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2012, 12:54 PM   #1
shanky
Member
 
Registered: Aug 2011
Posts: 155

Rep: Reputation: Disabled
Running leach protocol on ns2 !! errors !!


Hi,

I am trying to run leach protocol on ns2.34 using ubuntu 10.10 as platform.
I get an error when i try to execute the code leach_test, after entering the right path (/home/shantanu/ns-allinone-2.34/ns-2.34/ns-234-leach/)
i give the command ./leach_test i get the error in the file leach.err as this

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 "tcl/ex/wireless.tcl" line 184)

Which is this file mobilenode.tcl which has been referred to ?? i tried running the file "test" also but i get the error as this:

couldn't read file "wireless-demo-csci694.tcl": no such file or directory

Why does this happen?? And how can i get the nam to run for leach protocol.
Please guide me as i am a little confused about how to get the outputs although i have been reading the ns2 tutorial to understand.Would be great if someone can explain the process involved in getting outputs for leach.

Regards
Shanky
 
Old 02-28-2012, 01:43 PM   #2
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
Quote:
entering the right path (/home/shantanu/ns-allinone-2.34/ns-2.34/ns-234-leach/)
Something has gone wrong with your patching.
There should be no ns-allinone-2.34/ns-2.34/ns-234-leach/
Please read the script 'leach-HOME-setup234.sh.txt'
to know what's supposed to be done.


The "sh test" command ( and "sh leach_test" ) must be run in
/home/shantanu/ns-allinone-2.34/ns-2.34/, where both files are,
if you copied the files to the right location.

.

Last edited by knudfl; 02-28-2012 at 01:49 PM.
 
Old 02-28-2012, 02:50 PM   #3
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi knudfl,

Have clarified that mistake.There are two files leach_test, one in /home/shantanu/ns-allinone-2.34/ns-2.34/ns-234-leach/ and the other in
/home/shantanu/ns-allinone-2.34/ns-2.34/ .I was trying to get the output with the former one.
I did run ./test in the path /home/shantanu/ns-allinone-2.34/ns-2.34/ but it shows me a lot of warnings.Please have a look

shantanu@ubuntu:~/ns-allinone-2.34/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...


Is this a common error that happens? How can it be rectified?

Thanks
 
Old 02-28-2012, 03:33 PM   #4
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
No errors in post # 3.

Warnings are information, not errors.
Your test looks OK. That's the expected result.
Examples in the ns-2.27+leach thread ..
http://www.linuxquestions.org/questi...79/page17.html
A new example in post #250, other examples from post #5 etc. etc.

.
 
Old 02-29-2012, 12:05 PM   #5
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
Hi knudfl,

As referred by you i did check out those threads , but the script "test" which you have posted in post#6 of this link
http://www.linuxquestions.org/questi...2-27-a-785379/
and the script "test" in my directory are the same.
Why do i still get huge number of warnings? although they are not regarded as errors.

Also i have 2 more questions

1) The output would be written in the directory mit/leach_sims and i went through the leach.err which still shows me the error mentioned in the post#1 and also the file leach.out is empty .What does this mean?

2)How can i get the simulation running for the leach code ,to get the nam running? which .tcl file do i have to run ?

Regards
 
Old 02-29-2012, 01:17 PM   #6
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
Quote:
Why do i still get huge number of warnings ?
Some Linux OS, some versions / updates : No warnings.
Avoid the warnings : Edit some code, has been described
in one of the two long leach threads.

"leach.out" : I think you will find answers for it, when you
read all "400 posts"
2.27 http://www.linuxquestions.org/questi...2-27-a-785379/
2.34 http://www.linuxquestions.org/questi...2-34-a-870368/

Nam : If no "exec nam" is included in the tcl file: No nam window.
.

Last edited by knudfl; 02-29-2012 at 03:42 PM.
 
Old 07-08-2013, 04:18 AM   #7
DeepaliDeshpande
LQ Newbie
 
Registered: Jul 2013
Posts: 11

Rep: Reputation: Disabled
Leach

Hi everybody
today only i registered please tell me from where actually leach.energy file is obtained since i have run stats.tcl but still not getting as per my modifications. Actually i wanted to find remaining energy i.e total-expended but file is not getting generated.
Pl-----------------------------------s help me
 
  


Reply

Tags
leach, ns2



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
codes for leach protocol in ns2 shaddrack yaw nusenu Linux - Newbie 4 09-14-2014 10:16 AM
Leach Protocol for ns2.34 pushpita Linux - Software 36 07-08-2013 04:06 AM
patch for working leach protocol in ns2.34 fedora rajcek Linux - Wireless Networking 4 02-04-2013 06:59 AM
LEACH protocol installation on NS2.27 Scofield Linux - General 255 03-08-2012 05:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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