125-bridges.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. Filename: 125-bridges.txt
  2. Title: Behavior for bridge users, bridge relays, and bridge authorities
  3. Version: $Revision$
  4. Last-Modified: $Date$
  5. Author: Roger Dingledine
  6. Created: 11-Nov-2007
  7. Status: Finished
  8. Implemented-In: 0.2.0.x
  9. 0. Preface
  10. This document describes the design decisions around support for bridge
  11. users, bridge relays, and bridge authorities. It acts as an overview
  12. of the bridge design and deployment for developers, and it also tries
  13. to point out limitations in the current design and implementation.
  14. For more details on what all of these mean, look at blocking.tex in
  15. /doc/design-paper/
  16. 1. Bridge relays
  17. Bridge relays are just like normal Tor relays except they don't publish
  18. their server descriptors to the main directory authorities.
  19. 1.1. PublishServerDescriptor
  20. To configure your relay to be a bridge relay, just add
  21. BridgeRelay 1
  22. PublishServerDescriptor bridge
  23. to your torrc. This will cause your relay to publish its descriptor
  24. to the bridge authorities rather than to the default authorities.
  25. Alternatively, you can say
  26. BridgeRelay 1
  27. PublishServerDescriptor 0
  28. which will cause your relay to not publish anywhere. This could be
  29. useful for private bridges.
  30. 1.2. Defining DirPort
  31. Bridges need to answer BEGIN_DIR requests, both so they can answer
  32. "/server/authority" questions ("what's your descriptor?") and so they
  33. can supply their bridge users with cached copies of all the various
  34. Tor network information.
  35. As of Tor 0.2.0.13-alpha, bridges will answer begin_dir questions
  36. (and cache dir info they see so the answers will be more useful)
  37. whether their DirPort is enabled or not. (After all, we don't care if
  38. they have an open or reachable DirPort to answer begin_dir questions.)
  39. We need to investigate if there are any anonymity worries with answering
  40. BEGIN_DIR requests when our DirPort is off. I claim that we don't open
  41. any new attacks: it's still a fine question to ask what partitioning
  42. attacks there are when you can query a Tor client about its current
  43. directory opinions, but these attacks already exist when DirPort is on.
  44. We should investigate this in 0.2.1.x.
  45. 1.3. Exit policy
  46. Bridge relays should use an exit policy of "reject *:*". This is
  47. because they only need to relay traffic between the bridge users
  48. and the rest of the Tor network, so there's no need to let people
  49. exit directly from them.
  50. 1.4. RelayBandwidthRate / RelayBandwidthBurst
  51. We invented the RelayBandwidth* options for this situation: Tor clients
  52. who want to allow relaying too. See proposal 111 for details. Relay
  53. operators should feel free to rate-limit their relayed traffic.
  54. 1.5. Helping the user with port forwarding, NAT, etc.
  55. Just as for operating normal relays, our documentation and hints for
  56. how to make your ORPort reachable are inadequate for normal users.
  57. We need to work harder on this step, perhaps in 0.2.1.x.
  58. 1.6. Vidalia integration
  59. Vidalia 0.0.15 has turned its "Relay" settings page into a tri-state
  60. "Don't relay" / "Relay for the Tor network" / "Help censored users".
  61. If you click the third choice, it forces your exit policy to reject *:*,
  62. and it forces your DirPort to 9030 (but see Sec 1.2 above about DirPort).
  63. If all the bridges end up on port 9001, that's not so good. On the
  64. other hand, putting the bridges on a low-numbered port in the Unix
  65. world requires jumping through extra hoops. The current compromise is
  66. that Vidalia makes the ORPort default to 443 on Windows, and 9001 on
  67. other platforms.
  68. At the bottom of the relay config settings window, Vidalia displays
  69. the bridge identifier to the operator (see Section 3.1) so he can pass
  70. it on to bridge users.
  71. 1.7. What if the default ORPort is already used?
  72. If the user already has a webserver or some other application
  73. bound to port 443, then Tor will fail to bind it and complain to the
  74. user, probably in a cryptic way. Rather than just working on a better
  75. error message (though we should do this), we should consider an
  76. "ORPort auto" option that tells Tor to try to find something that's
  77. bindable and reachable. This would also help us tolerate ISPs that
  78. filter incoming connections on port 80 and port 443. But this should
  79. be a different proposal, and can wait until 0.2.1.x.
  80. 2. Bridge authorities.
  81. Bridge authorities are like normal directory authorities, except they
  82. don't create their own network-status documents or votes. So if you
  83. ask an authority for a network-status document or consensus, they
  84. behave like a directory mirror: they give you one from one of the main
  85. authorities. But if you ask the bridge authority for the descriptor
  86. corresponding to a particular identity fingerprint, it will happily
  87. give you the latest descriptor for that fingerprint.
  88. To become a bridge authority, add these lines to your torrc:
  89. AuthoritativeDirectory 1
  90. BridgeAuthoritativeDir 1
  91. Right now there's one bridge authority, running on the Tonga relay.
  92. 2.1. Exporting bridge-purpose descriptors
  93. We've added a new purpose for server descriptors: the "bridge"
  94. purpose. With the new router-descriptors file format that includes
  95. annotations, it's easy to look through it and find the bridge-purpose
  96. descriptors.
  97. We should work with Tonga to export its router-descriptors file to
  98. some place where we can distribute the bridge addresses according to
  99. the policies in blocking.pdf. It might even be easier to have it write
  100. out a separate file, just for export, that includes only the bridge
  101. descriptors; or maybe a six-liner perl postprocessing script is the
  102. better plan there to create a file for export.
  103. 2.2. Reachability/uptime testing
  104. Right now the bridge authorities just passively collect bridge
  105. descriptors, and give them out on request. At some point we are going
  106. to want to recommend new bridges to users, and we'll want to have
  107. some way of deciding which ones are up right now, which ones have
  108. been around for a while, etc. We should have the bridge authorities
  109. do active measurements of bridges just as the normal authorities do
  110. active measurements of normal relays. Then we can export the results
  111. just like in Section 2.1. above.
  112. In the design document, we suggested that bridges should publish
  113. anonymously (i.e. via Tor) to the bridge authority, so somebody watching
  114. the bridge authority can't just enumerate all the bridges. But if we're
  115. doing active measurement, the game is up. Perhaps we should back off on
  116. this goal, or perhaps we should do our active measurement anonymously?
  117. Answering this issue is scheduled for 0.2.1.x.
  118. 2.3. Migrating to multiple bridge authorities
  119. Having only one bridge authority is both a trust bottleneck (if you
  120. break into one place you learn about every single bridge we've got)
  121. and a robustness bottleneck (when it's down, bridge users become sad).
  122. Right now if we put up a second bridge authority, all the bridges would
  123. publish to it, and (assuming the code works) bridge users would query
  124. a random bridge authority. This resolves the robustness bottleneck,
  125. but makes the trust bottleneck even worse.
  126. In 0.2.1.x and later we should think about better ways to have multiple
  127. bridge authorities.
  128. 3. Bridge users.
  129. Bridge users are like ordinary Tor users except they use encrypted
  130. directory connections by default, and they use bridge relays as both
  131. entry guards (their first hop) and directory guards (the source of
  132. all their directory information).
  133. To become a bridge user, add the following two lines to your torrc:
  134. UseBridges 1
  135. TunnelDirConns 1
  136. and then add at least one "Bridge" line to your torrc based on the
  137. format below.
  138. 3.1. Format of the bridge identifier.
  139. The canonical format for a bridge identifier contains an IP address,
  140. an ORPort, and an identity fingerprint:
  141. bridge 128.31.0.34:9009 4C17 FB53 2E20 B2A8 AC19 9441 ECD2 B017 7B39 E4B1
  142. However, the identity fingerprint can be left out, in which case the
  143. bridge user will connect to that relay and use it as a bridge regardless
  144. of what identity key it presents:
  145. bridge 128.31.0.34:9009
  146. This might be useful for cases where only short bridge identifiers
  147. can be communicated to bridge users.
  148. In a future version we may also support bridge identifiers that are
  149. only a key fingerprint:
  150. bridge 4C17 FB53 2E20 B2A8 AC19 9441 ECD2 B017 7B39 E4B1
  151. and the bridge user can fetch the latest descriptor from the bridge
  152. authority (see Section 3.4).
  153. 3.2. Bridges as entry guards
  154. For now, bridge users add their bridge relays to their list of "entry
  155. guards" (see path-spec.txt for background on entry guards). They are
  156. managed by the entry guard algorithms exactly as if they were a normal
  157. entry guard -- their keys and timing get cached in the "state" file,
  158. etc. This means that when the Tor user starts up with "UseBridges"
  159. disabled, he will skip past the bridge entries since they won't be
  160. listed as up and usable in his networkstatus consensus. But to be clear,
  161. the "entry_guards" list doesn't currently distinguish guards by purpose.
  162. Internally, each bridge user keeps a smartlist of "bridge_info_t"
  163. that reflects the "bridge" lines from his torrc along with a download
  164. schedule (see Section 3.5 below). When he starts Tor, he attempts
  165. to fetch a descriptor for each configured bridge (see Section 3.4
  166. below). When he succeeds at getting a descriptor for one of the bridges
  167. in his list, he adds it directly to the entry guard list using the
  168. normal add_an_entry_guard() interface. Once a bridge descriptor has
  169. been added, should_delay_dir_fetches() will stop delaying further
  170. directory fetches, and the user begins to bootstrap his directory
  171. information from that bridge (see Section 3.3).
  172. Currently bridge users cache their bridge descriptors to the
  173. "cached-descriptors" file (annotated with purpose "bridge"), but
  174. they don't make any attempt to reuse descriptors they find in this
  175. file. The theory is that either the bridge is available now, in which
  176. case you can get a fresh descriptor, or it's not, in which case an
  177. old descriptor won't do you much good.
  178. We could disable writing out the bridge lines to the state file, if
  179. we think this is a problem.
  180. As an exception, if we get an application request when we have one
  181. or more bridge descriptors but we believe none of them are running,
  182. we mark them all as running again. This is similar to the exception
  183. already in place to help long-idle Tor clients realize they should
  184. fetch fresh directory information rather than just refuse requests.
  185. 3.3. Bridges as directory guards
  186. In addition to using bridges as the first hop in their circuits, bridge
  187. users also use them to fetch directory updates. Other than initial
  188. bootstrapping to find a working bridge descriptor (see Section 3.4
  189. below), all further non-anonymized directory fetches will be redirected
  190. to the bridge.
  191. This means that bridge relays need to have cached answers for all
  192. questions the bridge user might ask. This makes the upgrade path
  193. tricky --- for example, if we migrate to a v4 directory design, the
  194. bridge user would need to keep using v3 so long as his bridge relays
  195. only knew how to answer v3 queries.
  196. In a future design, for cases where the user has enough information
  197. to build circuits yet the chosen bridge doesn't know how to answer a
  198. given query, we might teach bridge users to make an anonymized request
  199. to a more suitable directory server.
  200. 3.4. How bridge users get their bridge descriptor
  201. Bridge users can fetch bridge descriptors in two ways: by going directly
  202. to the bridge and asking for "/tor/server/authority", or by going to
  203. the bridge authority and asking for "/tor/server/fp/ID". By default,
  204. they will only try the direct queries. If the user sets
  205. UpdateBridgesFromAuthority 1
  206. in his config file, then he will try querying the bridge authority
  207. first for bridges where he knows a digest (if he only knows an IP
  208. address and ORPort, then his only option is a direct query).
  209. If the user has at least one working bridge, then he will do further
  210. queries to the bridge authority through a full three-hop Tor circuit.
  211. But when bootstrapping, he will make a direct begin_dir-style connection
  212. to the bridge authority.
  213. As of Tor 0.2.0.10-alpha, if the user attempts to fetch a descriptor
  214. from the bridge authority and it returns a 404 not found, the user
  215. will automatically fall back to trying a direct query. Therefore it is
  216. recommended that bridge users always set UpdateBridgesFromAuthority,
  217. since at worst it will delay their fetches a little bit and notify
  218. the bridge authority of the identity fingerprint (but not location)
  219. of their intended bridges.
  220. 3.5. Bridge descriptor retry schedule
  221. Bridge users try to fetch a descriptor for each bridge (using the
  222. steps in Section 3.4 above) on startup. Whenever they receive a
  223. bridge descriptor, they reschedule a new descriptor download for 1
  224. hour from then.
  225. If on the other hand it fails, they try again after 15 minutes for the
  226. first attempt, after 15 minutes for the second attempt, and after 60
  227. minutes for subsequent attempts.
  228. In 0.2.1.x we should come up with some smarter retry schedules.
  229. 3.6. Vidalia integration
  230. Vidalia 0.0.15 has a new checkbox in its Network config window called
  231. "My ISP blocks connections to the Tor network." Users who click that
  232. box change their configuration to:
  233. TunnelDirConns 1
  234. PreferTunneledDirConns 1
  235. Once the box is checked, there is also a section for adding bridge
  236. identifiers. When at least one bridge identifier is present, Vidalia
  237. also changes their config to:
  238. UseBridges 1
  239. UpdateBridgesFromAuthority 1
  240. and updates their Bridge config option accordingly.
  241. 3.7. When should we make TunnelDirConns default
  242. Right now Tor's directory requests can be filtered on the network,
  243. and some tools used by Middle Eastern governments even do this. A user
  244. who wants to circumvent these filters should click the above box in
  245. Vidalia 0.0.15. But at what point should we make tunneled directory
  246. requests the default?
  247. Once proposal 124 (modified TLS handshake) is in place, we should
  248. consider doing the switch. This might even be in the 0.2.0.x timeframe.
  249. 3.8. Do we need a second layer of entry guards?
  250. If the bridge user uses the bridge as its entry guard, then the
  251. triangulation attacks from Lasse and Paul's Oakland paper work to
  252. locate the user's bridge(s).
  253. Worse, this is another way to enumerate bridges: if the bridge users
  254. keep rotating through second hops, then if you run a few fast servers
  255. (and avoid getting considered an Exit or a Guard) you'll quickly get
  256. a list of the bridges in active use.
  257. That's probably the strongest reason why bridge users will need to
  258. pick second-layer guards. Would this mean bridge users should switch
  259. to four-hop circuits?
  260. We should figure this out in the 0.2.1.x timeframe.