|
|
@@ -2,24 +2,35 @@
|
|
|
|
|
|
# Reproduce the Duoram 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.
|
|
|
+# 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 master NUMA commands are set, use them for Duoram
|
|
|
-if [ "$NUMA_P0" != "" ]; then
|
|
|
- export DUORAM_NUMA_P0="$NUMA_P0"
|
|
|
+# If the PRAC NUMA commands are set, use them for Duoram
|
|
|
+if [ "$PRAC_NUMA_P0" != "" ]; then
|
|
|
+ export DUORAM_NUMA_P0="$PRAC_NUMA_P0"
|
|
|
fi
|
|
|
-if [ "$NUMA_P1" != "" ]; then
|
|
|
- export DUORAM_NUMA_P1="$NUMA_P1"
|
|
|
+if [ "$PRAC_NUMA_P1" != "" ]; then
|
|
|
+ export DUORAM_NUMA_P1="$PRAC_NUMA_P1"
|
|
|
fi
|
|
|
-if [ "$NUMA_P2" != "" ]; then
|
|
|
- export DUORAM_NUMA_P2="$NUMA_P2"
|
|
|
+if [ "$PRAC_NUMA_P2" != "" ]; then
|
|
|
+ export DUORAM_NUMA_P2="$PRAC_NUMA_P2"
|
|
|
+fi
|
|
|
+
|
|
|
+# If the PRAC memory usage is set, use it for Duoram. In Duoram, P2 uses
|
|
|
+# twice the memory of P0 or P1 for preprocessing, so if P0 and P2 are on
|
|
|
+# the same NUMA node, set the total RAM available to 4/3 of the RAM
|
|
|
+# available for that node.
|
|
|
+if [ "$PRAC_P0_MAXGB" != "" ]; then
|
|
|
+ export DUORAM_MAXGB=$((2*PRAC_P0_MAXGB))
|
|
|
+elif [ "$PRAC_P02_MAXGB" != "" ]; then
|
|
|
+ export DUORAM_MAXGB=$((4*PRAC_P02_MAXGB/3))
|
|
|
+elif [ "$PRAC_MAXGB" != "" ]; then
|
|
|
+ export DUORAM_MAXGB=$PRAC_MAXGB
|
|
|
fi
|
|
|
|
|
|
# Allow running only subsets of the experiment suite. Valid values are
|
|
|
@@ -36,15 +47,15 @@ else
|
|
|
whichexps="$1"
|
|
|
fi
|
|
|
|
|
|
-# The number of operations per run; the graphs in the paper use 128
|
|
|
+# The number of iterations 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
|
|
|
+ # the next argument as the number of operations. $numiters will be
|
|
|
# ignored, anyway, since it will be specified as part of the
|
|
|
# command.
|
|
|
- numops=128
|
|
|
+ numiters=3
|
|
|
else
|
|
|
- numops="$2"
|
|
|
+ numiters="$2"
|
|
|
fi
|
|
|
|
|
|
# The maximum amount of memory to use (in GB). Set the environment
|
|
|
@@ -85,12 +96,6 @@ runone() {
|
|
|
# $3: bandwidth (e.g., 100mbit)
|
|
|
# $4: number of operations (e.g., 128)
|
|
|
run() {
|
|
|
- # The 2P read actually does both preprocessing and online
|
|
|
- runone read $1 $2 $3 $4 online 2P
|
|
|
- runone write $1 $2 $3 $4 preproc 2P
|
|
|
- runone write $1 $2 $3 $4 online 2P
|
|
|
- # The 2P read and write protocols are completely different, so
|
|
|
- # readwrite is just the sum of read and write.
|
|
|
# The 3P preprocessing protocol is identical for reads and writes,
|
|
|
# so we just do it once, and count it twice for readwrite.
|
|
|
runone read $1 $2 $3 $4 preproc 3P
|
|
|
@@ -123,9 +128,7 @@ if [ "$whichexps" = "test" ]; then
|
|
|
echo
|
|
|
echo "# Test output"
|
|
|
echo
|
|
|
- parse read_1us_100gbit_2_online_2P.out${LOGSUFFIX} \
|
|
|
- write_1us_100gbit_2_preproc_2P.out${LOGSUFFIX} \
|
|
|
- write_1us_100gbit_2_online_2P.out${LOGSUFFIX} \
|
|
|
+ parse \
|
|
|
read_1us_100gbit_2_preproc_3P.out${LOGSUFFIX} \
|
|
|
readwrite_1us_100gbit_2_online_3P.out${LOGSUFFIX} \
|
|
|
| egrep '(Onln|Totl).*readwrite' | sort
|
|
|
@@ -148,65 +151,19 @@ echo "$now: Starting experiments"
|
|
|
|
|
|
if [ "$whichexps" = "small" -o "$whichexps" = "all" ]; then
|
|
|
echo "Running small experiments..."
|
|
|
- # Figure 7(b)
|
|
|
- run 20 30ms 10mbit ${numops}
|
|
|
- run 20 30ms 30mbit ${numops}
|
|
|
- run 20 30ms 50mbit ${numops}
|
|
|
- run 20 30ms 70mbit ${numops}
|
|
|
- run 20 30ms 90mbit ${numops}
|
|
|
- run 20 30ms 110mbit ${numops}
|
|
|
- # Figure 7(c)
|
|
|
- run 20 10ms 100mbit ${numops}
|
|
|
- run 20 50ms 100mbit ${numops}
|
|
|
- run 20 70ms 100mbit ${numops}
|
|
|
- # Figures 8(a), 8(b), 8(c), 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 16 1us 100gbit ${numops}
|
|
|
- run 18 1us 100gbit ${numops}
|
|
|
- run 20 1us 100gbit ${numops}
|
|
|
- run 22 1us 100gbit ${numops}
|
|
|
- run 24 1us 100gbit ${numops}
|
|
|
- run 26 1us 100gbit ${numops}
|
|
|
- # Figures 7(a), 9(a)
|
|
|
- run 18 30ms 100mbit ${numops}
|
|
|
- run 22 30ms 100mbit ${numops}
|
|
|
- run 24 30ms 100mbit ${numops}
|
|
|
-fi
|
|
|
-if [ "$whichexps" = "small" -o "$whichexps" = "all" ]; then
|
|
|
- # Figures 7(a), 9(a)
|
|
|
- run 16 30ms 100mbit ${numops}
|
|
|
- run 20 30ms 100mbit ${numops}
|
|
|
- run 26 30ms 100mbit ${numops}
|
|
|
-fi
|
|
|
-if [ "$whichexps" = "scaling" ]; then
|
|
|
- echo "Running scaling experiments..."
|
|
|
- # Figure 10
|
|
|
- runone read 16 30ms 100mbit ${numops} online 2P
|
|
|
- runone read 20 30ms 100mbit ${numops} online 2P
|
|
|
- runone read 26 30ms 100mbit ${numops} online 2P
|
|
|
- runone read 16 30ms 100mbit ${numops} online 3P
|
|
|
- runone read 20 30ms 100mbit ${numops} online 3P
|
|
|
- runone read 26 30ms 100mbit ${numops} online 3P
|
|
|
+ for i in $(seq 1 $numiters); do
|
|
|
+ # Figure 6(a)
|
|
|
+ for nops in 16 32 64 128 256 512 1024 2048; do
|
|
|
+ run 20 30ms 100mbit $nops
|
|
|
+ done
|
|
|
+ # Figures 6(b), 6(c)
|
|
|
+ for size in 16 18 20 22 24 26 28 30; do
|
|
|
+ run $size 30ms 100mbit 10
|
|
|
+ done
|
|
|
+ done
|
|
|
fi
|
|
|
if [ "$whichexps" = "large" -o "$whichexps" = "all" ]; then
|
|
|
echo "Running large experiments..."
|
|
|
- # Figure 9(a)
|
|
|
- runone read 28 30ms 100mbit ${numops} preproc 3P
|
|
|
- runone read 28 30ms 100mbit ${numops} online 3P
|
|
|
- runone read 30 30ms 100mbit ${numops} preproc 3P
|
|
|
- runone read 30 30ms 100mbit ${numops} online 3P
|
|
|
- runone read 32 30ms 100mbit ${numops} preproc 3P
|
|
|
- runone read 32 30ms 100mbit ${numops} online 3P
|
|
|
- # Figures 9(b) and 9(c)
|
|
|
- runone read 28 1us 100gbit ${numops} preproc 3P
|
|
|
- runone read 28 1us 100gbit ${numops} online 3P
|
|
|
- runone read 30 1us 100gbit ${numops} preproc 3P
|
|
|
- runone read 30 1us 100gbit ${numops} online 3P
|
|
|
- runone read 32 1us 100gbit ${numops} preproc 3P
|
|
|
- runone read 32 1us 100gbit ${numops} online 3P
|
|
|
fi
|
|
|
|
|
|
now=`date`
|
|
|
@@ -216,137 +173,24 @@ echo "$now: Experiments complete"
|
|
|
# outputs differently.
|
|
|
if [ "$LOGSUFFIX" = "" ]; then
|
|
|
|
|
|
-parse *_${numops}_{online,preproc}_{2P,3P}.out > duoram_${numops}.dat
|
|
|
+parse *_{online,preproc}_3P.out > duoram.dat
|
|
|
|
|
|
echo
|
|
|
-echo "# Figure 7(a)"
|
|
|
-egrep '2PDuoramTotl readwrite .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '2PDuoramOnln readwrite .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramTotl readwrite .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln readwrite .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-echo "# Figure 7(b)"
|
|
|
-egrep '2PDuoramTotl readwrite 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
-echo
|
|
|
-egrep '2PDuoramOnln readwrite 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramTotl readwrite 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln readwrite 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
-echo
|
|
|
-echo "# Figure 7(c)"
|
|
|
-egrep '2PDuoramTotl readwrite 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
-echo
|
|
|
-egrep '2PDuoramOnln readwrite 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramTotl readwrite 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln readwrite 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
-echo
|
|
|
-echo "# Figure 8(a)"
|
|
|
-egrep '2PDuoramTotl read .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '2PDuoramOnln read .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramTotl read .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln read .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-echo "# Figure 8(b)"
|
|
|
-egrep '2PDuoramTotl write .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '2PDuoramOnln write .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramTotl write .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln write .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-echo "# Figure 8(c)"
|
|
|
-egrep '2PDuoramTotl readwrite .* 30ms 100mbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '2PDuoramOnln readwrite .* 30ms 100mbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramTotl readwrite .* 30ms 100mbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln readwrite .* 30ms 100mbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-echo "# Figure 9(a)"
|
|
|
-egrep '3PDuoramTotl read .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln read .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
+echo "# Figure 6(a)"
|
|
|
+egrep '3PDuoramTotl read 20 30ms 100mbit (16|32|64|128|256|512|1024|2048) .* s$' duoram.dat | sort -k6 -n
|
|
|
+#echo
|
|
|
+#egrep '3PDuoramOnln read 20 30ms 100mbit (16|32|64|128|256|512|1024|2048) .* s$' duoram.dat | sort -k6 -n
|
|
|
echo
|
|
|
-echo "# Figure 9(b)"
|
|
|
-egrep '3PDuoramTotl read .* 1us 100gbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
+echo "# Figure 6(b)"
|
|
|
+egrep '3PDuoramTotl read .* 30ms 100mbit 10 .* s$' duoram.dat | sort -k3 -n
|
|
|
echo
|
|
|
-egrep '3PDuoramOnln read .* 1us 100gbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
+#egrep '3PDuoramOnln read .* 30ms 100mbit 10 .* s$' duoram.dat | sort -k3 -n
|
|
|
+#echo
|
|
|
+echo "# Figure 6(c)"
|
|
|
+egrep '3PDuoramTotl read .* 30ms 100mbit 10 .* KiB$' duoram.dat | sort -k3 -n
|
|
|
echo
|
|
|
-echo "# Figure 9(c)"
|
|
|
-egrep '3PDuoramTotl read .* 1us 100gbit .* KiB$' duoram_${numops}.dat | sort -k3 -n
|
|
|
-echo
|
|
|
-egrep '3PDuoramOnln read .* 1us 100gbit .* KiB$' duoram_${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 '2PDuoramTotl read .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- egrep '2PDuoramOnln read .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramTotl read .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramOnln read .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- echo "# Figure 11(b)"
|
|
|
- egrep '2PDuoramTotl read 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- egrep '2PDuoramOnln read 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramTotl read 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramOnln read 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- echo "# Figure 11(c)"
|
|
|
- egrep '2PDuoramTotl read 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- egrep '2PDuoramOnln read 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramTotl read 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramOnln read 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- echo
|
|
|
- echo "# Figure 12(a)"
|
|
|
- egrep '2PDuoramTotl write .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- egrep '2PDuoramOnln write .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramTotl write .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramOnln write .* 30ms 100mbit .* s$' duoram_${numops}.dat | sort -k3 -n
|
|
|
- echo
|
|
|
- echo "# Figure 12(b)"
|
|
|
- egrep '2PDuoramTotl write 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- egrep '2PDuoramOnln write 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramTotl write 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramOnln write 20 30ms .* s$' duoram_${numops}.dat | sort -k5 -n
|
|
|
- echo
|
|
|
- echo "# Figure 12(c)"
|
|
|
- egrep '2PDuoramTotl write 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- egrep '2PDuoramOnln write 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramTotl write 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
- egrep '3PDuoramOnln write 20 .* 100mbit .* s$' duoram_${numops}.dat | sort -k4 -n
|
|
|
- echo
|
|
|
-fi
|
|
|
+#egrep '3PDuoramOnln read .* 30ms 100mbit 10 .* KiB$' duoram.dat | sort -k3 -n
|
|
|
+#echo
|
|
|
|
|
|
echo "# End figures"
|
|
|
echo
|