LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-04-2015, 01:19 AM   #1
sims2801
Member
 
Registered: Aug 2012
Posts: 50

Rep: Reputation: Disabled
delay calculation from trace files of AODV / LAR protocols


when i am running delay.awk file on AODV.tr and LAR.tr For AODV.tr , it is giving me the o/p value as some delay
but for LAR , its showing me the follwing error

gawk: e2edelay.awk:93: (FILENAME=larscen5.tr FNR=36516130) fatal: division by zero attempted

I was unable to recify the error. could you please help me.
thank you so much

this is the code of awk file which i am using for calculation of delay. kindly help

# http://205.196.121.184/fnufnnc17mwg/...c/e2edelay.awk
# http://mohittahiliani.blogspot.dk/20...s-for-ns2.html
# ===================================================================

# AWK Script for calculating:

# => Average End-to-End Delay.

# ===================================================================



BEGIN {

seqno = -1;

# droppedPackets = 0;

# receivedPackets = 0;

count = 0;

}

{

if($4 == "AGT" && $1 == "s" && seqno < $6) {

seqno = $6;

}
# else if(($4 == "AGT") && ($1 == "r")) {

# receivedPackets++;

# } else if ($1 == "D" && $7 == "tcp" && $8 > 512){

# droppedPackets++;

# }

#end-to-end delay

if($4 == "AGT" && $1 == "s") {

start_time[$6] = $2;

} else if(($7 == "cbr") && ($1 == "r")) {

end_time[$6] = $2;

} else if($1 == "D" && $7 == "cbr") {

end_time[$6] = -1;

}

}


END {

for(i=0; i<=seqno; i++) {

if(end_time[i] > 0) {

delay[i] = end_time[i] - start_time[i];

count++;

}

else

{

delay[i] = -1;

}

}

for(i=0; i<count; i++) {

if(delay[i] > 0) {

n_to_n_delay = n_to_n_delay + delay[i];

}

}

n_to_n_delay = n_to_n_delay/count;



print "\n";

# print "GeneratedPackets = " seqno+1;

# print "ReceivedPackets = " receivedPackets;

# print "Packet Delivery Ratio = " receivedPackets/(seqno+1)*100
#"%";

# print "Total Dropped Packets = " droppedPackets;

print "Average End-to-End Delay = " n_to_n_delay * 1000 " ms";

print "\n";

}
 
Old 03-05-2015, 10:01 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.4 + 50+ other Linux OS, for test only.
Posts: 16,756

Rep: Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329
Not all files.tr can be chewed with a random awk script.

Please try out the other "delay" sripts, awk-and-perl_scripts_12.2014.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

delay.awk
delay-e2e.awk
delay-link.awk
del-ratio.awk
e2edelay.awk
en2end-delay.awk
Endtoenddelay.awk
measure-delay.awk
tess-delay.awk
thr_drop_delay.awk


-
 
Old 03-11-2015, 07:56 AM   #3
sims2801
Member
 
Registered: Aug 2012
Posts: 50

Original Poster
Rep: Reputation: Disabled
thanks a lot for ur kind reply.

each awk file gives different o/p. then how we can sure which awk file has to be used.
I am trying with all the awk files which you mentioned but each file has some constraints like some are giving the same error , some are not giving any o/p , some are giving the o/p acc to each time instant ......

kindly suggest.
thanks
 
Old 03-11-2015, 11:11 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.4 + 50+ other Linux OS, for test only.
Posts: 16,756

Rep: Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329Reputation: 3329
<<< ref. post #3.

Please ask @billyfuad
http://network-simulator-ns-2.7690.n...20.html#a29193
>>> http://network-simulator-ns-2.7690.n...odes&user=5465
>>> "Send Email to billyfuad"


-
 
  


Reply

Tags
ns2


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
[SOLVED] end to end delay calculation in satellite links awk file problem-ns2.35 rianariana Linux - Software 3 11-23-2013 10:46 AM
Calculation of rtt from ns2 trace file maria_seb Linux - Wireless Networking 1 03-20-2013 11:19 AM
Problem with calculate loss packet and Mean delay in a a trace file of wimax maymouna Linux - Newbie 3 07-05-2011 07:06 PM
delay calculation for LSB in timer tkmsr Programming 2 09-05-2010 03:47 PM

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

All times are GMT -5. The time now is 01:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration