123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- #!/bin/bash
- # Reproduce the live network experiments for Figure 9 of the paper.
- # We need these environment variables set:
- # PRAC_SSH_P0_USERHOST: the user@host to ssh to for P0
- # PRAC_SSH_P0_SSHOPTS: any options to ssh you need to ssh to P0
- # PRAC_SSH_P0_IP: the IP address P0 can listen for connections on
- # PRAC_SSH_P0_DIR: the directory relative to the homedir where the prac
- # repo is checked out and built
- # PRAC_SSH_P1_USERHOST: the user@host to ssh to for P1
- # PRAC_SSH_P1_SSHOPTS: any options to ssh you need to ssh to P1
- # PRAC_SSH_P1_IP: the IP address P1 can listen for connections on
- # PRAC_SSH_P1_DIR: the directory relative to the homedir where the prac
- # repo is checked out and built
- # PRAC_SSH_P2_USERHOST: the user@host to ssh to for P2
- # PRAC_SSH_P2_SSHOPTS: any options to ssh you need to ssh to P2
- # PRAC_SSH_P2_IP: the IP address P2 can listen for connections on
- # PRAC_SSH_P2_DIR: the directory relative to the homedir where the prac
- # repo is checked out and built
- # Optional: PRAC_NUMA_P{0,1,2}
- # Add additional env vars
- export PRAC_USE_SSH=1
- export PRAC_PARSE_HOST=1
- # cd into the directory containing this script (from the bash faq 028)
- if [[ $BASH_SOURCE = */* ]]; then
- cd -- "${BASH_SOURCE%/*}/" || exit
- fi
- # The number of iterations to do
- if [ "$1" = "" ]; then
- niters=3
- else
- niters="$1"
- fi
- # Run the PRAC experiments
- echo "Running PRAC experiments..."
- echo
- ./repro fig9 $niters || exit 1
- # Set up the ORAM environment variables based on the PRAC ones
- export ORAM_SSH_C_USERHOST="$PRAC_SSH_P0_USERHOST"
- export ORAM_SSH_C_SSHOPTS="$PRAC_SSH_P0_SSHOPTS"
- export ORAM_SSH_C_IP="$PRAC_SSH_P0_IP"
- export ORAM_SSH_C_DIR="$PRAC_SSH_P0_DIR"/repro/comps/circuit-oram
- export ORAM_NUMA_C="$PRAC_NUMA_P0"
- export ORAM_SSH_D_USERHOST="$PRAC_SSH_P1_USERHOST"
- export ORAM_SSH_D_SSHOPTS="$PRAC_SSH_P1_SSHOPTS"
- export ORAM_SSH_D_IP="$PRAC_SSH_P1_IP"
- export ORAM_SSH_D_DIR="$PRAC_SSH_P1_DIR"/repro/comps/circuit-oram
- export ORAM_NUMA_D="$PRAC_NUMA_P1"
- export ORAM_SSH_E_USERHOST="$PRAC_SSH_P2_USERHOST"
- export ORAM_SSH_E_SSHOPTS="$PRAC_SSH_P2_SSHOPTS"
- export ORAM_SSH_E_IP="$PRAC_SSH_P2_IP"
- export ORAM_SSH_E_DIR="$PRAC_SSH_P2_DIR"/repro/comps/circuit-oram
- export ORAM_NUMA_E="$PRAC_NUMA_P2"
- export ORAM_USE_SSH=1
- export ORAM_PARSE_HOST=1
- echo
- echo "Running Circuit ORAM experiments..."
- echo
- ( cd comps/circuit-oram/prac && \
- ./generate_raw_data_reads_ssh.sh $niters && \
- ./parse_logs data/*.out > data/oram.dat ) || exit 1
- # Set up the Ramen environment variables based on the PRAC ones
- export RAMEN_SSH_P0_USERHOST="$PRAC_SSH_P0_USERHOST"
- export RAMEN_SSH_P0_SSHOPTS="$PRAC_SSH_P0_SSHOPTS"
- export RAMEN_SSH_P0_IP="$PRAC_SSH_P0_IP"
- export RAMEN_SSH_P0_DIR="$PRAC_SSH_P0_DIR"/repro/comps/ramen
- export RAMEN_NUMA_P0="$PRAC_NUMA_P0"
- export RAMEN_SSH_P1_USERHOST="$PRAC_SSH_P1_USERHOST"
- export RAMEN_SSH_P1_SSHOPTS="$PRAC_SSH_P1_SSHOPTS"
- export RAMEN_SSH_P1_IP="$PRAC_SSH_P1_IP"
- export RAMEN_SSH_P1_DIR="$PRAC_SSH_P1_DIR"/repro/comps/ramen
- export RAMEN_NUMA_P1="$PRAC_NUMA_P1"
- export RAMEN_SSH_P2_USERHOST="$PRAC_SSH_P2_USERHOST"
- export RAMEN_SSH_P2_SSHOPTS="$PRAC_SSH_P2_SSHOPTS"
- export RAMEN_SSH_P2_IP="$PRAC_SSH_P2_IP"
- export RAMEN_SSH_P2_DIR="$PRAC_SSH_P2_DIR"/repro/comps/ramen
- export RAMEN_NUMA_P2="$PRAC_NUMA_P2"
- export RAMEN_USE_SSH=1
- export RAMEN_PARSE_HOST=1
- echo
- echo "Running Ramen experiments..."
- echo
- ( cd comps/ramen/repro && \
- ./generate_raw_data_reads_ssh.sh $niters && \
- ./parse_logs data/*.out > data/ramen.dat ) || exit 1
- echo
- echo '# Figure 9'
- egrep 'PRACTotl heapsampler [0-9]+ [0-9]+ .* s' data/prac.dat | sort -k3,3n -k4,4n
- echo
- echo '# Last sentence of Section 8'
- prac_seconds=$(egrep 'PRACTotl heapsampler 300 2048 [0-9\.]+ .*s' data/prac.dat | cut -d' ' -f5)
- prac_hours=$(echo "$prac_seconds / 3600" | bc -l)
- echo 'PRAC '$prac_hours' hours'
- # The time to do 1 heap extract (48 ORAM reads)
- ramen_1_seconds=$(egrep 'Ramen read 9 48 [0-9\.]+ .*s' comps/ramen/repro/data/ramen.dat | cut -d' ' -f5)
- # The time to do 10 heap extracts (480 ORAM reads)
- ramen_10_seconds=$(egrep 'Ramen read 9 480 [0-9\.]+ .*s' comps/ramen/repro/data/ramen.dat | cut -d' ' -f5)
- # Extrapolate to 2048 heap extracts = 2048*48 = 98304 ORAM reads, noting there
- # may be constant overhead, so that the time for the first extract may be
- # different from subsequent ones. Therefore, compute the time for the 9
- # subsequent ones, scale up to 2047, and add the first one back in.
- ramen_2048_seconds=$(echo "($ramen_10_seconds - $ramen_1_seconds) / 9 * 2047 + $ramen_1_seconds" | bc -l)
- ramen_2048_hours=$(echo "$ramen_2048_seconds / 3600" | bc -l)
- echo 'Ramen '$ramen_2048_hours' hours'
- # The time to do 1 ORAM read (not 1 heap extract)
- oram_1_seconds=$(egrep 'CircuitORAMTotl read 9 1 [0-9\.]+ .*s' comps/circuit-oram/prac/data/oram.dat | cut -d' ' -f5)
- # The time to do 144 ORAM reads (3 heap extracts)
- oram_144_seconds=$(egrep 'CircuitORAMTotl read 9 144 [0-9\.]+ .*s' comps/circuit-oram/prac/data/oram.dat | cut -d' ' -f5)
- # Extrapolate to 2048 heap extracts = 2048*48 = 98304 ORAM reads as above
- oram_98304_seconds=$(echo "($oram_144_seconds - $oram_1_seconds) / 143 * 98303 + $oram_1_seconds" | bc -l)
- oram_98304_days=$(echo "$oram_98304_seconds / 3600 / 24" | bc -l)
- echo 'CircuitORAM '$oram_98304_days' days'
|