#!/usr/bin/tclsh set ctr 10 # set ctr 254 #set increase [lindex $argv 0] #set decrease [lindex $argv 1] set k 0 set data2 0 eval "exec cp ./awk/pingthrput.out ./results-sale/ftp/pingthrput.out" eval "exec cp ./awk/pingthrput.out ./results-sale/http/pingthrput.out" eval "exec cp ./runplot.com ./results-sale/http/runplot.com" eval "exec cp ./runplot.com ./results-sale/ftp/runplot.com" #is dos trace on or off foreach doson { 1 0 } { #redpd is 0 or 1 - does not work -> see ./redpd foreach redpd { 0 } { #reno, newreno, tahoe, sack foreach tcp_type { reno } { #0 - packets, 1 - bytes foreach bytes { 0 } { foreach rate_access { 100 } { foreach rate_bottleneck { 1.5 } { #DropTail or RED foreach queue { DropTail } { # Number of long-lived TCP/FTP flowstcp foreach flowstcp { 0 } { # reverse background traffic 0 or 1 foreach randomflows { 1 } { foreach rnd { 0 } { foreach rate1 { 0 } { foreach length1 { 0 } { foreach rate2 { 1.5 } { foreach period { 1200 } { foreach pack_size { 50 } { foreach length2 { 100 } { if {[expr ($length1+$length2)/($period)]<0.7} { if { $doson != 0 } { eval "exec ./mk_dos_trace.out $rate1 $length1 $rate2 $length2 $period $pack_size ./ascii/ascii-$rate1-$length1-$rate2-$length2-$period-$pack_size.txt ./cwnd/dos-$length2-$period" eval "exec rm -f ./cwnd/dos-$length2-$period" eval "exec ./binary_read_file.out ./ascii/file.bin ./ascii/ascii-$rate1-$length1-$rate2-$length2-$period-$pack_size.txt" eval "exec rm -f ./ascii/ascii-$rate1-$length1-$rate2-$length2-$period-$pack_size.txt" } puts "before dos.tcl call" eval "exec ./ns dos.tcl $tcp_type $bytes $rate_access $rate_bottleneck $queue $flowstcp $randomflows $rnd $rate1 $length1 $rate2 $length2 $period $pack_size $redpd $doson > ./results-sale/http/drops-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson" #NO min RTO ##eval "exec ./ns_nominrto dos.tcl $tcp_type $bytes $rate_access $rate_bottleneck $queue $flowstcp $randomflows $rnd $rate1 $length1 $rate2 $length2 $period $pack_size $redpd $doson" #> ./results-sale/http/thr-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson" puts "after dos.tcl call" eval "exec ./results-sale/http/pingthrput.out 1 ./results-sale/http/web-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson ./results-sale/http/drops-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson ./results-sale/http/out-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson $rnd 1.5 a 1 1" eval "exec rm -f ./results-sale/http/web-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson" eval "exec rm -f ./results-sale/http/drops-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson" if {$rnd == 0} { if {$period == 1100} { if {$flowstcp > 0} { set file [open ./results-sale/ftp/plotcmd "a+"] puts $file "set size 1.0,0.6 set key top right set xrange (0:2) set yrange (0:1.2) set xlabel %Inter-period (sec)% %Helvetica,24% set ylabel %Throughput (normalized)% %Helvetica,24% set terminal postscript color %Helvetica,18% set output %fig-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson.ps% plot 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr $flowstcp+2] title 'tot-tcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2, 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr $flowstcp+4] title 'dos-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2, 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr $flowstcp+5] title 'fi-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2" for {set i 0} {$i < $flowstcp} {incr i} { puts $file ", 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr 2+$i] title 'tcp$i-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2" } puts $file " " close $file } } if { $flowstcp > 0 } { set file [open ./results-sale/ftp/norm "a+"] puts $file "pingthrput.out 6 ./xmit-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson a ./xmit-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson-norm 1 $rate_bottleneck thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson $period $flowstcp" close $file eval "exec chmod 777 ./results-sale/ftp/norm" } eval "exec ./mk_dos_trace.out $rate1 $length1 $rate2 $length2 $period $pack_size ./ascii/ascii-$rate1-$length1-$rate2-$length2-$period-$pack_size.txt ./cwnd/dos-$length2-$period" #------------- set file [open ./results-sale/http/avg "a+"] #avg HTTP flows puts $file "pingthrput.out 4 ./out-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson a ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-$doson 1 1.5 a 1 1" close $file eval "exec chmod 777 ./results-sale/http/avg" #---------- #eval "exec cp ./results-sale/out-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson ./results-sale/out-$rate1-$length1-$rate2-$length2-$period-$doson" if {$doson == 1} { set file1 [open ./results-sale/http/ratio "a+"] puts $file1 "pingthrput.out 2 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-1 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-0 ./withdos-$flowstcp-$rate1-$length1-$rate2-$length2-$period 0 1.5 a 1 1" puts $file1 "pingthrput.out 2 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-0 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-0 ./nodos-$flowstcp-$rate1-$length1-$rate2-$length2-$period 0 1.5 a 1 1" close $file1 eval "exec chmod 777 ./results-sale/http/ratio" set file [open ./results-sale/http/plotcmd "a+"] puts $file "set size 1.0,0.6 set key bottom right set xlabel %File Size (pkts)% %Helvetica,24% set ylabel %Resp. Time(X)% %Helvetica,24% set logscale x set logscale y set terminal postscript color %Helvetica,18% set output %fig-$flowstcp-$rate1-$length1-$rate2-$length2-$period.ps% plot 'withdos-$flowstcp-$rate1-$length1-$rate2-$length2-$period' using 1:(*3>0 ? *3 : 1/0) title 'DoS' w lp lw 5, 'nodos-$flowstcp-$rate1-$length1-$rate2-$length2-$period' using 1:(*3>0 ? *3 : 1/0) title 'no DoS' w lp lw 5" puts $file " " close $file } } if {$rnd == 1} { if {$period == 1100} { if {$flowstcp > 0} { set file [open ./results-sale/ftp/plotcmd "a+"] puts $file "set size 1.0,0.6 set key top right set xrange (0:2) set yrange (0:1.2) set xlabel %Inter-period (sec)% %Helvetica,24% set ylabel %Throughput (normalized)% %Helvetica,24% set terminal postscript color %Helvetica,18% set output %fig-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson.ps% plot 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr $flowstcp+2] title 'tot-tcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2, 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr $flowstcp+4] title 'dos-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2, 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr $flowstcp+5] title 'fi-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2" for {set i 0} {$i < $flowstcp} {incr i} { puts $file ", 'thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' using 1:[expr 2+$i] title 'tcp$i-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson' w lp lw 2" } puts $file " " close $file } } if { $flowstcp > 0 } { set file [open ./results-sale/ftp/avg "a+"] #avg FTP flows puts $file "pingthrput.out 5 ./xmit-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson a ./xmit-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson-avg 1 1 a $period $flowstcp" close $file eval "exec chmod 777 ./results-sale/ftp/avg" } set file [open ./results-sale/http/avg "a+"] #avg HTTP flows puts $file "pingthrput.out 4 ./out-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rnd-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson a ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-$doson 1 1.5 a 1 1" close $file eval "exec chmod 777 ./results-sale/http/avg" if { $flowstcp > 0 } { set file [open ./results-sale/ftp/norm "a+"] puts $file "pingthrput.out 6 ./xmit-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson-avg a ./xmit-$tcp_type-$bytes-$rate_access-$rate_bottleneck-$queue-$flowstcp-$randomflows-$rate1-$length1-$rate2-$length2-$period-$pack_size-$redpd-$doson-norm 1 $rate_bottleneck thr-$flowstcp-$length1-$rate1-$length2-$rate2-$tcp_type-$bytes-$redpd-$doson $period $flowstcp" close $file eval "exec chmod 777 ./results-sale/ftp/norm" } if {$doson == 1} { set file1 [open ./results-sale/http/ratio "a+"] puts $file1 "pingthrput.out 2 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-1 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-0 ./withdos-$flowstcp-$rate1-$length1-$rate2-$length2-$period 1 1.5 a 1 1" puts $file1 "pingthrput.out 2 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-0 ./out-$flowstcp-$rate1-$length1-$rate2-$length2-$period-0 ./nodos-$flowstcp-$rate1-$length1-$rate2-$length2-$period 1 1.5 a 1 1" close $file1 eval "exec chmod 777 ./results-sale/http/ratio" set file [open ./results-sale/http/plotcmd "a+"] puts $file "set size 1.0,0.6 set key bottom right set xlabel %File Size (pkts)% %Helvetica,24% set ylabel %Resp. Time(X)% %Helvetica,24% set logscale x set logscale y set terminal postscript color %Helvetica,18% set output %fig-$flowstcp-$rate1-$length1-$rate2-$length2-$period.ps% plot 'withdos-$flowstcp-$rate1-$length1-$rate2-$length2-$period' using 1:(*3>0 ? *3 : 1/0) title 'DoS' w lp lw 5, 'nodos-$flowstcp-$rate1-$length1-$rate2-$length2-$period' using 1:(*3>0 ? *3 : 1/0) title 'no DoS' w lp lw 5" puts $file " " close $file } } } #$period > $length1 + $length2 } #length2 } #pack_size } # period } #rate2 } #length1 } #rate1 } #rnd } #randomflows } #flowstcp incr ctr } #queue } #rate_bottleneck } #rate_access } #bytes } #tcp_type } #redpd } #doson