xxx-rate-limit-exits.txt 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. 1. Overview
  2. We should rate limit the volume of stream creations at exits:
  3. 2.1. Per-circuit limits
  4. If a given circuit opens more than N streams in X seconds, further
  5. stream requests over the next Y seconds should fail with the reason
  6. 'resourcelimit'. Clients will automatically notice this and switch to
  7. a new circuit.
  8. The goal is to limit the effects of port scans on a given exit relay,
  9. so the relay's ISP won't get hassled as much.
  10. First thoughts for parameters would be N=100 streams in X=5 seconds
  11. causes 30 seconds of fails; and N=300 streams in X=30 seconds causes
  12. 30 seconds of fails.
  13. We could simplify by, instead of having a "for 30 seconds" parameter,
  14. just marking the circuit as forever failing new requests. (We don't want
  15. to just close the circuit because it may still have open streams on it.)
  16. 2.2. Per-destination limits
  17. If a given circuit opens more than N1 streams in X seconds to a single
  18. IP address, or all the circuits combined open more than N2 streams,
  19. then we should fail further attempts to reach that address for a while.
  20. The goal is to limit the abuse that Tor exit relays can dish out
  21. to a single target either for socket DoS or for web crawling, in
  22. the hopes of a) not triggering their automated defenses, and b) not
  23. making them upset at Tor. Hopefully these self-imposed bans will be
  24. much shorter-lived than bans or barriers put up by the websites.
  25. 3. Issues
  26. 3.1. Circuit-creation overload
  27. Making clients move to new circuits more often will cause more circuit
  28. creation requests.
  29. 3.2. How to pick the parameters?
  30. If we pick the numbers too low, then popular sites are effectively
  31. cut out of Tor. If we pick them too high, we don't do much good.
  32. Worse, picking them wrong isn't easy to fix, since the deployed Tor
  33. servers will ship with a certain set of numbers.
  34. We could put numbers (or "general settings") in the networkstatus
  35. consensus, and Tor exits would adapt more dynamically.
  36. We could also have a local config option about how aggressive this
  37. server should be with its parameters.
  38. 4. Client-side limitations
  39. Perhaps the clients should have built-in rate limits too, so they avoid
  40. harrassing the servers by default?
  41. Tricky if we want to get Tor clients in use at large enclaves.