aboutsummaryrefslogtreecommitdiff
path: root/path-spec.txt
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2021-08-27 11:11:08 -0400
committerNick Mathewson <nickm@torproject.org>2021-08-27 11:11:08 -0400
commita282bfc4996b39658b207e9ce1da322de26185cf (patch)
treed45f53ef329b365e84bb7286a91097f7a4ae53ee /path-spec.txt
parentde373736ee74a300f68e1355e0cbeed812ca5d80 (diff)
downloadtorspec-a282bfc4996b39658b207e9ce1da322de26185cf.tar.gz
torspec-a282bfc4996b39658b207e9ce1da322de26185cf.zip
path-spec: describe the behavior of circuit_expire_building()
This is my attempt to extract a general concise rule here. (I am not sure that Tor adjusts both timeout_ms and close_ms, but Arti does indeed adjust both.)
Diffstat (limited to 'path-spec.txt')
-rw-r--r--path-spec.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/path-spec.txt b/path-spec.txt
index 0243260..34e3bec 100644
--- a/path-spec.txt
+++ b/path-spec.txt
@@ -481,7 +481,8 @@ of their choices.
F(q) = Xm/((1.0-q)^(1.0/alpha))
- Thus, clients obtain their circuit build timeout by computing:
+ Thus, clients obtain the circuit build timeout for 3-hop circuits by
+ computing:
timeout_ms = F(0.8) # 'cbtquantile' == 0.8
@@ -500,6 +501,27 @@ of their choices.
timeout_ms = MIN(timeout_ms, max_observed_timeout)
close_ms = MAX(MIN(close_ms, 2*max_observed_timeout), 'cbtinitialtimeout')
+2.4.3. Calculating timeouts thresholds for circuits of different lengths
+
+ The timeout_ms and close_ms estimates above are good only for 3-hop
+ circuits, since only 3-hop circuits are recorded in the list of build
+ times.
+
+ To calculate the appropriate timeouts and close timeouts for circuits of
+ other lengths, the client multiples the timeout_ms and close_ms values
+ by a scaling factor determined by the number of communication hops
+ needed to build their circuits:
+
+ timeout_ms[hops=n] = timeout_ms * Actions(N) / Actions(3)
+
+ close_ms[hops=n] = close_ms * Actions(N) / Actions(3)
+
+ where Actions(N) = N * (N + 1) / 2.
+
+ To calculate timeouts for operations other than circuit building,
+ the client should add X to Actions(N) for every round-trip communication
+ required with the Xth hop.
+
2.4.4. How to record timeouts
Pareto estimators begin to lose their accuracy if the tail is omitted.