repro 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #!/bin/bash
  2. # Reproduce the Floram experiments from our paper:
  3. # Adithya Vadapalli, Ryan Henry, Ian Goldberg. Duoram: A
  4. # Bandwidth-Efficient Distributed ORAM for 2- and 3-Party Computation.
  5. # USENIX Security Symposium 2023.
  6. # cd into the directory containing this script (from the bash faq 028)
  7. if [[ $BASH_SOURCE = */* ]]; then
  8. cd -- "${BASH_SOURCE%/*}/" || exit
  9. fi
  10. # If the master NUMA commands are set, use them for Floram
  11. if [ "$NUMA_P0" != "" ]; then
  12. export FLORAM_NUMA_P0="$NUMA_P0"
  13. fi
  14. if [ "$NUMA_P1" != "" ]; then
  15. export FLORAM_NUMA_P1="$NUMA_P1"
  16. fi
  17. # Allow running only subsets of the experiment suite. Valid values are
  18. # "test", "small", "large", "scaling", "all", "none". ("none" is useful
  19. # if you just want to re-parse the output of existing logs. "scaling"
  20. # is the subset of "small" that generates the data points for Figure 10;
  21. # see the README for that one, since you need a machine with at least 64
  22. # cores to generate it.)
  23. if [ "$1" == "" ]; then
  24. whichexps="test"
  25. else
  26. whichexps="$1"
  27. fi
  28. # The number of operations per run; the graphs in the paper use 128
  29. if [ "$2" == "" ]; then
  30. numops=128
  31. else
  32. numops="$2"
  33. fi
  34. # Run one experiment
  35. # Arguments:
  36. # $1: mode (read, write, readwrite)
  37. # $2: depth (the ORAM has 2^depth elements)
  38. # $3: latency (e.g., 30ms)
  39. # $4: bandwidth (e.g., 100mbit)
  40. # $5: number of operations (e.g., 128)
  41. run() {
  42. now=`date`
  43. echo "$now: Running $1 $2 $3 $4 $5 ..."
  44. logfile="${1}_${3}_${4}_${5}.out"
  45. ./set-networking $3 $4
  46. echo "Network setup: $3 $4" >> $logfile
  47. ./run-experiment $1 $2 $5 >> $logfile
  48. }
  49. # Parse the output logs. We run this in the docker in case you don't
  50. # have perl installed on the host.
  51. # Arguments: a list of logfiles
  52. parse() {
  53. cat $* | docker exec -w /root -i floram_p0 ./parse_logs
  54. }
  55. # A very small kick-the-tires test to ensure everything compiled and
  56. # built properly
  57. if [ "$whichexps" == "test" ]; then
  58. echo "Running test experiment..."
  59. run read 16 1us 100gbit 2
  60. parse read_1us_100gbit_2.out
  61. exit
  62. fi
  63. now=`date`
  64. echo "$now: Starting experiments"
  65. if [ "$whichexps" == "small" -o "$whichexps" == "all" ]; then
  66. echo "Running small experiments..."
  67. # Figure 7(a), 8(c)
  68. run readwrite 16 30ms 100mbit ${numops}
  69. run readwrite 18 30ms 100mbit ${numops}
  70. run readwrite 20 30ms 100mbit ${numops}
  71. run readwrite 22 30ms 100mbit ${numops}
  72. run readwrite 24 30ms 100mbit ${numops}
  73. run readwrite 26 30ms 100mbit ${numops}
  74. # Figure 7(b)
  75. run readwrite 20 30ms 10mbit ${numops}
  76. run readwrite 20 30ms 30mbit ${numops}
  77. run readwrite 20 30ms 50mbit ${numops}
  78. run readwrite 20 30ms 70mbit ${numops}
  79. run readwrite 20 30ms 90mbit ${numops}
  80. run readwrite 20 30ms 110mbit ${numops}
  81. # Figure 7(c)
  82. run readwrite 20 10ms 100mbit ${numops}
  83. run readwrite 20 50ms 100mbit ${numops}
  84. run readwrite 20 70ms 100mbit ${numops}
  85. # Figures 8(a), 9(b), and 9(c)
  86. # Note that we set the latency to 1us, which really means "don't add
  87. # artificial latency", but we measure the onw-way latency to
  88. # actually be 30us, which is what we report in the paper. (pings
  89. # from one docker to the other take about 60us round trip.)
  90. run read 16 1us 100gbit ${numops}
  91. run read 18 1us 100gbit ${numops}
  92. run read 20 1us 100gbit ${numops}
  93. run read 22 1us 100gbit ${numops}
  94. run read 24 1us 100gbit ${numops}
  95. run read 26 1us 100gbit ${numops}
  96. # Figure 8(b)
  97. run write 16 1us 100gbit ${numops}
  98. run write 18 1us 100gbit ${numops}
  99. run write 20 1us 100gbit ${numops}
  100. run write 22 1us 100gbit ${numops}
  101. run write 24 1us 100gbit ${numops}
  102. run write 26 1us 100gbit ${numops}
  103. # Figure 9(a)
  104. run read 18 30ms 100mbit ${numops}
  105. run read 22 30ms 100mbit ${numops}
  106. run read 24 30ms 100mbit ${numops}
  107. fi
  108. if [ "$whichexps" == "small" -o "$whichexps" == "scaling" -o "$whichexps" == "all" ]; then
  109. # Figures 9(a), 10
  110. run read 16 30ms 100mbit ${numops}
  111. run read 20 30ms 100mbit ${numops}
  112. run read 26 30ms 100mbit ${numops}
  113. fi
  114. if [ "$whichexps" == "large" -o "$whichexps" == "all" ]; then
  115. echo "Running large experiments..."
  116. # Figure 9(a)
  117. run read 28 30ms 100mbit ${numops}
  118. run read 30 30ms 100mbit ${numops}
  119. run read 32 30ms 100mbit ${numops}
  120. # Figures 9(b) and 9(c)
  121. run read 28 1us 100gbit ${numops}
  122. run read 30 1us 100gbit ${numops}
  123. run read 32 1us 100gbit ${numops}
  124. fi
  125. now=`date`
  126. echo "$now: Experiments complete"
  127. parse *.out > floram.dat