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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-27-2017, 03:31 PM
|
#1
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Rep:
|
LEACH Protocol (Mit + uAMPS )
Hello My friend
Really new in ns2 and I am installing leach protocols (mit-uAMPS) in ns-2.35 and success to run the leach_test and wireless.tcl and get no error and there are leach.tr and leach.out .
My problems are I have my own scenarios which I make it in setdest in ns2
how I can apply this scenario in leach protocol and the change must do in wireless.tcl and leach_test .
Also I need the Packet delivery ratio (PDF) how I can calculate it in leach from leach.tr or leach.out
Thank you
|
|
|
03-27-2017, 06:27 PM
|
#2
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Quote:
I have my own scenarios which I make it in setdest in ns2
|
Please read wireless.tcl to know that a scenario file is already used :
Like ../mobility/scene/scen-670x670-50-600-20-0, or scen-670x670-50-600-20-2.
(Line number : $ grep -n mobility wireless.tcl ) (The "cbr" traffic file will also be listed.)
So you can just try adding your own file specs to wireless.tcl, and the file(s) to tcl/mobility
About Packet delivery ratio, PDF :
Find a file.awk in awk#perl#python__scripts-1-2017.tar.gz (~170 scripts) that can work with your file
https://drive.google.com/file/d/0B7S...ew?usp=sharing
List :
all.awk
Pdf-0.awk
pdf.awk
PDR.awk
PacketDeliveryFraction.awk
PacketDeliveryRatio.awk
Leach INFO http://www.linuxquestions.org/questi...leach%20ns235/
-
|
|
|
03-28-2017, 07:30 AM
|
#3
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
Thank you very much knudfl to fast answer
I put my scenario in the wireless.tcl and there is no errors
My question is ... there are also scenario in the leach_test file must I change it or not ? also the result for simulation for leach protocols in leach.tr or leach.out ?
Thank you
|
|
|
03-28-2017, 08:58 AM
|
#4
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Re #3.
Quote:
there are also scenario in the leach_test file
|
You can try making copies of 'leach_test' ( 1-leach_test , 2-leach_test ).
... And then try out the modifications : ./1-leach_test , ./2-leach_test
Ref. http://www.linuxquestions.org/questi...4175556129/#11
-
|
|
|
04-05-2017, 12:13 PM
|
#5
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
LEACH Resulats
I hope all have a nice day
I installed Mit-uAmps in Ns-2.35 and run leach_test and No error in leach.err My problem When I need to calculate the packet send and packets drop and PDR from leach.tr by using AWK I get different results in each time I run leach_test.
Please, any body can help me for that.
Best Regards
|
|
|
04-05-2017, 01:21 PM
|
#6
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Re #5.
"Different results / random results" :
I guess that's caused by the ns2 function "random seed".
Though seed is set to 0.0, seed is by definition still random, AFAIK.
Using grep with the Leach files :
Code:
$ grep -Rin seed *
common/mobilenode.cc:228: energy_model()->afe()->set_sleepseed(atof(argv[2]));
mit/uAMPS/ns-bsapp.tcl:30: $rng_ seed 0
mit/uAMPS/ns-leach.tcl:39: $rng_ seed 0
mit/uAMPS/ns-mte.tcl:32: $rng_ seed 0
mit/uAMPS/sims/genscen:11:$rng seed 0
tcl/ex/wireless.tcl:57:set opt(seed) 0.0
tcl/ex/wireless.tcl:116: puts "\t\t\[-seed seed\] \[-stop sec\] \[-tr tracefile\]\n"
tcl/ex/wireless.tcl:122: lappend optlist cp nn seed sc stop tr x y
tcl/ex/wireless.tcl:206:if {$opt(seed) > 0} {
tcl/ex/wireless.tcl:207: puts "Seeding Random number generator with $opt(seed)\n"
tcl/ex/wireless.tcl:208: ns-random $opt(seed)
tcl/ex/wireless.tcl:304:puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)"
The reason for "random seed" : ns2 intends to imitate a real world situation. AFAIK.
https://www.google.com/webhp?hl=all&...=en&q=ns2+seed
* http://www.isi.edu/nsnam/ns/doc/node268.html
-
|
|
1 members found this post helpful.
|
04-05-2017, 01:40 PM
|
#7
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
Thank you very much knudfl
I will check that
|
|
|
04-05-2017, 04:08 PM
|
#8
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
Need Help
I want to thanks again knudfl Really I check seed it is 0 in all places, and it is the same problem the result is different when run leach_test and read results from leach.tr please see the attach files maybe u can help me.
thanks knudfl
|
|
|
04-05-2017, 04:21 PM
|
#9
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,330
|
Quote:
Originally Posted by ITengineer
I want to thanks again knudfl Really I check seed it is 0 in all places, and it is the same problem the result is different when run leach_test and read results from leach.tr please see the attach files maybe u can help me.
thanks knudfl
|
Sorry, but do you really not understand what a random number is??? It STARTS with 0...and generates a random number. It will NEVER be the same twice.
|
|
|
04-05-2017, 04:31 PM
|
#10
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
Really I understand what you mean But? I want to make comparative and I fix the number of nodes and all parameters and when run Leach_ test and see the results when nodes are 50 and nodes are 100 it's same PDR and packet lsot and etc ... I am new in this field.
Thanks
Last edited by ITengineer; 04-06-2017 at 05:36 AM.
|
|
|
04-05-2017, 04:34 PM
|
#11
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,330
|
Quote:
Originally Posted by ITengineer
Really I understand what you mean But? I want to make comparative and I fix the number of nodes and all parameters and want run Leach_ test and see the results when nodes are 50 and nodes are 100. I am new in this field .
|
And you are seeing those results. The 'field' doesn't matter in this context....a random number is just that: RANDOM. You won't get the same results twice. Not sure what you don't understand about that....
|
|
|
04-06-2017, 05:46 AM
|
#12
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
Thanks TB0ne
I want to make comparative and I fix the number of nodes and all parameters. when running leach_test twice the results of PDR, packet lost and etc ...which read it from leach.tr different in each time and I don't change any parameters I thought if I don't change the parameters results must be same . But I get not same when running leach_test
Thanks
Last edited by ITengineer; 04-06-2017 at 05:47 AM.
|
|
|
04-06-2017, 07:21 AM
|
#13
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
Re #12, etc.
http://www.isi.edu/nsnam/ns/doc/node268.html : Quote → →
Quote:
To get non-deterministic behavior, set the seed of the default RNG to 0.
This will set the seed based on the current time of day and a counter.
|
I.e. "seed = 0" causes a random result.
-
Last edited by knudfl; 04-06-2017 at 07:23 AM.
|
|
1 members found this post helpful.
|
04-06-2017, 10:01 AM
|
#14
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,330
|
Quote:
Originally Posted by ITengineer
Thanks TB0ne
I want to make comparative and I fix the number of nodes and all parameters. when running leach_test twice the results of PDR, packet lost and etc ...which read it from leach.tr different in each time and I don't change any parameters I thought if I don't change the parameters results must be same . But I get not same when running leach_test
Thanks
|
YOU ARE USING A RANDOM NUMBER GENERATOR...IT WILL GENERATE RANDOM NUMBERS. How, exactly do you think you'll get the same results twice with random values???? What do you not understand about this???? The seed is where the random number pool STARTS from.
If you truly can't understand that, then you need to ask your teacher to explain what a random number is.
|
|
|
04-08-2017, 05:55 AM
|
#15
|
LQ Newbie
Registered: Mar 2017
Posts: 10
Original Poster
Rep:
|
Quote:
Originally Posted by knudfl
|
Thank you very much knudf for your cooperation. I now understand that But I have another question why always receive in zero PLeease if you guide me to solve this problem
|
|
|
All times are GMT -5. The time now is 08:58 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|