LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-24-2014, 08:55 AM   #1
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Rep: Reputation: Disabled
.tcl code for LEACH and SPIN protocols- Bad


I need the .tcl codes for LEACH and SPIN protocols. Could you mail me the codes to my e-mail id either to 'ksdeshamukh@gmail.com' or 'kartikavya@gmail.com'
 
Old 04-24-2014, 09:15 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by kartiksd View Post
I need the .tcl codes for LEACH and SPIN protocols. Could you mail me the codes to my e-mail id either to 'ksdeshamukh@gmail.com' or 'kartikavya@gmail.com'
No we won't. This isn't the place to come for handouts, or the place where you can get free, customized, personal one-on-one consulting/tech-support. This is the place to come for HELP. Show us what you've done/tried, and where you're stuck. Otherwise, you can look things up on Google yourself.
 
Old 04-24-2014, 09:18 AM   #3
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
Welcome to LQ.

SPIN : spin/rca/sims/rca.tcl is included in "old-spin.tar.gz", post #13 →
http://www.linuxquestions.org/questi...2-a-928523/#13
SPIN info http://www.linuxquestions.org/questions/tags/spin-ns2/

LEACH : The files to run the simulation { test, leach_test, wireless*.tcl }:
In the leach patches →
exidus-pegasis-leach-ns234.patch.2.tar.gz , ns-234-leach.tar.gz , etc.

Leach info http://www.linuxquestions.org/questions/tags/leach/
Leach / pegasis info http://www.linuxquestions.org/questions/tags/pegasis/

-
 
2 members found this post helpful.
Old 04-28-2014, 07:52 PM   #4
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
thank you knudfl

it was very helpful and I could get the code. How to install SPIN protocol in ns-2.34?
 
Old 04-29-2014, 04:35 AM   #5
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
# 4 .

There are examples, where people say : I added SPIN to ns-2.34/,
but they didn't tell how to do it.
? Might be simple, it's a few lines to edit.
("Old ns2 mac* might be too different from "new ns2 mac* ?)
.. Besides that, is the SPIN protocol used at all in real life ?

*ns2 files with SPIN code :
app.cc app.h cmu-trace.cc ll.cc ll.h mac.cc
packet.cc packet.h scheduler.cc wireless-phy.cc

Finding the lines with SPIN, in the spin/ directory :
$ grep -Rin spin *
... Which will show the line numbers, where the SPIN code starts.


EDIT : The mac.cc SPIN is just this ...
86:#ifdef SPIN
87-static int MacIndex = 0;
88-#else
89-static int MacIndex = 1;
90-#endif

-
Attached Files
File Type: txt spin_ns2.files.txt (1,018 Bytes, 165 views)

Last edited by knudfl; 04-29-2014 at 04:46 AM.
 
Old 05-04-2014, 02:50 PM   #6
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
to knufdl

while executing rca.tcl in SPIN protocol, I encountered this error,

' no such variable
(read trace on "env(RCA_LIBRARY)")
invoked from within
"source $env(RCA_LIBRARY)/timer.tcl"
(file"rca.tcl" line 1) '

also I have done the changes u had said.....
Pls help me ....
 
Old 05-04-2014, 04:36 PM   #7
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
# 6 .

Which version of ns-allinone-2.xx are you using for SPIN ?

About your errors : The line(s) with the error is missing.
I.e. which variable is missing :
Somewhere above the line with "no such variable".

-
 
Old 05-04-2014, 09:21 PM   #8
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
to knufdl

I am using ns -allione 2.34
also in ubuntu 12.04 LTS
 
Old 05-05-2014, 12:12 AM   #9
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
# 6 .

What is the error ? ?

The error is the usually one of the first lines.
Post #5 shows the last five lines.

-
 
Old 05-05-2014, 04:47 AM   #10
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
the error mentioned in #6 is encountered.
I typed " ns rca.tcl " in ns-2 terminal and it showed the message in post #6 and stopped execution.....

TO knufdl, Sir/Madam, could pls upload a video how to execute SPIN protocol from scratch. It would be helpful....
Pls do as soon as possible....... need them badly .......... Thank you.....
 
Old 05-05-2014, 06:27 AM   #11
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
# 10 .

This is the result I got so far : Making the ten diff´s between the original
ns-2.1b5a files, and the "ns-2.1b5a SPIN code" , like :
$ diff -Nau ns-allinone-2.1b5a/ns-2.1b5/ll.h spin/ll.h > ll.h.patch

The 10 files are attached as DIFF-2.1b5__spin.tar.bz2.txt .
Download the 4.2kB package, rename to DIFF-2.1b5__spin.tar.bz2, and unpack.
.. Then you have the 10 times "code to be added to ns-2.xx" files.
.. I will try if the code is usable at all with ns-2.34 .... later.
.
Attached Files
File Type: txt DIFF-2.1b5__spin.tar.bz2.txt (4.2 KB, 79 views)
 
Old 05-05-2014, 09:38 PM   #12
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
To knudfl, Sir I am attaching the leach.txt file, could you provide me the a similar file that works for spin protocol, which shows output on nam and graph. Pls help me .. I need to have atleat some of the output by tomorrow please help me sir.... Waiting for your reply.....
Attached Files
File Type: txt leach.txt (95.3 KB, 211 views)
 
Old 05-06-2014, 02:59 AM   #13
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
# 12 .

Not leach.txt : You mean leach.tcl.txt . ( Saved here as ``kartiksd-(leach).tcl´´ ).

? I don't see that this tcl file has anything to do with LEACH.
? It's just a very nice simulation example with three xgraph outputs.
The file can be used with any "none leach executable 'ns' ".
If really leach , then please explain the "leach functions".

Who wrote the file ? A link please.

-

Last edited by knudfl; 05-06-2014 at 04:46 AM.
 
Old 05-06-2014, 09:12 AM   #14
kartiksd
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
A friend of mine gave me the file. can u give me optimised spin tcl for other than you mentioned in #3. Please sir...
 
Old 05-06-2014, 09:14 AM   #15
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
# 14 .
Quote:
optimised spin tcl
Sorry, I do not write files.tcl .
 
  


Reply

Tags
spin-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
SPIN and LEACH protocol in NS-2 shanky Linux - General 18 04-26-2015 04:02 AM
LEACH and dsdv in tcl file linuxUser123linux Linux - Software 1 03-05-2014 12:05 AM
LEACH tcl linuxUser123linux Linux - Wireless Networking 2 07-19-2013 12:03 PM
a tcl sample file using leach saeed.m Linux - Software 2 07-15-2013 04:47 AM
SPIN and TEEN protocols shanky Linux - Newbie 1 03-10-2012 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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