Pārlūkot izejas kodu

Gather and parse data for Figures 6 and 7

Ian Goldberg 6 mēneši atpakaļ
vecāks
revīzija
a7bf56c09b
6 mainītis faili ar 198 papildinājumiem un 305 dzēšanām
  1. 138 0
      prac/repro
  2. 12 20
      prac/repro-bs-const-db.sh
  3. 12 27
      prac/repro-bs.sh
  4. 18 0
      prac/repro-reads-const-db.sh
  5. 18 0
      prac/repro-reads.sh
  6. 0 258
      repro

+ 138 - 0
prac/repro

@@ -0,0 +1,138 @@
+#!/bin/bash
+
+# Reproduce the Floram experiments from our paper:
+
+# Sajin Sasy, Adithya Vadapalli, Ian Goldberg. PRAC: Round-Efficient
+# 3-Party MPC for Dynamic Data Structures
+
+# cd into the directory containing this script (from the bash faq 028)
+if [[ $BASH_SOURCE = */* ]]; then
+  cd -- "${BASH_SOURCE%/*}/" || exit
+fi
+
+# If the Duoram NUMA commands are set, but Floram-specific ones are not,
+# use them for Floram
+if [ "$FLORAM_NUMA_P0" == "" -a "$DUORAM_NUMA_P0" != "" ]; then
+    export FLORAM_NUMA_P0="$DUORAM_NUMA_P0"
+fi
+if [ "$FLORAM_NUMA_P1" == "" -a "$DUORAM_NUMA_P1" != "" ]; then
+    export FLORAM_NUMA_P1="$DUORAM_NUMA_P1"
+fi
+
+# Allow running only subsets of the experiment suite.  Valid values are
+# "test", "all", "none".  ("none" is useful if you just want to re-parse
+# the output of existing logs.)  You can also say "single" followed by
+# all the arguments to "run" (below) to run a single experiment; for
+# example:
+# ./repro single read 20 1
+if [ "$1" = "" ]; then
+    whichexps="test"
+else
+    whichexps="$1"
+fi
+
+# The number of operations per run; the graphs in the paper use 3
+if [ "$whichexps" = "single" -o "$2" = "" ]; then
+    # If there's an explicit experiment on the command line, don't read
+    # the next argument as the number of operations.  $numops will be
+    # ignored, anyway, since it will be specified as part of the
+    # command.
+    numiters=3
+else
+    numiters="$2"
+fi
+
+# Run one experiment
+# Arguments:
+# $1: mode (read, bs)
+# $2: depth (the ORAM has 2^depth elements)
+# $3: number of operations (e.g., 20)
+run() {
+    now=`date`
+    echo "$now: Running $1 $2 $3 ..."
+    logfile="${1}_${3}.out${LOGSUFFIX}"
+    mkdir -p data
+    ../run-experiment $1 $2 $3 >> data/$logfile
+}
+
+# Parse the output logs.  We run this in the docker in case you don't
+# have perl installed on the host.
+# Arguments: a list of logfiles
+parse() {
+    if [ "$FLORAM_PARSE_HOST" = "1" ]; then
+        ../parse_logs $*
+    else
+        cat $* | docker exec -w /root -i floram_p0 ./parse_logs
+    fi
+}
+
+# A very small kick-the-tires test to ensure everything compiled and
+# built properly
+if [ "$whichexps" = "test" ]; then
+    echo "Running test experiment..."
+    run read 16 1
+    echo
+    echo "# Test output"
+    echo
+    parse data/read_1.out${LOGSUFFIX}
+    echo
+    echo "# End test output"
+    echo
+    exit
+fi
+
+# Be able to run a single experiment specified on the command line
+if [ "$whichexps" = "single" ]; then
+    echo "Running single experiment..."
+    shift
+    run $*
+    exit
+fi
+
+now=`date`
+echo "$now: Starting experiments"
+
+if [ "$whichexps" = "all" ]; then
+    echo "Running experiments..."
+    # Figure 6(a)
+    ./repro-reads-const-db.sh ${numiters}
+    # Figures 6(b) and 6(c)
+    ./repro-reads.sh ${numiters}
+    # Figure 7(a)
+    ./repro-bs-const-db.sh ${numiters}
+    # Figures 7(b) and 7(c)
+    ./repro-bs.sh ${numiters}
+fi
+
+now=`date`
+echo "$now: Experiments complete"
+
+# If you specified a custom log suffix, you're going to be parsing the
+# outputs differently.
+if [ "$LOGSUFFIX" = "" ]; then
+
+parse data/*.out > data/floram.dat
+
+echo
+echo "# Figure 6(a)"
+egrep 'Floram read 20 (16|32|64|128|256|512|1024|2048) .* s$' data/floram.dat | sort -k4 -n
+echo
+echo "# Figure 6(b)"
+egrep 'Floram read ([0-9]+) 10 .* s$' data/floram.dat | sort -k3 -n
+echo
+echo "# Figure 6(c)"
+egrep 'Floram read ([0-9]+) 10 .* KiB$' data/floram.dat | sort -k3 -n
+echo
+echo "# Figure 7(a)"
+egrep 'Floram bs 20 (4|8|16|32|64) .* s$' data/floram.dat | sort -k4 -n
+echo
+echo "# Figure 7(b)"
+egrep 'Floram bs ([0-9]+) 1 .* s$' data/floram.dat | sort -k3 -n
+echo
+echo "# Figure 7(c)"
+egrep 'Floram bs ([0-9]+) 1 .* KiB$' data/floram.dat | sort -k3 -n
+echo
+echo "# End figures"
+echo
+
+fi

+ 12 - 20
prac/repro-bs-const-db.sh

@@ -1,25 +1,17 @@
-cd ..
-./set-networking
-./unset-networking
+#!/bin/bash
+
+# Usage: ./repro-bs-const-db.sh [niters]
 
 nitrs=1
+if [ "$1" != "" ]; then
+    nitrs="$1"
+fi
 
+cd ..
+mkdir -p prac/data
 for itr in $(seq 1 $nitrs); do
-./run-experiment bs 20 4 > prac/log_bs_20_4_$itr
-echo "run-experiment bs 4 searchees"
-
-./run-experiment bs 20 8 > prac/log_bs_20_8_$itr
-echo "run-experiment bs 8 searches"
-
-./run-experiment bs 20 16 > prac/log_bs_20_16_$itr
-echo "run-experiment bs 16 searchs"
-
-./run-experiment bs 20 32 > prac/log_bs_20_32_$itr
-echo "run-experiment bs 32 searches"
-
-./run-experiment bs 20 64 > prac/log_bs_20_64_$itr
-echo "run-experiment bs 64 searches" 
-
-
-
+    for n in 4 8 16 32 64; do
+        now=`date`; echo "$now: Running ${n} searches on DB of size 2^20 ..."
+        ./run-experiment bs 20 ${n} >> prac/data/log_20_${n}_bs.out
+    done
 done

+ 12 - 27
prac/repro-bs.sh

@@ -1,32 +1,17 @@
-cd ..
-./set-networking
-./unset-networking
+#!/bin/bash
+
+# Usage: ./repro-bs.sh [niters]
 
 nitrs=1
+if [ "$1" != "" ]; then
+    nitrs="$1"
+fi
 
+cd ..
+mkdir -p prac/data
 for itr in $(seq 1 $nitrs); do
-./run-experiment bs 16 1 > prac/log_bs_16_1_$itr
-echo "run-experiment bs 16 1"
-
-./run-experiment bs 18 1 > prac/log_bs_18_1_$itr
-echo "run-experiment bs 18 1"
-
-./run-experiment bs 20 1 > prac/log_bs_20_1_$itr
-echo "run-experiment bs 20 1"
-
-./run-experiment bs 22 1 > prac/log_bs_22_1_$itr
-echo "run-experiment bs 22 1"
-
-./run-experiment bs 24 1 > prac/log_bs_24_1_$itr
-echo "run-experiment bs 24 1" 
-
-./run-experiment bs 26 1 > prac/log_bs_26_1_$itr
-echo "run-experiment bs 26 1" 
-
-./run-experiment bs 28 1 > prac/log_bs_28_1_$itr
-echo "run-experiment bs 28 1"
-
-./run-experiment bs 30 1 > prac/log_bs_30_1_$itr
-echo "run-experiment bs 30 1" 
-
+    for size in 16 18 20 22 24 26 28; do
+        now=`date`; echo "$now: Running 1 search on DB of size 2^${size} ..."
+        ./run-experiment bs ${size} 1 >> prac/data/log_${size}_1_bs.out
+    done
 done

+ 18 - 0
prac/repro-reads-const-db.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Usage: ./repro-reads-const-db.sh [niters]
+
+nitrs=1
+if [ "$1" != "" ]; then
+    nitrs="$1"
+fi
+
+cd ..
+mkdir -p prac/data
+for itr in $(seq 1 $nitrs); do
+    for n in 16 32 64 128 256 512 1024 2048; do
+        now=`date`; echo "$now: Running ${n} reads on DB of size 2^20 ..."
+        ./run-experiment read 20 ${n} >> prac/data/log_20_${n}_reads.out
+    done
+done
+

+ 18 - 0
prac/repro-reads.sh

@@ -0,0 +1,18 @@
+#!/bin/bash
+
+# Usage: ./repro-reads.sh [niters]
+
+nitrs=1
+if [ "$1" != "" ]; then
+    nitrs="$1"
+fi
+
+cd ..
+mkdir -p prac/data
+for itr in $(seq 1 $nitrs); do
+    for size in 16 18 20 22 24 26 28 30; do
+        now=`date`; echo "$now: Running 10 reads on DB of size 2^${size} ..."
+        ./run-experiment read ${size} 10 >> prac/data/log_${size}_10_reads.out
+    done
+done
+

+ 0 - 258
repro

@@ -1,258 +0,0 @@
-#!/bin/bash
-
-# Reproduce the Floram experiments from our paper:
-
-# Adithya Vadapalli, Ryan Henry, Ian Goldberg. Duoram: A
-# Bandwidth-Efficient Distributed ORAM for 2- and 3-Party Computation.
-# USENIX Security Symposium 2023.
-
-# cd into the directory containing this script (from the bash faq 028)
-if [[ $BASH_SOURCE = */* ]]; then
-  cd -- "${BASH_SOURCE%/*}/" || exit
-fi
-
-# If the Duoram NUMA commands are set, but Floram-specific ones are not,
-# use them for Floram
-if [ "$FLORAM_NUMA_P0" == "" -a "$DUORAM_NUMA_P0" != "" ]; then
-    export FLORAM_NUMA_P0="$DUORAM_NUMA_P0"
-fi
-if [ "$FLORAM_NUMA_P1" == "" -a "$DUORAM_NUMA_P1" != "" ]; then
-    export FLORAM_NUMA_P1="$DUORAM_NUMA_P1"
-fi
-
-# Allow running only subsets of the experiment suite.  Valid values are
-# "test", "small", "large", "scaling", "all", "none".  ("none" is useful
-# if you just want to re-parse the output of existing logs.  "scaling"
-# is the subset of "small" that generates the data points for Figure 10;
-# see the README for that one, since you need a machine with at least 64
-# cores to generate it.)  You can also say "single" followed by all the
-# arguments to "run" (below) to run a single experiment; for example:
-# ./repro single readwrite 20 1us 100gbit 128
-if [ "$1" = "" ]; then
-    whichexps="test"
-else
-    whichexps="$1"
-fi
-
-# The number of operations per run; the graphs in the paper use 128
-if [ "$whichexps" = "single" -o "$2" = "" ]; then
-    # If there's an explicit experiment on the command line, don't read
-    # the next argument as the number of operations.  $numops will be
-    # ignored, anyway, since it will be specified as part of the
-    # command.
-    numops=128
-else
-    numops="$2"
-fi
-
-# Run one experiment
-# Arguments:
-# $1: mode (read, write, readwrite)
-# $2: depth (the ORAM has 2^depth elements)
-# $3: latency (e.g., 30ms)
-# $4: bandwidth (e.g., 100mbit)
-# $5: number of operations (e.g., 128)
-run() {
-    now=`date`
-    echo "$now: Running $1 $2 $3 $4 $5 ..."
-    logfile="${1}_${3}_${4}_${5}.out${LOGSUFFIX}"
-    ./set-networking $3 $4
-    echo "Network setup: $3 $4" >> $logfile
-    ./run-experiment $1 $2 $5 >> $logfile
-}
-
-# Parse the output logs.  We run this in the docker in case you don't
-# have perl installed on the host.
-# Arguments: a list of logfiles
-parse() {
-    if [ "$FLORAM_PARSE_HOST" = "1" ]; then
-        ./parse_logs $*
-    else
-        cat $* | docker exec -w /root -i floram_p0 ./parse_logs
-    fi
-}
-
-# A very small kick-the-tires test to ensure everything compiled and
-# built properly
-if [ "$whichexps" = "test" ]; then
-    echo "Running test experiment..."
-    run read 16 1us 100gbit 2
-    echo
-    echo "# Test output"
-    echo
-    parse read_1us_100gbit_2.out${LOGSUFFIX}
-    echo
-    echo "# End test output"
-    echo
-    exit
-fi
-
-# Be able to run a single experiment specified on the command line
-if [ "$whichexps" = "single" ]; then
-    echo "Running single experiment..."
-    shift
-    run $*
-    exit
-fi
-
-now=`date`
-echo "$now: Starting experiments"
-
-if [ "$whichexps" = "small" -o "$whichexps" = "all" ]; then
-    echo "Running small experiments..."
-    # Figures 7(a), 8(c)
-    run readwrite 16 30ms 100mbit ${numops}
-    run readwrite 18 30ms 100mbit ${numops}
-    run readwrite 20 30ms 100mbit ${numops}
-    run readwrite 22 30ms 100mbit ${numops}
-    run readwrite 24 30ms 100mbit ${numops}
-    run readwrite 26 30ms 100mbit ${numops}
-    # Figure 7(b)
-    run readwrite 20 30ms 10mbit ${numops}
-    run readwrite 20 30ms 30mbit ${numops}
-    run readwrite 20 30ms 50mbit ${numops}
-    run readwrite 20 30ms 70mbit ${numops}
-    run readwrite 20 30ms 90mbit ${numops}
-    run readwrite 20 30ms 110mbit ${numops}
-    # Figure 7(c)
-    run readwrite 20 10ms 100mbit ${numops}
-    run readwrite 20 50ms 100mbit ${numops}
-    run readwrite 20 70ms 100mbit ${numops}
-    # Figures 8(a), 9(b), and 9(c)
-    # Note that we set the latency to 1us, which really means "don't add
-    # artificial latency", but we measure the one-way latency to
-    # actually be 30us, which is what we report in the paper. (pings
-    # from one docker to the other take about 60us round trip.)
-    run read 16 1us 100gbit ${numops}
-    run read 18 1us 100gbit ${numops}
-    run read 20 1us 100gbit ${numops}
-    run read 22 1us 100gbit ${numops}
-    run read 24 1us 100gbit ${numops}
-    run read 26 1us 100gbit ${numops}
-    # Figure 8(b)
-    run write 16 1us 100gbit ${numops}
-    run write 18 1us 100gbit ${numops}
-    run write 20 1us 100gbit ${numops}
-    run write 22 1us 100gbit ${numops}
-    run write 24 1us 100gbit ${numops}
-    run write 26 1us 100gbit ${numops}
-    # Figures 9(a), 11(a)
-    run read 18 30ms 100mbit ${numops}
-    run read 22 30ms 100mbit ${numops}
-    run read 24 30ms 100mbit ${numops}
-fi
-if [ "$whichexps" = "small" -o "$whichexps" = "scaling" -o "$whichexps" = "all" ]; then
-    # Figures 9(a), 10, 11(a)
-    run read 16 30ms 100mbit ${numops}
-    run read 20 30ms 100mbit ${numops}
-    run read 26 30ms 100mbit ${numops}
-fi
-if [ "$whichexps" = "large" -o "$whichexps" = "all" ]; then
-    echo "Running large experiments..."
-    # Figure 9(a)
-    run read 28 30ms 100mbit ${numops}
-    run read 30 30ms 100mbit ${numops}
-    run read 32 30ms 100mbit ${numops}
-    # Figures 9(b) and 9(c)
-    run read 28 1us 100gbit ${numops}
-    run read 30 1us 100gbit ${numops}
-    run read 32 1us 100gbit ${numops}
-fi
-if [ "$whichexps" = "extended" ]; then
-    # Do the experiments for the plots that appear only in the extended version
-    # of the paper
-    # Figure 11(b)
-    run read 20 30ms 10mbit ${numops}
-    run read 20 30ms 30mbit ${numops}
-    run read 20 30ms 50mbit ${numops}
-    run read 20 30ms 70mbit ${numops}
-    run read 20 30ms 90mbit ${numops}
-    run read 20 30ms 110mbit ${numops}
-    # Figure 11(c)
-    run read 20 10ms 100mbit ${numops}
-    run read 20 50ms 100mbit ${numops}
-    run read 20 70ms 100mbit ${numops}
-    # Figure 12(a)
-    run write 16 30ms 100mbit ${numops}
-    run write 18 30ms 100mbit ${numops}
-    run write 20 30ms 100mbit ${numops}
-    run write 22 30ms 100mbit ${numops}
-    run write 24 30ms 100mbit ${numops}
-    run write 26 30ms 100mbit ${numops}
-    # Figure 12(b)
-    run write 20 30ms 10mbit ${numops}
-    run write 20 30ms 30mbit ${numops}
-    run write 20 30ms 50mbit ${numops}
-    run write 20 30ms 70mbit ${numops}
-    run write 20 30ms 90mbit ${numops}
-    run write 20 30ms 110mbit ${numops}
-    # Figure 12(c)
-    run write 20 10ms 100mbit ${numops}
-    run write 20 50ms 100mbit ${numops}
-    run write 20 70ms 100mbit ${numops}
-fi
-
-now=`date`
-echo "$now: Experiments complete"
-
-# If you specified a custom log suffix, you're going to be parsing the
-# outputs differently.
-if [ "$LOGSUFFIX" = "" ]; then
-
-parse *_${numops}.out > floram_${numops}.dat
-
-echo
-echo "# Figure 7(a)"
-egrep 'Floram readwrite .* 30ms 100mbit .* s$' floram_${numops}.dat | sort -k3 -n
-echo
-echo "# Figure 7(b)"
-egrep 'Floram readwrite 20 30ms .* s$' floram_${numops}.dat | sort -k5 -n
-echo
-echo "# Figure 7(c)"
-egrep 'Floram readwrite 20 .* 100mbit .* s$' floram_${numops}.dat | sort -k4 -n
-echo
-echo "# Figure 8(a)"
-egrep 'Floram read .* 1us 100gbit .* KiB$' floram_${numops}.dat | sort -k3 -n
-echo
-echo "# Figure 8(b)"
-egrep 'Floram write .* 1us 100gbit .* KiB$' floram_${numops}.dat | sort -k3 -n
-echo
-echo "# Figure 8(c)"
-egrep 'Floram readwrite .* 30ms 100mbit .* KiB$' floram_${numops}.dat | sort -k3 -n
-echo
-echo "# Figure 9(a)"
-egrep 'Floram read .* 30ms 100mbit .* s$' floram_${numops}.dat | sort -k3 -n
-echo
-echo "# Figure 9(b)"
-egrep 'Floram read .* 1us 100gbit .* s$' floram_${numops}.dat | sort -k3 -n
-echo
-echo "# Figure 9(c)"
-egrep 'Floram read .* 1us 100gbit .* KiB$' floram_${numops}.dat | sort -k3 -n
-echo
-
-if [ "$DUORAM_EXTENDED_PLOTS" = "1" ]; then
-    # Also show the plots for the extended version (Figures 11, 12)
-    echo "# Figure 11(a)"
-    egrep 'Floram read .* 30ms 100mbit .* s$' floram_${numops}.dat | sort -k3 -n
-    echo
-    echo "# Figure 11(b)"
-    egrep 'Floram read 20 30ms .* s$' floram_${numops}.dat | sort -k5 -n
-    echo
-    echo "# Figure 11(c)"
-    egrep 'Floram read 20 .* 100mbit .* s$' floram_${numops}.dat | sort -k4 -n
-    echo
-    echo "# Figure 12(a)"
-    egrep 'Floram write .* 30ms 100mbit .* s$' floram_${numops}.dat | sort -k3 -n
-    echo
-    echo "# Figure 12(b)"
-    egrep 'Floram write 20 30ms .* s$' floram_${numops}.dat | sort -k5 -n
-    echo
-    echo "# Figure 12(c)"
-    egrep 'Floram write 20 .* 100mbit .* s$' floram_${numops}.dat | sort -k4 -n
-    echo
-fi
-
-echo "# End figures"
-echo
-
-fi