Skip to content
Merged

SCONE #2814

Show file tree
Hide file tree
Changes from 64 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
88a70b9
Ignore all SCONE packets
martinthomson Jul 30, 2025
adf34f4
SCONE transport parameter
martinthomson Jul 30, 2025
180fa17
Add SCONE indication
martinthomson Jul 30, 2025
9abae10
Log SCONE value
martinthomson Jul 30, 2025
051b44f
Add a connection-level test for SCONE
martinthomson Jul 30, 2025
340cab1
Clippy, review comments
martinthomson Jul 30, 2025
61606a8
Reduce log level for packet drops
martinthomson Jul 30, 2025
14a6922
Conditionally error on other version packets
martinthomson Jul 30, 2025
45866a0
Merge branch 'main' into scone
larseggert Aug 4, 2025
504465c
Add a further test for Initial before docking two bytes
martinthomson Aug 18, 2025
3c0924b
Fix the indication reservation and test it
martinthomson Aug 19, 2025
8248f31
chore(.github/check.yaml): remove obsolete run_benchmarks input (#2826)
mxinden Aug 5, 2025
7d1e8e1
ci: Create cache on `merge_group` trigger (#2824)
larseggert Aug 5, 2025
5e3698b
refactor(http3): improve `FrameReader` `Debug` implementation (#2815)
mxinden Aug 6, 2025
4f2be30
chore(clippy): remove expect for needless_match (#2835)
mxinden Aug 8, 2025
f46cbe8
chore(clippy): update to latest lints (#2837)
mxinden Aug 8, 2025
beb8474
ci: Disable systemd unified cgroups on GCP (#2803)
larseggert Aug 8, 2025
eea59c8
build(deps): bump github/codeql-action from 3.29.7 to 3.29.8 (#2845)
dependabot[bot] Aug 11, 2025
7fe5139
build(deps): bump actions/cache from 4.2.3 to 4.2.4 (#2844)
dependabot[bot] Aug 11, 2025
bdb4655
build(deps): bump docker/login-action from 3.4.0 to 3.5.0 (#2846)
dependabot[bot] Aug 11, 2025
cbd333b
build(deps): bump actions/download-artifact from 4.3.0 to 5.0.0 (#2841)
dependabot[bot] Aug 11, 2025
96733d7
ci: Use an older kernel with `cpuset` support for benchers (#2840)
larseggert Aug 11, 2025
88f45d3
fix(transport/frame): prevent potential overflow in padding decode (#…
mxinden Aug 11, 2025
d36d80f
docs(transport/datagrams): remove outdated fn return docs (#2842)
mxinden Aug 11, 2025
c75f260
refactor(crypto): improve `ResumptionToken` `Debug` impl (#2847)
mxinden Aug 12, 2025
3cf3f20
docs(transport): extend preprocess_packet docs on State::Closing (#2848)
mxinden Aug 12, 2025
fac12b9
ci: Use 6.11 kernel on GCP (#2849)
larseggert Aug 12, 2025
2e0fb5b
ci: Use implicit `$HOME` home directory (#2850)
larseggert Aug 12, 2025
ca891d4
feat: Optimize `neqo-qpack` (#2831)
larseggert Aug 12, 2025
8aaff0d
fix(http3): reduce visibility of internal functions (#2802)
mxinden Aug 13, 2025
03635cb
refactor: unify most exchange_packets impls (#2851)
mxinden Aug 14, 2025
2b03734
Make initial RTT configurable (#2825)
aochagavia Aug 14, 2025
6de0cbc
fix(bin): replace buggy `to_headers` with `FromStr` `impl` (#2833)
mxinden Aug 14, 2025
f44bf2a
refactor(webtransport): rename WebTransportEvent::Session to NewSessi…
mxinden Aug 15, 2025
802539a
ci: No `mold` (#2857)
larseggert Aug 15, 2025
288654a
docs(http3): remove partially outdated docs (#2859)
mxinden Aug 15, 2025
f91d30a
chore: Bump `sfv` to 0.14 (#2856)
larseggert Aug 18, 2025
9897a61
Make the drop_handshake_packet_from_wrong_address robust (#2862)
martinthomson Aug 18, 2025
54e4f41
Make discarded_initial_keys more robust (#2864)
martinthomson Aug 18, 2025
c40be86
Improve resending of Initial on undecryptable (#2866)
martinthomson Aug 18, 2025
a2fad09
compatible_upgrade_large_initial robustness (#2863)
martinthomson Aug 18, 2025
816123e
Move connection parameter defaults to the type (#2869)
martinthomson Aug 18, 2025
1957111
Move test_frame_writer use (#2870)
martinthomson Aug 18, 2025
70b354a
Improve the ALPN handling (#2871)
martinthomson Aug 18, 2025
29f90e2
Make only_server_initial more robust (#2865)
martinthomson Aug 18, 2025
0612eb7
coalesce_05rtt robustness improvements (#2867)
martinthomson Aug 18, 2025
dd2dc28
A bunch of logging improvements (#2874)
martinthomson Aug 18, 2025
0c54805
Completely rewrite dup_server_flight1 (#2868)
martinthomson Aug 18, 2025
9381d2c
Force coverage up by simplifying a test (#2872)
martinthomson Aug 18, 2025
a12844d
Fix packet_with_only_padding test (#2873)
martinthomson Aug 18, 2025
a5731cb
PTO across packet number spaces better (#2878)
martinthomson Aug 19, 2025
83ea414
fix: Don't call `finish` in `std::hash::Hash` implementations (#2881)
larseggert Aug 20, 2025
de8a0d5
refactor(bin/server): simplify run() removing need for HttpServer::ne…
mxinden Aug 20, 2025
308cd48
Fix compatible upgrade (#2877)
martinthomson Aug 20, 2025
04372c8
Address test changes (more padding now means rearrangement of handshake)
martinthomson Aug 21, 2025
ed63dbe
Merge branch 'main' into scone
martinthomson Aug 21, 2025
f19e25e
Merge branch 'main' into scone
martinthomson Nov 1, 2025
8cab793
More tests with less flake
martinthomson Nov 1, 2025
d2bda88
Moar robust testing
martinthomson Nov 1, 2025
e054658
Finalize fixes for more tests
martinthomson Nov 2, 2025
7633496
dafmt
martinthomson Nov 2, 2025
8825e39
Clippy
martinthomson Nov 2, 2025
5cae4b1
Merge branch 'main' into scone
martinthomson Mar 12, 2026
31da46b
Merge branch 'main' into scone
martinthomson Mar 12, 2026
7d92ee3
Fix some comments
martinthomson Mar 13, 2026
07e4f68
Merge branch 'main' into scone
martinthomson Mar 13, 2026
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
76 changes: 54 additions & 22 deletions neqo-transport/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ impl Connection {
/// A long default for timer resolution, so that we don't tax the
/// system too hard when we don't need to.
const LOOSE_TIMER_RESOLUTION: Duration = Duration::from_millis(50);
/// The SCONE indicator.
const SCONE_INDICATION: &[u8] = &[0xc8, 0x13];
Comment thread
martinthomson marked this conversation as resolved.
Resolved

/// Create a new QUIC connection with Client role.
/// # Errors
Expand Down Expand Up @@ -2668,15 +2670,6 @@ impl Connection {
let profile = self.loss_recovery.send_profile(&path.borrow(), now);
qdebug!("[{self}] output_dgram_on_path send_profile {profile:?}");

// Determine the size limit and padding for this UDP datagram.
let limit = if path.borrow().pmtud().needs_probe() {
needs_padding = true;
debug_assert!(path.borrow().pmtud().probe_size() >= profile.limit());
path.borrow().pmtud().probe_size()
} else {
profile.limit()
};

// Frames for different epochs must go in different packets, but then these
// packets can go in a single datagram
for space in PacketNumberSpace::iter() {
Expand All @@ -2689,6 +2682,25 @@ impl Connection {

let header_start = encoder.len();

// Configure the limits and padding for this packet.
let limit = if path.borrow().pmtud().needs_probe() {
needs_padding = true;
debug_assert!(path.borrow().pmtud().probe_size() >= profile.limit());
path.borrow().pmtud().probe_size()
} else {
profile.limit()
- if space == PacketNumberSpace::Initial {
// Reserve some space for the SCONE indication in an Initial.
// This reduces the amount available for building the packet,
// but we'll pad to `profile.limit()` when padding.
// This will not reserve space for the indication if packets
// are coalesced (with Handshake or 0-RTT). That's too bad.
Self::SCONE_INDICATION.len()
Comment thread
martinthomson marked this conversation as resolved.
Resolved
} else {
0
}
} - aead_expansion;

let (pt, mut builder, pn) = Self::build_packet_header(
&path.borrow(),
epoch,
Expand All @@ -2697,9 +2709,7 @@ impl Connection {
&self.address_validation,
version,
grease_quic_bit,
// Limit the packet builder further to leave space for AEAD
// expansion added in `builder.build` below.
limit - aead_expansion,
limit,
self.loss_recovery.largest_acknowledged_pn(space),
);
// The builder will set the limit to 0 if there isn't enough space for the header.
Expand Down Expand Up @@ -2819,16 +2829,8 @@ impl Connection {
} else {
// Perform additional padding for Initial packets as necessary.
if let Some(mut initial) = initial_sent.take() {
if needs_padding && encoder.len() < profile.limit() {
qdebug!(
"[{self}] pad Initial from {} to PLPMTU {}",
encoder.len(),
profile.limit()
);
initial.track_padding(profile.limit() - encoder.len());
// These zeros aren't padding frames, they are an invalid all-zero coalesced
// packet, which is why we don't increase `frame_tx.padding` count here.
encoder.pad_to(profile.limit(), 0);
if needs_padding {
self.pad_initial(&mut encoder, &mut initial, &profile);
}
self.loss_recovery.on_packet_sent(path, initial, now);
}
Expand All @@ -2837,6 +2839,36 @@ impl Connection {
}
}

fn pad_initial(
&self,
encoder: &mut Encoder<&mut Vec<u8>>,
initial: &mut sent::Packet,
profile: &SendProfile,
) {
if encoder.len() >= profile.limit() {
return;
}

qdebug!(
"[{self}] pad Initial from {} to {}",
encoder.len(),
profile.limit()
);
let pad_amount = profile.limit() - encoder.len();
initial.track_padding(pad_amount);
// This ensures that the last bytes are a SCONE indication, if there is enough space.
// This is not tracked, other than for congestion control (above)
if pad_amount >= Self::SCONE_INDICATION.len() {
encoder.pad_to(
profile.limit() - Self::SCONE_INDICATION.len() + 1,
Self::SCONE_INDICATION[0],
Comment thread
martinthomson marked this conversation as resolved.
Resolved
);
encoder.encode(&Self::SCONE_INDICATION[1..]);
Comment thread
martinthomson marked this conversation as resolved.
Resolved
} else {
encoder.pad_to(profile.limit(), Self::SCONE_INDICATION[0]);
}
}

/// # Errors
/// When connection state is not valid.
pub fn initiate_key_update(&mut self) -> Res<()> {
Expand Down
9 changes: 5 additions & 4 deletions neqo-transport/src/connection/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ use crate::{
tparams::{
PreferredAddress, TransportParameter,
TransportParameterId::{
self, ActiveConnectionIdLimit, DisableMigration, GreaseQuicBit, InitialMaxData,
ActiveConnectionIdLimit, DisableMigration, GreaseQuicBit, IdleTimeout, InitialMaxData,
InitialMaxStreamDataBidiLocal, InitialMaxStreamDataBidiRemote, InitialMaxStreamDataUni,
InitialMaxStreamsBidi, InitialMaxStreamsUni, MaxAckDelay, MaxDatagramFrameSize,
MinAckDelay,
MinAckDelay, PreferredAddress as PreferredAddressTp, Scone,
},
TransportParametersHandler,
},
Expand Down Expand Up @@ -509,6 +509,7 @@ impl ConnectionParameters {
if self.grease {
tps.local_mut().set_empty(GreaseQuicBit);
}
tps.local_mut().set_empty(Scone);
tps.local_mut().set_integer(
MaxAckDelay,
u64::try_from(DEFAULT_LOCAL_ACK_DELAY.as_millis())?,
Expand All @@ -533,15 +534,15 @@ impl ConnectionParameters {
tps.local_mut()
.set_integer(InitialMaxStreamsUni, self.max_streams_uni);
tps.local_mut().set_integer(
TransportParameterId::IdleTimeout,
IdleTimeout,
Comment thread
larseggert marked this conversation as resolved.
Resolved
u64::try_from(self.idle_timeout.as_millis()).unwrap_or(0),
);
if let PreferredAddressConfig::Address(preferred) = &self.preferred_address
&& role == Role::Server
{
let (cid, srt) = cid_manager.preferred_address_cid()?;
tps.local_mut().set(
TransportParameterId::PreferredAddress,
PreferredAddressTp,
TransportParameter::PreferredAddress {
v4: preferred.ipv4(),
v6: preferred.ipv6(),
Expand Down
Loading
Loading