[ns] awk error
Kiraneet sharma
kiraneet.sharma at gmail.com
Thu Mar 26 20:23:18 PDT 2009
Hello...
the awk script for finding the sent,received packets and packet delivery
ratio
is written below.
do the following
[root at localhost ~]# awk -f name_of_awk_script.awk name of your tracefile.tr
--------------------------------------------------------------------------------------------------------------------------
BEGIN {
sendLine = 0;
recvLine = 0;
fowardLine = 0;
}
$0 ~/^s.* AGT/ {
sendLine ++ ;
}
$0 ~/^r.* AGT/ {
recvLine ++ ;
}
$0 ~/^f.* RTR/ {
fowardLine ++ ;
}
END {
printf "%d %d %.4f \n", sendLine, recvLine,
(recvLine/sendLine),fowardLine;
}
More information about the Ns-users
mailing list