Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bc823e3
rename PunchMe to ReachOut
divagant-martian Nov 4, 2025
7785350
use new codes for transport parameter and frames
divagant-martian Nov 4, 2025
d20cc0b
update frame fields
divagant-martian Nov 4, 2025
4422853
add the beginnings of nat traversal state
divagant-martian Nov 6, 2025
6a484f9
init state when the extension is negotiated
divagant-martian Nov 6, 2025
0bf8328
move the client side api away to deal with the error just once
divagant-martian Nov 6, 2025
e2b4f1c
handle removed and added frames
divagant-martian Nov 6, 2025
b77d066
make some types public
divagant-martian Nov 6, 2025
abd3079
move iroh_hp out of connection
divagant-martian Nov 6, 2025
12fe8a0
thread adding addresses
divagant-martian Nov 6, 2025
fd756af
thread removing addresses
divagant-martian Nov 6, 2025
c71a428
include adding and removing frames in retransmission data
divagant-martian Nov 6, 2025
0cce3f9
Send ADD_ADDRESS and REMOVE_ADDRESS frames
divagant-martian Nov 10, 2025
9dab34f
Add how to query the local nat traversal addresses.
divagant-martian Nov 10, 2025
38d73d0
Thread server updates about addresses
divagant-martian Nov 10, 2025
6dc2ba1
Boilerplate threading the nat traversal round call
divagant-martian Nov 10, 2025
5bc97ea
Remove the path_id from the ReachOut frame
divagant-martian Nov 11, 2025
eed7d68
add retransmission fields for reach out frames
divagant-martian Nov 13, 2025
ed1dfea
Send the reach out frames, probe server addresses
divagant-martian Nov 13, 2025
86aea3e
fix docs
divagant-martian Nov 13, 2025
b73cf6a
Send the reach out frames
divagant-martian Nov 13, 2025
d630190
Merge remote-tracking branch 'n0/main-iroh' into protocol-simplification
divagant-martian Nov 14, 2025
01b4fd3
add fields to queue pending server-side challenges
divagant-martian Nov 14, 2025
49b750d
Return the remotely advertised nat traversal addresses instead
divagant-martian Nov 17, 2025
366dec6
modify the meaning of the transport parameter
divagant-martian Nov 18, 2025
64ff191
Hook up id tryfrom
flub Nov 20, 2025
f71832f
Queue server challenges
divagant-martian Nov 20, 2025
4817d96
send rand data instead of path challenges
divagant-martian Nov 20, 2025
9188107
track sent reach outs in stats and sent frames
divagant-martian Nov 20, 2025
25b2063
track sent add and remove address in stats and sent frames
divagant-martian Nov 20, 2025
874be5e
Update `RttEstimator` from path challenge responses
matheus23 Nov 21, 2025
ee88899
Change APIs to set addresses
flub Nov 21, 2025
dcd7340
logging conventions
flub Nov 21, 2025
6a19cc7
write 8 bytes, not 0
flub Nov 21, 2025
079d83b
Update `RttEstimator` from path challenge responses
matheus23 Nov 21, 2025
bfb30e8
stop LossDetection timer when giving up on a path
flub Nov 21, 2025
dc40257
Write `path_challenge_retransmit` test
matheus23 Nov 22, 2025
2e13da6
use canonical and ipv4-mapped ipv6 addresses when needed
flub Nov 22, 2025
e317298
stop all path timers when all path data is dropped
flub Nov 22, 2025
334ab73
Introduce `PathData::is_validating_path` and fix send logic
matheus23 Nov 22, 2025
61c87ab
refactor: use constants for error codes
dignifiedquire Nov 22, 2025
4da495f
Write `path_challenge_retransmit` test
matheus23 Nov 22, 2025
fe22a2b
Introduce `PathData::is_validating_path` and fix send logic
matheus23 Nov 22, 2025
07257da
Make sure to send a path challenge on the previous path, actually
matheus23 Nov 22, 2025
7a094bd
fix panic
divagant-martian Nov 23, 2025
b13b011
Write failing tests
matheus23 Nov 23, 2025
f8da305
Add a `PathChallengeLost` path timer for resending path challenges
matheus23 Nov 23, 2025
8fc082b
Less brittle logic to decide whether to send PATH_CHALLENGE
matheus23 Nov 23, 2025
45352a3
Merge remote-tracking branch 'origin/protocol-simplification' into ma…
matheus23 Nov 23, 2025
9f60bb7
Fix merge
matheus23 Nov 23, 2025
1fdbf69
feat(quinn-proto): Use RTT from path challenges, implement path chall…
matheus23 Nov 23, 2025
e58b807
fix not closing last path
flub Nov 23, 2025
02fd7ee
improve logging by adding spans
flub Nov 23, 2025
44ccd2f
Write failing test case
matheus23 Nov 26, 2025
b0e69b5
Fix: Use the local max path ID instead of `Connection::max_path_id` i…
matheus23 Nov 26, 2025
5bd31b7
fix: Accept or reject incoming frames based on `self.local_max_path_i…
matheus23 Nov 27, 2025
b0c0108
Fix docs and clippy
flub Nov 27, 2025
7854c50
chore: fix wasm builds (#186)
dignifiedquire Nov 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 42 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 19 additions & 22 deletions quinn-proto/src/config/transport.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use std::{fmt, num::NonZeroU32, sync::Arc};
use std::{
fmt,
num::{NonZeroU8, NonZeroU32},
sync::Arc,
};
#[cfg(feature = "qlog")]
use std::{io, sync::Mutex, time::Instant};

Expand All @@ -15,7 +19,7 @@ use crate::{
/// When multipath is required and has not been explicitly enabled, this value will be used for
/// [`TransportConfig::max_concurrent_multipath_paths`].
const DEFAULT_CONCURRENT_MULTIPATH_PATHS_WHEN_ENABLED_: NonZeroU32 = {
match NonZeroU32::new(4) {
match NonZeroU32::new(12) {
Some(v) => v,
None => panic!("to enable multipath this must be positive, which clearly it is"),
}
Expand Down Expand Up @@ -78,7 +82,7 @@ pub struct TransportConfig {
pub(crate) default_path_max_idle_timeout: Option<Duration>,
pub(crate) default_path_keep_alive_interval: Option<Duration>,

pub(crate) nat_traversal_concurrency_limit: Option<NonZeroU32>,
pub(crate) max_remote_nat_traversal_addresses: Option<NonZeroU8>,

pub(crate) qlog_sink: QlogSink,
}
Expand Down Expand Up @@ -443,33 +447,26 @@ impl TransportConfig {
.map(Into::into)
}

/// Sets the maximum number of concurrent nat traversal attempts to initiate as a client, or to
/// allow as a server.
/// Sets the maximum number of nat traversal addresses this endpoint allows the remote to
/// advertise
///
/// Setting this to any nonzero value will enable the Nat Traversal Extension for QUIC,
/// see <https://www.ietf.org/archive/id/draft-seemann-quic-nat-traversal-02.html>
/// Setting this to any nonzero value will enable Iroh's holepunching, losely based in the Nat
/// Traversal Extension for QUIC, see
/// <https://www.ietf.org/archive/id/draft-seemann-quic-nat-traversal-02.html>
///
/// This implementation expects the multipath extension to be enabled as well. if not yet
/// enabled via [`Self::max_concurrent_multipath_paths`], a default value of
/// [`DEFAULT_CONCURRENT_MULTIPATH_PATHS_WHEN_ENABLED`] will be used.
pub fn set_max_nat_traversal_concurrent_attempts(&mut self, max_concurrent: u32) -> &mut Self {
self.nat_traversal_concurrency_limit = NonZeroU32::new(max_concurrent);
if max_concurrent != 0 && self.max_concurrent_multipath_paths.is_none() {
pub fn set_max_remote_nat_traversal_addresses(&mut self, max_addresses: u8) -> &mut Self {
self.max_remote_nat_traversal_addresses = NonZeroU8::new(max_addresses);
if max_addresses != 0 && self.max_concurrent_multipath_paths.is_none() {
self.max_concurrent_multipath_paths(
DEFAULT_CONCURRENT_MULTIPATH_PATHS_WHEN_ENABLED_.get(),
);
}
self
}

/// Gets the maximum number of concurrent attempts for nat traversal
///
/// If this is `Some`, the value is guaranteed to be non zero.
pub fn get_nat_traversal_concurrency_limit(&self) -> Option<VarInt> {
self.nat_traversal_concurrency_limit
.map(|non_zero| VarInt::from_u32(non_zero.get()))
}

/// qlog capture configuration to use for a particular connection
#[cfg(feature = "qlog")]
pub fn qlog_stream(&mut self, stream: Option<QlogStream>) -> &mut Self {
Expand Down Expand Up @@ -526,7 +523,7 @@ impl Default for TransportConfig {
default_path_keep_alive_interval: None,

// nat traversal disabled by default
nat_traversal_concurrency_limit: None,
max_remote_nat_traversal_addresses: None,

qlog_sink: QlogSink::default(),
}
Expand Down Expand Up @@ -565,7 +562,7 @@ impl fmt::Debug for TransportConfig {
max_concurrent_multipath_paths,
default_path_max_idle_timeout,
default_path_keep_alive_interval,
nat_traversal_concurrency_limit,
max_remote_nat_traversal_addresses,
qlog_sink,
} = self;
let mut s = fmt.debug_struct("TransportConfig");
Expand Down Expand Up @@ -610,8 +607,8 @@ impl fmt::Debug for TransportConfig {
default_path_keep_alive_interval,
)
.field(
"nat_traversal_concurrency_limit",
nat_traversal_concurrency_limit,
"max_remote_nat_traversal_addresses",
max_remote_nat_traversal_addresses,
);
if cfg!(feature = "qlog") {
s.field("qlog_stream", &qlog_sink.is_enabled());
Expand Down
Loading
Loading