aboutsummaryrefslogtreecommitdiff
path: root/spec/tor-spec/subprotocol-versioning.md
blob: 5f43c717fc95fa590643a15a627415323c23c466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<a id="tor-spec.txt-9"></a>

# Subprotocol versioning

This section specifies the Tor subprotocol versioning. They are broken down
into different types with their current version numbers. Any new version
number should be added to this section.

The dir-spec.txt details how those versions are encoded. See the
"proto"/"pr" line in a descriptor and the "recommended-relay-protocols",
"required-relay-protocols", "recommended-client-protocols" and
"required-client-protocols" lines in the vote/consensus format.

Here are the rules a relay and client should follow when encountering a
protocol list in the consensus:

 - When a relay lacks a protocol listed in recommended-relay-protocols,
   it should warn its operator that the relay is obsolete.

 - When a relay lacks a protocol listed in required-relay-protocols, it
   should warn its operator as above. If the consensus is newer than the
   date when the software was released or scheduled for release, it must
   not attempt to join the network.

 - When a client lacks a protocol listed in recommended-client-protocols,
   it should warn the user that the client is obsolete.

 - When a client lacks a protocol listed in required-client-protocols,
   it should warn the user as above.  If the consensus is newer than the
   date when the software was released, it must not connect to the
   network.  This implements a "safe forward shutdown" mechanism for
   zombie clients.

 - If a client or relay has a cached consensus telling it that a given
   protocol is required, and it does not implement that protocol, it
   SHOULD NOT try to fetch a newer consensus.

Software release dates SHOULD be automatically updated as part of the
release process, to prevent forgetting to move them forward.  Software
release dates MAY be manually adjusted by maintainers if necessary.

Starting in version 0.2.9.4-alpha, the initial required protocols for
clients that we will Recommend and Require are:

```text
Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 Link=4
LinkAuth=1 Microdesc=1-2 Relay=2
```

For relays we will Require:

```text
Cons=1 Desc=1 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 Link=3-4
LinkAuth=1 Microdesc=1 Relay=1-2
```

For relays, we will additionally Recommend all protocols which we
recommend for clients.

<a id="tor-spec.txt-9.1"></a>

## "Link"

The "link" protocols are those used by clients and relays to initiate and
receive OR connections and to handle cells on OR connections. The "link"
protocol versions correspond 1:1 to those versions.

Two Tor instances can make a connection to each other only if they have at
least one link protocol in common.

The current "link" versions are: "1" through "5". See
[Negotiating versions with VERSIONS cells](./negotiating-channels.md#VERSIONS-cells) for more
information. All current Tor versions support "1-3"; versions from
0.2.4.11-alpha and on support "1-4"; versions from 0.3.1.1-alpha and on
support "1-5". Eventually we will drop "1" and "2".

<a id="tor-spec.txt-9.2"></a>

## "LinkAuth" {#link-auth}

LinkAuth protocols correspond to varieties of AUTHENTICATE cells used for
the v3+ link protocols.

Current versions are:

 * "1" is the RSA link authentication described in [Link authentication type 1: RSA-SHA256-TLSSecret](./obsolete-channels.md#RSA-SHA256-TLSSecret).

 * "2" is unused, and reserved by [proposal 244].

 * "3" is the ed25519 link authentication described in [Link authentication type 3: Ed25519-SHA256-RFC5705](./negotiating-channels.md#Ed25519-SHA256-RFC5705).

<a id="tor-spec.txt-9.3"></a>

## "Relay"

The "relay" protocols are those used to handle CREATE/CREATE2
cells, and those that handle the various relay messages received
after a CREATE/CREATE2 cell.  (Except, relay cells used to manage
introduction and rendezvous points are managed with the "HSIntro"
and "HSRend" protocols respectively.)

Current versions are as follows.

 * "1" -- supports the TAP key exchange, with all features in Tor 0.2.3.
   Support for CREATE and CREATED and CREATE_FAST and CREATED_FAST
   and EXTEND and EXTENDED.

 * "2" -- supports the ntor key exchange, and all features in Tor
   0.2.4.19.  Includes support for CREATE2 and CREATED2 and
   EXTEND2 and EXTENDED2.

   Relay=2 has limited IPv6 support:

    * Clients might not include IPv6 ORPorts in EXTEND2 messages.
    * Relays (and bridges) might not initiate IPv6 connections in
      response to EXTEND2 messages containing IPv6 ORPorts, even if they
      are configured with an IPv6 ORPort.

   However, relays support accepting inbound connections to their IPv6
   ORPorts. And they might extend circuits via authenticated IPv6
   connections to other relays.

 * "3" -- relays support extending over IPv6 connections in response to an
   EXTEND2 message containing an IPv6 ORPort.

   Bridges might not extend over IPv6, because they try to imitate
   client behaviour.

   A successful IPv6 extend requires:
     * Relay subprotocol version 3 (or later) on the extending relay,
     * an IPv6 ORPort on the extending relay,
     * an IPv6 ORPort for the accepting relay in the EXTEND2 message, and
     * an IPv6 ORPort on the accepting relay.
   (Because different tor instances can have different views of the
   network, these checks should be done when the path is selected.
   Extending relays should only check local IPv6 information, before
   attempting the extend.)

   When relays receive an EXTEND2 message containing both an IPv4 and an
   IPv6 ORPort, and there is no existing authenticated connection with
   the target relay, the extending relay may choose between IPv4 and
   IPv6 at random. The extending relay might not try the other address,
   if the first connection fails.

   As is the case with other subprotocol versions, tor advertises,
   recommends, or requires support for this protocol version, regardless
   of its current configuration.

   In particular:
     * relays without an IPv6 ORPort, and
     * tor instances that are not relays,
   have the following behaviour, regardless of their configuration:
     * advertise support for "Relay=3" in their descriptor
       (if they are a relay, bridge, or directory authority), and
     * react to consensuses recommending or requiring support for
       "Relay=3".

   This subprotocol version is described in
   [proposal 311], and implemented in Tor 0.4.5.1-alpha.

 * "4" -- support the ntorv3 (version 3) key exchange and all features in
   0.4.7.3-alpha. This adds a new CREATE2 cell type. See [proposal 332]
   and [The "ntor-v3" handshake](./create-created-cells.md#ntor-v3) for more details.

 * "5" -- \[RESERVED\] support the ntorv3 subprotocol request extension
   ([proposal 346])
   allowing a client to request what features to be used on a circuit.

<a id="tor-spec.txt-9.4"></a>

## "HSIntro" {#HSIntro}

The "HSIntro" protocol handles introduction points.

 * "3" -- supports authentication as of [proposal 121] in Tor 0.2.1.6-alpha.

 * "4" -- support ed25519 authentication keys which is defined by the HS v3
   protocol as part of [proposal 224] in Tor 0.3.0.4-alpha.

 * "5" -- support ESTABLISH_INTRO message DoS parameters extension for onion
   service version 3 only in Tor 0.4.2.1-alpha.

<a id="tor-spec.txt-9.5"></a>

## "HSRend"

The "HSRend" protocol handles rendezvous points.

 * "1" -- supports all features in Tor 0.0.6.

 * "2" -- supports RENDEZVOUS2 messages of arbitrary length as long as they
   have 20 bytes of cookie in Tor 0.2.9.1-alpha.

<a id="tor-spec.txt-9.6"></a>

## "HSDir"

The "HSDir" protocols are the set of hidden service document types that can
be uploaded to, understood by, and downloaded from a tor relay, and the set
of URLs available to fetch them.

 * "1" -- supports all features in Tor 0.2.0.10-alpha.

 * "2" -- support ed25519 blinded keys request which is defined by the HS v3
   protocol as part of [proposal 224] in Tor 0.3.0.4-alpha.

<a id="tor-spec.txt-9.7"></a>

## "DirCache"

The "DirCache" protocols are the set of documents available for download
from a directory cache via BEGIN_DIR, and the set of URLs available to
fetch them.  (This excludes URLs for hidden service objects.)

 * "1" -- supports all features in Tor 0.2.4.19.

 * "2" -- adds support for consensus diffs in Tor 0.3.1.1-alpha.

<a id="tor-spec.txt-9.8"></a>

## "Desc"

Describes features present or absent in descriptors.

Most features in descriptors don't require a "Desc" update -- only those
that need to someday be required.  For example, someday clients will need
to understand ed25519 identities.

 * "1" -- supports all features in Tor 0.2.4.19.

 * "2" -- cross-signing with onion-keys, signing with ed25519
identities.

<a id="tor-spec.txt-9.9"></a>

## "Microdesc"

Describes features present or absent in microdescriptors.

Most features in descriptors don't require a "MicroDesc" update -- only
those that need to someday be required.  These correspond more or less with
consensus methods.

 * "1" -- consensus methods 9 through 20.

 * "2" -- consensus method 21 (adds ed25519 keys to microdescs).

<a id="tor-spec.txt-9.10"></a>

## "Cons"

Describes features present or absent in consensus documents.

Most features in consensus documents don't require a "Cons" update -- only
those that need to someday be required.

These correspond more or less with consensus methods.

 * "1" -- consensus methods 9 through 20.

 * "2" -- consensus method 21 (adds ed25519 keys to microdescs).

<a id="tor-spec.txt-9.11"></a>

## "Padding"

Describes the padding capabilities of the relay.

 * "1" -- \[DEFUNCT\] Relay supports circuit-level padding. This version MUST NOT
   be used as it was also enabled in relays that don't actually support
   circuit-level padding. Advertised by Tor versions from
   tor-0.4.0.1-alpha and only up to and including tor-0.4.1.4-rc.

 * "2" -- Relay supports the HS circuit setup padding machines ([proposal 302]).
   Advertised by Tor versions from tor-0.4.1.5 and onwards.

<a id="tor-spec.txt-9.12"></a>

## "FlowCtrl"

Describes the flow control protocol at the circuit and stream level. If
there is no FlowCtrl advertised, tor supports the unauthenticated flow
control features (version 0).

 * "1" -- supports authenticated circuit level SENDMEs as of [proposal 289] in
   Tor 0.4.1.1-alpha.

 * "2" -- supports congestion control by the Exits which implies a new SENDME
   format and algorithm. See [proposal 324] for more details. Advertised
   in tor 0.4.7.3-alpha.

## "Conflux"

Describes the communications mechanisms used to bundle circuits together,
in order to split traffic across multiple paths.

> TODO: This is not yet described here. For details see
> [proposal 329].

<a id="tor-spec.txt-9.13"></a>

## "Datagram"

Describes the UDP protocol capabilities of a relay.

 * "1" -- \[RESERVED\] supports UDP by an Exit as in the relay command
   CONNECT_UDP, CONNECTED_UDP and DATAGRAM. See [proposal 339] for more details.
   (Not yet advertised, reserved)

[proposal 121]: ../proposals/121-hidden-service-authentication.txt
[proposal 224]: ../proposals/224-rend-spec-ng.txt
[proposal 244]: ../proposals/244-use-rfc5705-for-tls-binding.txt
[proposal 289]: ../proposals/289-authenticated-sendmes.txt
[proposal 302]: ../proposals/302-padding-machines-for-onion-clients.txt
[proposal 311]: ../proposals/311-relay-ipv6-reachability.txt
[proposal 324]: ../proposals/324-rtt-congestion-control.txt
[proposal 329]: ../proposals/329-traffic-splitting.txt
[proposal 332]: ../proposals/332-ntor-v3-with-extra-data.md
[proposal 339]: ../proposals/339-udp-over-tor.md
[proposal 346]: ../proposals/346-protovers-again.md