160-bandwidth-offset.txt 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. Filename: 160-bandwidth-offset.txt
  2. Title: Authorities vote for bandwidth offsets in consensus
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Roger Dingledine
  6. Created: 4-May-2009
  7. Status: Open
  8. Target: 0.2.2.x
  9. 1. Motivation
  10. As part of proposal 141, we moved the bandwidth value for each relay
  11. into the consensus. Now clients can know how they should load balance
  12. even before they've fetched the corresponding relay descriptors.
  13. Putting the bandwidth in the consensus also lets the directory
  14. authorities choose more accurate numbers to advertise, if we come up
  15. with a better algorithm for deciding weightings.
  16. Our original plan was to teach directory authorities how to measure
  17. bandwidth themselves; then every authority would vote for the bandwidth
  18. it prefers, and we'd take the median of votes as usual.
  19. The problem comes when we have 7 authorities, and only a few of them
  20. have smarter bandwidth allocation algorithms. So long as the majority
  21. of them are voting for the number in the relay descriptor, the minority
  22. that have better numbers will be ignored.
  23. 2. Options
  24. One fix would be to demand that every authority also run the
  25. new bandwidth measurement algorithms: in that case, part of the
  26. responsibility of being an authority operator is that you need to run
  27. this code too. But in practice we can't really require all current
  28. authority operators to do that; and if we want to expand the set of
  29. authority operators even further, it will become even more impractical.
  30. Also, bandwidth testing adds load to the network, so we don't really
  31. want to require that the number of concurrent bandwidth tests match
  32. the number of authorities we have.
  33. The better fix is to allow certain authorities to specify that they are
  34. voting on bandwidth "offsets": how much they think the weight should
  35. be changed for the relay in question. We should put the offset vote in
  36. the stanza for the relay in question, so a given authority can choose
  37. which relays to express preferences for and which not.
  38. 3. Security implications
  39. If only some authorities choose to vote on an offset, then a majority of
  40. those voting authorities can arbitrarily change the bandwidth weighting
  41. for the relay. At the extreme, if there's only one offset-voting
  42. authority, then that authority can dictate which relays clients will
  43. find attractive.
  44. This problem isn't entirely new: we already have the worry wrt
  45. the subset of authorities that vote for BadExit.
  46. To make it not so bad, we should deploy at least three offset-voting
  47. authorities.
  48. Also, authorities that know how to vote for offsets should vote for
  49. an offset of zero for new nodes, rather than choosing not to vote on
  50. any offset in those cases.
  51. 4. Design
  52. First, we need a new consensus method to support this new calculation.
  53. Now v3 votes can have a new weight on the "w" line:
  54. "Bandwidth_Offset=" INT.
  55. Once we're using the new consensus method, the new way to compute the
  56. Bandwidth weight is by taking the old vote (explained in proposal 141:
  57. median, then choose the lower number in the case of ties), and adding
  58. or subtracting the median offset (using the offset closer to 0 in the
  59. case of ties, and with a sum of 0 if the sum is negative).
  60. Then the actual consensus looks just the same as it did before,
  61. so clients never have to know that this additional calculation is
  62. happening.