aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/congestion.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-proto: change some instances of `sendme_inc` to u8Steven Engler2026-08-121-2/+2
|
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-proto: vegas: return early if clock stall was detectedSteven Engler2026-05-071-5/+8
|
* proto: Remove unnecessary feature-gatingGabriela Moldovan2026-03-191-1/+1
| | | | | | | `test_utils` is not exposed outside of `tor-proto`, so the feature gating here isn't needed (we typically use the `testing` feature for exposing testing utilities outside the current crate, but that's not the case here).
* proto: Make CongestionWindow CopyGabriela Moldovan2025-11-171-4/+4
|
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* proto: Expose RoundtripTimeEstimator more broadly.Gabriela Moldovan2025-09-161-3/+0
| | | | We need this to calculate the half-stream timeouts for #264.
* proto: Pass owned CongestionWindowParams to CongestionControl::new.Gabriela Moldovan2025-09-041-2/+2
| | | | | | | We no longer need to clone `CongestionWindowParams` now that it implements `Copy`. Resolves a clippy warning.
* Update code for Edition 2024Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* tor-proto: send XOFF messages when the queue grows too largeSteven Engler2025-07-161-2/+0
|
* tor-proto: add `CongestionControl::uses_xon_xoff()`Steven Engler2025-07-161-0/+10
|
* tor-proto: Use mockable runtime in congestion control RTT estimator.Gabriela Moldovan2025-06-231-5/+6
|
* tor-proto: Add an accessor for the cc algorithm.Gabriela Moldovan2025-06-111-1/+10
| | | | | | 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.
* tor-proto: Remove no-longer needed clone()s.Gabriela Moldovan2025-06-111-1/+1
| | | | | | This doesn't really change anything, but removing the `.clone()` makes it a bit more obvious that copying the `*Params` is a lightweight operation.
* Remove the last traces of CircTag.Nick Mathewson2025-05-061-6/+7
|
* tor-proto: Add congestion control accessors for conflux.Gabriela Moldovan2025-05-061-1/+32
|
* tor-proto: rename `allow_stream_sendme` to `uses_stream_sendme`Steven Engler2025-04-231-6/+6
| | | | | We use this method to decide whether to allow receiving stream SENDMEs, and also whether we should send stream SENDMEs.
* circ: Don't send stream level SENDME with CCDavid Goulet2025-04-231-1/+9
| | | | | | | | | | | | | 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]>
* fix: fix typosDimitris Apostolou2025-01-301-1/+1
|
* congestion: Use getters for all parametersDavid Goulet2025-01-161-19/+22
| | | | | | Allows us to remove the pub. Signed-off-by: David Goulet <[email protected]>
* congestion: Move code to test moduleDavid Goulet2025-01-161-10/+14
| | | | | | | Put code for test inside the test module instead of gated by a cfg(test). Signed-off-by: David Goulet <[email protected]>
* congestion: Add standard clippy checks to testsDavid Goulet2025-01-161-0/+14
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Some comments and mod syntax tweakingDavid Goulet2025-01-161-7/+1
| | | | | | | Don't put in the comments, let the top-level module comments do that job. Signed-off-by: David Goulet <[email protected]>
* congestion: Make a test_utils.rsDavid Goulet2025-01-161-43/+5
| | | | | | | | 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]>
* proto: Add Vegas congestion control algorithmDavid Goulet2025-01-161-0/+7
| | | | | | | | | | | 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]>
* proto: New CongestionControl object and fixed window algorithmDavid Goulet2025-01-161-7/+188
| | | | | | | | | | | | | | | | | | | | | | | 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]>
* proto: Add generic objects for congestion controlDavid Goulet2025-01-161-0/+241
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]>