LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   .tcl code for LEACH and SPIN protocols- Bad (https://www.linuxquestions.org/questions/linux-newbie-8/tcl-code-for-leach-and-spin-protocols-bad-4175502839/)

kartiksd 04-24-2014 08:55 AM

.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'

TB0ne 04-24-2014 09:15 AM

Quote:

Originally Posted by kartiksd (Post 5158385)
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.

knudfl 04-24-2014 09:18 AM

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/

-

kartiksd 04-28-2014 07:52 PM

thank you knudfl
 
it was very helpful and I could get the code. How to install SPIN protocol in ns-2.34?

knudfl 04-29-2014 04:35 AM

1 Attachment(s)
# 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

-

kartiksd 05-04-2014 02:50 PM

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 ....

knudfl 05-04-2014 04:36 PM

# 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".

-

kartiksd 05-04-2014 09:21 PM

to knufdl
 
I am using ns -allione 2.34
also in ubuntu 12.04 LTS

knudfl 05-05-2014 12:12 AM

# 6 .

What is the error ? ?

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

-

kartiksd 05-05-2014 04:47 AM

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.....

knudfl 05-05-2014 06:27 AM

1 Attachment(s)
# 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.
.

kartiksd 05-05-2014 09:38 PM

1 Attachment(s)
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.....

knudfl 05-06-2014 02:59 AM

# 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.

-

kartiksd 05-06-2014 09:12 AM

A friend of mine gave me the file. can u give me optimised spin tcl for other than you mentioned in #3. Please sir...

knudfl 05-06-2014 09:14 AM

# 14 .
Quote:

optimised spin tcl
Sorry, I do not write files.tcl .


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