LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-03-2018, 10:09 PM   #16
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled

Quote:
Originally Posted by knudfl View Post
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.
 
Old 01-04-2018, 03:58 AM   #17
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,139

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
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/.

Last edited by knudfl; 01-04-2018 at 06:02 AM.
 
Old 01-04-2018, 08:57 PM   #18
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
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

Last edited by mauriz; 01-04-2018 at 11:02 PM.
 
Old 01-05-2018, 08:43 AM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,139

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
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


-
 
Old 01-06-2018, 11:07 PM   #20
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

Rep: Reputation: Disabled
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.
 
Old 01-07-2018, 07:14 AM   #21
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,139

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
Re #20.

Repeat : Must be a 32bits OS. Must be Ubuntu 10.04 or earlier
 
Old 01-07-2018, 09:53 AM   #22
mauriz
LQ Newbie
 
Registered: Dec 2017
Posts: 16

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

Last edited by mauriz; 01-07-2018 at 10:03 AM.
 
Old 01-07-2018, 11:05 AM   #23
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,139

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
Re #22.

? Which OS are you using ? And : Is it 32bits or 64bits ?
 
Old 01-22-2019, 05:23 AM   #24
bingyou
LQ Newbie
 
Registered: Jun 2018
Posts: 2

Rep: Reputation: Disabled
Question 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!!!
 
Old 01-22-2019, 08:35 AM   #25
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,139

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
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.)

-

Last edited by knudfl; 01-22-2019 at 08:54 AM.
 
Old 01-24-2019, 04:01 AM   #26
bingyou
LQ Newbie
 
Registered: Jun 2018
Posts: 2

Rep: Reputation: Disabled
@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?
 
  


Reply

Tags
leach, leach ns235, ns2, ns2 ns-allinone, ubuntu 14.04


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
problem with running leach protocol in ns2.34 leach.er Mohamed69 Linux - Software 14 04-16-2018 08:10 AM
How to using NAM Trace format to find PDR, Packet Loss, Timeout, RTT in NS2? krist_chamber Linux - Networking 2 12-02-2015 02:04 PM
leach.out total energy increase leach ns2.34 linuxUser123linux Linux - Software 1 07-13-2013 05:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration