BEGIN { highest_packet_id=0; } { Event=$1; Time=$2; Tx=$3; Rx=$4; Packet=$12; Type=$5; Bytes=$8; Initial_Tx=$9; Initial_Rx=$10; if(Packet>highest_packet_id) highest_packet_id=Packet; if(Type=="cbr") { if (Event=="+" && ((Tx=="0" && Rx=="2") || (Tx=="1" && Rx=="2"))) { start_time[Packet]=Time; } if (Event=="r" && Tx=="2" && Rx=="3") { end_time[Packet]=Time; } if (Event=="d" && Initial_Tx=="0.0" && Initial_Rx=="3.0") { end_time[Packet]=-1; dropped_pckts_03++; } if (Event=="d" && Initial_Tx=="1.0" && Initial_Rx=="3.1") { end_time[Packet]=-1; dropped_pckts_13++; } } } END { for(packet_id=0;packet_id<=highest_packet_id;packet_id++) { if (start_time[packet_id] 3 = %f\n",dropped_pckts_03); printf("Dropped packets 1 -> 3 = %f\n",dropped_pckts_13); }