155-four-hidden-service-improvements.txt 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. Filename: 155-four-hidden-service-improvements.txt
  2. Title: Four Improvements of Hidden Service Performance
  3. Author: Karsten Loesing, Christian Wilms
  4. Created: 25-Sep-2008
  5. Status: Finished
  6. Implemented-In: 0.2.1.x
  7. Change history:
  8. 25-Sep-2008 Initial proposal for or-dev
  9. Overview:
  10. A performance analysis of hidden services [1] has brought up a few
  11. possible design changes to reduce advertisement time of a hidden service
  12. in the network as well as connection establishment time. Some of these
  13. design changes have side-effects on anonymity or overall network load
  14. which had to be weighed up against individual performance gains. A
  15. discussion of seven possible design changes [2] has led to a selection
  16. of four changes [3] that are proposed to be implemented here.
  17. Design:
  18. 1. Shorter Circuit Extension Timeout
  19. When establishing a connection to a hidden service a client cannibalizes
  20. an existing circuit and extends it by one hop to one of the service's
  21. introduction points. In most cases this can be accomplished within a few
  22. seconds. Therefore, the current timeout of 60 seconds for extending a
  23. circuit is far too high.
  24. Assuming that the timeout would be reduced to a lower value, for example
  25. 30 seconds, a second (or third) attempt to cannibalize and extend would
  26. be started earlier. With the current timeout of 60 seconds, 93.42% of all
  27. circuits can be established, whereas this fraction would have been only
  28. 0.87% smaller at 92.55% with a timeout of 30 seconds.
  29. For a timeout of 30 seconds the performance gain would be approximately 2
  30. seconds in the mean as opposed to the current timeout of 60 seconds. At
  31. the same time a smaller timeout leads to discarding an increasing number
  32. of circuits that might have been completed within the current timeout of
  33. 60 seconds.
  34. Measurements with simulated low-bandwidth connectivity have shown that
  35. there is no significant effect of client connectivity on circuit
  36. extension times. The reason for this might be that extension messages are
  37. small and thereby independent of the client bandwidth. Further, the
  38. connection between client and entry node only constitutes a single hop of
  39. a circuit, so that its influence on the whole circuit is limited.
  40. The exact value of the new timeout does not necessarily have to be 30
  41. seconds, but might also depend on the results of circuit build timeout
  42. measurements as described in proposal 151.
  43. 2. Parallel Connections to Introduction Points
  44. An additional approach to accelerate extension of introduction circuits
  45. is to extend a second circuit in parallel to a different introduction
  46. point. Such parallel extension attempts should be started after a short
  47. delay of, e.g., 15 seconds in order to prevent unnecessary circuit
  48. extensions and thereby save network resources. Whichever circuit
  49. extension succeeds first is used for introduction, while the other
  50. attempt is aborted.
  51. An evaluation has been performed for the more resource-intensive approach
  52. of starting two parallel circuits immediately instead of waiting for a
  53. short delay. The result was a reduction of connection establishment times
  54. from 27.4 seconds in the original protocol to 22.5 seconds.
  55. While the effect of the proposed approach of delayed parallelization on
  56. mean connection establishment times is expected to be smaller,
  57. variability of connection attempt times can be reduced significantly.
  58. 3. Increase Count of Internal Circuits
  59. Hidden services need to create or cannibalize and extend a circuit to a
  60. rendezvous point for every client request. Really popular hidden services
  61. require more than two internal circuits in the pool to answer multiple
  62. client requests at the same time. This scenario was not yet analyzed, but
  63. will probably exhibit worse performance than measured in the previous
  64. analysis. The number of preemptively built internal circuits should be a
  65. function of connection requests in the past to adapt to changing needs.
  66. Furthermore, an increased number of internal circuits on client side
  67. would allow clients to establish connections to more than one hidden
  68. service at a time.
  69. Under the assumption that a popular hidden service cannot make use of
  70. cannibalization for connecting to rendezvous points, the circuit creation
  71. time needs to be added to the current results. In the mean, the
  72. connection establishment time to a popular hidden service would increase
  73. by 4.7 seconds.
  74. 4. Build More Introduction Circuits
  75. When establishing introduction points, a hidden service should launch 5
  76. instead of 3 introduction circuits at the same time and use only the
  77. first 3 that could be established. The remaining two circuits could still
  78. be used for other purposes afterwards.
  79. The effect has been simulated using previously measured data, too.
  80. Therefore, circuit establishment times were derived from log files and
  81. written to an array. Afterwards, a simulation with 10,000 runs was
  82. performed picking 5 (4, 6) random values and using the 3 lowest values in
  83. contrast to picking only 3 values at random. The result is that the mean
  84. time of the 3-out-of-3 approach is 8.1 seconds, while the mean time of
  85. the 3-out-of-5 approach is 4.4 seconds.
  86. The effect on network load is minimal, because the hidden service can
  87. reuse the slower internal circuits for other purposes, e.g., rendezvous
  88. circuits. The only change is that a hidden service starts establishing
  89. more circuits at once instead of subsequently doing so.
  90. References:
  91. [1] http://freehaven.net/~karsten/hidserv/perfanalysis-2008-06-15.pdf
  92. [2] http://freehaven.net/~karsten/hidserv/discussion-2008-07-15.pdf
  93. [3] http://freehaven.net/~karsten/hidserv/design-2008-08-15.pdf