Commit Graph

3653 Commits

Author SHA1 Message Date
Dirkjan Ochtman 1081180bd2 Simplify setup of server TransportParameters 2021-11-10 14:19:08 -08:00
Dirkjan Ochtman 843c18c446 Simplify Endpoint::add_connection() interface to avoid unwrapping 2021-11-10 14:19:08 -08:00
Dirkjan Ochtman 41bdfd17f2 Avoid unwrapping server config 2021-11-10 14:19:08 -08:00
Dirkjan Ochtman c1a4a67ae8 Simplify PartialDecode interface 2021-11-10 14:19:08 -08:00
Benjamin Saunders b7adfd6295 Sort crypto::ServerConfig methods by call order 2021-11-10 11:25:19 +01:00
Benjamin Saunders 81e69ddf2d Test multi-version interop 2021-11-10 11:25:19 +01:00
Benjamin Saunders a7cd22f683 Move client protocol version into ClientConfig 2021-11-10 11:25:19 +01:00
Benjamin Saunders 1c60cf6ee2 Backwards-compatibility with late draft versions 2021-11-10 11:25:19 +01:00
Benjamin Saunders 1159ae3c65 Non-exhaustive ClientConfig 2021-11-10 11:25:19 +01:00
Benjamin Saunders a3e1409130 Advertise all supported versions in version negotiation 2021-11-10 11:25:19 +01:00
BiagioFesta 25d9a40bf9 followup: rename "stateless retry" -> "retry"
Fix compile error in quinn-proto after field rename
2021-11-06 13:11:56 +01:00
Benjamin Saunders 41ae958679 Rename "stateless retry" to "retry"
This better reflects the final RFC terminology.
2021-11-06 07:23:50 +01:00
Benjamin Saunders 6913ad3f74 Cache dependencies for CI 2021-11-05 07:10:26 +01:00
Benjamin Saunders d03ee11857 Update comment 2021-11-04 11:01:30 +01:00
Benjamin Saunders f97a7eb02a Fix spurious transmit for readiness for stream flow control
When a receive stream had flow control credits to issue but then exits
the receiving w/ unknown size state (e.g. due to receiving a STREAM
frame with the FIN bit set) then a previously queued MAX_STREAM_DATA
frame may become unnecessary. Because this was not accounted for by
Retransmits::is_empty, a transmit might be attempted for the benefit
of that frame, potentially yielding an illegal ACK-only packet.
2021-11-04 11:01:30 +01:00
Benjamin Saunders 2361ace317 Fix spurious transmit readiness for reset streams
When a stream had outgoing data but is then reset, it could cause
StreamsState to indicate readiness and then fail to encode any
streams, potentially yielding an illegal ACK-only packet.
2021-11-04 11:01:30 +01:00
Benjamin Saunders c35e61a9e3 Don't enter persistent congestion without an RTT sample
RFC 9002 §7.6.2: [..] a prior RTT sample existed when these two
packets were sent.
2021-11-04 10:59:10 +01:00
Benjamin Saunders f116fc1adf Persistent congestion is detected only on ACK receipt
RFC 9002 §7.6.2: A sender establishes persistent congestion after the
receipt of an acknowledgment [...]
2021-11-04 10:59:10 +01:00
Benjamin Saunders 77e3fa6e07 Persistent congestion requires ACK-eliciting packets
See RFC 9002 §7.6.2.
2021-11-04 10:59:10 +01:00
Benjamin Saunders e68bb3ca6a Exclude max ACK delay from PTO during handshake
RFC 9002 §6.2.1: When the PTO is armed for Initial or Handshake packet
number spaces, the max_ack_delay in the PTO period computation is set
to 0, since the peer is expected to not delay these packets
intentionally.
2021-11-04 10:59:10 +01:00
Benjamin Saunders 366520020c Style tweak 2021-11-04 10:39:17 +01:00
Benjamin Saunders d4d1664331 Handle persistent congestion
This was missed in the original port.
2021-11-04 10:39:17 +01:00
Benjamin Saunders 61ed855628 Fix window confusion during fast convergence 2021-11-04 10:39:17 +01:00
Benjamin Saunders 46f9a57d3b Apply datagram frame size to entire frame, not just payload
This is, unfortunately, the specified behavior.
2021-11-04 08:57:42 +01:00
Benjamin Saunders f60e8864d7 Skip slow tests under tarpaulin
These were causing coverage to time out.
2021-11-04 08:55:37 +01:00
Benjamin Saunders 87086eade7 Cut header
This is redundant to the banner, among other things.
2021-11-04 08:51:38 +01:00
Benjamin Saunders 3be524c7f7 Update README 2021-11-04 08:51:38 +01:00
Rouzip 730fdaf723 remove unwrap! 2021-11-01 10:11:35 -07:00
Benjamin Saunders e26753dea0 Set version number to 1 2021-10-30 14:35:25 +02:00
Benjamin Saunders b00d52beb0 Update cryptographic constants 2021-10-30 14:35:25 +02:00
Frank Spitulski 7c04a155c8 BBR Congestion Control
squashed messages:

fixup for docs and removing extra braces

add downcasting hatch

pretty print should be Display, not Debug

un-needed export

fmt and clippy

re-expose CCAs to public API

reorder constants

inline bbr_state

remove extra param

refactor bbr into its own module

refactor bbr into its own module

no threadlocal rng, use genrange

rename fields for review

Update quinn/src/connection.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

Update quinn-proto/src/connection/mod.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

Update quinn-proto/src/connection/mod.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

fill() now supported

clippy in cubic was covered by the rebase

add links to BBR info

refactor to hide internal PathData

clarify BBR usage

reduce struct scope

collapse update_last_sent into on_sent

collapse on_loss into on_congestion_event

remove dead code

Update quinn/src/connection.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

Update quinn-proto/src/congestion/bbr.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

Update quinn-proto/src/congestion.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

Update quinn-proto/src/congestion/cubic.rs

Co-authored-by: Benjamin Saunders <ben.e.saunders@gmail.com>

clippy

safer duration comparison

backwards compatibility fill

add docs, rename stats cca to congestion

remove PacketNumber and bbr_ prefixes

rename constants to rust style

fix packet number typing

enable drain to target bdp mode during probe bw

add ack aggregation for better target growth

fix not entering growth mode

remove extra debug printing

enable rtt probe and track min rtt

track max bandwidth with minmax filter

use minmax filter for max bandwidth estimation

switch minmax filter to use round counts instead of times

port minmax filter to rust

fix: count lost packet size instead of their id

fix bw estimation not updating current bw

expose congestion configs

split bytes acked from end ack method

simplify full bandwidth check

remove some unused variables

add 125% of target full bandwidth condition as per docs

fix loss resetting too early, fix bandwidth target units of measurement

check if full bw reached

calculate recovery window

calculate cwnd

calculate pacing rate

maybe_enter_or_exit_probe_rtt

update gain cycle phase

refactor bandwidth estimation

add cca into stats for debugging

add target window

add recovery state transitions

loss recording

bandwidth estimation
2021-10-30 14:15:25 +02:00
Benjamin Saunders a09c6f97c2 Send ping on rebind to ensure peers notice migration
Otherwise, a client that is only receiving will lose its connection on
rebind.
2021-10-30 14:15:10 +02:00
Benjamin Saunders 289099106e Drop some trailing periods 2021-10-30 14:12:03 +02:00
Benjamin Saunders 91b093e13c Clarify stream limit scope 2021-10-30 14:12:03 +02:00
Benjamin Saunders 6cdc8badd6 impl From<ConnectionError> for connection I/O errors
thiserror's #[from] implies #[source].
2021-10-30 14:12:03 +02:00
Benjamin Saunders 29e3177330 Fix double-pretty-printing of error details
The alternate form, "{:#}", of anyhow errors traverses through
`Error::source` and prints each level. We should therefore avoid
explicitly printing an inner error marked as the source so that
detailed errors can be formatted without confusing duplication.
2021-10-30 14:12:03 +02:00
Benjamin Saunders 987a8935a8 Rename ConnectionClosed error variants to ConnectionLost
These don't necessarily represent a connection being deliberately
closed by the peer, but rather any error that might lead to connection
loss.
2021-10-30 14:12:03 +02:00
Benjamin Saunders b923c4c8b0 Pass SocketAddr by value
We always consume this by value in the end, and it's a little more
ergonomic.
2021-10-29 20:12:45 +02:00
Benjamin Saunders 5d1b6a101b Remove EndpointBuilder
Now that rustls configuration is more straightforward, this is not
adding significant value.
2021-10-29 20:12:45 +02:00
Benjamin Saunders 6aebb67f08 Reexport EndpointConfig 2021-10-29 20:12:45 +02:00
Benjamin Saunders 34ca6cff61 Privatize crypto config helpers
We're now sufficiently compatible with rustls defaults that these
aren't worth the API surface area.
2021-10-29 08:02:13 +02:00
Benjamin Saunders 495d2927cb Remove certificate newtypes 2021-10-29 08:02:13 +02:00
Benjamin Saunders 180826bf82 Fix up some more dead intra-doc links 2021-10-28 07:23:28 +02:00
Benjamin Saunders 9543f46c00 Check intra-doc links in CI 2021-10-28 07:23:28 +02:00
Benjamin Saunders ba8c05a660 Disable GSO after encountering EIO on send on Linux 2021-10-27 18:10:11 -07:00
Benjamin Saunders eae921f1eb Move UDP capabilities from globals to explicit shared state 2021-10-27 18:10:11 -07:00
Benjamin Saunders 5fa13e9e1e Fix up dead intra-doc links 2021-10-27 17:56:27 -07:00
Benjamin Saunders c533437066 Resolve lints 2021-10-27 17:49:48 -07:00
Benjamin Saunders 14eb41c15a Erase use of crypto::Session
Monomorphizes the public API.
2021-10-27 17:49:48 -07:00
Benjamin Saunders 45033d056b Object-safe crypto::Session 2021-10-27 17:49:48 -07:00