108-mtbf-based-stability.txt 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Filename: 108-mtbf-based-stability.txt
  2. Title: Base "Stable" Flag on Mean Time Between Failures
  3. Author: Nick Mathewson
  4. Created: 10-Mar-2007
  5. Status: Closed
  6. Implemented-In: 0.2.0.x
  7. Overview:
  8. This document proposes that we change how directory authorities set the
  9. stability flag from inspection of a router's declared Uptime to the
  10. authorities' perceived mean time between failure for the router.
  11. Motivation:
  12. Clients prefer nodes that the authorities call Stable. This flag is (as
  13. of 0.2.0.0-alpha-dev) set entirely based on the node's declared value for
  14. uptime. This creates an opportunity for malicious nodes to declare
  15. falsely high uptimes in order to get more traffic.
  16. Spec changes:
  17. Replace the current rule for setting the Stable flag with:
  18. "Stable" -- A router is 'Stable' if it is active and its observed Stability
  19. for the past month is at or above the median Stability for active routers.
  20. Routers are never called stable if they are running a version of Tor
  21. known to drop circuits stupidly. (0.1.1.10-alpha through 0.1.1.16-rc
  22. are stupid this way.)
  23. Stability shall be defined as the weighted mean length of the runs
  24. observed by a given directory authority. A run begins when an authority
  25. decides that the server is Running, and ends when the authority decides
  26. that the server is not Running. In-progress runs are counted when
  27. measuring Stability. When calculating the mean, runs are weighted by
  28. $\alpha ^ t$, where $t$ is time elapsed since the end of the run, and
  29. $0 < \alpha < 1$. Time when an authority is down do not count to the
  30. length of the run.
  31. Rejected Alternative:
  32. "A router's Stability shall be defined as the sum of $\alpha ^ d$ for every
  33. $d$ such that the router was considered reachable for the entire day
  34. $d$ days ago.
  35. This allows a simpler implementation: every day, we multiply
  36. yesterday's Stability by alpha, and if the router was observed to be
  37. available every time we looked today, we add 1.
  38. Instead of "day", we could pick an arbitrary time unit. We should
  39. pick alpha to be high enough that long-term stability counts, but low
  40. enough that the distant past is eventually forgotten. Something
  41. between .8 and .95 seems right.
  42. (By requiring that routers be up for an entire day to get their
  43. stability increased, instead of counting fractions of a day, we
  44. capture the notion that stability is more like "probability of
  45. staying up for the next hour" than it is like "probability of being
  46. up at some randomly chosen time over the next hour." The former
  47. notion of stability is far more relevant for long-lived circuits.)
  48. Limitations:
  49. Authorities can have false positives and false negatives when trying to
  50. tell whether a router is up or down. So long as these aren't terribly
  51. wrong, and so long as they aren't significantly biased, we should be able
  52. to use them to estimate stability pretty well.
  53. Probing approaches like the above could miss short incidents of
  54. downtime. If we use the router's declared uptime, we could detect
  55. these: but doing so would penalize routers who reported their uptime
  56. accurately.
  57. Implementation:
  58. For now, the easiest way to store this information at authorities
  59. would probably be in some kind of periodically flushed flat file.
  60. Later, we could move to Berkeley db or something if we really had to.
  61. For each router, an authority will need to store:
  62. The router ID.
  63. Whether the router is up.
  64. The time when the current run started, if the router is up.
  65. The weighted sum length of all previous runs.
  66. The time at which the weighted sum length was last weighted down.
  67. Servers should probe at random intervals to test whether servers are
  68. running.