This is an automated email from the git hooks/post-receive script.
dgoulet pushed a change to branch main in repository torspec.
from 578145b New proposal 342: Decoupling hs_interval and SRV lifetime new 31c3254 tor-spec: fix ambitious formulation in VERSIONS new ad7091d Merge branch 'tor-gitlab/mr/99' new 4d950a2 Prop#324: Do not increase cwnd if the window is not full. new 529cb00 Merge branch 'tor-gitlab/mr/98' new 28d1f63 Document the extra NL that sometimes comes with a descriptor new 93e2f2f Merge branch 'tor-gitlab/mr/94' new bf877ec dir-spec: Expect authority.z to always be available new d3904cb Merge branch 'tor-gitlab/mr/93' new a2c7812 tor-spec: Fix line exceeding 80 characters new e9598b1 Merge branch 'tor-gitlab/mr/92'
The 10 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference.
Summary of changes: dir-spec.txt | 17 ++- proposals/324-rtt-congestion-control.txt | 184 +++++++++++++++++++++++-------- tor-spec.txt | 6 +- 3 files changed, 155 insertions(+), 52 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit a2c7812e60bd4a898bd415a73ebb883429f8266b Author: Emil Engler me@emilengler.com AuthorDate: Mon Oct 24 11:36:21 2022 +0200
tor-spec: Fix line exceeding 80 characters
This commit inserts a line break in order to fix the only line exceeding 80 characters in this document. --- tor-spec.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tor-spec.txt b/tor-spec.txt index 3f03890..d6491c6 100644 --- a/tor-spec.txt +++ b/tor-spec.txt @@ -1635,8 +1635,8 @@ see tor-design.pdf. inbound RELAY_EARLY cells, it MUST close the circuit immediately.
When speaking v2 of the link protocol or later, clients MUST only send - EXTEND/EXTEND2 cells inside RELAY_EARLY cells. Clients SHOULD send the first ~8 - RELAY cells that are not targeted at the first hop of any circuit as + EXTEND/EXTEND2 cells inside RELAY_EARLY cells. Clients SHOULD send the first + ~8 RELAY cells that are not targeted at the first hop of any circuit as RELAY_EARLY cells too, in order to partially conceal the circuit length.
[Starting with Tor 0.2.3.11-alpha, relays should reject any
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit bf877ec9984bba9d6bcc2c5bb1c05c982b0f6ddd Author: Ian Jackson ijackson@chiark.greenend.org.uk AuthorDate: Mon Oct 31 14:23:18 2022 +0000
dir-spec: Expect authority.z to always be available
And discuss the places where it is used. --- dir-spec.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/dir-spec.txt b/dir-spec.txt index d2f6c4e..7d779b6 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -4067,8 +4067,7 @@ B. General-use HTTP URLs
http://<hostname>/tor/keys/all.z
- The key certificate for this server (if it is an authority) should be - available at: + The key certificate for this server should be available at:
http://<hostname>/tor/keys/authority.z
@@ -4125,10 +4124,10 @@ B. General-use HTTP URLs
http://<hostname>/tor/server/authority.z
- [Nothing in the Tor protocol uses this resource yet, but it is useful - for debugging purposes. Also, the official Tor implementations - (starting at 0.1.1.x) use this resource to test whether a server's - own DirPort is reachable.] + This is used for authorities, and also if a server is configured + as a bridge. The official Tor implementations (starting at + 0.1.1.x) use this resource to test whether a server's own DirPort + is reachable. It is also useful for debugging purposes.
A concatenated set of the most recent descriptors for all known servers should be available at:
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 28d1f6379e99f6e19efb3a7871177ad910094212 Author: Nick Mathewson nickm@torproject.org AuthorDate: Tue Nov 15 17:16:56 2022 -0500
Document the extra NL that sometimes comes with a descriptor
This NL isn't so easy to remove in Tor, since some older control-port code depends on it IIRC. But not having documented it caused arti#637: let's explain that, so that the next unfortunate implementor doesn't hit it. --- dir-spec.txt | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dir-spec.txt b/dir-spec.txt index d2f6c4e..d574e3f 100644 --- a/dir-spec.txt +++ b/dir-spec.txt @@ -487,6 +487,12 @@ Table of Contents accepted and ignored. Many of the nonterminals below are defined in section 2.1.3.
+ Note that many versions of Tor will generate an extra newline at the + end of their descriptors. Implementations MUST tolerate one or + more blank lines at the end of a single descriptor or a list of + concatenated descriptors. New implementations SHOULD NOT generate + such blank lines. + "router" nickname address ORPort SOCKSPort DirPort NL
[At start, exactly once.]
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 4d950a261fdfbe18a16ead421d67e3959236be6b Author: Mike Perry mikeperry-git@torproject.org AuthorDate: Fri Dec 16 22:22:27 2022 +0000
Prop#324: Do not increase cwnd if the window is not full.
- Allow a gap between inflight and cwnd before declaring the cwnd not full. - Parameterize how often a cwnd must be full - Clean up vegas algorithm for variable scoping and clarity --- proposals/324-rtt-congestion-control.txt | 184 +++++++++++++++++++++++-------- 1 file changed, 141 insertions(+), 43 deletions(-)
diff --git a/proposals/324-rtt-congestion-control.txt b/proposals/324-rtt-congestion-control.txt index d529d5c..4937744 100644 --- a/proposals/324-rtt-congestion-control.txt +++ b/proposals/324-rtt-congestion-control.txt @@ -538,7 +538,10 @@ original cwnd estimator. So while this capability to change the BDP estimator remains in the C implementation, we do not expect it to be used.
However, it was useful to use a local OR connection block at the time of -SENDME ack arrival, as an immediate congestion signal. +SENDME ack arrival, as an immediate congestion signal. Note that in C-Tor, +this orconn_block state is not derived from any socket info, but instead is a +heuristic that declares an orconn as blocked if any circuit cell queue +exceeds the 'cellq_high' consensus parameter.
(As an additional optimization, we could also use the ECN signal described in ideas/xxx-backward-ecn.txt, but this is not implemented. It is likely only of @@ -554,70 +557,132 @@ per the rules in RFC3742: # Below the cap, we increment as per cc_cwnd_inc_pct_ss percent: return round(cc_cwnd_inc_pct_ss*cc_sendme_inc/100) else: - # This returns an increment equivalent to RFC3742, rounded: - # K = int(cwnd/(0.5 max_ssthresh)); - # inc = int(MSS/K); - return round((cc_sendme_inc*cc_ss_cap_pathtype)/(2*cwnd)); + # This returns an increment equivalent to RFC3742, rounded, + # with a minimum of inc=1. + # From RFC3742: + # K = int(cwnd/(0.5 max_ssthresh)); + # inc = int(MSS/K); + return MAX(round((cc_sendme_inc*cc_ss_cap_pathtype)/(2*cwnd)), 1); + +During both Slow Start, and Steady State, if the congestion window is not full, +we never increase the congestion window. We can still decrease it, or exit slow +start, in this case. This is done to avoid causing overshoot. The original TCP +Vegas addressed this problem by computing BDP and queue_use from inflight, +instead of cwnd, but we found that approach to have signficantly worse +performance. + +Because C-Tor is single-threaded, multiple SENDME acks may arrive during one +processing loop, before edge connections resume reading. For this reason, +we provide two heuristics to provide some slack in determining the full +condition. The first is to allow a gap between inflight and cwnd, +parameterized as 'cc_cwnd_full_gap' multiples of 'cc_sendme_inc': + cwnd_is_full(cwnd, inflight): + if inflight + 'cc_cwnd_full_gap'*'cc_sendme_inc' >= cwnd: + return true + else + return false + +The second heuristic immediately resets the full state if it falls below +'cc_cwnd_full_minpct' full: + cwnd_is_nonfull(cwnd, inflight): + if 100*inflight < 'cc_cwnd_full_minpct'*cwnd: + return true + else + return false + +This full status is cached once per cwnd if 'cc_cwnd_full_per_cwnd=1'; +otherwise it is cached once per cwnd update. These two helper functions +determine the number of acks in each case: + SENDME_PER_CWND(cwnd): + return ((cwnd + 'cc_sendme_inc'/2)/'cc_sendme_inc') + CWND_UPDATE_RATE(cwnd, in_slow_start): + # In Slow Start, update every SENDME + if in_slow_start: + return 1 + else: # Otherwise, update as per the 'cc_inc_rate' (31) + return ((cwnd + 'cc_cwnd_inc_rate'*'cc_sendme_inc'/2) + / ('cc_cwnd_inc_rate'*'cc_sendme_inc'));
-After Slow Start, congestion signals from RTT, blocked OR connections, or ECN -are processed only once per congestion window. This is achieved through the -next_cc_event flag, which is initialized to a cwnd worth of SENDME acks, and -is decremented each ack. Congestion signals are only evaluated when it reaches -0. +Shadow experimentation indicates that 'cc_cwnd_full_gap=2' and +'cc_cwnd_full_per_cwnd=0' minimizes queue overshoot, where as +'cc_cwnd_full_per_cwnd=1' and 'cc_cwnd_full_gap=1' is slightly better +for performance. Since there may be a difference between Shadow and live, +we leave this parmeterization in place.
Here is the complete pseudocode for TOR_VEGAS with RFC3742, which is run every -time an endpoint receives a SENDME ack: - - # Update acked cells - inflight -= cc_sendme_inc +time an endpoint receives a SENDME ack. All variables are scoped to the +circuit, unless prefixed by an underscore (local), or in single quotes +(consensus parameters):
+ # Decrement counters that signal either an update or cwnd event if next_cc_event: next_cc_event-- + if next_cwnd_event: + next_cwnd_event--
# Do not update anything if we detected a clock stall or jump, # as per [CLOCK_HEURISTICS] if clock_stalled_or_jumped: + inflight -= 'cc_sendme_inc' return
if BDP > cwnd: - queue_use = 0 + _queue_use = 0 else: - queue_use = cwnd - BDP + _queue_use = cwnd - BDP + + if cwnd_is_full(cwnd, inflight): + cwnd_full = 1 + else if cwnd_is_nonfull(cwnd, inflight): + cwnd_full = 0
if in_slow_start: - if queue_use < cc_vegas_gamma and not orconn_blocked: - inc = rfc3742_ss_inc(cwnd); - cwnd += inc - next_cc_event = 1 - - # If the RFC3742 increment drops below steady-state increment - # over a full cwnd worth of acks, exit slow start - if inc*SENDME_PER_CWND(cwnd) <= cc_cwnd_inc: - in_slow_start = 0 - next_cc_event = round(cwnd / (cc_cwnd_inc_rate * cc_sendme_inc)) - else: + if _queue_use < 'cc_vegas_gamma' and not orconn_blocked: + # Only increase cwnd if the cwnd is full + if cwnd_full: + _inc = rfc3742_ss_inc(cwnd); + cwnd += _inc + + # If the RFC3742 increment drops below steady-state increment + # over a full cwnd worth of acks, exit slow start. + if _inc*SENDME_PER_CWND(cwnd) <= 'cc_cwnd_inc'*'cc_cwnd_inc_rate': + in_slow_start = 0 + else: # Limit hit. Exit Slow start (even if cwnd not full) in_slow_start = 0 - cwnd = BDP + cc_vegas_gamma - next_cc_event = round(cwnd / (cc_cwnd_inc_rate * cc_sendme_inc)) + cwnd = BDP + 'cc_vegas_gamma'
# Provide an emergency hard-max on slow start: - if cwnd >= cc_ss_max: - cwnd = cc_ss_max + if cwnd >= 'cc_ss_max': + cwnd = 'cc_ss_max' in_slow_start = 0 - next_cc_event = round(cwnd / (cc_cwnd_inc_rate * cc_sendme_inc)) else if next_cc_event == 0: - if queue_use > cc_vegas_delta: - cwnd = BDP + cc_vegas_delta - cc_cwnd_inc - elif queue_use > cc_vegas_beta or orconn_blocked: - cwnd -= cc_cwnd_inc - elif queue_use < cc_vegas_alpha: - cwnd += cc_cwnd_inc - - cwnd = MAX(cwnd, cc_circwindow_min) + if _queue_use > 'cc_vegas_delta': + cwnd = BDP + 'cc_vegas_delta' - 'cc_cwnd_inc' + elif _queue_use > cc_vegas_beta or orconn_blocked: + cwnd -= 'cc_cwnd_inc' + elif cwnd_full and _queue_use < 'cc_vegas_alpha': + # Only increment if queue is low, *and* the cwnd is full + cwnd += 'cc_cwnd_inc' + + cwnd = MAX(cwnd, 'cc_circwindow_min') + + # Specify next cwnd and cc update + if next_cc_event == 0: + next_cc_event = CWND_UPDATE_RATE(cwnd) + if next_cwnd_event == 0: + next_cwnd_event = SENDME_PER_CWND(cwnd) + + # Determine if we need to reset the cwnd_full state + # (Parameterized) + if 'cc_cwnd_full_per_cwnd' == 1: + if next_cwnd_event == SENDME_PER_CWND(cwnd): + cwnd_full = 0 + else: + if next_cc_event == CWND_UPDATE_RATE(cwnd): + cwnd_full = 0
- # Count the number of sendme acks until next update of cwnd, - # rounded to nearest integer - next_cc_event = round(cwnd / (cc_cwnd_inc_rate * cc_sendme_inc)) + # Update acked cells + inflight -= 'cc_sendme_inc'
3.4. Tor NOLA: Direct BDP tracker [TOR_NOLA] @@ -1479,6 +1544,39 @@ These are sorted in order of importance to tune, most important first. The largest congestion window seen in Shadow is ~3000, so this was set as a safety valve above that.
+ cc_cwnd_full_gap: + - Description: This parameter defines the integer number of + 'cc_sendme_inc' multiples of gap allowed between inflight and + cwnd, to still declare the cwnd full. + - Range: [0, INT32_MAX] + - Default: 1-2 + - Shadow Tuning Results: + A value of 0 resulted in a slight loss of performance, and increased + variance in throughput. The optimal number here likely depends on + edgeconn inbuf size, edgeconn kernel buffer size, and eventloop + behavior. + + cc_cwnd_full_minpct: + - Description: This paramter defines a low watermark in percent. If + inflight falls below this percent of cwnd, the congestion window + is immediately declared non-full. + - Range: [0, 100] + - Default: 75 + + cc_cwnd_full_per_cwnd: + - Description: This parameter governs how often a cwnd must be + full, in order to allow congestion window increase. If it is 1, + then the cwnd only needs to be full once per cwnd worth of acks. + If it is 0, then it must be full once every cwnd update (ie: + every SENDME). + - Range: [0, 1] + - Default: 1 + - Shadow Tuning Results: + A value of 0 resulted in a slight loss of performance, and increased + variance in throughput. The optimal number here likely depends on + edgeconn inbuf size, edgeconn kernel buffer size, and eventloop + behavior. + 6.5.4. NOLA Parameters
cc_nola_overshoot:
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 31c325434ea540f1ca27bc10e88fb13ad960a16b Author: Emil Engler me@emilengler.com AuthorDate: Thu Dec 22 19:31:01 2022 +0100
tor-spec: fix ambitious formulation in VERSIONS
This commit fixes an ambitious formulation within the definition of the VERSIONS cells. It says, that a VERSIONS cell with an odd number of bytes is invalid. This statement is not true, because the CircID (2 bytes for VERSIONS cells), Command (1 byte) and Length (2 byte) make up 5 bytes, which is an odd number. Adding an odd number to an even number of bytes (the payload in this case) always results in an odd number. --- tor-spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tor-spec.txt b/tor-spec.txt index f728478..2116097 100644 --- a/tor-spec.txt +++ b/tor-spec.txt @@ -662,7 +662,7 @@ see tor-design.pdf. versions cell they received. If they have no such version in common, they cannot communicate and MUST close the connection. Either party MUST close the connection if the versions cell is not well-formed (for example, - if it contains an odd number of bytes). + if the payload contains an odd number of bytes).
Any VERSIONS cells sent after the first VERSIONS cell MUST be ignored. (To be interpreted correctly, later VERSIONS cells MUST have a CIRCID_LEN
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit ad7091d64141e6d2d580d1281e308b2994b1d1ba Merge: 578145b 31c3254 Author: David Goulet dgoulet@torproject.org AuthorDate: Tue Jan 10 13:49:31 2023 -0500
Merge branch 'tor-gitlab/mr/99'
tor-spec.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 529cb006170858c5a5c1e7028bdb47bba04d1ae5 Merge: ad7091d 4d950a2 Author: David Goulet dgoulet@torproject.org AuthorDate: Tue Jan 10 13:52:28 2023 -0500
Merge branch 'tor-gitlab/mr/98'
proposals/324-rtt-congestion-control.txt | 184 +++++++++++++++++++++++-------- 1 file changed, 141 insertions(+), 43 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit 93e2f2f574d99458e0e7075f8a4df34b1d8d32ce Merge: 529cb00 28d1f63 Author: David Goulet dgoulet@torproject.org AuthorDate: Tue Jan 10 13:53:15 2023 -0500
Merge branch 'tor-gitlab/mr/94'
dir-spec.txt | 6 ++++++ 1 file changed, 6 insertions(+)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit d3904cbe4b14c849160a732fa758c5bd19f53045 Merge: 93e2f2f bf877ec Author: David Goulet dgoulet@torproject.org AuthorDate: Tue Jan 10 13:53:47 2023 -0500
Merge branch 'tor-gitlab/mr/93'
dir-spec.txt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
This is an automated email from the git hooks/post-receive script.
dgoulet pushed a commit to branch main in repository torspec.
commit e9598b11633cc09c95323e230f5fd5f007c1483c Merge: d3904cb a2c7812 Author: David Goulet dgoulet@torproject.org AuthorDate: Tue Jan 10 13:54:30 2023 -0500
Merge branch 'tor-gitlab/mr/92'
tor-spec.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tor-commits@lists.torproject.org