-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(iroh-net)!: Improve initial connection latency #2234
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
the docotor changes will have their own PR
flub
changed the title
feat(iroh-net): Improve initial connection latency
feat(iroh-net)!: Improve initial connection latency
May 6, 2024
looks like |
Eventually we want to own this entire namespace, but that's for later.
PTAL, I believe this is ready now. |
dignifiedquire
approved these changes
May 8, 2024
ci sad |
it used to require quinn for this
matheus23
pushed a commit
that referenced
this pull request
Nov 14, 2024
## Description When the magic socket changes the underlying path the congestion controller has all the wrong ideas about the latency. This results in widely varying latencies and only slowly settling of them. This change resets the values of the congestion controller whenever the magic socket path changes. The result is a much faster stable connection. Renames the Pong::src field to ping_observed_addr to try and make this field a bit more intuitive to read. This helps especially around logging pongs and the UDP address of the pong sender next to each other. The mesh_stacks function in the tests has the relay server removed. The point of the function is to hook up the magic endpoints using direct addresses, so the relay is redundant. Furthermore the way the server was set up in the tests made it not functional, so it never did anything. So things are simplified without it. ## Breaking Changes - `MagicEndpoint::accept` now returns `magic_endpoint::Accept` rather than Quinn's `Accept` type. - `magic_endpoint::Connecting` replaces `quinn::Connecting`. This is the type returned by `.await`ing the `Accept` future. - `magic_endpoint::accept_conn` and `magic_endpoint::get_alpn` have been removed. You now accept the connection by directly awaiting the futures returned. To retrieve the ALPN use the new `Connecting::alpn` method. ## Notes & open questions To review, start at the new `rtt_actor.rs`, that's the important bit. Then look at `MagicEndpoint` how it adds it to `.connect()` (simple) and `.accept()` (complex). The latter requires copying a bunch of Quinn structs into magic_endpoint. This also simplifies how the interact with the alpn a little. Everything else is how making the rest of iroh adapt to those changes. ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [x] Tests if relevant. - [x] All breaking changes documented. ## TODO - ~~[ ] Use stream-util instead of futures-concurrency~~
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When the magic socket changes the underlying path the congestion controller has all the wrong ideas about the latency. This results in widely varying latencies and only slowly settling of them. This change resets the values of the congestion controller whenever the magic socket path changes. The result is a much faster stable connection.
Renames the Pong::src field to ping_observed_addr to try and make this field a bit more intuitive to read. This helps especially around logging pongs and the UDP address of the pong sender next to each other.
The mesh_stacks function in the tests has the relay server removed. The point of the function is to hook up the magic endpoints using direct addresses, so the relay is redundant. Furthermore the way the server was set up in the tests made it not functional, so it never did anything. So things are simplified without it.
Breaking Changes
MagicEndpoint::accept
now returnsmagic_endpoint::Accept
rather than Quinn'sAccept
type.magic_endpoint::Connecting
replacesquinn::Connecting
. This is the type returned by.await
ing theAccept
future.magic_endpoint::accept_conn
andmagic_endpoint::get_alpn
have been removed. You now accept the connection by directly awaiting the futures returned. To retrieve the ALPN use the newConnecting::alpn
method.Notes & open questions
To review, start at the new
rtt_actor.rs
, that's the important bit. Then look atMagicEndpoint
how it adds it to.connect()
(simple) and.accept()
(complex). The latter requires copying a bunch of Quinn structs into magic_endpoint. This also simplifies how the interact with the alpn a little. Everything else is how making the rest of iroh adapt to those changes.Change checklist
TODO
[ ] Use stream-util instead of futures-concurrency