| 1 |
#!/bin/csh -f |
| 2 |
|
| 3 |
date |
| 4 |
|
| 5 |
set ns_dir = "../../../../" |
| 6 |
set out_dir = "out/" |
| 7 |
|
| 8 |
@ BW = 30 |
| 9 |
@ seed = 472904 |
| 10 |
@ delay = 10 |
| 11 |
@ num_hops = 9 |
| 12 |
set tcl_file = parking_lot_topo.tcl |
| 13 |
|
| 14 |
|
| 15 |
\rm -f ${out_dir}tmp.log ${out_dir}u.* ${out_dir}q.* ${out_dir}d.* ${out_dir}uq.* ${out_dir}uqd.* ${out_dir}string.eps |
| 16 |
|
| 17 |
@ e = 1 |
| 18 |
#foreach exp ( RED/XCP RED CSFQ REM Vq ) |
| 19 |
#foreach exp ( XCP RED DropTail REM ) |
| 20 |
foreach exp ( XCP ) |
| 21 |
echo "Experiment: Efficiency of a ${exp} Queue with BW= ${BW} delay= ${delay} msec " |
| 22 |
echo "${ns_dir}ns $tcl_file ${num_hops} 0 ${seed} ${exp} ${BW} 30 $delay > ${out_dir}tmp.log" |
| 23 |
${ns_dir}ns $tcl_file ${num_hops} 0 ${seed} ${exp} ${BW} 30 $delay > ${out_dir}tmp.log |
| 24 |
|
| 25 |
# \rm ${out_dir}u.$e ${out_dir}q.$e ${out_dir}d.$e |
| 26 |
|
| 27 |
@ l = 0 |
| 28 |
while ( $l < $num_hops ) |
| 29 |
echo "Link = $l" |
| 30 |
@ next_l = ($l + 1) |
| 31 |
|
| 32 |
if ($exp == "XCP") then |
| 33 |
set suffix = red |
| 34 |
else |
| 35 |
set suffix = trace |
| 36 |
endif |
| 37 |
|
| 38 |
# Bottleneck Utilization |
| 39 |
grep "u " TR/ft_${suffix}_q${l}.tr | awk '{print $2, $3}' >! ${out_dir}u.${l}.${e}.dat |
| 40 |
awk -v L=$l \ |
| 41 |
'BEGIN {sum=0.0;f=0;} {sum=sum+$2; f=f+1} \ |
| 42 |
END {printf("%d %g\n",L+1, sum/f);}' \ |
| 43 |
${out_dir}u.${l}.${e}.dat >>! ${out_dir}u.${e} |
| 44 |
|
| 45 |
#Queue Size |
| 46 |
grep "q " TR/ft_${suffix}_q${l}.tr | awk '{print $2, $3}' >! ${out_dir}q.${l}.${e}.dat |
| 47 |
awk -v L=$l 'BEGIN {sum=0.0;f=0;} {sum=sum+$2; f=f+1} END {printf("%d %d\n",L+1, sum/f)}' \ |
| 48 |
${out_dir}q.${l}.${e}.dat >>! ${out_dir}q.${e} |
| 49 |
|
| 50 |
|
| 51 |
grep "q$l drops" ${out_dir}tmp.log| awk -v L=$l '{print L+1, $4}' >>! ${out_dir}d.${e} |
| 52 |
|
| 53 |
@ l = ($l + 1) |
| 54 |
end |
| 55 |
|
| 56 |
join ${out_dir}u.$e ${out_dir}q.$e > ${out_dir}uq.$e |
| 57 |
join ${out_dir}uq.$e ${out_dir}d.$e > ${out_dir}uqd.$e |
| 58 |
|
| 59 |
@ e = $e + 1 |
| 60 |
|
| 61 |
end |
| 62 |
|
| 63 |
cd ${out_dir} |
| 64 |
|
| 65 |
gnuplot string.gp |
| 66 |
gv string.eps & |
| 67 |
|
| 68 |
echo "DONE" |
| 69 |
date |