File: tcpf2xgr

package info (click to toggle)
ns2 2.35%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 78,796 kB
  • sloc: cpp: 172,923; tcl: 107,130; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 816; awk: 525; csh: 355
file content (61 lines) | stat: -rwxr-xr-x 1,524 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/sh
#
# tcpf2xgr -- convert full-tcp trace file to xgraph or gnuplot
# Usage: tcpf2xgr [-r] [-m wrap] [-s scale] TclShPath tracefile <xgraph | gnuplot> [testname]
#
PATH=$PATH:../../bin:.
PROGNAME=$0

while [ $# -ne 0 ] # loop over arguments
do
	case $1 in
	-[mM])	opts="$opts $1 $2"
		shift;;
	-[sS])	opts="$opts $1 $2"
		shift;;
	-[nN])	opts="$opts $1 $2"
		shift;;
	-[rR])	opts="$opts $1"
		shift;;

	*)	break;;
	esac
	shift
done

if [ $# -lt 3 ]; then
	echo "Usage: $PROGNAME [-m wrap] [-r] [-s scale] TclShPath tracefile <xgraph | gnuplot> testname"
	exit 1;
fi
TCLSH=$1; shift
GNAME=$1
if [ $# -eq 3 ]; then
	GNAME=$3;
fi
PROGDIR=`dirname $PROGNAME`
$TCLSH $PROGDIR/tcpfull-summarize.tcl $opts $1 $1
$TCLSH $PROGDIR/tcpfull-summarize.tcl $opts $1 $1.r reverse
$TCLSH $PROGDIR/cplot.tcl $2 $GNAME.forw \
	$1.p "segments sent" \
	$1.acks "acks w/data rcvd" \
	$1.packs "pure acks rcvd" \
	$1.d "drops" \
	$1.es "zero-len segments sent" \
	$1.ctrl "SYN or FIN" \
	$1.ecn "EcnEcho ACKs" \
	$1.cact "Cong Action" \
	$1.sack "Acks w/SACK info" | $2 &

$TCLSH $PROGDIR/cplot.tcl $2 $GNAME.REV $1.r.p "segments sent" \
	$1.r.acks "acks w/data rcvd" \
	$1.r.packs "pure acks rcvd" \
	$1.r.d "drops" \
	$1.r.es "zero-len segments sent" \
	$1.r.ctrl "SYN or FIN" \
	$1.r.ecn "EcnEcho ACKs" \
	$1.r.cact "Cong Action" \
	$1.r.sack "Acks w/SACK info" | $2 &

sleep 2
rm -f $1.p $1.acks $1.packs $1.d $1.ctrl $1.es $1.ecn $1.cact $1.sack
rm -f $1.r.p $1.r.acks $1.r.packs $1.r.d $1.r.ctrl $1.r.es $1.r.ecn $1.r.cact $1.r.sack