[ndnSIM] AWK in ns3 (ndnSIM)

Farwa A. Hannan f169006 at nu.edu.pk
Wed Jun 19 01:55:24 PDT 2019


I've resolved these error. Now I'm getting the following error.

awk: Delay-Retrans-3.awk:40: (FILENAME=./app-delays-trace.txt FNR=437)
fatal: division by zero attempted


Any help to resolve this?

On Wed, Jun 19, 2019 at 1:26 PM Farwa A. Hannan <f169006 at nu.edu.pk> wrote:

> Hi,
>
> I am using *AWK script* for calculating *delays and retransmissions*.
> Following the the script which I'm using in *"Delay-Retrans-3.awk"*.
>
>
> # AWK Script
> BEGIN {
> total_delayus=0;
> last_seq_number;
> num_of_values=0;
> avg_retrans=0;
> sum_retrans=0;
> total_delayus2=0;
> last_seq_number2;
> num_of_values2=0;
> avg_retrans2=0;
> sum_retrans2=0;
> total_delayus3=0;
> last_seq_number3;
> num_of_values3=0;
> avg_retrans3=0;
> sum_retrans3=0;
> {
> }
> if (( $2 == "0" ) && ( $5 == "FullDelay" )) {
> total_delayus = total_delayus + $6;
> last_seq_number = $4;
> sum_retrans = sum_retrans + $8;
> num_of_values = num_of_values + 1;
> }
> if (( $2 == "7" ) && ( $5 == "FullDelay" )) {
> total_delayus2 = total_delayus2 + $6;
> last_seq_number2 = $4;
> sum_retrans2 = sum_retrans2 + $8;
> num_of_values2 = num_of_values2 + 1;
> }
> if (( $2 == "9" ) && ( $5 == "FullDelay" )) {
> total_delayus3 = total_delayus3 + $6;
> last_seq_number3 = $4;
> sum_retrans3 = sum_retrans3 + $8;
> num_of_values3 = num_of_values3 + 1;
> }
> }
> END {
> avg_retrans = sum_retrans / num_of_values;
> avg_retrans2 = sum_retrans2 / num_of_values2;
> avg_retrans3 = sum_retrans3 / num_of_values3;
> #printf("Total_Delay_: %.4f Avg_of_ReTX_: %.3f\n",
> 1total_delayus, avg_retrans );
> #printf("Total_Delay_: %.4f Avg_of_ReTX_: %.3f\n",
> total_delayus2, avg_retrans2 );
> printf("1pair Total_Delay_: %.4f Last_Seq_Number_: %d
> Avg_of_ReTX_: %.3f\n", total_delayus, last_seq_number,
> avg_retrans );
> printf("2pair Total_Delay_: %.4f Last_Seq_Number_: %d
> Avg_of_ReTX_: %.3f\n", total_delayus2, last_seq_number2,
> avg_retrans2 );
> printf("3pair Total_Delay_: %.4f Last_Seq_Number_: %d
> Avg_of_ReTX_: %.3f\n", total_delayus3, last_seq_number3,
> avg_retrans3 );
> }
>
>
> I am running it on the terminal using the following command
>
> awk -f Delay-Retrans-3.awk "./app-delays-trace.txt"
>
>
> For all of this I am using ns3(ndnSim). But instead of getting the output
> I'm getting the following error messages
>
> awk: Delay-Retrans-3.awk:44: 1total_delayus, avg_retrans );
> awk: Delay-Retrans-3.awk:44:               ^ syntax error
> awk: Delay-Retrans-3.awk:46: total_delayus2, avg_retrans2 );
> awk: Delay-Retrans-3.awk:46:               ^ syntax error
> awk: Delay-Retrans-3.awk:47: printf("1pair Total_Delay_: %.4f
> Last_Seq_Number_: %d
> awk: Delay-Retrans-3.awk:47:        ^ unterminated string
> awk: Delay-Retrans-3.awk:47: printf("1pair Total_Delay_: %.4f
> Last_Seq_Number_: %d
> awk: Delay-Retrans-3.awk:47:        ^ syntax error
>
> Please guide me to solve the problems. Since I'm unable to solve it.
> Thanks
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20190619/5c34f9bc/attachment.html>


More information about the ndnSIM mailing list