160-bandwidth-offset.txt 3.3 KB

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