aboutsummaryrefslogtreecommitdiff
path: root/spec/dir-spec/extra-info-document-format.md
blob: 0defe70b731bc1a9e773583b7a96a6e86b413aa8 (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
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
<a id="dir-spec.txt-2.1.2"></a>

# Extra-info document format

Extra-info documents consist of the following items:

```text
    "extra-info" Nickname Fingerprint NL
        [At start, exactly once.]
```

Identifies what router this is an extra-info descriptor for.
Fingerprint is encoded in hex (using upper-case letters), with
no spaces.

```text
    "identity-ed25519"
        [As in router descriptors]

    "published" YYYY-MM-DD HH:MM:SS NL

       [Exactly once.]
```

The time, in UTC, when this document (and its corresponding router
descriptor if any) was generated.  It MUST match the published time
in the corresponding server descriptor.

```text
    "read-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM,NUM,NUM... NL
        [At most once.]
    "write-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM,NUM,NUM... NL
        [At most once.]
```

Declare how much bandwidth the OR has used recently. Usage is divided
into intervals of NSEC seconds.  The YYYY-MM-DD HH:MM:SS field
defines the end of the most recent interval.  The numbers are the
number of bytes used in the most recent intervals, ordered from
oldest to newest.

These fields include both IPv4 and IPv6 traffic.

```text
    "ipv6-read-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL
        [At most once]
    "ipv6-write-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL
        [At most once]
```

Declare how much bandwidth the OR has used recently, on IPv6
connections. See "read-history" and "write-history" for full details.

```text
    "geoip-db-digest" Digest NL
        [At most once.]
```

SHA1 digest of the IPv4 GeoIP database file that is used to
resolve IPv4 addresses to country codes.

```text
    "geoip6-db-digest" Digest NL
        [At most once.]
```

SHA1 digest of the IPv6 GeoIP database file that is used to
resolve IPv6 addresses to country codes.

("geoip-start-time" YYYY-MM-DD HH:MM:SS NL)
("geoip-client-origins" CC=NUM,CC=NUM,... NL)

Only generated by bridge routers (see blocking.pdf), and only
when they have been configured with a geoip database.
Non-bridges SHOULD NOT generate these fields.  Contains a list
of mappings from two-letter country codes (CC) to the number
of clients that have connected to that bridge from that
country (approximate, and rounded up to the nearest multiple of 8
in order to hamper traffic analysis).  A country is included
only if it has at least one address.  The time in
"geoip-start-time" is the time at which we began collecting geoip
statistics.

"geoip-start-time" and "geoip-client-origins" have been replaced by
"bridge-stats-end" and "bridge-ips" in 0.2.2.4-alpha. The
reason is that the measurement interval with "geoip-stats" as
determined by subtracting "geoip-start-time" from "published" could
have had a variable length, whereas the measurement interval in
0.2.2.4-alpha and later is set to be exactly 24 hours long. In
order to clearly distinguish the new measurement intervals from
the old ones, the new keywords have been introduced.

```text
    "bridge-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default).

A "bridge-stats-end" line, as well as any other "bridge-\*" line,
is only added when the relay has been running as a bridge for at
least 24 hours.

```text
    "bridge-ips" CC=NUM,CC=NUM,... NL
        [At most once.]
```

List of mappings from two-letter country codes to the number of
unique IP addresses that have connected from that country to the
bridge and which are no known relays, rounded up to the nearest
multiple of 8.

```text
    "bridge-ip-versions" FAM=NUM,FAM=NUM,... NL
        [At most once.]
```

List of unique IP addresses that have connected to the bridge
per protocol family.

```text
    "bridge-ip-transports" PT=NUM,PT=NUM,... NL
        [At most once.]
```

List of mappings from pluggable transport names to the number
of unique IP addresses that have connected using that
pluggable transport. Unobfuscated connections are counted
using the reserved pluggable transport name "`<OR>`" (without
quotes). If we received a connection from a transport proxy
but we couldn't figure out the name of the pluggable
transport, we use the reserved pluggable transport name
"`<??>`".

("`<OR>`" and "`<??>`" are reserved because normal pluggable
transport names MUST match the following regular expression:
"`[a-zA-Z_][a-zA-Z0-9_]*`" )

The pluggable transport name list is sorted into lexically
ascending order.

If no clients have connected to the bridge yet, we only write
"bridge-ip-transports" to the stats file.

```text
    "dirreq-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default).

A "dirreq-stats-end" line, as well as any other "dirreq-\*" line,
is only added when the relay has opened its Dir port and after 24
hours of measuring directory requests.

```text
    "dirreq-v2-ips" CC=NUM,CC=NUM,... NL
        [At most once.]
    "dirreq-v3-ips" CC=NUM,CC=NUM,... NL
        [At most once.]
```

List of mappings from two-letter country codes to the number of
unique IP addresses that have connected from that country to
request a v2/v3 network status, rounded up to the nearest multiple
of 8. Only those IP addresses are counted that the directory can
answer with a 200 OK status code.  (Note here and below: current Tor
versions, as of 0.2.5.2-alpha, no longer cache or serve v2
networkstatus documents.)

```text
    "dirreq-v2-reqs" CC=NUM,CC=NUM,... NL
        [At most once.]
    "dirreq-v3-reqs" CC=NUM,CC=NUM,... NL
        [At most once.]
```

List of mappings from two-letter country codes to the number of
requests for v2/v3 network statuses from that country, rounded up
to the nearest multiple of 8. Only those requests are counted that
the directory can answer with a 200 OK status code.

```text
    "dirreq-v2-share" NUM% NL
        [At most once.]
    "dirreq-v3-share" NUM% NL
        [At most once.]
```

The share of v2/v3 network status requests that the directory
expects to receive from clients based on its advertised bandwidth
compared to the overall network bandwidth capacity. Shares are
formatted in percent with two decimal places. Shares are
calculated as means over the whole 24-hour interval.

```text
    "dirreq-v2-resp" status=NUM,... NL
        [At most once.]
    "dirreq-v3-resp" status=NUM,... NL
        [At most once.]
```

List of mappings from response statuses to the number of requests
for v2/v3 network statuses that were answered with that response
status, rounded up to the nearest multiple of 4. Only response
statuses with at least 1 response are reported. New response
statuses can be added at any time. The current list of response
statuses is as follows:

```text
        "ok": a network status request is answered; this number
           corresponds to the sum of all requests as reported in
           "dirreq-v2-reqs" or "dirreq-v3-reqs", respectively, before
           rounding up.
        "not-enough-sigs: a version 3 network status is not signed by a
           sufficient number of requested authorities.
        "unavailable": a requested network status object is unavailable.
        "not-found": a requested network status is not found.
        "not-modified": a network status has not been modified since the
           If-Modified-Since time that is included in the request.
        "busy": the directory is busy.

    "dirreq-v2-direct-dl" key=NUM,... NL
        [At most once.]
    "dirreq-v3-direct-dl" key=NUM,... NL
        [At most once.]
    "dirreq-v2-tunneled-dl" key=NUM,... NL
        [At most once.]
    "dirreq-v3-tunneled-dl" key=NUM,... NL
        [At most once.]
```

List of statistics about possible failures in the download process
of v2/v3 network statuses. Requests are either "direct"
HTTP-encoded requests over the relay's directory port, or
"tunneled" requests using a BEGIN_DIR relay message over the relay's OR
port. The list of possible statistics can change, and statistics
can be left out from reporting. The current list of statistics is
as follows:

Successful downloads and failures:

```text
        "complete": a client has finished the download successfully.
        "timeout": a download did not finish within 10 minutes after
           starting to send the response.
        "running": a download is still running at the end of the
           measurement period for less than 10 minutes after starting to
           send the response.

        Download times:

        "min", "max": smallest and largest measured bandwidth in B/s.
        "d[1-4,6-9]": 1st to 4th and 6th to 9th decile of measured
           bandwidth in B/s. For a given decile i, i/10 of all downloads
           had a smaller bandwidth than di, and (10-i)/10 of all downloads
           had a larger bandwidth than di.
        "q[1,3]": 1st and 3rd quartile of measured bandwidth in B/s. One
           fourth of all downloads had a smaller bandwidth than q1, one
           fourth of all downloads had a larger bandwidth than q3, and the
           remaining half of all downloads had a bandwidth between q1 and
           q3.
        "md": median of measured bandwidth in B/s. Half of the downloads
           had a smaller bandwidth than md, the other half had a larger
           bandwidth than md.

    "dirreq-read-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL
        [At most once]
    "dirreq-write-history" YYYY-MM-DD HH:MM:SS (NSEC s) NUM,NUM,NUM... NL
        [At most once]
```

Declare how much bandwidth the OR has spent on answering directory
requests.  Usage is divided into intervals of NSEC seconds.  The
YYYY-MM-DD HH:MM:SS field defines the end of the most recent
interval.  The numbers are the number of bytes used in the most
recent intervals, ordered from oldest to newest.

```text
    "entry-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default).

An "entry-stats-end" line, as well as any other "entry-\*"
line, is first added after the relay has been running for at least
24 hours.

```text
    "entry-ips" CC=NUM,CC=NUM,... NL
        [At most once.]
```

List of mappings from two-letter country codes to the number of
unique IP addresses that have connected from that country to the
relay and which are no known other relays, rounded up to the
nearest multiple of 8.

```text
    "cell-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default).

A "cell-stats-end" line, as well as any other "cell-\*" line,
is first added after the relay has been running for at least 24
hours.

```text
    "cell-processed-cells" NUM,...,NUM NL
        [At most once.]
```

Mean number of processed cells per circuit, subdivided into
deciles of circuits by the number of cells they have processed in
descending order from loudest to quietest circuits.

```text
    "cell-queued-cells" NUM,...,NUM NL
        [At most once.]
```

Mean number of cells contained in queues by circuit decile. These
means are calculated by 1) determining the mean number of cells in
a single circuit between its creation and its termination and 2)
calculating the mean for all circuits in a given decile as
determined in "cell-processed-cells". Numbers have a precision of
two decimal places.

Note that this statistic can be inaccurate for circuits that had
queued cells at the start or end of the measurement interval.

```text
    "cell-time-in-queue" NUM,...,NUM NL
        [At most once.]
```

Mean time cells spend in circuit queues in milliseconds. Times are
calculated by 1) determining the mean time cells spend in the
queue of a single circuit and 2) calculating the mean for all
circuits in a given decile as determined in
"cell-processed-cells".

Note that this statistic can be inaccurate for circuits that had
queued cells at the start or end of the measurement interval.

```text
    "cell-circuits-per-decile" NUM NL
        [At most once.]
```

Mean number of circuits that are included in any of the deciles,
rounded up to the next integer.

```text
    "conn-bi-direct" YYYY-MM-DD HH:MM:SS (NSEC s) BELOW,READ,WRITE,BOTH NL
        [At most once]
```

Number of connections, split into 10-second intervals, that are
used uni-directionally or bi-directionally as observed in the NSEC
seconds (usually 86400 seconds) before YYYY-MM-DD HH:MM:SS.  Every
10 seconds, we determine for every connection whether we read and
wrote less than a threshold of 20 KiB (BELOW), read at least 10
times more than we wrote (READ), wrote at least 10 times more than
we read (WRITE), or read and wrote more than the threshold, but
not 10 times more in either direction (BOTH).  After classifying a
connection, read and write counters are reset for the next
10-second interval.

This measurement includes both IPv4 and IPv6 connections.

```text
    "ipv6-conn-bi-direct" YYYY-MM-DD HH:MM:SS (NSEC s) BELOW,READ,WRITE,BOTH NL
        [At most once]
```

Number of IPv6 connections that are used uni-directionally or
bi-directionally. See "conn-bi-direct" for more details.

```text
    "exit-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default).

An "exit-stats-end" line, as well as any other "exit-\*" line, is
first added after the relay has been running for at least 24 hours
and only if the relay permits exiting (where exiting to a single
port and IP address is sufficient).

```text
    "exit-kibibytes-written" port=N,port=N,... NL
        [At most once.]
    "exit-kibibytes-read" port=N,port=N,... NL
        [At most once.]
```

List of mappings from ports to the number of kibibytes that the
relay has written to or read from exit connections to that port,
rounded up to the next full kibibyte.  Relays may limit the
number of listed ports and subsume any remaining kibibytes under
port "other".

```text
    "exit-streams-opened" port=N,port=N,... NL
        [At most once.]
```

List of mappings from ports to the number of opened exit streams
to that port, rounded up to the nearest multiple of 4.  Relays may
limit the number of listed ports and subsume any remaining opened
streams under port "other".

```text
    "hidserv-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
    "hidserv-v3-stats-end" YYYY-MM-DD HH:MM:SS (NSEC s) NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default).

A "hidserv-stats-end" line, as well as any other "hidserv-\*" line,
is first added after the relay has been running for at least 24
hours.

(Introduced in tor-0.4.6.1-alpha)

```text
    "hidserv-rend-relayed-cells" SP NUM SP key=val SP key=val ... NL
        [At most once.]
    "hidserv-rend-v3-relayed-cells" SP NUM SP key=val SP key=val ... NL
        [At most once.]
```

Approximate number of relay cells seen in either direction on a
circuit after receiving and successfully processing a RENDEZVOUS1
cell.

The original measurement value is obfuscated in several steps:
first, it is rounded up to the nearest multiple of 'bin_size'
which is reported in the key=val part of this line; second, a
(possibly negative) noise value is added to the result of the
first step by randomly sampling from a Laplace distribution with
mu = 0 and b = (delta_f / epsilon) with 'delta_f' and 'epsilon'
being reported in the key=val part, too; third, the result of the
previous obfuscation steps is truncated to the next smaller
integer and included as 'NUM'. Note that the overall reported
value can be negative.

(Introduced in tor-0.4.6.1-alpha)

```text
    "hidserv-dir-onions-seen" SP NUM SP key=val SP key=val ... NL
        [At most once.]
    "hidserv-dir-v3-onions-seen" SP NUM SP key=val SP key=val ... NL
        [At most once.]
```

Approximate number of unique hidden-service identities seen in
descriptors published to and accepted by this hidden-service
directory.

The original measurement value is obfuscated in the same way as
the 'NUM' value reported in "hidserv-rend-relayed-cells", but
possibly with different parameters as reported in the key=val part
of this line. Note that the overall reported value can be
negative.

(Introduced in tor-0.4.6.1-alpha)

```text
    "transport" transportname address:port [arglist] NL
        [Any number.]
```

Signals that the router supports the 'transportname' pluggable
transport in IP address 'address' and TCP port 'port'. A single
descriptor MUST not have more than one transport line with the
same 'transportname'.

Pluggable transports are only relevant to bridges, but these entries
can appear in non-bridge relays as well.

```text
    "padding-counts" YYYY-MM-DD HH:MM:SS (NSEC s) key=NUM key=NUM ... NL
        [At most once.]
```

YYYY-MM-DD HH:MM:SS defines the end of the included measurement
interval of length NSEC seconds (86400 seconds by default). Counts
are reset to 0 at the end of this interval.

The keyword list is currently as follows:

```text
         bin-size
           - The current rounding value for cell count fields (10000 by
             default)
         write-drop
           - The number of RELAY_DROP messages this relay sent
         write-pad
           - The number of PADDING cells this relay sent
         write-total
           - The total number of cells this relay cent
         read-drop
           - The number of RELAY_DROP messages this relay received
         read-pad
           - The number of PADDING cells this relay received
         read-total
           - The total number of cells this relay received
         enabled-read-pad
           - The number of PADDING cells this relay received on
             connections that support padding
         enabled-read-total
           - The total number of cells this relay received on connections
             that support padding
         enabled-write-pad
           - The total number of cells this relay received on connections
             that support padding
         enabled-write-total
           - The total number of cells sent by this relay on connections
             that support padding
         max-chanpad-timers
           - The maximum number of timers that this relay scheduled for
             padding in the previous NSEC interval

    "overload-ratelimits" SP version SP YYYY-MM-DD SP HH:MM:SS
                      SP rate-limit SP burst-limit
                      SP read-overload-count SP write-overload-count NL
        [At most once.]

        Indicates that a bandwidth limit was exhausted for this relay.
```

The "rate-limit" and "burst-limit" are the raw values from the
BandwidthRate and BandwidthBurst found in the torrc configuration file.

The "{read|write}-overload-count" are the counts of how many times the
reported limits of burst/rate were exhausted and thus the maximum
between the read and write count occurrences. To make the counter more
meaningful and to avoid multiple connections saturating the counter
when a relay is overloaded, we only increment it once a minute.

The 'version' field is set to '1' for now.

(Introduced in tor-0.4.6.1-alpha)

```text
    "overload-fd-exhausted" SP version YYYY-MM-DD HH:MM:SS NL
        [At most once.]
```

Indicates that a file descriptor exhaustion was experienced by this
relay.

The timestamp indicates that the maximum was reached between the
timestamp and the "published" timestamp of the document.

This overload field should remain in place for 72 hours since last
triggered.  If the limits are reached again in this period, the
timestamp is updated, and this 72 hour period restarts.

The 'version' field is set to '1' for the initial implementation which
detects fd exhaustion only when a socket open fails.

(Introduced in tor-0.4.6.1-alpha)

```text
    "router-sig-ed25519"
        [As in router descriptors]

    "router-signature" NL Signature NL
        [At end, exactly once.]
        [No extra arguments]
```

A document signature as documented in section 1.3, using the
initial item "extra-info" and the final item "router-signature",
signed with the router's identity key.