2 # we need the number of bytes in a packet to do the output
3 # in packet numbers rather than byte numbers.
10 # convert tcp trace to send/ack form.
12 tim = t
[1]*3600 + t
[2]*60 + t
[3]
19 # we have a data packet record:
20 # ignore guys with syn, fin or reset 'cause we
21 # can't handle their sequence numbers. Try to
22 # detect and add a flag character for 'anomalies':
24 # - -> packet after hole (missing packet(s))
25 # # -> odd size packet
29 strtSeq =
substr($
6,1,i
-1)
30 endSeq =
substr($
6,i
+1,j
-i
-1)
31 len = endSeq
- strtSeq
35 if (endSeq
- expectNext
< 0)
38 if (strtSeq
- expectNext
> 0)
40 else if (len
!= packetsize
)
46 printf "%7.2f\t%7.2f\t%s send %s %d", tim
-tzero
, tim
-ltim
,\
48 if (++timesSent
[id
] > 1)
49 printf " (%.2f) [%d]", tim
- timeOf
[id
], timesSent
[id
]
50 if (len
!= packetsize
)
56 printf "%7.2f\t%7.2f\t%s ack %s %d", tim
-tzero
, tim
-ltim
,\
62 printf " (%.2f)", tim
- timeOf
[id
]
63 if (++timesAcked
[id
] > 1)
64 printf " [%d]", timesAcked
[id
]