summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/congestion
Commit message (Collapse)AuthorAgeFilesLines
* Remove the last traces of CircTag.Nick Mathewson2025-05-061-3/+0
|
* proto: Use SendmeTag in place of CircTagNick Mathewson2025-05-061-38/+2
| | | | | This doesn't make much change yet, but does save us an allocation when handling SENDMEs.
* tor-proto: Add congestion control accessors for conflux.Gabriela Moldovan2025-05-062-0/+10
|
* tor-proto: expand docs for `CongestionWindowParams::set_sendme_inc`Steven Engler2025-04-231-1/+5
|
* tor-proto: rename `allow_stream_sendme` to `uses_stream_sendme`Steven Engler2025-04-232-2/+2
| | | | | We use this method to decide whether to allow receiving stream SENDMEs, and also whether we should send stream SENDMEs.
* tests: Add CC ntorv3 negotiation unit testDavid Goulet2025-04-232-5/+52
| | | | | | | | Also add one for the sendme_inc validity function. Part of #1817 Signed-off-by: David Goulet <[email protected]>
* circ: Don't send stream level SENDME with CCDavid Goulet2025-04-232-0/+8
| | | | | | | | | | | | | 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]>
* circ: Apply possible subprotocol changes to circ paramsDavid Goulet2025-04-231-1/+5
| | | | | | | | | | | | | 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]>
* congestion: Setup a fallback algorithm in the paramsDavid Goulet2025-04-232-1/+9
| | | | | | | | | | | | | | | | 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]>
* circ: Set the negotiated CC sendme_inc from handshakeDavid Goulet2025-04-231-0/+38
| | | | | | | | | | | 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]>
* Add a RelayCellFormat argument to encode().Nick Mathewson2025-04-161-2/+3
| | | | | | | | | 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.
* fix: fix typosDimitris Apostolou2025-01-303-7/+7
|
* tor-proto: Use SENDME_TAG_LEN constant instead of magic value.Gabriela Moldovan2025-01-281-6/+7
|
* tor-proto: Use CircTag::try_from for clarity.Gabriela Moldovan2025-01-281-0/+10
|
* tor-proto: Use CircTag instead of raw byte slice.Gabriela Moldovan2025-01-281-1/+1
|
* congestion: Use getters for all parametersDavid Goulet2025-01-163-49/+72
| | | | | | Allows us to remove the pub. Signed-off-by: David Goulet <[email protected]>
* congestion: Remove Default from every parametersDavid Goulet2025-01-162-24/+6
| | | | | | | Important to enforce that every field is explicitely set so we avoid forgetting fields. Signed-off-by: David Goulet <[email protected]>
* congestion: Make the cc_alg values a caret_int for better code semanticDavid Goulet2025-01-161-0/+14
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Move test code in test module for VegasDavid Goulet2025-01-161-16/+15
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Remove duplicated commentsDavid Goulet2025-01-161-13/+0
| | | | | | No need to have these comments in the implementation of the Trait. Signed-off-by: David Goulet <[email protected]>
* congestion: Remove FixedWindow start window default valueDavid Goulet2025-01-162-12/+17
| | | | | | | | 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]>
* congestion: Add standard clippy checks to testsDavid Goulet2025-01-162-0/+28
| | | | Signed-off-by: David Goulet <[email protected]>
* congestion: Make a test_utils.rsDavid Goulet2025-01-163-2/+55
| | | | | | | | 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]>
* congestion: Remove duplicate RttParameters structDavid Goulet2025-01-161-39/+7
| | | | | | | Turns out that RoundTripEstimatorParams is the same exact thing so one less data structure. Signed-off-by: David Goulet <[email protected]>
* proto: Add Vegas congestion control algorithmDavid Goulet2025-01-162-0/+592
| | | | | | | | | | | 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-163-0/+557
| | | | | | | | | | | | | | | | | | | | | | | 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-162-0/+416
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]>