Skip to content
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

Add multipath #28

Draft
wants to merge 204 commits into
base: iroh-0.11.x
Choose a base branch
from
Draft

Add multipath #28

wants to merge 204 commits into from

Conversation

flub
Copy link
Collaborator

@flub flub commented Jan 15, 2025

No description provided.

gretchenfrage and others added 30 commits December 20, 2024 10:31
Factors out the retry_src_cid and orig_dst_cid fields of Incoming into
a new token::IncomingToken struct.
Moves more logic from Endpoint::handle_first_packet to the proto::token
module. Due to improved decoupling between modules, Token::from_bytes
and ValidationError can now be made private.
This allows us to remove the `#[doc(hidden)] pub fn new() -> Self`.
- Removes `#[doc(hidden)]`
- Adds hyperlink
- Demotes most of the doc comment to non-doc comment, as it seems more
  like an internal note than something the user needs to see.
Previously, this method was public, but marked as `#[doc(hidden)]`.
However, nothing anywhere was using it. This commit makes it private.
The module is already `#[cfg(fuzzing)]`, which should make it not appear
in docs.
Removes some unnecessary indirection.
Updates the requirements on [rustls-platform-verifier](https://github.com/rustls/rustls-platform-verifier) to permit the latest version.
- [Release notes](https://github.com/rustls/rustls-platform-verifier/releases)
- [Changelog](https://github.com/rustls/rustls-platform-verifier/blob/main/CHANGELOG)
- [Commits](rustls/rustls-platform-verifier@v/0.4.0...v/0.4.0)

---
updated-dependencies:
- dependency-name: rustls-platform-verifier
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
This will be useful for NEW_TOKEN usage, as validation tokens will only
include IP address and not port.
Prior to this commit, decoding a socket addr from a RetryToken called
get_u8 and get_u16, which would have panicked if an encrypted token were
minted that terminated after that point. This replaces them with calls
that short-circuit, for consistency with other parts of the code there.
This will be useful for NEW_TOKEN usage, as it will make there be more
than one call site for this.
djc and others added 30 commits March 30, 2025 17:17
Bumps [socket2](https://github.com/rust-lang/socket2) from 0.5.8 to 0.5.9.
- [Release notes](https://github.com/rust-lang/socket2/releases)
- [Changelog](https://github.com/rust-lang/socket2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/socket2/commits)

---
updated-dependencies:
- dependency-name: socket2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
We don't care about those platforms for now.  We likely don't do
platform-specific changes anyway.
merging main again, in a PR to check CI will be happy
This TransmitBuf is a wrapper around the buffer in which datagrams are
being created.  It keeps track of the state required to know the
boundaries of the datagrams in the buffer.
This removes the extra arguments from Packetbuilder::new that tell the
builder about datagram boundaries in favour of using the state of
TransmitBuf directly.
This moves the logic of updating the buffer for new datagrams into a
function on the TransmitBuf.  This centralises all the manipulation of
these variables into one logical place, ensuring all the invariants
are upheld.
This helps encapsulation by ensuring that no outside users can mutate
these fields.  Reducing the amount of logic that needs to be reasoned
about.
We want to hide the actual buffer implementation from most of these
locations.  Currently it is a TransmitBuf but it likely will become
something else in the future.  So make this generic.
This allows making TransmitBuf::buf private at last.  Now all the
logic it handles is fully encapsulated.
This re-arranges the loop in poll_transmit to always finish the packet
before going to the next iteration.

This primarily enables to mutably borrow the TransmitBuf into a
packet-specific buffer while the packet is being built.  But this is
not yet utilised in this commit.

It does however remove the need of the mutable builder_storage Option,
which makes reasoning over packet building slightly easier.

- The logic to know on which packet space to send next, or whether
  there is no longer anything to send, has been moved to the
  next_send_space method.

- The logic to decide whether to pad a packet before finishing it is
  moved to the end of the loop.

- The logic to check the congestion controller and pacing is kept at
  the start of the loop.  Before a new packet is started.  Starting a
  new datagram also stays there.
Now that the packet is always finished at the end of the loop we no
longer need to carry around the mutable SentFrames.  Reducing further
the number of things to keep track of.
The PacketBuilder::finish_and_track function took a SentFrames
argument as an Option.  However this was an artifact of the
poll_transmit loop tracking it in an Option before, and it not being
clear this was always Some when things were going correctly.  Now all
the callers clearly always pass this in so we can remove the Option.
Now the lifetimes allow for this the PacketBuilder can own the
TransmitBuf.  This is gives it more control over the buffer into which
the packet can be written.

This commit itself does nothing interesting with this yet.  It merely
moves the buffer ownership in a mechanical way.  However, this enables
future changes to reduce the use of offsets in so many places.
This moves keeping track of the available frame space to the packet
builder.  The available space is now encoded into the BufMut returned
by PacketBuilder::frame_space_mut().  This removes the need for the
BufLen trait in many of the places writing frames.
Now that the PacketBuilder::frame_space_mut exists the direct BufMut
impl on it can be removed.  Nothing external needs to directly write
into the packet buffer outside of the frame space.
It no longer needs to keep track of this field because the TransmitBuf
already does.  Removing duplicate state is nice.
You always need to remember to handle pad_datagram if needed.  While
really this always happens just before the call to finish_and_track.
Instead this can be done in finish_and_track without any logic change,
and this helps avoiding mistakes.
This applies the refactors from
quinn-rs#2168 and
quinn-rs#2195 onto our multipath branch!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.