[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torspec/main] path-spec: describe the behavior of circuit_expire_building()



commit a282bfc4996b39658b207e9ce1da322de26185cf
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Aug 27 11:11:08 2021 -0400

    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.)
---
 path-spec.txt | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

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.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits