108-mtbf-based-stability.txt 3.7 KB

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