161-computing-bandwidth-adjustments.txt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. Title: Computing Bandwidth Adjustments
  2. Filename: 161-computing-bandwidth-adjustments.txt
  3. Author: Mike Perry
  4. Created: 12-May-2009
  5. Target: 0.2.2.x
  6. Status: Open
  7. 1. Motivation
  8. There is high variance in the performance of the Tor network. Despite
  9. our efforts to balance load evenly across the Tor nodes, some nodes are
  10. significantly slower and more overloaded than others.
  11. Proposal 160 describes how we can augment the directory authorities to
  12. vote on measured bandwidths for routers. This proposal describes what
  13. goes into the measuring process.
  14. 2. Measurement Selection
  15. The general idea is to determine a load factor representing the ratio
  16. of the capacity of measured nodes to the rest of the network. This load
  17. factor could be computed from three potentially relevant statistics:
  18. circuit failure rates, circuit extend times, or stream capacity.
  19. Circuit failure rates and circuit extend times appear to be
  20. non-linearly proportional to node load. We've observed that the same
  21. nodes when scanned at US nighttime hours (when load is presumably
  22. lower) exhibit almost no circuit failure, and significantly faster
  23. extend times than when scanned during the day.
  24. Stream capacity, however, is much more uniform, even during US
  25. nighttime hours. Moreover, it is a more intuitive representation of
  26. node capacity, and also less dependent upon distance and latency
  27. if amortized over large stream fetches.
  28. 2. Average Stream Bandwidth Calculation
  29. The average stream bandwidths are obtained by dividing the network
  30. into 3% slices according to advertised node bandwidth, yielding
  31. about 45 nodes per slice in the current network.
  32. Two hop circuits are built using nodes from the same slice, and a large
  33. file is downloaded via these circuits. This process is repeated
  34. several hundred times, and average stream capacities are assigned to
  35. each node from these results.
  36. 3. Ratio Calculation Options
  37. There are two options for deriving the ratios themselves. They can
  38. be obtained by dividing each nodes' average stream capacity by
  39. either the average for the slice, or the average for the network as a
  40. whole.
  41. Dividing by the network-wide average has the advantage that it will
  42. account for issues related to unbalancing between higher vs lower
  43. capacity, such as Steven Murdoch's queuing theory weighting result.
  44. Dividing by the slice average has the advantage that many scans can
  45. be run in parallel from a single authority, and that results are
  46. typically available sooner after a given scan takes place.
  47. 3. Ratio Filtering
  48. After the base ratios are calculated, a second pass is performed
  49. to remove any streams with nodes of ratios less than X=0.5 from
  50. the results of other nodes. In addition, all outlying streams
  51. with capacity of one standard deviation below a node's average
  52. are also removed.
  53. The final ratio result will be calculated as the maximum of
  54. these two resulting ratios if both are less than 1.0, the minimum
  55. if both are greater than 1.0, and the mean if one is greater
  56. and one is less than 1.0.
  57. 4. Security implications
  58. The ratio filtering will deal with cases of sabotage by dropping
  59. both very slow outliers in stream average calculations, as well
  60. as dropping streams that used very slow nodes from the calculation
  61. of other nodes.
  62. This scheme will not address nodes that try to game the system by
  63. providing better service to scanners. The scanners can be detected
  64. at the entry by IP address, and at the exit by the destination fetch.
  65. Measures can be taken to obfuscate and separate the scanners' source
  66. IP address from the directory authority IP address. For instance,
  67. scans can happen offsite and the results can be rsynced into the
  68. authorities. The destination fetch can also be obscured by using SSL
  69. and periodically changing the large document that is fetched.
  70. Neither of these methods are foolproof, but such nodes can already
  71. lie about their bandwidth to attract more traffic, so this solution
  72. does not set us back any in that regard.
  73. 4. Integration with Proposal 160
  74. The final results will be produced for the voting mechanism
  75. described in Proposal 160 by multiplying the derived ratio by
  76. the average observed advertised bandwidth during the course of the
  77. scan. This will produce a new bandwidth value that will be
  78. output into a file consisting of lines of the form:
  79. <node-idhex> SP new_bandwidth NL
  80. This file can be either copied or rsynced into a directory readable
  81. by the directory authority.