From e1cfcab81e142f0047770dc985b4cff792bcc7c3 Mon Sep 17 00:00:00 2001 From: hjp Date: Thu, 18 Feb 1999 12:56:56 +0000 Subject: [PATCH] Filter tcpdump output and convert to time/seq# graph. --- tcpdump_tools/tcpdumptognuplot | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 tcpdump_tools/tcpdumptognuplot diff --git a/tcpdump_tools/tcpdumptognuplot b/tcpdump_tools/tcpdumptognuplot new file mode 100755 index 0000000..bc94d2c --- /dev/null +++ b/tcpdump_tools/tcpdumptognuplot @@ -0,0 +1,30 @@ +#!/usr/bin/perl +$count = $ack = $prevtime = 0; + +while () { + if (/${ARGV[0]}/) { + print "# ", $_; + # 20:22:42.441592 calypso.wsr.ac.at.ftp-data > octopussy.wsr.ac.at.1365: . 1:1461(1460) ack 1 win 57344 (DF) + if (/^(\d\d):(\d\d):(\d\d).(\d\d\d\d\d\d) /) { + print "# time: $1 $2 $3 $4\n"; + $time = $1 * 3600 + $2 * 60 + $3 + $4 * 0.000001; + if ($prevtime == 0) { $prevtime = $time }; + $time -= $prevtime; + } + if (/(\d+):(\d+)\((\d+)\)/) { + print "# sequence: $1 $2 $3\n"; + # filter out initial seq. number but allow some packet loss + if ($2 == $1 + $3 && $1 <= $count + 300000) { + $count = $2; + } + } + if (/ ack (\d+)/) { + print "# ack: $1\n"; + # filter out initial seq. number but allow some packet loss + if ($1 <= $ack + 300000) { + $ack = $1; + } + } + print $time, "\t", $count, "\t", $ack, "\n"; + } +}