xxx-grand-scaling-plan.txt 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Right now as I understand it, there are n big scaling problems heading
  2. our way:
  3. 1) Clients need to learn all the relay descriptors they could use. That's
  4. a lot of bytes through a potentially small pipe.
  5. 2) Relays need to hold open TCP connections to most other relays.
  6. 3) Clients need to learn the whole networkstatus. Even using v3, as
  7. the network grows that will become unwieldy.
  8. 4) Dir mirrors need to mirror all the relay descriptors; eventually this
  9. will get big too.
  10. Here's my plan.
  11. --------------------------------------------------------------------
  12. Piece one: download O(1) descriptors rather than O(n) descriptors.
  13. We need to change our circuit extend protocol so it fetches a relay
  14. descriptor at every 'extend' operation:
  15. - Client fetches networkstatus, picks guards, connects to one.
  16. - Client picks middle hop out of networkstatus, asks guard for
  17. its descriptor, then extends to it.
  18. - Clients picks exit hop out of networkstatus, asks middle hop
  19. for its descriptor, then extends to it. Done.
  20. The client needs to ask for the descriptor even if it already has a
  21. copy, because otherwise we leak too much. Also, the descriptor needs to
  22. be padded to some large (but not too large) size to prevent the middle
  23. hops from guessing about it.
  24. The first step towards this is to instrument the current code to see
  25. how much of a win this would actually be -- I am guessing it is already
  26. a win even with the current number of descriptors.
  27. We also would need to assign the 'Exit' flag more usefully, and make
  28. clients pay attention to it when picking their last hop, since they
  29. don't actually know the exit policies of the relays they're choosing from.
  30. We also need to think harder about other implications -- for example,
  31. a relay with a tiny exit policy won't get the Exit flag, and thus won't
  32. ever get picked as an exit relay. Plus, our "enclave exit" model is out
  33. the window unless we figure out a cool trick.
  34. More generally, we'll probably want to compress the descriptors that we
  35. send back; maybe 8k is a good upper bound? I wonder if we could ask for
  36. several descriptors, and bundle back all of the ones that fit in the 8k?
  37. We'd also want to put the load balancing weights into the networkstatus,
  38. so clients can choose fast nodes more often without needing to see the
  39. descriptors. This is a good opportunity for the authorities to be able
  40. to put "more accurate" weights in if they learn to detect attacks. It
  41. also means we should consider running automated audits to make sure the
  42. authorities aren't trying to snooker everybody.
  43. I'm aiming to get Peter Palfrader to tackle this problem in mid 2008,
  44. but I bet he could use some help.
  45. --------------------------------------------------------------------
  46. Piece two: inter-relay communication uses UDP
  47. If relays send packets to/from other relays via UDP, they don't need a
  48. new descriptor for each such link. Thus we'll still need to keep state
  49. for each link, but we won't max out on sockets.
  50. Clearly a lot more work needs to be done here. Ian Goldberg has a student
  51. who has been working on it, and if all goes well we'll be chipping in
  52. some funding to continue that. Also, Camilo Viecco has been doing his
  53. PhD thesis on it.
  54. --------------------------------------------------------------------
  55. Piece three: networkstatus documents get partitioned
  56. While the authorities should be expected to be able to handle learning
  57. about all the relays, there's no reason the clients or the mirrors need
  58. to. Authorities should put a cap on the number of relays listed in a
  59. single networkstatus, and split them when they get too big.
  60. We'd need a good way to have each authority come to the same conclusion
  61. about which partition a given relay goes into.
  62. Directory mirrors would then mirror all the relay descriptors in their
  63. partition. This is compatible with 'piece one' above, since clients in
  64. a given partition will only ask about descriptors in that partition.
  65. More complex versions of this design would involve overlapping partitions,
  66. but that would seem to start contradicting other parts of this proposal
  67. right quick.
  68. Nobody is working on this piece yet. It's hard to say when we'll need
  69. it, but it would be nice to have some more thought on it before the week
  70. that we need it.
  71. --------------------------------------------------------------------