125-bridges.txt 12 KB

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