LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   calculating PDR--leach in NS2.35 (https://www.linuxquestions.org/questions/linux-software-2/calculating-pdr-leach-in-ns2-35-a-4175604877/)

mauriz 01-03-2018 09:09 PM

Quote:

Originally Posted by knudfl (Post 5799178)
Re #11.

Note : You can have as many ns-allinone-2.xx as you want, installed at the same time.
But do never add any *PATH text to .bashrc. Not required.

-

Sorry for disturbing you, Mr @knudfl
I've do install ns-2.34 and ns-2.35 and didn't add any *PATH text to .bashrc then I got this
Quote:

mau@mau-Satellite-L745:~$ ns
The program 'ns' is currently not installed. You can install it by typing:
sudo apt-get install ns2
How to solve it?
Thankyou for your attention and sorry.

knudfl 01-04-2018 02:58 AM

Re #16.

ns-2.34/ , assume Leach :
$ cd ns-2.34/
$ sudo make install ('make install' will copy 'ns' to /usr/local/bin/)


And for a stock ns-2.35/, i.e. no patches / no changes :
$ cd ns-2.35/
$ cp ns ns235-orig
$ sudo cp ns235-orig /usr/local/bin/
Note : The leach 'ns' from ns-2.34 is no good with default simulations.tcl.


Notes
Quote:

The executable 'ns' or "ns-<any-name>" is hard coded to know the location of it`s libraries:
ns-allinone-2.35/{ lib/{libtcl*, tclConfig.sh, tcl8*/}, bin/tcsh8* }.

The old year ~1999 text ....
Please put .... ,, IMPORTANT NOTICES: You MUST put ..
.. was meant only for a "University Computer" :
.. i.e. when you had no write permissions to /usr/local/.


mauriz 01-04-2018 07:57 PM

Quote:

Originally Posted by knudfl (Post 5801547)
Re #16.

ns-2.34/ , assume Leach :
$ cd ns-2.34/
$ sudo make install ('make install' will copy 'ns' to /usr/local/bin/)


And for a stock ns-2.35/, i.e. no patches / no changes :
$ cd ns-2.35/
$ cp ns ns235-orig
$ sudo cp ns235-orig /usr/local/bin/

Ok Mr. Thank you so much for your attention. I really appreciate it :)
But I get the same problem as when I use ns-2.35 for leach.
When I use ns-2.34, leach.out shows me this :
Quote:

At 1.0999999999999999:
Total Energy = 29851.535640588765
Total Data = 0
Total Alive = 4

Simulation complete.
There is no errors:
Quote:

INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!
What must I do? :(

And what do you mean about this:
Quote:

Note : The leach 'ns' from ns-2.34 is no good with default simulations.tcl.
Sorry, but I dont understand

knudfl 01-05-2018 07:43 AM

Re #18.
Quote:

I get the same problem
? Which OS ? Must be a 32bits OS. Must be Ubuntu 10.04 or earlier !


Quote:

The leach 'ns' from ns-2.34 is no good with default simulations.tcl
The executable 'ns' from ns-2.34 + leach can be used for Leach only.
Hence /usr/local/bin/ns-orig


-

mauriz 01-06-2018 10:07 PM

Quote:

mau@mau-Satellite-L745:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
mau@mau-Satellite-L745:~$ uname -i
x86_64


Quote:

The executable 'ns' from ns-2.34 + leach can be used for Leach only.
Hence /usr/local/bin/ns-orig
Ok. Thank you
My simulation always stop at 1.09 or 2.3 and show Total Data=0, and I've try for many time but it always shows the same until now.

knudfl 01-07-2018 06:14 AM

Re #20.

Repeat : Must be a 32bits OS. Must be Ubuntu 10.04 or earlier

mauriz 01-07-2018 08:53 AM

So why my simulation still show Total Data=0 and stop at 1 or 2s ? :(
Do you have any solution?

knudfl 01-07-2018 10:05 AM

Re #22.

? Which OS are you using ? And : Is it 32bits or 64bits ?

bingyou 01-22-2019 04:23 AM

about pdr and end-to-end delay
 
PDR :
Code:

$ awk -f PDR.awk leach.tr
cbr s:102 r:199, r/s Ratio:1.9510, f:0

=========================================
=========================================
hello,
1)Why is the value of PDR greater than 1? Is this normal?
And I want to evaluate the delay through the leach. tr file, but can't find the column of cbr? (my $opt (cp) "")? Is it correct to calculate delay only by [ recvTime[pkt_id] - sendTime[pkt_id] ] ? or,i need add -cp(in leach_test.tcl) with the file generated by cbrgen.tcl?
thanks!!!

knudfl 01-22-2019 07:35 AM

Post #24, @bingyou : Welcome to LQ.

PDR > 1 : Happens sometimes with various simulations / protocols. Don't know why.
... I guess the trace file is actually listing more r than s ?
* You can extract send (s) and receive (r) lines to make a count :
Code:

$ grep "s " leach.tr | wc
  43711

$ grep "r " leach.tr | wc
  99317


Delay examples
Code:

[AWK-first.10.18]$ perl End-to-End-Delay##.pl leach.tr
.
.
Delay:32.3383429999922
Delay:64.6264480000127
Delay:32.3380539999789
 Simulation Time = 498.20000 seconds
 Total Receive Count = 43707
 Average End to End Delay = 32.8981541589885 milliseconds

Code:

[AWK-first.10.18]$ awk -f Avg_Del.awk leach.tr
 avgDelay[ms] overall:  498174

~240 awk and perl ns2-scripts https://drive.google.com/drive/folde...7T?usp=sharing
( AWK-first.10.18 is the "top 25 scripts.)

-

bingyou 01-24-2019 03:01 AM

@knudfl Thanks for your reply .It helps me a lot .
1)r is more than s .I think in the Cluster Building Phase the CH broadcasts the ADV message to all other nodes. the s is 1, and the r is 99(if there are 100nodes) in trace file.Bur i don't understand the 9th pkt that node 60 sends to node48. s is 1,r is 3. also the 7th, 10th pkt.
Code:

r 0.001121952 _16_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001121959 _65_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001121974 _5_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001121974 _1_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001121990 _27_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001122008 _56_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001122011 _39_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
r 0.001122017 _40_ AGT  --- 4 rca 2 [0 21000000 ffff0008 0] ------- [A 33 -1 -1]
s 0.018505691 _5_ AGT  --- 5 rca 16 [0 5000000 0 0] ------- [R 5 10 -1]
r 0.018843847 _10_ AGT  --- 5 rca 16 [0 5000000 ffff0008 0] ------- [R 5 10 -1]
s 0.038531366 _22_ AGT  --- 6 rca 16 [0 16000000 0 0] ------- [R 22 48 -1]
r 0.038869541 _48_ AGT  --- 6 rca 16 [0 16000000 ffff0008 0] ------- [R 22 48 -1]
s 0.047816087 _95_ AGT  --- 7 rca 16 [0 5f000000 0 0] ------- [R 95 48 -1]
r 0.048154124 _48_ AGT  --- 7 rca 16 [0 5f000000 ffff0008 0] ------- [R 95 48 -1]
r 0.048154251 _22_ AGT  --- 7 rca 16 [0 5f000000 ffff0008 0] ------- [R 95 48 -1]
s 0.058963609 _93_ AGT  --- 8 rca 16 [0 5d000000 0 0] ------- [R 93 36 -1]
r 0.059301702 _36_ AGT  --- 8 rca 16 [0 5d000000 ffff0008 0] ------- [R 93 36 -1]
s 0.072799292 _60_ AGT  --- 9 rca 16 [0 3c000000 0 0] ------- [R 60 48 -1]
r 0.073137331 _22_ AGT  --- 9 rca 16 [0 3c000000 ffff0008 0] ------- [R 60 48 -1]
r 0.073137443 _95_ AGT  --- 9 rca 16 [0 3c000000 ffff0008 0] ------- [R 60 48 -1]
r 0.073137461 _48_ AGT  --- 9 rca 16 [0 3c000000 ffff0008 0] ------- [R 60 48 -1]
s 0.094977208 _68_ AGT  --- 10 rca 16 [0 44000000 0 0] ------- [R 68 48 -1]
r 0.095315225 _22_ AGT  --- 10 rca 16 [0 44000000 ffff0008 0] ------- [R 68 48 -1]
r 0.095315263 _60_ AGT  --- 10 rca 16 [0 44000000 ffff0008 0] ------- [R 68 48 -1]
r 0.095315386 _95_ AGT  --- 10 rca 16 [0 44000000 ffff0008 0] ------- [R 68 48 -1]
r 0.095315394 _48_ AGT  --- 10 rca 16 [0 44000000 ffff0008 0] ------- [R 68 48 -1]
s 0.096349800 _44_ AGT  --- 11 rca 16 [0 2c000000 0 0] ------- [R 44 2 -1]
r 0.096687957 _2_ AGT  --- 11 rca 16 [0 2c000000 ffff0008 0] ------- [R 44 2 -1]

2)I think the avgDelay in "
Quote:

[AWK-first.10.18]$ awk -f Avg_Del.awk leach.tr avgDelay[ms] overall: 498174
" is wrong. In file "Avg_Del.awk" the pkt_id =$12, I think it should be "pkt_id=$6". The end-to-end delay calculated with file "End-to-End-Delay##.pl" is more reasonable.The receive time is determined by the first time it is accepted.

3)
Quote:

[AWK-first.10.18]$ perl End-to-End-Delay##.pl leach.tr
.
.
Delay:32.3383429999922
Delay:64.6264480000127
Delay:32.3380539999789
Simulation Time = 498.20000 seconds
Total Receive Count = 43707
Average End to End Delay = 32.8981541589885 milliseconds
Quote:

$ grep "s " leach.tr | wc
43711
The PDR = 43707 / 43711 . Is it correct?


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