| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
| |
Congestion control is not completely working correctly, and is not fully
implemented (XON/XOFF). This commit adds a new experimental "flowctl-cc"
feature to enable the congestion control extension during the ntor-v3
handshake.
|
| | |
|
| | |
|
| |
|
|
|
| |
We use this method to decide whether to allow receiving stream SENDMEs,
and also whether we should send stream SENDMEs.
|
| |
|
|
|
|
|
| |
`OpenStreamEnt::put_for_incoming_sendme()` calls
`StreamSendFlowControl::put_for_incoming_sendme()`, which returns an
error if the `StreamSendFlowControl` is in XON/XOFF mode. So we don't
need this extra check.
|
| |
|
|
|
| |
Congestion control tells us whether we should use stream or XON/XOFF
flow control.
|
| |
|
|
|
|
|
|
| |
Previously new stream entries required a `StreamSendWindow`, but to
support other flow control algorithms, we want new stream entries to
take a `StreamSendFlowControl` instead.
This also deduplicates the `StreamSendWindow` creation code.
|
| |
|
|
|
|
|
| |
This doesn't do anything yet, so is effectively like not having stream
flow control.
This should be implemented as part of arti#534.
|
| |
|
|
|
|
|
|
| |
Also add one for the sendme_inc validity function.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
If we ever receive a stream-level SENDME from the Exit while the circuit
is under congestion control (Vegas), it is a protocol violation so close
the circuit.
This is important in order to avoid yet another side channel with cells
that would be essentially ignored silently.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new function to the CongestionControl object that returns
true or false on if stream level SENDMEs are allowed by the underlying
algorithm.
Congestion control Vegas doesn't allow them as in it retires them and so
we avoid sending them for that algorithm.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
| |
These pass through congestion control state to the reactor, and aren't
actually hooked up to the congestion control code yet.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This puts in, based on the circuit parameters, the CC extension request
in the CREATE and EXTEND requests.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Congestion control can change the circuit parameters if the relay we are
negotiating with doesn't support FlowCtrl=2.
This commit adds a function in the circuit builder that will apply any
changes to the circuit parameters of the hop based on the hop protocol
values. For now, only congestion control applies.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
This avoids cloning the object and instead allows us to have a
CircParameters per hop on the circuit path. This will come handy with
congestion control where each hop might have different congestion
control parameters.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CircParameters is built before path selection and thus once we start
building the hops, we can't access the consensus values that were used
to build it in the first place.
For congestion control, we require a fallback algorithm in case the hop
doesn't support FlowCtrl=2.
This commit adds a "fallback_alg" to the CC parameters which will be
used for this exact case.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
When receiving the congestion control response extension, evaluate our
state and set the sendme_inc if valid in our circuit parameters.
For this, a series of helper functions is needed.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is required because circuit ntor v3 handshake can negotiate circuit
level parameters and thus able to change any values.
Needed for congestion control ntorv3 handshake extension for which the
sendme increment is negotiated.
Part of #1817
Signed-off-by: David Goulet <[email protected]>
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Part of #1849.
Note that these functions are distributed across crates,
so that if (in the future) we stop doing API breaks
with every release, we will get the right outputs.
Note also that these functions build the list of protocols
out of specific symbolic features, rather than numbers:
this makes it easier to avoid errors about "which feature was
Relay=4 again", and easier to avoid accidentally referring to a
protocol that doesn't exist, like "Consensus" (should be "Cons")
or "HsDir" (case is wrong).
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since v1 cells have a longer tag, they can fit less data into a
single cell. Ah well, that's the cost of improved security.
The code in data.rs is a little wonky, in that it currently requires
its buffer to be exactly the maximum size for a data cell. We have
a TODO about fixing that in the future, but for now I've moved it to
use a boxed slice rather than a boxed array.
Part of #1944.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This will let us actually _send_ messages in the right format.
This approach is not ideal for packed/fragmented messages;
they will need a separate RelayCellEncoder.
part of #1944.
|
| |
|
|
| |
(Also note a couple of other CGO-related issues)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
In `send_relay_cell()` in `tunnel/reactor/circuit.rs`,
replace an unconditional array access (which would cause a panic if
`hop_num` were out-of-range) with a checked `get_mut()` call.
It's not totally clear whether this can happen in practice,
but in either case, an error is probably better than a panic.
All of our other lookups in this vector are either checked,
or more obviously infallible.
Closes #1950.
|
| |
|
|
|
| |
This comes up on OSX; I hadn't seen it before, so I assume it is new
with Rust 1.86.
|
| |
|
|
|
| |
This won't involve an extra dep, because we already use `itertools`
throughout the codebase.
|
| |
|
|
|
| |
For service introduction circuits, we have `IptMsgHandler`, so we've
already worked something out :)
|
| | |
|
| |
|
|
| |
ntor v3 is now always enabled.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Done using:
```
for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do
cargo set-version -p $crate 0.29.0
done
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The non-{arti-,tor-} crates are:
```
./maint/list_crates | rg -v '^(tor|arti)'
oneshot-fused-workaround
slotmap-careful
test-temp-dir
fslock-guard
hashx
equix
caret
fs-mistrust
safelog
retry-error
```
We split them in the following categories:
* crates with no changes (no version bumps):
```
maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-'
oneshot-fused-workaround: No change.
slotmap-careful: No change.
fslock-guard: No change.
caret: No change.
retry-error: No change.
```
* crates that only have non-functional changes (bump the patch version):
- test-temp-dir
- equix
- fs-mistrust
- safelog
* crates where APIs were broken (bump minor):
- hashx (`RngCore` impl for `SipRand`)
The bumps from this commit were created using this script:
```
PATCH="
test-temp-dir
equix
fs-mistrust
safelog
"
for crate in $PATCH; do
cargo set-version --bump patch -p $crate;
done
MINOR="
hashx
"
for crate in $MINOR; do
cargo set-version --bump minor -p $crate;
done
```
|
| | |
|
| | |
|
| |\
| |
| |
| |
| | |
tor-proto: simplify `ConfluxSet::circuit_action`
See merge request tpo/core/arti!2884
|
| | |
| |
| |
| | |
I also added an additional non-doc TODO comment.
|
| | |
| |
| |
| | |
As far as I can tell, the extra drop handling code isn't needed anymore.
|
| | |
| |
| |
| |
| | |
I think the return type is simplified enough now that we don't need
this.
|
| | |
| |
| |
| |
| |
| | |
Now returns only the first item of the stream rather than the stream
itself. We use this in `Reactor::run_once`, which means we only ever use
the first item anyways.
|
| | | |
|
| |\ \
| |/
|/|
| |
| | |
tor-proto: Replace RunOnceCmdInner with CircuitCmd in Circuit impl
See merge request tpo/core/arti!2881
|
| | | |
|
| | |
| |
| |
| | |
Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2881#note_3178624
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
There is no `Multiple` counterpart in `CircuitAction`, so the `Single`
variant name doesn't make much sense.
|