2 Tor bridges specification
6 This document describes the design decisions around support for bridge
7 users, bridge relays, and bridge authorities. It acts as an overview
8 of the bridge design and deployment for developers, and it also tries
9 to point out limitations in the current design and implementation.
11 For more details on what all of these mean, look at blocking.tex in
16 Bridge relays are just like normal Tor relays except they don't publish
17 their server descriptors to the main directory authorities.
19 1.1. PublishServerDescriptor
21 To configure your relay to be a bridge relay, just add
23 PublishServerDescriptor bridge
24 to your torrc. This will cause your relay to publish its descriptor
25 to the bridge authorities rather than to the default authorities.
27 Alternatively, you can say
29 PublishServerDescriptor 0
30 which will cause your relay to not publish anywhere. This could be
31 useful for private bridges.
35 Bridge relays should use an exit policy of "reject *:*". This is
36 because they only need to relay traffic between the bridge users
37 and the rest of the Tor network, so there's no need to let people
38 exit directly from them.
40 We invented the RelayBandwidth* options for this situation: Tor clients
41 who want to allow relaying too. See proposal 111 for details. Relay
42 operators should feel free to rate-limit their relayed traffic.
44 1.3. Implementation note.
46 Vidalia 0.0.15 has turned its "Relay" settings page into a tri-state
47 "Don't relay" / "Relay for the Tor network" / "Help censored users".
49 If you click the third choice, it forces your exit policy to reject *:*.
51 If all the bridges end up on port 9001, that's not so good. On the
52 other hand, putting the bridges on a low-numbered port in the Unix
53 world requires jumping through extra hoops. The current compromise is
54 that Vidalia makes the ORPort default to 443 on Windows, and 9001 on
57 At the bottom of the relay config settings window, Vidalia displays
58 the bridge identifier to the operator (see Section 3.1) so he can pass
59 it on to bridge users.
61 2. Bridge authorities.
63 Bridge authorities are like normal v3 directory authorities, except
64 they don't create their own network-status documents or votes. So if
65 you ask a bridge authority for a network-status document or consensus,
66 they behave like a directory mirror: they give you one from one of
67 the main authorities. But if you ask the bridge authority for the
68 descriptor corresponding to a particular identity fingerprint, it will
69 happily give you the latest descriptor for that fingerprint.
71 To become a bridge authority, add these lines to your torrc:
72 AuthoritativeDirectory 1
73 BridgeAuthoritativeDir 1
75 Right now there's one bridge authority, running on the Tonga relay.
77 2.1. Exporting bridge-purpose descriptors
79 We've added a new purpose for server descriptors: the "bridge"
80 purpose. With the new router-descriptors file format that includes
81 annotations, it's easy to look through it and find the bridge-purpose
84 Currently we export the bridge descriptors from Tonga to the
85 BridgeDB server, so it can give them out according to the policies
88 2.2. Reachability/uptime testing
90 Right now the bridge authorities do active reachability testing of
91 bridges, so we know which ones to recommend for users.
93 But in the design document, we suggested that bridges should publish
94 anonymously (i.e. via Tor) to the bridge authority, so somebody watching
95 the bridge authority can't just enumerate all the bridges. But if we're
96 doing active measurement, the game is up. Perhaps we should back off on
97 this goal, or perhaps we should do our active measurement anonymously?
99 Answering this issue is scheduled for 0.2.1.x.
101 2.3. Future work: migrating to multiple bridge authorities
103 Having only one bridge authority is both a trust bottleneck (if you
104 break into one place you learn about every single bridge we've got)
105 and a robustness bottleneck (when it's down, bridge users become sad).
107 Right now if we put up a second bridge authority, all the bridges would
108 publish to it, and (assuming the code works) bridge users would query
109 a random bridge authority. This resolves the robustness bottleneck,
110 but makes the trust bottleneck even worse.
112 In 0.2.2.x and later we should think about better ways to have multiple
117 Bridge users are like ordinary Tor users except they use encrypted
118 directory connections by default, and they use bridge relays as both
119 entry guards (their first hop) and directory guards (the source of
120 all their directory information).
122 To become a bridge user, add the following line to your torrc:
125 and then add at least one "Bridge" line to your torrc based on the
128 3.1. Format of the bridge identifier.
130 The canonical format for a bridge identifier contains an IP address,
131 an ORPort, and an identity fingerprint:
132 bridge 128.31.0.34:9009 4C17 FB53 2E20 B2A8 AC19 9441 ECD2 B017 7B39 E4B1
134 However, the identity fingerprint can be left out, in which case the
135 bridge user will connect to that relay and use it as a bridge regardless
136 of what identity key it presents:
137 bridge 128.31.0.34:9009
138 This might be useful for cases where only short bridge identifiers
139 can be communicated to bridge users.
141 In a future version we may also support bridge identifiers that are
142 only a key fingerprint:
143 bridge 4C17 FB53 2E20 B2A8 AC19 9441 ECD2 B017 7B39 E4B1
144 and the bridge user can fetch the latest descriptor from the bridge
145 authority (see Section 3.4).
147 3.2. Bridges as entry guards
149 For now, bridge users add their bridge relays to their list of "entry
150 guards" (see path-spec.txt for background on entry guards). They are
151 managed by the entry guard algorithms exactly as if they were a normal
152 entry guard -- their keys and timing get cached in the "state" file,
153 etc. This means that when the Tor user starts up with "UseBridges"
154 disabled, he will skip past the bridge entries since they won't be
155 listed as up and usable in his networkstatus consensus. But to be clear,
156 the "entry_guards" list doesn't currently distinguish guards by purpose.
158 Internally, each bridge user keeps a smartlist of "bridge_info_t"
159 that reflects the "bridge" lines from his torrc along with a download
160 schedule (see Section 3.5 below). When he starts Tor, he attempts
161 to fetch a descriptor for each configured bridge (see Section 3.4
162 below). When he succeeds at getting a descriptor for one of the bridges
163 in his list, he adds it directly to the entry guard list using the
164 normal add_an_entry_guard() interface. Once a bridge descriptor has
165 been added, should_delay_dir_fetches() will stop delaying further
166 directory fetches, and the user begins to bootstrap his directory
167 information from that bridge (see Section 3.3).
169 Currently bridge users cache their bridge descriptors to the
170 "cached-descriptors" file (annotated with purpose "bridge"), but
171 they don't make any attempt to reuse descriptors they find in this
172 file. The theory is that either the bridge is available now, in which
173 case you can get a fresh descriptor, or it's not, in which case an
174 old descriptor won't do you much good.
176 We could disable writing out the bridge lines to the state file, if
177 we think this is a problem.
179 As an exception, if we get an application request when we have one
180 or more bridge descriptors but we believe none of them are running,
181 we mark them all as running again. This is similar to the exception
182 already in place to help long-idle Tor clients realize they should
183 fetch fresh directory information rather than just refuse requests.
185 3.3. Bridges as directory guards
187 In addition to using bridges as the first hop in their circuits, bridge
188 users also use them to fetch directory updates. Other than initial
189 bootstrapping to find a working bridge descriptor (see Section 3.4
190 below), all further non-anonymized directory fetches will be redirected
193 This means that bridge relays need to have cached answers for all
194 questions the bridge user might ask. This makes the upgrade path
195 tricky --- for example, if we migrate to a v4 directory design, the
196 bridge user would need to keep using v3 so long as his bridge relays
197 only knew how to answer v3 queries.
199 In a future design, for cases where the user has enough information
200 to build circuits yet the chosen bridge doesn't know how to answer a
201 given query, we might teach bridge users to make an anonymized request
202 to a more suitable directory server.
204 3.4. How bridge users get their bridge descriptor
206 Bridge users can fetch bridge descriptors in two ways: by going directly
207 to the bridge and asking for "/tor/server/authority", or by going to
208 the bridge authority and asking for "/tor/server/fp/ID". By default,
209 they will only try the direct queries. If the user sets
210 UpdateBridgesFromAuthority 1
211 in his config file, then he will try querying the bridge authority
212 first for bridges where he knows a digest (if he only knows an IP
213 address and ORPort, then his only option is a direct query).
215 If the user has at least one working bridge, then he will do further
216 queries to the bridge authority through a full three-hop Tor circuit.
217 But when bootstrapping, he will make a direct begin_dir-style connection
218 to the bridge authority.
220 As of Tor 0.2.0.10-alpha, if the user attempts to fetch a descriptor
221 from the bridge authority and it returns a 404 not found, the user
222 will automatically fall back to trying a direct query. Therefore it is
223 recommended that bridge users always set UpdateBridgesFromAuthority,
224 since at worst it will delay their fetches a little bit and notify
225 the bridge authority of the identity fingerprint (but not location)
226 of their intended bridges.
228 3.5. Bridge descriptor retry schedule
230 Bridge users try to fetch a descriptor for each bridge (using the
231 steps in Section 3.4 above) on startup. Whenever they receive a
232 bridge descriptor, they reschedule a new descriptor download for 1
235 If on the other hand it fails, they try again after 15 minutes for the
236 first attempt, after 15 minutes for the second attempt, and after 60
237 minutes for subsequent attempts.
239 In 0.2.2.x we should come up with some smarter retry schedules.
241 3.6. Implementation note.
243 Vidalia 0.1.0 has a new checkbox in its Network config window called
244 "My ISP blocks connections to the Tor network." Users who click that
245 box change their configuration to:
247 UpdateBridgesFromAuthority 1
248 and should add at least one bridge identifier.