Closed
Description
Summary
Implement the QUIC transport for rust-libp2p.
Done criteria
- Quic can be used as a transport in the
Swarm
for communication between nodes that can directly reach each other - TLS handshake is compliant with the libp2p/specs TLS Handshake and unit tested
- Transport is unit & integration tested
- Benchmarked with mxinden/libp2p-perf
- Tested again go-libp2p with Testground
- Public API is documented
Status Quo
Alpha implementation based on quinn
crate. See #3454.
Previous attempts / History
- Implement QUIC #211
- Initial Issue
- [WIP] Add libp2p-quic #563
- First implementation using
picoquic
- Not using
quinn
because back then mostquinn
types were!Send
- First implementation using
- [WIP] Add experimental QUIC support. #862
- Continuation of [WIP] Add libp2p-quic #563
- QUIC support #1334
- Use
quinn-proto
- Continuation in branch
tomaka/quiccc-again
- Use
- Add libp2p-quic. #2144
- Inspired by QUIC support #1334 but does not share code
- Related repo: https://github.com/ipfs-rust/libp2p-quic
- published on crates.io as
libp2p-quic
- Support noise in addition to tls
- Closed because quic+noise not in libp2p specs
- Libp2p quic second attempt #2159
- Continuation of Add libp2p-quic. #2144
- Handles ecn codes and gso (throughput)
- "Support for plugging in your own crypto"
- transports/quic: Add implementation based on
quinn-proto
#2289 [Most recent PR]- Initially a continuation of Libp2p quic second attempt #2159
- Later code was replaced with old code from
tomaka/quiccc-again
branch
- Quic attempt 4 #2801 Alternative to transports/quic: Add implementation based on
quinn-proto
#2289- Uses
quinn
instead ofquinn-proto
- Uses
Tasks
- Finish transports/quic: Refactor Muxer and Connection kpp/rust-libp2p#23 (replaces transports/quic: Adapt QuicMuxer to upstream StreamMuxer changes elenaf9/rust-libp2p#6)
- Finish remaining TODOs / FIXMEs in transports/quic: Add implementation based on
quinn-proto
#2289: - Evaluate whether we should switch to use
UdpSocket
fromquinn_udp
instead of the ruststd
implementation- Will stick with the rust
std
ones for the first version.
- Will stick with the rust
- Review how backpressure is enforced throughout the whole implementation
- If the application is too busy to read from an existing substream
- If max inbound substreams is reached
- If one connection is busy
- Enhance docs
- Enhance test
- Enhance ping test in libp2p/test-plans for interop tests with Testground
- More tests in general: backpressure, closing substreams, closing connections, limits, ..
- Add QUIC support to mxinden/libp2p-perf for benchmarks (mxinden/libp2p-perf is replaced by https://github.com/libp2p/test-plans/blob/master/perf/)
- quic: Add support for
quic
codepoint , interpreted as QUIC version draft-29 #3133
Long-term (not required for first implementation):
- Properly implement
Transport::dial_as_listener
to support hole-punching feat(quic): implement hole punching #3964 - Handle address change if a connection migrates
- Handle / use ECN bits (Happening now with the move to quinn refactor(quic): rewrite quic using quinn #3454)
- Fix local_address when processing an incoming UDP datagram for a new connection on a socket that is bound to a wildcard address.
- Similarly, select correct socket when listening on wildcard address fix(quic): improve listener socket selection when dialing #4259
- When first starting to listen, enable server-capabilities on existing client-only endpoint instead of creating a new one
- Evaluate alternatives to the
quinn_proto
quic implementation- quinn refactor(quic): rewrite quic using quinn #3454
s2n-quic
(AWS)quiche
(Cloudflare)
- Refactor tls-config handling to support
PeerId
-validation on TLS level: Add muxer compliance test suite and refactor tests to not depend onlibp2p-swarm
kpp/rust-libp2p#27 (comment) Consider verifying expectedPeerId
as part of auth upgrades #2946