Commit Graph

102 Commits

Author SHA1 Message Date
Dirkjan Ochtman 34530a8238 chore: Warn for unused_qualifications
(cherry picked from commit 531b6dd347)
2026-07-17 08:43:31 -05:00
Philipp Krüger 269e5e0c38 feat: Add Endpoint::wait_all_draining to enable faster endpoint closing (#651)
## Description

Adds an API for waiting for the start of the draining period in
`Endpoint::wait_all_draining` instead of waiting for draining to have
finished with `Endpoint::wait_idle`.

This allows dropping the `Endpoint` once all connections became inactive
and there is no need to wait for all connections to have drained.

This is all motivated by [this
paragraph](https://datatracker.ietf.org/doc/html/rfc9000#section-10.2-6)
in the QUIC spec:

> Endpoints that have some alternative means to ensure that
late-arriving packets do not induce a response, such as those that are
able to close the UDP socket, MAY end these states earlier to allow for
faster resource recovery. Servers that retain an open socket for
accepting new connections SHOULD NOT end the closing or draining state
early.

And finally, we're not replacing `Endpoint::wait_idle` and instead keep
it around as some tests require waiting for all `Connection`s to be
dropped before proceeding, which is only guaranteed by `wait_idle` and
not `wait_all_draining`.

## Breaking Changes

- Only an addition: `Endpoint::wait_all_draining` was added.

## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
- [x] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.
- [x] Tests if relevant.
- [x] All breaking changes documented.
2026-05-21 09:42:20 +00:00
Rüdiger Klaehn a0f988a91d refactor: Rename read_chunk to read_bytes and make it return just a Bytes (#535)
## Description

Remove Chunk usage in ordered read API

Make read_chunk return just a Bytes. Also rename read_chunks to
read_chunks_many (it already returns Bytes).

Add a bytes_read fn for the rare case where you do need the offset
despite being in ordered read mode.

Not sure if people agree, but there was an inconsistency before between
read_chunk (returns a Chunk, including offset) and read_chunks (fills a
bunch of Bytes, no offset).

Also it doesn't seem useful to have Chunk at all for ordered streams.
You usually don't care about the offset unless you are reading unordered
streams. So I would like to confine Chunk usage to only the (now
separate) unordered read API.

## Breaking Changes

noq::RecvStream::read_chunk returns a Bytes.
noq::RecvStream::read_chunks renamed to read_many_chunks.

## Notes & open questions

Note: while the [other related
PR](https://github.com/n0-computer/noq/pull/536) is just renaming, this
one is I think actually removing some weirdness.

Why does read_chunk give you an offset but read_chunks does not. And
there is no way to get the offset if you need it if you use read_chunks.

---------

Co-authored-by: Floris Bruynooghe <flub@n0.computer>
2026-05-07 08:52:03 +00:00
Friedel Ziegelmayer fd36bc5bf5 refactor!: cleanup single path based expectations (#616)
## Description

- Removes the two API calls on `Connection` that haven't been migrated
yet
- Adds some more explicit `expect`s for unnamed `unwrap`s

Closes #514

## Breaking Changes

- remove
  - `noq::Connection::local_ip`
  - `noq::Connection::remote_address`
2026-04-29 07:13:03 +00:00
Friedel Ziegelmayer 0ac6b4620b feat(proto): replace BBR with BBRv3 + breaking Controller API changes (#611)
Pulls in upstream quinn PR https://github.com/quinn-rs/quinn/pull/2481

Squashes the upstream commits and adapts them.

Closes #603

Upstream commits
- f8b25b24b - granular packet events for congestion controllers
- 52f04ed9b - Pacer queries Controller for pacing rate / send quantum
- c022e308a - BBRv3 implementation + MaxFilter
- ce60e5b5c - remove old BBR implementation



## Breaking Changes

- `Controller` trait:
  - `on_ack` gains `pn: u64`
  - `on_congestion_event` gains `largest_lost: u64`
- New optional `on_packet_sent`, `on_packet_lost`,
`on_ack_frequency_update`
- New `metrics()` -> `ControllerMetrics { congestion_window, ssthresh,
pacing_rate, send_quantum }`, used by the pacer
- Pacer changes:
- `Pacer::delay()` now also takes `capacity: Option<u64>` and
`pacing_rate: Option<u64>` from the controller; CC-supplied values take
precedence over the window-derived defaults but are still capped by
noq's `max_bytes_per_second`.

---------

Co-authored-by: Tipuch <fiorini751@proton.me>
2026-04-24 09:18:46 +00:00
dignifiedquire 79b20f4453 fix: gate perf Path import on json-output + restore deny.toml entries 2026-04-22 15:15:19 +02:00
Zotyamester 72400f34da fix(perf): suppress table output in JSON mode
Suppress table output meant to provide human-friendly visualization
when using the `--json` CLI option and its argument is `-`, that is,
when the JSON output targets stdout.

Fixes #2544.

(cherry picked from commit f853e5e082)
2026-04-22 15:15:19 +02:00
Philipp Krüger 98507bd045 refactor(proto)!: Remove excessive Arc-wrapping (#489) 2026-03-10 10:51:21 +00:00
Friedel Ziegelmayer 294e3ea603 refactor!: rename to noq (#461)
* refactor!: rename to noq

* fixup python scripts

* fixup

* fixup

* fixup: cr
2026-02-27 14:57:21 +00:00
Dirkjan Ochtman 6cb31438bb Hoist lint configuration to the workspace level 2026-01-12 16:46:28 +01:00
Franz Heinzmann abbe27bf07 feat!: update qlog to latest drafts, add more events and QUIC extensions, emit traces per connection (#208)
* refactor: upgrade to latest n0-qlog

* feat: record path id

* feat: add qlog support for multipath frames

* support more frames and error codes

* feat: add support for quic-address-discovery and quic-ack-frequency extensions

* feat: support iroh's NAT traversal extension

* feat: emit TupleAssigned for new paths

* fixup

* chore: update to latest n0-qlog

* feat: emit TransportParameters

* chore: clippy

* deps: update to n0-qlog 0.1.0

* refactor: add qlog factory, move group_id to common_fields

* docs: improve

* chore: clippy

* fixup

* feat: add QlogFileFactory and util methods on TransportConfig

* feat: reexport from quinn

* chore: clippy

* feat: qlog timers

* add more timers

* docs: improve

* refactor: disable keep alive timers in qlog to reduce noise

* address review

* fix: downgrade logging

* cleanup

* fixup naming

---------

Co-authored-by: Friedel Ziegelmayer <me@dignifiedquire.com>
2025-12-06 10:07:30 +00:00
dignifiedquire c8a655c4b4 Merge remote-tracking branch 'upstream/main' into chore-merge-upstream 2025-12-01 14:08:32 +01:00
Diva M 1b79bec886 Merge commit '3194714f6fa1c78108b2a6353bd3e2af95ce1152' into multipath-quinn-0.11.x-b2b930a-merges 2025-09-30 09:58:30 -05:00
Phoenix Kahlo 1350132407 refactor: Pass ConnectionId by value
Breaking.
2025-09-06 20:08:59 +00:00
Dirkjan Ochtman 80b8ffdb4b Use newer rustls-pki-types PEM parser API 2025-09-02 17:46:40 +00:00
Dirkjan Ochtman e4f0550b29 perf: move main() above Cli 2025-08-31 17:48:31 +00:00
Damien Deville a9d4377db2 perf: add a feature to enable profiling with tokio-console 2025-08-28 08:15:31 +00:00
Dreamacro f5632ce2ee perf: move client and server on one binary 2025-08-26 05:36:31 +00:00
Dreamacro c7bdfa2b8f perf: add max udp payload size option 2025-08-25 02:36:16 +00:00
Damien Deville 8ba63e4d71 perf: allow setting send / receive connection or stream windows 2025-08-22 13:28:08 +00:00
Damien Deville 325b4e0e42 perf: support SI units for the various size parameters 2025-08-22 13:28:08 +00:00
Damien Deville 7d59865ffe perf: factorize init of tracing 2025-08-20 10:51:43 +00:00
Damien Deville 7825e9d39e perf: used buffered writer for qlog stream 2025-08-20 10:51:43 +00:00
Damien Deville 0c8b65fd42 perf: factorize socket binding 2025-08-20 10:51:43 +00:00
Damien Deville c5da14658a perf: factorize common options 2025-08-20 10:51:43 +00:00
Floris Bruynooghe 143eb1b815 Merge branch 'main' into multipath-quinn-0.11.x 2025-08-02 17:14:02 +02:00
Benjamin Saunders 1c6aecc683 Stabilize qlog feature 2025-07-22 00:53:03 +00:00
Benjamin Saunders 25b5dcd569 Configure qlog in TransportConfig 2025-07-22 00:53:03 +00:00
Fabien Savy 56b68df635 add qlog option to perf 2025-07-04 07:57:47 +00:00
Dirkjan Ochtman 8339ef3ccc Upgrade rcgen to 0.14 2025-07-02 19:27:49 +00:00
Damien Deville 62bc881b9a perf: leave async tasks early 2025-06-30 08:12:54 +00:00
Damien Deville a8eba3ada6 perf: allow selecting congestion algorithm 2025-06-30 08:12:54 +00:00
Damien Deville 1678ada26d perf: allow configuring ack frequency 2025-06-30 08:12:54 +00:00
Damien Deville abd1be051b perf: allow setting initial round trip time 2025-06-30 08:12:54 +00:00
Floris Bruynooghe deba4ee85f Merge branch 'main' into multipath-quinn-0.11.x 2025-04-10 12:36:01 +02:00
Lars Eggert 83b48b5b87 feat: Allow changing the UDP send/receive buffer sizes
Also includes getters for the current sizes and a test.
Bump version to 0.5.11.
2025-03-25 08:20:27 +00:00
Dirkjan Ochtman a8807131e4 Switch to 2024 style 2025-02-23 11:52:46 +00:00
Divma c04b6a9fbb take advantage of the fact that packet protection with and without multipath is equivalent for Path(0) (#39) 2025-01-27 11:56:27 -05:00
Divma af1b428d4e include path_id in packet protection (#36) 2025-01-24 11:29:06 -05:00
Dirkjan Ochtman 43b74b658b proto: replace hidden field with From impl 2024-12-20 19:34:28 +00:00
Lars Eggert f8b8c5032e chore: Fix cargo clippy issues 2024-11-18 23:31:18 +00:00
Benjamin Saunders b42e21e74d Make SendStream::finish synchronous
`await`ing on this was error-prone and not very useful, since it gave
little insight into application state, and was redundant to `stopped`.
2024-05-03 11:52:44 -07:00
gabrik ce13559778 proto: validate ServerConfig crypto provider
Signed-off-by: gabrik <gabriele.baldoni@gmail.com>
2024-04-22 09:45:53 +02:00
Dirkjan Ochtman e6d48970af proto: validate ClientConfig crypto provider
Co-authored-by: gabrik <gabriele.baldoni@gmail.com>
2024-04-22 09:45:53 +02:00
Dirkjan Ochtman 3be1ab5ab2 Upgrade to rcgen 0.13 2024-04-22 09:45:53 +02:00
Dirkjan Ochtman a85a4c12ee Update rustls to 0.23 and ring to 0.17 2024-04-22 09:45:53 +02:00
Dirkjan Ochtman f0d1a45639 perf: hoist config construction out of conditionals 2024-04-22 09:45:53 +02:00
Dirkjan Ochtman 85351bc399 proto: remove the Side argument from ServerConfig::initial_keys() 2024-04-22 09:45:53 +02:00
Damien Deville 90118e76b3 perf: change throughput units from MiB/s into Mb/s. 2024-04-18 19:26:36 +02:00
Phoenix Kahlo 54d5d60b42 Allow accept/refuse/retry before handshake begins
This commit removes use_retry from the server config and provides a
public API for the user to manually accept/refuse/retry incoming
connections before a handshake begins, and inspect properties such as
an incoming connection's remote address and whether that address is
validated when doing so.

In quinn-proto, Incoming is made public, as well as Endpoint's accept/
refuse/retry methods which operate on it. The
DatagramEvent::NewConnection event is modified to return an incoming
but not yet accepted connection.

In quinn, awaiting Endpoint::accept now yields a new
quinn::Incoming type, rather than quinn::Connecting. The new
quinn::Incoming type has all the methods its quinn_proto equivalent has,
as well as an accept method to (fallibly) transition it into a
Connecting, and also refuse, retry, and ignore methods.

Furthermore, quinn::Incoming implements IntoFuture with the output type
Result<Connection, ConnectionError>>, which is the same as the Future
output type of Connecting. This lets server code which was
straightforwardly awaiting the result of quinn::Endpoint::accept work
with little to no modification.

The test accept_after_close was removed because the functionality it
was testing for no longer exists.
2024-04-03 10:02:29 +02:00