125-bridges.txt 12 KB

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