diff --git a/quest/m1/README.md b/quest/m1/README.md index 7cb047d9dcb..a208f0190fa 100644 --- a/quest/m1/README.md +++ b/quest/m1/README.md @@ -185,7 +185,6 @@ per-frame CPU growth since #5926. - [Poll-first async](/quest/m1/poll-first/README.md) - library crates compile no coroutines by default: async wrappers are generated from `poll_*` and gated behind an `async` feature - [Authored tracks default to a 30 s max-age](/quest/m1/max-age-defaults.md) - raw and media tracks advertise 30 s unless their author chooses otherwise, with explicit unlimited in every binding - [HLS export lists a same-codec reconfigure's first group under the new init](/quest/m1/hls-reinit-same-codec.md) - the hand-over pick, whichever of the catalog and the records arrives first, after the catalog `hls` removal is planned -- [moq-quic deletes its remaining 0-RTT code](/quest/m1/quic-zero-rtt-leftovers.md) - only the code that drops a 0-RTT packet remains, with a test - [Gate the no-em-dash rule](/quest/m1/em-dash-gate.md) - `just check` fails on an em dash in any tracked text file - [The resume model passes its long run again](/quest/m1/resume-model-7542.md) - fix #7542's regression that drops groups a long-budget reader can still get - [A resume more than one group behind never hangs](/quest/m1/ietf-resume-behind.md) - a resumed read gets every group or a drop on every wire version diff --git a/quest/m1/quic-zero-rtt-leftovers.md b/quest/m1/quic-zero-rtt-leftovers.md deleted file mode 100644 index 0cca73b79fa..00000000000 --- a/quest/m1/quic-zero-rtt-leftovers.md +++ /dev/null @@ -1,20 +0,0 @@ -# [XS] moq-quic deletes its remaining 0-RTT code - -## Goal - -moq-quic has no 0-RTT code left beyond what it needs to recognize and drop a 0-RTT packet: no Data-space mapping for 0-RTT, no early-data guards or tests, and a test proving a peer's 0-RTT packets are dropped unprocessed. - -## Plan - -The maintainer deleted 0-RTT entirely (see [quic-api](/quest/m1/quic-api/README.md)): MoQ needs the finished handshake for CONNECT and authorization. [moq-dev/moq#6837](https://github.com/moq-dev/moq/pull/6837) already drops 0-RTT before decryption (`rs/moq-quic/src/endpoint.rs:215-227`, `rs/moq-quic/src/connection/packet_crypto.rs:16-19`), so the "ACK in 0-RTT" report on [moq-dev/moq#7334](https://github.com/moq-dev/moq/pull/7334) isn't reachable on main. - -Decided 2026-10-30 (maintainer, follow-up planning after the /quest-afk run): a standalone m1 cleanup. Remove what's left: - -- `PartialDecode::space()` and `Header::space()` mapping 0-RTT to the Data space, and `is_0rtt()` (`rs/moq-quic/src/packet.rs:82-95`, `:391-393`), keeping only the `LongType::ZeroRtt` decode needed to skip the packet. -- The no-op `LongType::ZeroRtt` arm in `rs/moq-quic/src/connection/mod.rs:2812-2814`. -- The rustls early-data guards and their test (`rs/moq-quic/src/crypto/rustls.rs:295-296, 355-356, 420-421, 458-459, 605-681`) if rustls's defaults already leave early data off; otherwise keep the guard and its test. -- The characterize test `early_packets_leave_handshake_and_application_data_usable` (`rs/moq-quic/src/tests/characterize/frames.rs:38-110`) becomes a test that a 0-RTT packet, ACK included, is dropped; fix the comment at `rs/moq-uring/tests/integration/endpoint.rs:290`. - -`process_early_payload` handles Initial and Handshake packets, not 0-RTT; leave it. - -Public API: none. Wire: none. diff --git a/quest/m2/quic-long-type.md b/quest/m2/quic-long-type.md index 6d71e79b8bf..4c3bbd00865 100644 --- a/quest/m2/quic-long-type.md +++ b/quest/m2/quic-long-type.md @@ -11,8 +11,3 @@ goes with it. Planned 2026-11-01 (maintainer, follow-up planning after the 2026-11-01 /quest-complete run). A mechanical change in `rs/moq-quic/src/packet.rs`. Keep the packet fuzz target and its regression seeds passing. -On main, `LongType` still has `ZeroRtt` until #7492 lands. - -## Required - -- [moq-quic deletes its remaining 0-RTT code](/quest/m1/quic-zero-rtt-leftovers.md) - moves 0-RTT out of `LongType`, in [moq-dev/moq#7492](https://github.com/moq-dev/moq/pull/7492) diff --git a/rs/moq-quic/src/connection/mod.rs b/rs/moq-quic/src/connection/mod.rs index 14e2de86860..a9c224466a6 100644 --- a/rs/moq-quic/src/connection/mod.rs +++ b/rs/moq-quic/src/connection/mod.rs @@ -2998,9 +2998,6 @@ impl Connection { } Ok(()) } - Header::Long { - ty: LongType::ZeroRtt, .. - } => Ok(()), Header::VersionNegotiate { .. } => { // RFC 9000 6.2: discard once any other packet was processed if processed_server_packet { diff --git a/rs/moq-quic/src/connection/packet_crypto.rs b/rs/moq-quic/src/connection/packet_crypto.rs index a11c0bd5d25..9cfd9a4b76d 100644 --- a/rs/moq-quic/src/connection/packet_crypto.rs +++ b/rs/moq-quic/src/connection/packet_crypto.rs @@ -13,10 +13,6 @@ pub(super) fn unprotect_header( spaces: &[PacketSpace; 3], stateless_reset_token: Option, ) -> Option { - if partial_decode.is_0rtt() { - trace!("discarding early data"); - return None; - } let header_crypto = if let Some(space) = partial_decode.space() { if let Some(crypto) = &spaces[space].crypto { Some(&*crypto.header.remote) diff --git a/rs/moq-quic/src/endpoint.rs b/rs/moq-quic/src/endpoint.rs index c5d49503637..bb77d8a1f1c 100644 --- a/rs/moq-quic/src/endpoint.rs +++ b/rs/moq-quic/src/endpoint.rs @@ -155,7 +155,7 @@ impl Endpoint { } = received; // Partially decode packet or short-circuit if unable let datagram_len = data.len(); - let mut event = match PartialDecode::new( + let event = match PartialDecode::new( data, &FixedLengthConnectionIdParser::new(self.local_cid_generator.cid_len()), self.config.grease_quic_bit, @@ -214,20 +214,6 @@ impl Endpoint { } }; - // Drop leading early packets before routing or buffering, preserving a coalesced - // handshake packet after them. - while event.first_decode.is_0rtt() { - let data = event.remaining.take()?; - let (first_decode, remaining) = PartialDecode::new( - data, - &FixedLengthConnectionIdParser::new(self.local_cid_generator.cid_len()), - self.config.grease_quic_bit, - ) - .ok()?; - event.first_decode = first_decode; - event.remaining = remaining; - } - let addresses = FourTuple { remote, local_ip }; let dst_cid = event.first_decode.dst_cid(); diff --git a/rs/moq-quic/src/fuzz.rs b/rs/moq-quic/src/fuzz.rs index 08e35446261..0cd4cc46b05 100644 --- a/rs/moq-quic/src/fuzz.rs +++ b/rs/moq-quic/src/fuzz.rs @@ -52,7 +52,8 @@ pub const TARGETS: &[(&str, Target)] = &[ /// A cid length byte, a grease byte, and a datagram: the unprotected packet header. /// -/// A decoded packet and the coalesced remainder together account for every input byte. +/// The decoded packet is the bytes just before the coalesced remainder, and any bytes before +/// it start with a 0-RTT packet, which the decode skips. pub fn packet(data: &[u8]) -> bool { let [cid_len, grease, packet @ ..] = data else { return false; @@ -68,8 +69,14 @@ pub fn packet(data: &[u8]) -> bool { return false; }; - let rest = rest.map_or(0, |rest| rest.len()); - assert_eq!(len, decoded.len() + rest, "the decode lost bytes"); + let end = len - rest.map_or(0, |rest| rest.len()); + let skipped = end.checked_sub(decoded.len()).expect("the decode invented bytes"); + assert_eq!(decoded.data(), &packet[skipped..end], "the decode moved bytes"); + // A long header (0x80) with the 0-RTT type (0x10 of the type bits 0x30) + assert!( + skipped == 0 || packet[0] & 0xb0 == 0x90, + "the decode skipped a packet that is not 0-RTT" + ); true } diff --git a/rs/moq-quic/src/packet.rs b/rs/moq-quic/src/packet.rs index 91f01cd60ff..97e7b83d07a 100644 --- a/rs/moq-quic/src/packet.rs +++ b/rs/moq-quic/src/packet.rs @@ -30,27 +30,41 @@ pub struct PartialDecode { impl PartialDecode { /// Begin decoding a QUIC packet from `bytes`, returning any trailing data not part of that packet + /// + /// 0-RTT packets are skipped unread, so the packet decoded is the first one after them. A + /// datagram holding nothing but 0-RTT packets is [`PacketDecodeError::ZeroRtt`]. pub fn new( - bytes: BytesMut, + mut bytes: BytesMut, cid_parser: &(impl ConnectionIdParser + ?Sized), grease_quic_bit: bool, ) -> Result<(Self, Option), PacketDecodeError> { - let mut buf = io::Cursor::new(bytes); - let plain_header = ProtectedHeader::decode(&mut buf, cid_parser, grease_quic_bit)?; - let dgram_len = buf.get_ref().len(); - let packet_len = plain_header - .payload_len() - .map(|len| (buf.position() + len) as usize) - .unwrap_or(dgram_len); - match dgram_len.cmp(&packet_len) { - Ordering::Equal => Ok((Self { plain_header, buf }, None)), - Ordering::Less => Err(PacketDecodeError::InvalidHeader( - "packet too short to contain payload length", - )), - Ordering::Greater => { - let rest = Some(buf.get_mut().split_off(packet_len)); - Ok((Self { plain_header, buf }, rest)) - } + loop { + let mut buf = io::Cursor::new(bytes); + let Some(plain_header) = ProtectedHeader::decode(&mut buf, cid_parser, grease_quic_bit)? else { + // `decode` consumed the whole 0-RTT packet; decode the one coalesced after it. + let skipped = buf.position() as usize; + bytes = buf.into_inner(); + bytes.advance(skipped); + if bytes.is_empty() { + return Err(PacketDecodeError::ZeroRtt); + } + continue; + }; + let dgram_len = buf.get_ref().len(); + let packet_len = plain_header + .payload_len() + .map(|len| (buf.position() + len) as usize) + .unwrap_or(dgram_len); + return match dgram_len.cmp(&packet_len) { + Ordering::Equal => Ok((Self { plain_header, buf }, None)), + Ordering::Less => Err(PacketDecodeError::InvalidHeader( + "packet too short to contain payload length", + )), + Ordering::Greater => { + let rest = Some(buf.get_mut().split_off(packet_len)); + Ok((Self { plain_header, buf }, rest)) + } + }; } } @@ -71,6 +85,7 @@ impl PartialDecode { self.space() == Some(SpaceId::Initial) } + /// The space whose keys protect this packet, or `None` for an unprotected packet pub(crate) fn space(&self) -> Option { use ProtectedHeader::*; match self.plain_header { @@ -79,21 +94,11 @@ impl PartialDecode { ty: LongType::Handshake, .. } => Some(SpaceId::Handshake), - Long { - ty: LongType::ZeroRtt, .. - } => Some(SpaceId::Data), Short { .. } => Some(SpaceId::Data), _ => None, } } - pub(crate) fn is_0rtt(&self) -> bool { - match self.plain_header { - ProtectedHeader::Long { ty, .. } => ty == LongType::ZeroRtt, - _ => false, - } - } - /// The destination connection ID of the packet pub fn dst_cid(&self) -> ConnectionId { self.plain_header.dst_cid() @@ -388,9 +393,6 @@ impl Header { use Header::*; match *self { Short { .. } => SpaceId::Data, - Long { - ty: LongType::ZeroRtt, .. - } => SpaceId::Data, Long { ty: LongType::Handshake, .. @@ -548,11 +550,13 @@ impl ProtectedHeader { } /// Decode a plain header from given buffer, with given [`ConnectionIdParser`]. + /// + /// A 0-RTT packet is `None`, with `buf` advanced past its payload: it is dropped unread. pub fn decode( buf: &mut io::Cursor>, cid_parser: &(impl ConnectionIdParser + ?Sized), grease_quic_bit: bool, - ) -> Result { + ) -> Result, PacketDecodeError> { let first = buf.get::()?; if !grease_quic_bit && first & FIXED_BIT == 0 { return Err(PacketDecodeError::InvalidHeader("fixed bit unset")); @@ -560,10 +564,10 @@ impl ProtectedHeader { if first & LONG_HEADER_FORM == 0 { let spin = first & SPIN_BIT != 0; - Ok(Self::Short { + Ok(Some(Self::Short { spin, dst_cid: cid_parser.parse(buf)?, - }) + })) } else { let version = buf.get::()?; @@ -573,11 +577,11 @@ impl ProtectedHeader { // TODO: Support long CIDs for compatibility with future QUIC versions if version == 0 { let random = first & !LONG_HEADER_FORM; - return Ok(Self::VersionNegotiate { + return Ok(Some(Self::VersionNegotiate { random, dst_cid, src_cid, - }); + })); } if crate::Version::from_wire(version).is_none() { @@ -588,7 +592,7 @@ impl ProtectedHeader { }); } - match LongHeaderType::from_byte(first)? { + Ok(Some(match LongHeaderType::from_byte(first)? { LongHeaderType::Initial => { let token_len = buf.get_var()? as usize; let token_start = buf.position() as usize; @@ -598,27 +602,37 @@ impl ProtectedHeader { buf.advance(token_len); let len = buf.get_var()?; - Ok(Self::Initial(ProtectedInitialHeader { + Self::Initial(ProtectedInitialHeader { dst_cid, src_cid, token_pos: token_start..token_start + token_len, len, version, - })) + }) } - LongHeaderType::Retry => Ok(Self::Retry { + LongHeaderType::Retry => Self::Retry { dst_cid, src_cid, version, - }), - LongHeaderType::Standard(ty) => Ok(Self::Long { + }, + LongHeaderType::ZeroRtt => { + let len = buf.get_var()?; + if len > buf.remaining() as u64 { + return Err(PacketDecodeError::InvalidHeader( + "packet too short to contain payload length", + )); + } + buf.advance(len as usize); + return Ok(None); + } + LongHeaderType::Standard(ty) => Self::Long { ty, dst_cid, src_cid, len: buf.get_var()?, version, - }), - } + }, + })) } } } @@ -781,6 +795,8 @@ pub trait ConnectionIdParser { pub(crate) enum LongHeaderType { Initial, Retry, + /// Dropped as it is decoded, so no decoded header holds one + ZeroRtt, Standard(LongType), } @@ -790,7 +806,7 @@ impl LongHeaderType { debug_assert!(b & LONG_HEADER_FORM != 0, "not a long packet"); Ok(match (b & 0x30) >> 4 { 0x0 => Initial, - 0x1 => Standard(ZeroRtt), + 0x1 => ZeroRtt, 0x2 => Standard(Handshake), 0x3 => Retry, _ => unreachable!(), @@ -803,7 +819,7 @@ impl From for u8 { use {LongHeaderType::*, LongType::*}; match ty { Initial => LONG_HEADER_FORM | FIXED_BIT, - Standard(ZeroRtt) => LONG_HEADER_FORM | FIXED_BIT | (0x1 << 4), + ZeroRtt => LONG_HEADER_FORM | FIXED_BIT | (0x1 << 4), Standard(Handshake) => LONG_HEADER_FORM | FIXED_BIT | (0x2 << 4), Retry => LONG_HEADER_FORM | FIXED_BIT | (0x3 << 4), } @@ -815,8 +831,6 @@ impl From for u8 { pub enum LongType { /// Handshake packet Handshake, - /// 0-RTT packet - ZeroRtt, } /// Packet decode error @@ -835,6 +849,9 @@ pub enum PacketDecodeError { /// The packet header is invalid #[error("invalid header: {0}")] InvalidHeader(&'static str), + /// The datagram held only 0-RTT packets, which are dropped unread + #[error("only 0-RTT packets, which are dropped")] + ZeroRtt, } impl From for PacketDecodeError { @@ -898,6 +915,47 @@ mod tests { check_pn(PacketNumber::new(0x10000, 0), &hex!("010000")); } + /// A 0-RTT packet with a two-byte payload, version 1, and empty connection IDs + const ZERO_RTT: [u8; 10] = hex!("d0 00000001 00 00 02 aabb"); + const HANDSHAKE: [u8; 10] = hex!("e0 00000001 00 00 02 ccdd"); + const SHORT: [u8; 3] = hex!("40 0102"); + + fn decode(bytes: &[u8]) -> Result<(PartialDecode, Option), PacketDecodeError> { + PartialDecode::new(bytes.into(), &FixedLengthConnectionIdParser::new(0), false) + } + + #[test] + fn zero_rtt_alone_is_dropped() { + assert_eq!(decode(&ZERO_RTT).unwrap_err(), PacketDecodeError::ZeroRtt); + assert_eq!( + decode(&[ZERO_RTT, ZERO_RTT].concat()).unwrap_err(), + PacketDecodeError::ZeroRtt + ); + // A 0-RTT packet longer than the datagram is malformed, not skipped. + assert!(matches!( + decode(&ZERO_RTT[..9]).unwrap_err(), + PacketDecodeError::InvalidHeader(_) + )); + } + + #[test] + fn zero_rtt_coalesced_is_skipped() { + let datagram = [&ZERO_RTT[..], &HANDSHAKE, &ZERO_RTT, &ZERO_RTT, &SHORT].concat(); + let (handshake, rest) = decode(&datagram).unwrap(); + assert_eq!(handshake.data(), HANDSHAKE); + assert_eq!(handshake.space(), Some(SpaceId::Handshake)); + let rest = rest.unwrap(); + assert_eq!(rest[..], [&ZERO_RTT[..], &ZERO_RTT, &SHORT].concat()[..]); + let (short, rest) = decode(&rest).unwrap(); + assert_eq!(short.data(), SHORT); + assert!(rest.is_none()); + + // A trailing 0-RTT packet is left in the remainder, which then decodes to nothing. + let (handshake, rest) = decode(&[HANDSHAKE, ZERO_RTT].concat()).unwrap(); + assert_eq!(handshake.data(), HANDSHAKE); + assert_eq!(decode(&rest.unwrap()).unwrap_err(), PacketDecodeError::ZeroRtt); + } + #[test] fn pn_expand_roundtrip() { for expected in 0..1024 { diff --git a/rs/moq-quic/src/tests/characterize/frames.rs b/rs/moq-quic/src/tests/characterize/frames.rs index ba26722e9b8..008383462a7 100644 --- a/rs/moq-quic/src/tests/characterize/frames.rs +++ b/rs/moq-quic/src/tests/characterize/frames.rs @@ -35,11 +35,12 @@ fn client_answer(frames: Frames) -> Option { } } -/// Early data is discarded without decryption, without losing a coalesced -/// Initial or a later 1-RTT stream on the same connection. +/// A 0-RTT packet is dropped before decryption, alone or coalesced, so an ACK inside it for a +/// packet the server never sent is not processed, and a coalesced Initial or 1-RTT packet is +/// still read. #[test] -fn early_packets_leave_handshake_and_application_data_usable() { - use crate::packet::{FixedLengthConnectionIdParser, Header, LongType, PacketNumber, PartialDecode}; +fn zero_rtt_packets_are_dropped() { + use crate::packet::{FixedLengthConnectionIdParser, Header, LongHeaderType, LongType, PacketNumber, PartialDecode}; for leading in [true, false] { let _guard = subscribe(); let mut pair = pair_with(|_| {}); @@ -54,32 +55,38 @@ fn early_packets_leave_handshake_and_application_data_usable() { ) .unwrap(); let initial_header = decoded.initial_header().unwrap(); - let mut early = Vec::new(); + let mut zero_rtt = Vec::new(); + // No header encodes as 0-RTT, so encode a Handshake one and retype it below. let encoded = Header::Long { - ty: LongType::ZeroRtt, + ty: LongType::Handshake, src_cid: initial_header.src_cid, dst_cid: initial_header.dst_cid, number: PacketNumber::U8(0), version: 1, } - .encode(&mut early); + .encode(&mut zero_rtt); + // Processing this ACK would be a PROTOCOL_VIOLATION: the server never sent packet 1000. + let ack = Frames::default().var(FrameType::ACK, &[1000, 0, 0, 0]); + zero_rtt.extend_from_slice(&ack.0); let keys = config .crypto .clone() .start_session(Version::V1, "localhost", &TransportParameters::default()) .unwrap() .initial_keys(initial_header.dst_cid, Side::Client); - // The ciphertext is deliberately opaque: early-data rejection precedes decryption, - // regardless of which ticket or keys the sender used. - early.resize(early.len() + 32 + keys.packet.local.tag_len(), 0xff); - encoded.finish(&mut early, &*keys.header.local, Some((0, &*keys.packet.local))); + // The keys don't matter: the drop precedes decryption. + zero_rtt.resize(zero_rtt.len() + 32 + keys.packet.local.tag_len(), 0); + encoded.finish(&mut zero_rtt, &*keys.header.local, Some((0, &*keys.packet.local))); + // The type bits are outside header protection. + const TYPE_BITS: u8 = 0x30; + zero_rtt[0] = zero_rtt[0] & !TYPE_BITS | u8::from(LongHeaderType::ZeroRtt) & TYPE_BITS; let mut datagram = Vec::new(); if leading { - datagram.extend_from_slice(&early); + datagram.extend_from_slice(&zero_rtt); } datagram.extend_from_slice(&initial); if !leading { - datagram.extend_from_slice(&early); + datagram.extend_from_slice(&zero_rtt); } pair.server.inbound.push_front((now, ecn, datagram.as_slice().into())); pair.drive(); @@ -88,11 +95,18 @@ fn early_packets_leave_handshake_and_application_data_usable() { assert_connected(pair.server_conn_mut(server_ch)); assert!(pair.server_streams(server_ch).accept(Dir::Uni).is_none()); + // Alone, the 0-RTT packet changes nothing. + let before = pair.server_conn_mut(server_ch).stats().frame_rx; + pair.server.inbound.push_back((now, ecn, zero_rtt.as_slice().into())); + pair.drive_server(); + assert_eq!(pair.server_conn_mut(server_ch).stats().frame_rx.acks, before.acks); + assert!(lost(pair.server_conn_mut(server_ch)).is_none()); + let stream = pair .client_streams(client_ch) .open(Dir::Uni, Default::default()) .unwrap(); - const DATA: &[u8] = b"after early data"; + const DATA: &[u8] = b"after 0-RTT"; client_sends( &mut pair, client_ch, @@ -100,8 +114,13 @@ fn early_packets_leave_handshake_and_application_data_usable() { Frames::default().stream(stream.into(), 0, DATA, true), ); let (now, ecn, application) = pair.server.inbound.pop_back().unwrap(); - early.extend_from_slice(&application); - pair.server.inbound.push_back((now, ecn, early.as_slice().into())); + zero_rtt.extend_from_slice(&application); + pair.server.inbound.push_back((now, ecn, zero_rtt.as_slice().into())); + let before = pair.server_conn_mut(server_ch).stats().frame_rx; + pair.drive_server(); + let after = pair.server_conn_mut(server_ch).stats().frame_rx; + assert_eq!(after.acks, before.acks); + assert_eq!(after.stream, before.stream + 1); pair.drive(); assert!(lost(pair.client_conn_mut(client_ch)).is_none()); assert!(lost(pair.server_conn_mut(server_ch)).is_none()); diff --git a/rs/moq-quic/src/tests/token.rs b/rs/moq-quic/src/tests/token.rs index 33a0e8bebda..d3ae7451d36 100644 --- a/rs/moq-quic/src/tests/token.rs +++ b/rs/moq-quic/src/tests/token.rs @@ -82,7 +82,7 @@ fn oversized_retry_token() { .unwrap(); let mut buf = Vec::new(); let _ = conn.poll_transmit(now, 1, &mut buf).unwrap(); - let ProtectedHeader::Initial(initial) = + let Some(ProtectedHeader::Initial(initial)) = ProtectedHeader::decode(&mut Cursor::new(&buf), &FixedLengthConnectionIdParser::new(0), false).unwrap() else { panic!("expected an Initial packet") diff --git a/rs/moq-uring/tests/integration/endpoint.rs b/rs/moq-uring/tests/integration/endpoint.rs index 38bb07f788c..7c31b113f21 100644 --- a/rs/moq-uring/tests/integration/endpoint.rs +++ b/rs/moq-uring/tests/integration/endpoint.rs @@ -341,8 +341,9 @@ fn unsupported_version_is_negotiated_only_by_servers() { } sock.set_read_timeout(Some(Duration::from_secs(5)))?; - // The long-header type bits are version-specific. Use bits that mean - // 0-RTT in v1 to prove we negotiate before interpreting them. + // The long-header type bits are version-specific. These bits mean + // 0-RTT in v1, which moq-quic drops unanswered, so a reply proves we + // negotiate the version before interpreting them. let mut packet = Vec::new(); packet.push(0xD0); // long header, fixed bit, unknown-version type packet.extend_from_slice(&0x0a0a_0a0au32.to_be_bytes());