135-private-tor-networks.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. Filename: 135-private-tor-networks.txt
  2. Title: Simplify Configuration of Private Tor Networks
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Karsten Loesing
  6. Created: 29-Apr-2008
  7. Status: Closed
  8. Target: 0.2.1.x
  9. Implemented-In: 0.2.1.2-alpha
  10. Change history:
  11. 29-Apr-2008 Initial proposal for or-dev
  12. 19-May-2008 Included changes based on comments by Nick to or-dev and
  13. added a section for test cases.
  14. 18-Jun-2008 Changed testing-network-only configuration option names.
  15. Overview:
  16. Configuring a private Tor network has become a time-consuming and
  17. error-prone task with the introduction of the v3 directory protocol. In
  18. addition to that, operators of private Tor networks need to set an
  19. increasing number of non-trivial configuration options, and it is hard
  20. to keep FAQ entries describing this task up-to-date. In this proposal we
  21. (1) suggest to (optionally) accelerate timing of the v3 directory voting
  22. process and (2) introduce an umbrella config option specifically aimed at
  23. creating private Tor networks.
  24. Design:
  25. 1. Accelerate Timing of v3 Directory Voting Process
  26. Tor has reasonable defaults for setting up a large, Internet-scale
  27. network with comparably high latencies and possibly wrong server clocks.
  28. However, those defaults are bad when it comes to quickly setting up a
  29. private Tor network for testing, either on a single node or LAN (things
  30. might be different when creating a test network on PlanetLab or
  31. something). Some time constraints should be made configurable for private
  32. networks. The general idea is to accelerate everything that has to do
  33. with propagation of directory information, but nothing else, so that a
  34. private network is available as soon as possible. (As a possible
  35. safeguard, changing these configuration values could be made dependent on
  36. the umbrella configuration option introduced in 2.)
  37. 1.1. Initial Voting Schedule
  38. When a v3 directory does not know any consensus, it assumes an initial,
  39. hard-coded VotingInterval of 30 minutes, VoteDelay of 5 minutes, and
  40. DistDelay of 5 minutes. This is important for multiple, simultaneously
  41. restarted directory authorities to meet at a common time and create an
  42. initial consensus. Unfortunately, this means that it may take up to half
  43. an hour (or even more) for a private Tor network to bootstrap.
  44. We propose to make these three time constants configurable (note that
  45. V3AuthVotingInterval, V3AuthVoteDelay, and V3AuthDistDelay do not have an
  46. effect on the _initial_ voting schedule, but only on the schedule that a
  47. directory authority votes for). This can be achieved by introducing three
  48. new configuration options: TestingV3AuthInitialVotingInterval,
  49. TestingV3AuthInitialVoteDelay, and TestingV3AuthInitialDistDelay.
  50. As first safeguards, Tor should only accept configuration values for
  51. TestingV3AuthInitialVotingInterval that divide evenly into the default
  52. value of 30 minutes. The effect is that even if people misconfigured
  53. their directory authorities, they would meet at the default values at the
  54. latest. The second safeguard is to allow configuration only when the
  55. umbrella configuration option TestingTorNetwork is set.
  56. 1.2. Immediately Provide Reachability Information (Running flag)
  57. The default behavior of a directory authority is to provide the Running
  58. flag only after the authority is available for at least 30 minutes. The
  59. rationale is that before that time, an authority simply cannot deliver
  60. useful information about other running nodes. But for private Tor
  61. networks this may be different. This is currently implemented in the code
  62. as:
  63. /** If we've been around for less than this amount of time, our
  64. * reachability information is not accurate. */
  65. #define DIRSERV_TIME_TO_GET_REACHABILITY_INFO (30*60)
  66. There should be another configuration option
  67. TestingAuthDirTimeToLearnReachability with a default value of 30 minutes
  68. that can be changed when running testing Tor networks, e.g. to 0 minutes.
  69. The configuration value would simply replace the quoted constant. Again,
  70. changing this option could be safeguarded by requiring the umbrella
  71. configuration option TestingTorNetwork to be set.
  72. 1.3. Reduce Estimated Descriptor Propagation Time
  73. Tor currently assumes that it takes up to 10 minutes until router
  74. descriptors are propagated from the authorities to directory caches.
  75. This is not very useful for private Tor networks, and we want to be able
  76. to reduce this time, so that clients can download router descriptors in a
  77. timely manner.
  78. /** Clients don't download any descriptor this recent, since it will
  79. * probably not have propagated to enough caches. */
  80. #define ESTIMATED_PROPAGATION_TIME (10*60)
  81. We suggest to introduce a new config option
  82. TestingEstimatedDescriptorPropagationTime which defaults to 10 minutes,
  83. but that can be set to any lower non-negative value, e.g. 0 minutes. The
  84. same safeguards as in 1.2 could be used here, too.
  85. 2. Umbrella Option for Setting Up Private Tor Networks
  86. Setting up a private Tor network requires a number of specific settings
  87. that are not required or useful when running Tor in the public Tor
  88. network. Instead of writing down these options in a FAQ entry, there
  89. should be a single configuration option, e.g. TestingTorNetwork, that
  90. changes all required settings at once. Newer Tor versions would keep the
  91. set of configuration options up-to-date. It should still remain possible
  92. to manually overwrite the settings that the umbrella configuration option
  93. affects.
  94. The following configuration options are set by TestingTorNetwork:
  95. - ServerDNSAllowBrokenResolvConf 1
  96. Ignore the situation that private relays are not aware of any name
  97. servers.
  98. - DirAllowPrivateAddresses 1
  99. Allow router descriptors containing private IP addresses.
  100. - EnforceDistinctSubnets 0
  101. Permit building circuits with relays in the same subnet.
  102. - AssumeReachable 1
  103. Omit self-testing for reachability.
  104. - AuthDirMaxServersPerAddr 0
  105. - AuthDirMaxServersPerAuthAddr 0
  106. Permit an unlimited number of nodes on the same IP address.
  107. - ClientDNSRejectInternalAddresses 0
  108. Believe in DNS responses resolving to private IP addresses.
  109. - ExitPolicyRejectPrivate 0
  110. Allow exiting to private IP addresses. (This one is a matter of
  111. taste---it might be dangerous to make this a default in a private
  112. network, although people setting up private Tor networks should know
  113. what they are doing.)
  114. - V3AuthVotingInterval 5 minutes
  115. - V3AuthVoteDelay 20 seconds
  116. - V3AuthDistDelay 20 seconds
  117. Accelerate voting schedule after first consensus has been reached.
  118. - TestingV3AuthInitialVotingInterval 5 minutes
  119. - TestingV3AuthInitialVoteDelay 20 seconds
  120. - TestingV3AuthInitialDistDelay 20 seconds
  121. Accelerate initial voting schedule until first consensus is reached.
  122. - TestingAuthDirTimeToLearnReachability 0 minutes
  123. Consider routers as Running from the start of running an authority.
  124. - TestingEstimatedDescriptorPropagationTime 0 minutes
  125. Clients try downloading router descriptors from directory caches,
  126. even when they are not 10 minutes old.
  127. In addition to changing the defaults for these configuration options,
  128. TestingTorNetwork can only be set when a user has manually configured
  129. DirServer lines.
  130. Test:
  131. The implementation of this proposal must pass the following tests:
  132. 1. Set TestingTorNetwork and see if dependent configuration options are
  133. correctly changed.
  134. tor DataDirectory . ControlPort 9051 TestingTorNetwork 1 DirServer \
  135. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000"
  136. telnet 127.0.0.1 9051
  137. AUTHENTICATE
  138. GETCONF TestingTorNetwork TestingAuthDirTimeToLearnReachability
  139. 250-TestingTorNetwork=1
  140. 250 TestingAuthDirTimeToLearnReachability=0
  141. QUIT
  142. 2. Set TestingTorNetwork and a dependent configuration value to see if
  143. the provided value is used for the dependent option.
  144. tor DataDirectory . ControlPort 9051 TestingTorNetwork 1 DirServer \
  145. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000" \
  146. TestingAuthDirTimeToLearnReachability 5
  147. telnet 127.0.0.1 9051
  148. AUTHENTICATE
  149. GETCONF TestingTorNetwork TestingAuthDirTimeToLearnReachability
  150. 250-TestingTorNetwork=1
  151. 250 TestingAuthDirTimeToLearnReachability=5
  152. QUIT
  153. 3. Start with TestingTorNetwork set and change a dependent configuration
  154. option later on.
  155. tor DataDirectory . ControlPort 9051 TestingTorNetwork 1 DirServer \
  156. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000"
  157. telnet 127.0.0.1 9051
  158. AUTHENTICATE
  159. SETCONF TestingAuthDirTimeToLearnReachability=5
  160. GETCONF TestingAuthDirTimeToLearnReachability
  161. 250 TestingAuthDirTimeToLearnReachability=5
  162. QUIT
  163. 4. Start with TestingTorNetwork set and a dependent configuration value,
  164. and reset that dependent configuration value. The result should be
  165. the testing-network specific default value.
  166. tor DataDirectory . ControlPort 9051 TestingTorNetwork 1 DirServer \
  167. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000" \
  168. TestingAuthDirTimeToLearnReachability 5
  169. telnet 127.0.0.1 9051
  170. AUTHENTICATE
  171. GETCONF TestingAuthDirTimeToLearnReachability
  172. 250 TestingAuthDirTimeToLearnReachability=5
  173. RESETCONF TestingAuthDirTimeToLearnReachability
  174. GETCONF TestingAuthDirTimeToLearnReachability
  175. 250 TestingAuthDirTimeToLearnReachability=0
  176. QUIT
  177. 5. Leave TestingTorNetwork unset and check if dependent configuration
  178. options are left unchanged.
  179. tor DataDirectory . ControlPort 9051 DirServer \
  180. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000"
  181. telnet 127.0.0.1 9051
  182. AUTHENTICATE
  183. GETCONF TestingTorNetwork TestingAuthDirTimeToLearnReachability
  184. 250-TestingTorNetwork=0
  185. 250 TestingAuthDirTimeToLearnReachability=1800
  186. QUIT
  187. 6. Leave TestingTorNetwork unset, but set dependent configuration option
  188. which should fail.
  189. tor DataDirectory . ControlPort 9051 DirServer \
  190. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000" \
  191. TestingAuthDirTimeToLearnReachability 0
  192. [warn] Failed to parse/validate config:
  193. TestingAuthDirTimeToLearnReachability may only be changed in testing
  194. Tor networks!
  195. 7. Start with TestingTorNetwork unset and change dependent configuration
  196. option later on which should fail.
  197. tor DataDirectory . ControlPort 9051 DirServer \
  198. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000"
  199. telnet 127.0.0.1 9051
  200. AUTHENTICATE
  201. SETCONF TestingAuthDirTimeToLearnReachability=0
  202. 513 Unacceptable option value: TestingAuthDirTimeToLearnReachability
  203. may only be changed in testing Tor networks!
  204. 8. Start with TestingTorNetwork unset and set it later on which should
  205. fail.
  206. tor DataDirectory . ControlPort 9051 DirServer \
  207. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000"
  208. telnet 127.0.0.1 9051
  209. AUTHENTICATE
  210. SETCONF TestingTorNetwork=1
  211. 553 Transition not allowed: While Tor is running, changing
  212. TestingTorNetwork is not allowed.
  213. 9. Start with TestingTorNetwork set and unset it later on which should
  214. fail.
  215. tor DataDirectory . ControlPort 9051 TestingTorNetwork 1 DirServer \
  216. "mydir 127.0.0.1:1234 0000000000000000000000000000000000000000"
  217. telnet 127.0.0.1 9051
  218. AUTHENTICATE
  219. RESETCONF TestingTorNetwork
  220. 513 Unacceptable option value: TestingV3AuthInitialVotingInterval may
  221. only be changed in testing Tor networks!
  222. 10. Set TestingTorNetwork, but do not provide an alternate DirServer
  223. which should fail.
  224. tor DataDirectory . ControlPort 9051 TestingTorNetwork 1
  225. [warn] Failed to parse/validate config: TestingTorNetwork may only be
  226. configured in combination with a non-default set of DirServers.