hello
i want get number of path break form simulation of AODV routing protocol with ns2.35.
after searching in net and looking drop result in "ns/trace/cmu-trace.h" i got that "DROP_RTR_MAC_CALLBACK " when occur that path was broken.
in trace file i looking for "CBK" and in awk script i write this code::
Code:
BEGIN {
# Variables defining the reason for the dropped packets
CBK = 0;
CBK_= 0;
keeptimmer=0;
routing_packets=0;
}
{
event = $1;
time = $2;
node = $3;
type = $4;
reason = $5;
node2 = $5;
packetid = $6;
mac_sub_type=$7;
size=$8;
source = $11;
dest = $10;
energy=$14;
# Check for the dropped packets
if (reason == "CBK")
{
if (time != keeptimer)
{
keeptimer=time;
if (event == "D")
{
if (mac_sub_type == "cbr")
CBK++;
else
CBK_++;
}
}
}
}
END {
printf ("%d ",CBK ) >> "drops.txt";
}
my question is:is my way true to get number of path break???
tnx