#!/bin/tcsh # # Usage: process fwdPM ftp ID duration warmup pairs # if ( $? != 0 || $# < 6 ) then echo "Usage: $0 fwdPM ftp ID duration warmup pairs" exit 2 endif # command-line arguments set fwdPM = $1 set ftp = $2 set ID = $3 set duration = $4 set warmup = $5 set pairs = $6 set run = 1 set datadir = "./processed" mkdir -p $datadir set pattern = "${fwdPM}cs-${ftp}FTP-$ID-${duration}s" set BINDIR = "/home/research/multi-cl/bin" touch PROCESS set date = `date "+%H:%M:%S (%m/%d/%y)"` echo -n "$fwdPM $ID ${duration}s START: $date " >> PROCESS # combine PM files if ! (-e $pattern-PM.dat.gz) then if ! (-e $pattern-PM.dat) then cat $pattern-PM2.dat $pattern-PM3.dat | sort -n | head -$pairs > $pattern-PM.dat endif set PMfile = "$pattern-PM.dat" else zcat $pattern-PM.dat.gz | head -$pairs >! PM.dat set PMfile = "PM.dat" endif # gzip all PM data files if (-e $pattern-PM0.dat) then gzip -f $pattern-PM?.dat endif # find the time the last pair completed on forward path tail -1 $PMfile | awk '{printf "%d\n", $1}' >! $datadir/$pattern-LAST-RSP.dat set last_time = `cat $datadir/$pattern-LAST-RSP.dat` mkdir -p $datadir/gput mkdir -p $datadir/tput # # gput dst "r" # tput 01 "+" # drop 01, 23 # qsz 01, 23 # # ::::::::::::::::::::::::::::: TPUT :::::::::::::::::::::::::::::::::: if ($ID == "0CL") then set queues = "src 01" else if ($ID == "1CL") then set queues = "src 01 12" else if ($ID == "2CL") then set queues = "src 01 12 34" else if ($ID == "3CL") then set queues = "src 01 12 34 56" endif foreach q ($queues) set temp = "$q.trq" if ! (-e $temp) then zcat $pattern-$q.trq.gz >! $temp endif # :: AGGREGATE :::: # compute aggregate tput per second set file = "$datadir/tput/$pattern-tput-$q.dat" if ! (-e $file || -e ${file}.gz) then if ($q == "src") then awk '{if ($1=="+" && $4==0 && $2 < '$last_time') print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file else awk '{if ($1=="+" && $3<$4 && $2 < '$last_time') print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif endif # calculate average tput set tputfile = "$datadir/TPUT-$q" if ! (-e $tputfile) then echo "# c/s ftp ID run mean" >! $tputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $tputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $tputfile # :: E2E-HTTP ONLY :::: # compute tput per second for web flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12-17) set file = "$datadir/tput/$pattern-tput-$q-HTTP.dat" if ! (-e $file || -e ${file}.gz) then if ($q == "src") then awk '{if ($1=="+" && $4==0 && $2 < '$last_time' && $7>=10 && $7<12) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file else awk '{if ($1=="+" && $3<$4 && $2 < '$last_time' && $7>=10 && $7<12) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif endif # calculate average tput set tputfile = "$datadir/TPUT-$q-HTTP" if ! (-e $tputfile) then echo "# c/s ftp ID run mean" >! $tputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $tputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $tputfile # :: FTP ONLY :::: # compute tput per second for ftp flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12+) set file = "$datadir/tput/$pattern-tput-$q-FTP.dat" if ! (-e $file || -e ${file}.gz) then if ($q == "src") then awk '{if ($1=="+" && $4==0 && $2 < '$last_time' && $7<10) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file else awk '{if ($1=="+" && $3<$4 && $2 < '$last_time' && $7<10) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif endif # calculate average tput set tputfile = "$datadir/TPUT-$q-FTP" if ! (-e $tputfile) then echo "# c/s ftp ID run mean" >! $tputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $tputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $tputfile if ($q != "src" && $q != "01") then # :: CT-HTTP ONLY :::: # compute tput per second for cross-traffic web flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12-23) set file = "$datadir/tput/$pattern-tput-$q-CT.dat" if ! (-e $file || -e ${file}.gz) then awk '{if ($1=="+" && $2 < '$last_time' && $3<$4 && $7>=12 && $7<24) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif # calculate average tput set tputfile = "$datadir/TPUT-$q-CT" if ! (-e $tputfile) then echo "# c/s ftp ID run mean" >! $tputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $tputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $tputfile endif end # ::::::::::::::::::::::::::::: RSPTIME :::::::::::::::::::::::::::::::::: # compute CDF of response times if ! (-e $datadir/$pattern-rsptime-CDF.dat) then awk '{if ($1 != "#") print $4}' $PMfile | sort -n | calcCDF.pl -z -o -b 10 >! $datadir/$pattern-rsptime-CDF.dat endif # calculate average and quantiles of rsptime set rsptimefile = "$datadir/RSPTIME" if ! (-e $rsptimefile) then echo "# c/s ftp ID run mean 10Q 25Q 50Q 75Q 90Q 99Q" >! $rsptimefile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $rsptimefile awk '{print $4}' $PMfile | avg.pl | awk '{printf "%-9.3f ", $2}' >> $rsptimefile awk '{if ($1 != "#" && $4 >= 0.1) print $2}' $datadir/$pattern-rsptime-CDF.dat | head -1 | awk '{printf "%-5d ",$1}' >> $rsptimefile awk '{if ($1 != "#" && $4 >= 0.25) print $2}' $datadir/$pattern-rsptime-CDF.dat | head -1 | awk '{printf "%-5d ",$1}' >> $rsptimefile awk '{if ($1 != "#" && $4 >= 0.5) print $2}' $datadir/$pattern-rsptime-CDF.dat | head -1 | awk '{printf "%-5d ",$1}' >> $rsptimefile awk '{if ($1 != "#" && $4 >= 0.75) print $2}' $datadir/$pattern-rsptime-CDF.dat | head -1 | awk '{printf "%-5d ",$1}' >> $rsptimefile awk '{if ($1 != "#" && $4 >= 0.9) print $2}' $datadir/$pattern-rsptime-CDF.dat | head -1 | awk '{printf "%-5d ",$1}' >> $rsptimefile awk '{if ($1 != "#" && $4 >= 0.99) print $2}' $datadir/$pattern-rsptime-CDF.dat | head -1 | awk '{printf "%-5d\n",$1}' >> $rsptimefile # ::::::::::::::::::::::::::::: GPUT :::::::::::::::::::::::::::::::::: if ($ID == "0CL") then set queues = "01 dst" else if ($ID == "1CL") then set queues = "01 12 dst" else if ($ID == "2CL") then set queues = "01 12 34 dst" else if ($ID == "3CL") then set queues = "01 12 34 56 dst" else echo "ID ($ID) invalid. Use 0CL, 1CL, 2CL, or 3CL" exit endif foreach q ($queues) set temp = "$q.trq" if ! (-e $temp) then zcat $pattern-$q.trq.gz >! $temp endif # :: AGGREGATE :::: # compute aggregate gput per second set file = "$datadir/gput/$pattern-gput-$q.dat" if ! (-e $file || -e ${file}.gz) then awk '{if ($1=="r" && $2 < '$last_time' && $3<$4) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif # calculate average gput set gputfile = "$datadir/GPUT-$q" if ! (-e $gputfile) then echo "# c/s ftp ID run mean" >! $gputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $gputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $gputfile # :: E2E-HTTP ONLY :::: # compute gput per second for web flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12-17) set file = "$datadir/gput/$pattern-gput-$q-HTTP.dat" if ! (-e $file || -e ${file}.gz) then awk '{if ($1=="r" && $2 < '$last_time' && $3<$4 && $7>=10 && $7<12) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif # calculate average gput set gputfile = "$datadir/GPUT-$q-HTTP" if ! (-e $gputfile) then echo "# c/s ftp ID run mean" >! $gputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $gputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $gputfile # :: FTP ONLY :::: # compute gput per second for ftp flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12-17) set file = "$datadir/gput/$pattern-gput-$q-FTP.dat" if ! (-e $file || -e ${file}.gz) then awk '{if ($1=="r" && $2 < '$last_time' && $3<$4 && $7<10) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif # calculate average gput set gputfile = "$datadir/GPUT-$q-FTP" if ! (-e $gputfile) then echo "# c/s ftp ID run mean" >! $gputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $gputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $gputfile if ($q != "dst" && $q != "01") then # :: CT-HTTP ONLY :::: # compute gput per second for cross-traffic web flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12-23) set file = "$datadir/gput/$pattern-gput-$q-CT.dat" if ! (-e $file || -e ${file}.gz) then awk '{if ($1=="r" && $2 < '$last_time' && $3<$4 && $7>=12 && $7<24) print $2,($6*8/1000.0)}' $temp | interval_sum.pl 1 $warmup | awk '{print $1, $3}' > $file endif # calculate average gput set gputfile = "$datadir/GPUT-$q-CT" if ! (-e $gputfile) then echo "# c/s ftp ID run mean" >! $gputfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $gputfile awk '{print $2}' $file | avg.pl | awk '{printf "%-9.3f\n", $2}' >> $gputfile endif end # ::::::::::::::::::::::::::::: QSZ :::::::::::::::::::::::::::::::::: if ($ID == "0CL") then set queues = "01" else if ($ID == "1CL") then set queues = "01 12" else if ($ID == "2CL") then set queues = "01 12 34" else if ($ID == "3CL") then set queues = "01 12 34 56" endif foreach q ($queues) set temp = "qsz-$q.tr" set cdffile = "$datadir/$pattern-$q-qsz-CDF.dat" zcat $pattern-$q-qsz.tr.gz >! $temp # compute CDF of queue size if ! (-e $cdffile) then awk '{print $3}' $temp | sort -n | calcCDF.pl -z -o -b 1 > $cdffile endif # calculate average and quantiles of qsz set qszfile = "$datadir/QSZ-$q" if ! (-e $qszfile) then echo "# c/s ftp ID run mean 10Q 25Q 50Q 75Q 90Q max" >! $qszfile endif printf "%-5.2f %-3d %-3s %-3d " $fwdPM $ftp $ID $run >> $qszfile awk '{print $3}' $temp | avg.pl | awk '{printf "%-8.3f ", $2}' >> $qszfile awk '{if ($1 != "#" && $4 >= 0.1) print $2}' $cdffile | head -1 | awk '{printf "%-5d ",$1}' >> $qszfile awk '{if ($1 != "#" && $4 >= 0.25) print $2}' $cdffile | head -1 | awk '{printf "%-5d ",$1}' >> $qszfile awk '{if ($1 != "#" && $4 >= 0.5) print $2}' $cdffile | head -1 | awk '{printf "%-5d ",$1}' >> $qszfile awk '{if ($1 != "#" && $4 >= 0.75) print $2}' $cdffile | head -1 | awk '{printf "%-5d ",$1}' >> $qszfile awk '{if ($1 != "#" && $4 >= 0.9) print $2}' $cdffile | head -1 | awk '{printf "%-5d ",$1}' >> $qszfile tail -1 $cdffile | awk '{printf "%-5d\n", $2}' >> $qszfile rm $temp end # ::::::::::::::::::::::::::::: DROPS :::::::::::::::::::::::::::::::::: if ($ID == "0CL") then set queues = "src 01" else if ($ID == "1CL") then set queues = "src 01 12" else if ($ID == "2CL") then set queues = "src 01 12 34" else if ($ID == "3CL") then set queues = "src 01 12 34 56" endif foreach q ($queues) set temp = "$q.trq" if ! (-e $temp) then zcat $pattern-$q.trq.gz >! $temp endif # :: AGGREGATE :::: # compute drops # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12+) set dropsfile = "$datadir/DROPS-$q" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile if ($q == "src") then awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3>=8 && $3<12 && $4==0 {drops++; dropsb=dropsb+$6} $1=="+" && $3>=8 && $3<12 && $4==0 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile else awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3<$4 {drops++; dropsb=dropsb+$6} $1=="+" && $3<$4 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile endif # :: E2E HTTP ONLY :::: # compute drops for web traffic # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12+) set dropsfile = "$datadir/DROPS-$q-HTTP" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile if ($q == "src") then awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3>=10 && $3<12 && $4==0 {drops++; dropsb=dropsb+$6} $1=="+" && $3>=10 && $3<12 && $4==0 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile else awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3<$4 && $7>=10 && $7<12 {drops++; dropsb=dropsb+$6} $1=="+" && $3<$4 && $7>=10 && $7<12 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile endif # :: E2E FTP ONLY :::: # compute drops for ftp traffic # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12+) set dropsfile = "$datadir/DROPS-$q-FTP" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile if ($q == "src") then awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3>=8 && $3<10 && $4==0 {drops++; dropsb=dropsb+$6} $1=="+" && $3>=8 && $3<10 && $4==0 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile else awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3<$4 && $7>=8 && $7<10 {drops++; dropsb=dropsb+$6} $1=="+" && $3<$4 && $7>=8 && $7<10 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile endif # :: CT-HTTP ONLY :::: # compute drops for cross-traffic web flows # (FTP flows are srcs 8-9. HTTP flows are srcs 10-11. CT are srcs 12-23) if ($q != "01" && $q != "src") then set dropsfile = "$datadir/DROPS-$q-CT" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile awk 'NR == 1 {drops=0; pckts=0; bytes=0; dropsb=0} $1=="d" && $3<$4 && $7>=12 && $7<24 {drops++; dropsb=dropsb+$6} $1=="+" && $3<$4 && $7>=12 && $7<24 {pckts++; bytes=bytes+$6} END {printf "%-5.2f %-7d %-7d %-5.2f %-9d %-9d\n", (pckts>0)?(drops/pckts)*100:0, drops, pckts, (bytes>0)?(dropsb/bytes)*100:0, dropsb, bytes}' $temp >> $dropsfile endif end # :: E2E DROPS :::: # :: E2E HTTP DROPS :::: set dropsfile = "$datadir/DROPS-HTTP" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile printf "%-5.2f" $fwdPM >! tmp set rate = `cat tmp` set pcktsHTTP = `grep $rate $datadir/DROPS-src-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $7}'` set drops01 = `grep $rate $datadir/DROPS-01-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` set drops12 = `grep $rate $datadir/DROPS-12-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` if ($ID != "1CL") then set drops34 = `grep $rate $datadir/DROPS-34-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` endif if ($ID == "3CL") then set drops56 = `grep $rate $datadir/DROPS-56-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` endif set dropsHTTP = `expr $drops01 + $drops12` if ($ID != "1CL") then set dropsHTTP = `expr $dropsHTTP + $drops34` endif if ($ID == "3CL") then set dropsHTTP = `expr $dropsHTTP + $drops56` endif set percent = 0 if ($pcktsHTTP != 0) then set percent = `perl -e "print $dropsHTTP/$pcktsHTTP * 100"` endif printf "%-5.2f %-7d %-7d " $percent $dropsHTTP $pcktsHTTP >> $dropsfile set bytesHTTP = `grep $rate $datadir/DROPS-src-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $10}'` set drops01 = `grep $rate $datadir/DROPS-01-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $9}'` set drops12 = `grep $rate $datadir/DROPS-12-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $9}'` if ($ID != "1CL") then set drops34 = `grep $rate $datadir/DROPS-34-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $9}'` endif if ($ID == "3CL") then set drops56 = `grep $rate $datadir/DROPS-56-HTTP | grep $ftp | grep $ID | grep $run | awk '{print $9}'` endif set BdropsHTTP = `expr $drops01 + $drops12` if ($ID != "1CL") then set BdropsHTTP = `expr $BdropsHTTP + $drops34` endif if ($ID == "3CL") then set BdropsHTTP = `expr $BdropsHTTP + $drops56` endif set percent = 0 if ($bytesHTTP != 0) then set percent = `perl -e "print $BdropsHTTP/$bytesHTTP * 100"` endif printf "%-5.2f %-9d %-9d\n" $percent $BdropsHTTP $bytesHTTP >> $dropsfile # :: E2E FTP DROPS :::: set dropsfile = "$datadir/DROPS-FTP" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile # $rate is set above in HTTP drops set pcktsFTP = `grep $rate $datadir/DROPS-src-FTP | grep $ftp | grep $ID | grep $run | awk '{print $7}'` set drops01 = `grep $rate $datadir/DROPS-01-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` set drops12 = `grep $rate $datadir/DROPS-12-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` if ($ID != "1CL") then set drops34 = `grep $rate $datadir/DROPS-34-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` endif if ($ID == "3CL") then set drops56 = `grep $rate $datadir/DROPS-56-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` endif set dropsFTP = `expr $drops01 + $drops12` if ($ID != "1CL") then set dropsFTP = `expr $dropsFTP + $drops34` endif if ($ID == "3CL") then set dropsFTP = `expr $dropsFTP + $drops56` endif set percent = 0 if ($pcktsFTP != 0) then set percent = `perl -e "print $dropsFTP/$pcktsFTP * 100"` endif printf "%-5.2f %-7d %-7d " $percent $dropsFTP $pcktsFTP >> $dropsfile set bytesFTP = `grep $rate $datadir/DROPS-src-FTP | grep $ftp | grep $ID | grep $run | awk '{print $10}'` set drops01 = `grep $rate $datadir/DROPS-01-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` set drops12 = `grep $rate $datadir/DROPS-12-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` if ($ID != "1CL") then set drops34 = `grep $rate $datadir/DROPS-34-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` endif if ($ID == "3CL") then set drops56 = `grep $rate $datadir/DROPS-56-FTP | grep $ftp | grep $ID | grep $run | awk '{print $6}'` endif set BdropsFTP = `expr $drops01 + $drops12` if ($ID != "1CL") then set BdropsFTP = `expr $BdropsFTP + $drops34` endif if ($ID == "3CL") then set BdropsFTP = `expr $BdropsFTP + $drops56` endif set percent = 0 if ($bytesFTP != 0) then set percent = `perl -e "print $BdropsFTP/$pcktsFTP * 100"` endif printf "%-5.2f %-9d %-9d\n" $percent $BdropsFTP $bytesFTP >> $dropsfile # ::: E2E DROPS :::: set dropsfile = "$datadir/DROPS" if ! (-e $dropsfile) then echo "# c/s ftp ID run dropp% dropp packets dropb% dropb bytes" > $dropsfile endif printf "%-5.2f %-3s %-3s %-3d " $fwdPM $ftp $ID $run >> $dropsfile set pckts = `expr $pcktsFTP + $pcktsHTTP` set drops = `expr $dropsFTP + $dropsHTTP` set percent = 0 if ($pckts != 0) then set percent = `perl -e "print $drops/$pckts * 100"` endif printf "%-5.2f %-7d %-7d " $percent $drops $pckts >> $dropsfile set bytes = `expr $bytesFTP + $bytesHTTP` set drops = `expr $BdropsFTP + $BdropsHTTP` set percent = 0 if ($bytes != 0) then set percent = `perl -e "print $drops/$bytes * 100"` endif printf "%-5.2f %-9d %-9d\n" $percent $drops $bytes >> $dropsfile # ::::::::::::::::::::::::::::: MARKS :::::::::::::::::::::::::::::::::: $BINDIR/grab-marks ${pattern}-ECN.trq $BINDIR/process-ECN-marks $fwdPM $ftp $ID $duration $warmup $pairs $BINDIR/process-congnotif $fwdPM $ftp $ID $duration $warmup $pairs # ::::::::::::::::::::::::::::: CLEANUP :::::::::::::::::::::::::::::::::: if (-e PM.dat) then rm PM.dat endif if ! (-e $pattern-PM.dat.gz) then gzip $pattern-PM.dat endif foreach q (src 01 12 34 56 dst) if (-e $q.trq) then rm $q.trq endif end set date = `date "+%H:%M:%S (%m/%d/%y)"` echo "END: $date" >> PROCESS