Quinn

Futures-based QUIC implementation in Rust

Github星跟踪图

Quinn

Documentation
Crates.io
Build status
codecov
Chat
License: MIT
License: Apache 2.0

Quinn is an implementation of the QUIC transport protocol undergoing
standardization by the IETF. It is suitable for experimental use. This repository
contains the following crates:

  • quinn contains a high-level async API based on tokio, see
    quinn/examples/ for
    usage. This will be used by most Rust developers. (Basic benchmarks are included.)
  • quinn-proto contains a deterministic state machine of the protocol which performs
    no I/O internally and is suitable for use with custom event loops (and potentially
    a C or C++ API).
  • quinn-h3 contains an implementation of HTTP 3 and QPACK. It is split internally
    in a deterministatic state machine and a tokio-based high-level async API.
  • bench contains some extra benchmarks without any framework.
  • interop contains tooling that helps the Quinn team run interoperability tests.

Quinn is the subject of a RustFest Paris (May 2018) presentation; you can
also get the slides (and the animation about head-of-line
blocking). Video of the talk is available on YouTube. Since this
presentation, Quinn has been merged with quicr, another Rust implementation.

All feedback welcome. Feel free to file bugs, requests for documentation and
any other feedback to the issue tracker.

Quinn was created and is maintained by Dirkjan Ochtman and Benjamin Saunders.

Features

  • Simultaneous client/server operation
  • Ordered and unordered reads for improved performance
  • Works on stable Rust, tested on Linux, macOS and Windows
  • Pluggable cryptography, with a standard implementation backed by
    rustls and ring

Status

  • QUIC draft 24 with TLS 1.3
  • Cryptographic handshake
  • Stream data w/ flow control and congestion control
  • Connection close
  • Stateless retry
  • Explicit congestion notification
  • Migration
  • 0-RTT data
  • Session resumption
  • HTTP over QUIC

Usage Notes

Buffers

A Quinn endpoint corresponds to a single UDP socket, no matter how many
connections are in use. Handling high aggregate data rates on a single endpoint
can require a larger UDP buffer than is configured by default in most
environments. If you observe erratic latency and/or throughput over a stable
network link, consider increasing the buffer sizes used. For example, you could
adjust the SO_SNDBUF and SO_RCVBUF options of the UDP socket to be used
before passing it in to Quinn. Note that some platforms (e.g. Linux) require
elevated privileges or modified system configuration for a process to increase
its UDP buffer sizes.

Certificates

By default, Quinn clients validate the cryptographic identity of servers they
connect to. This prevents an active, on-path attacker from intercepting
messages, but requires trusting some certificate authority. For many purposes,
this can be accomplished by using certificates from Let's Encrypt
for servers, and relying on the default configuration for clients.

For some cases, including peer-to-peer, trust-on-first-use, deliberately
insecure applications, or any case where servers are not identified by domain
name, this isn't practical. Arbitrary certificate validation logic can be
implemented by enabling the dangerous_configuration feature of rustls and
constructing a Quinn ClientConfig with an overridden certificate verifier by
hand.

When operating your own certificate authority doesn't make sense, rcgen
can be used to generate self-signed certificates on demand. To support
trust-on-first-use, servers that automatically generate self-signed certificates
should write their generated certificate to persistent storage and reuse it on
future runs.

Running the Examples

$ cargo run --example server ./
$ cargo run --example client https://localhost:4433/Cargo.toml

This launches a HTTP 0.9 server on the loopback address serving the current
working directory, with the client fetching ./Cargo.toml. By default, the
server generates a self-signed certificate and stores it to disk, where the
client will automatically find and trust it.

Development

The quinn-proto test suite uses simulated IO for reproducibility and to avoid
long sleeps in certain timing-sensitive tests. If the SSLKEYLOGFILE
environment variable is set, the tests will emit UDP packets for inspection
using external protocol analyzers like Wireshark, and NSS-compatible key logs
for the client side of each connection will be written to the path specified in
the variable.

主要指标

概览
名称与所有者quinn-rs/quinn
主编程语言Rust
编程语言Rust (语言数: 1)
平台
许可证Apache License 2.0
所有者活动
创建于2018-04-03 07:47:41
推送于2025-05-28 07:47:49
最后一次提交
发布数65
最新版本名称quinn-proto-0.11.12 (发布于 2025-05-09 09:46:44)
第一版名称pre-quicr-quinn (发布于 2018-10-03 11:33:17)
用户参与
星数4.3k
关注者数63
派生数434
提交数3.9k
已启用问题?
问题数705
打开的问题数117
拉请求数1301
打开的拉请求数22
关闭的拉请求数230
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?