Errors while using awk script for calculating average end to end delay in ns2
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
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.
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.
Errors while using awk script for calculating average end to end delay in ns2
Hi,
always when I try to get results from my tracefile (simple_aodv.tr) I get several errors:
I want to calculate the average end to end delay of my tracefile.
I use the following command to start the calculation:
awk -f "e2edelay.awk" "simple_aodv.tr"
But I get only this message: awk: e2edelay.awk:77: (FILENAME=simple_aodv.tr FNR=36530) Fatal:division by zero attempted
Has someone an idea why I get this Error: division by zero attempted? Is there an error in the awk script?
I used the same command for calculating the packet delivery rate and there it works.
What do you mean with the datafile is not correct? I used the same tracefile for calculating the packet delivery rate and the proctocol overhead, and it worked without errors. I get only errors when I try to calculate the end-to-end Delay!
That's the code for calculating the end-to-end Delay
please use [COLOR="Blue"][code][/code][/COLOR] to keep formatting of your code.
The message: awk: e2edelay.awk:77: (FILENAME=simple_aodv.tr FNR=36530) Fatal:division by zero attempted means: the error occured in the line 77 of the script e2edelay.awk, and using the line 36530 of the tracefile. Probably that line contains invalid data, or it has invalid format, I cannot check it.
The code you posted does contain a division in line 77, the error message means the variable count is zero. The variable count is only modified in line 53, but only if the condition in line 49 was true (end_time[i] > 0). Looks like it never happened.
Yes, there must be an error in the code. It's like you said, in line 77 it want to divide trough 0 and this is what makes the error. I found this .awk script for calculating the average end 2 end delay in the internet. I use it for a wireless scenario, perhaps this .awk script is only for wired scenarios? Can someone give me a working .awk script for calculating the end 2 end delay?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.