| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
We will need this to calculate the END ack timeout.
|
| |
|
|
|
|
|
| |
We no longer need to clone `CongestionWindowParams` now that it
implements `Copy`.
Resolves a clippy warning.
|
| |
|
|
|
| |
These will likely always just be a collection of integers (lightweight
to copy).
|
| |
|
|
|
|
|
|
|
|
| |
```text
warning: duplicated attribute
--> crates/tor-hsservice/src/timeout_track.rs:630:14
|
630 | #![allow(clippy::needless_pass_by_value)] // TODO hoist into standard lint block
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
First, run
```
git grep -l "^edition =" |
xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;'
```
Second, manually verify that all Cargo.toml files have changed,
and nothing else has changed.
Third, run cargo fmt again.
|
| |
|
|
|
| |
Instead call it compatible_with_cgo, which is what we actually
care about in this context.
|
| |
|
|
| |
Let's see if it works!
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
A `None` value signals to the conflux code to know to fall back on the
initial RTT of the circuit.
Without this change, the conflux switching logic is broken as we end up
staying on the leg with the best initial RTT forever (the other leg is
never picked, because its `ewma_rtt()` is stuck on `u32::MAX`, and never
updated as we never send on it).
|
| |
|
|
|
|
|
| |
The expanded expression makes it easier to see that
`can_crosscheck_with_current_estimate()` can never return `true` if
`self.ewma_rtt` is `None`, and that the `expect()` from
`is_clock_stalled()` cannot panic.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The `RttEstimator` now uses `None` to represent not-yet-measured RTTs.
Previously, all the measured RTTs defaulted to 0, in contradiction with
the `RttEstimator::{min,ewma}_rtt_usec()` docs, which state that both
functions are supposed to return `u32::MAX` if there is no estimate.
Closes #2049
|
| |
|
|
|
|
| |
Conflux is only supported when prop324 congestion control is enabled, so
we need an accessor for the cc algorithm of a given circuit hop in order
for the conflux code to be able to check *which* cc algorithm is in use.
|
| |
|
|
|
|
| |
This doesn't really change anything, but removing the `.clone()` makes
it a bit more obvious that copying the `*Params` is a lightweight
operation.
|
| | |
|
| | |
|
| |
|
|
|
| |
The fallback CC algorithm is _always_ fixed-window, and we should only
use it when the selected CC algorithm is not supported.
|
| |
|
|
|
|
|
|
|
| |
Now tor-circmgr no longer needs to check which Protover capabilities
are enabled, or construct a separate CircParameters for each hop.
Instead, tor-proto decides whether to use the fallback CC mode,
based on whether the target supports FLOWCTRL_CC.
Closes #1967.
|
| |
|
|
|
|
|
|
|
|
|
| |
One type will now represent _the kind of hop we are asking
tor-proto to negotiate_; the other will represent
_the state of such negotiation_.
This doesn't simplify the code much yet, but it will be helpful
as we add more and more negotiable settings.
Part of #1967
|
| | |
|
| |
|
|
|
| |
This doesn't make much change yet, but does save us an allocation
when handling SENDMEs.
|
| | |
|
| | |
|
| |
|
|
|
| |
We use this method to decide whether to allow receiving stream SENDMEs,
and also whether we should send stream SENDMEs.
|
| |
|
|
|
|
|
|
| |
Also add one for the sendme_inc validity function.
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Allows us to remove the pub.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Important to enforce that every field is explicitely set so we avoid
forgetting fields.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
| |
No need to have these comments in the implementation of the Trait.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
In unit tests, we set a 1000 by default but else, we don't set a default
so our implementation doesn't forget to set the right value from the
consensus.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
| |
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
| |
Instead of having the congestion.rs test module public, make a
test_utils.rs file that contains code for other unit tests within the
congestion module.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
| |
Turns out that RoundTripEstimatorParams is the same exact thing so one
less data structure.
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
| |
The big one! This is the Vegas algorithm implementation that is hooked
to the CongestionControl object by implementing the algorithm trait.
Still, at this commit, nothing is being used by the circuit reactor yet.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the top level CongestionControl object that will allow the circuit
reactor to use it in order to decide if a cell can be sent or not. In
order to be used, it is configured with an algorithm that implements the
CongestionControlAlgorithm trait.
The Fixed Window algorithm is also added which essentially implements
the SENDME logic as arti knows it today with a fixed window size.
The SENDME code has been refactor in two different logical steps in
order to accomodate the future Vegas algorithm for which the congestion
window logic and SENDME validity is seperated.
There is now a SENDME validator that takes care of tracking the tags
(authenticated SENDMEs) and validating them upon reception. Then, if
valid, the window management is passed down the congestion control
algorithm, at this commit, FixedWindow object.
Related #534
Signed-off-by: David Goulet <[email protected]>
|
|
|
This commit adds the congestion window object, a round trip estimator
(RTT) and a state enum. These 3 entities are used by congestion control
in a generic way that is they are passed and used by any algorithm.
At this commit, they are not used hence the allow deadcode attribute for
now in order to minimize the build warnings.
We also introduce the params.rs file containing the parameters, taken
from consensus, used to configure these objects. They will be exposed to
the tor-cirmgr crate to build the CircParameters. More will come.
This also introduces the congestion/ directory that will contain more
code in future commits.
Related #534
Signed-off-by: David Goulet <[email protected]>
|