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

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