Skip to content

Commit 3bd2ffd

Browse files
committed
support for draft -09/-10
1 parent fae2fd4 commit 3bd2ffd

File tree

7 files changed

+87
-79
lines changed

7 files changed

+87
-79
lines changed

apps/src/args.rs

+12-8
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct CommonArgs {
5757
pub qpack_max_table_capacity: Option<u64>,
5858
pub qpack_blocked_streams: Option<u64>,
5959
pub initial_cwnd_packets: u64,
60-
pub initial_max_paths: Option<u64>,
60+
pub initial_max_path_id: Option<u64>,
6161
}
6262

6363
/// Creates a new `CommonArgs` structure using the provided [`Docopt`].
@@ -84,7 +84,7 @@ pub struct CommonArgs {
8484
/// --qpack-max-table-capacity BYTES Max capacity of dynamic QPACK decoding.
8585
/// --qpack-blocked-streams STREAMS Limit of blocked streams while decoding.
8686
/// --initial-cwnd-packets Size of initial congestion window, in packets.
87-
/// --initial-max-paths Enable multipath support up to the number of
87+
/// --initial-max-path-id Enable multipath support up to the number of
8888
/// paths.
8989
///
9090
/// [`Docopt`]: https://docs.rs/docopt/1.1.0/docopt/
@@ -197,8 +197,12 @@ impl Args for CommonArgs {
197197
.parse::<u64>()
198198
.unwrap();
199199

200-
let initial_max_paths = if args.get_str("--initial-max-paths") != "" {
201-
Some(args.get_str("--initial-max-paths").parse::<u64>().unwrap())
200+
let initial_max_path_id = if args.get_str("--initial-max-path-id") != "" {
201+
Some(
202+
args.get_str("--initial-max-path-id")
203+
.parse::<u64>()
204+
.unwrap(),
205+
)
202206
} else {
203207
None
204208
};
@@ -226,7 +230,7 @@ impl Args for CommonArgs {
226230
qpack_max_table_capacity,
227231
qpack_blocked_streams,
228232
initial_cwnd_packets,
229-
initial_max_paths,
233+
initial_max_path_id,
230234
}
231235
}
232236
}
@@ -256,7 +260,7 @@ impl Default for CommonArgs {
256260
qpack_max_table_capacity: None,
257261
qpack_blocked_streams: None,
258262
initial_cwnd_packets: 10,
259-
initial_max_paths: None,
263+
initial_max_path_id: None,
260264
}
261265
}
262266
}
@@ -294,7 +298,7 @@ Options:
294298
--max-active-cids NUM The maximum number of active Connection IDs we can support [default: 2].
295299
--enable-active-migration Enable active connection migration.
296300
--perform-migration Perform connection migration on another source port.
297-
--initial-max-paths NUM Enable multipath support up to the number of paths.
301+
--initial-max-path-id NUM Enable multipath support up to the number of paths.
298302
-A --address ADDR ... Specify addresses to be used instead of the unspecified address. Non-routable addresses will lead to connectivity issues.
299303
-R --rm-addr TIMEADDR ... Specify addresses to stop using after the provided time (format time,addr).
300304
-S --status TIMEADDRSTAT ... Specify availability status to advertise to the peer after the provided time (format time,addr,available).
@@ -542,7 +546,7 @@ Options:
542546
--disable-gso Disable GSO (linux only).
543547
--disable-pacing Disable pacing (linux only).
544548
--initial-cwnd-packets PACKETS The initial congestion window size in terms of packet count [default: 10].
545-
--initial-max-paths NUM Enable multipath support up to the number of paths.
549+
--initial-max-path-id NUM Enable multipath support up to the number of paths.
546550
-h --help Show this screen.
547551
";
548552

apps/src/bin/quiche-server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ fn main() {
123123
config.set_initial_congestion_window_packets(
124124
usize::try_from(conn_args.initial_cwnd_packets).unwrap(),
125125
);
126-
if let Some(initial_max_paths) = conn_args.initial_max_paths {
127-
config.set_initial_max_paths(initial_max_paths);
126+
if let Some(initial_max_path_id) = conn_args.initial_max_path_id {
127+
config.set_initial_max_path_id(initial_max_path_id);
128128
}
129129

130130
config.set_max_connection_window(conn_args.max_window);

apps/src/client.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ pub fn connect(
127127
config.set_initial_max_streams_uni(conn_args.max_streams_uni);
128128
config.set_disable_active_migration(!conn_args.enable_active_migration);
129129
config.set_active_connection_id_limit(conn_args.max_active_cids);
130-
if let Some(initial_max_paths) = conn_args.initial_max_paths {
131-
config.set_initial_max_paths(initial_max_paths);
130+
if let Some(initial_max_path_id) = conn_args.initial_max_path_id {
131+
config.set_initial_max_path_id(initial_max_path_id);
132132
}
133133

134134
config.set_max_connection_window(conn_args.max_window);
@@ -495,15 +495,15 @@ pub fn connect(
495495
}
496496
}
497497

498-
if conn_args.initial_max_paths.is_some() &&
498+
if conn_args.initial_max_path_id.is_some() &&
499499
probed_paths < addrs.len() &&
500500
conn.available_dcids() > 0 &&
501501
conn.probe_path(addrs[probed_paths], peer_addr).is_ok()
502502
{
503503
probed_paths += 1;
504504
}
505505

506-
if conn_args.initial_max_paths.is_none() &&
506+
if conn_args.initial_max_path_id.is_none() &&
507507
args.perform_migration &&
508508
!new_path_probed &&
509509
scid_sent &&

qlog/src/events/quic.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,13 @@ pub enum QuicFrameTypeName {
372372
ApplicationClose,
373373
HandshakeDone,
374374
Datagram,
375-
AckMp,
375+
MpAck,
376376
PathAbandon,
377-
PathStatus,
377+
PathAvailable,
378+
PathStandby,
379+
MpNewConnectionId,
380+
MpRetireConnectionId,
381+
MaxPathId,
378382
Unknown,
379383
}
380384

@@ -509,8 +513,8 @@ pub enum QuicFrame {
509513
raw: Option<Bytes>,
510514
},
511515

512-
AckMp {
513-
space_identifier: u64,
516+
MpAck {
517+
path_identifier: u64,
514518

515519
ack_delay: Option<f32>,
516520
acked_ranges: Option<AckedRanges>,
@@ -552,7 +556,7 @@ pub enum QuicFrame {
552556
sequence_number: u64,
553557
},
554558

555-
MaxPaths {
559+
MaxPathId {
556560
max_path_id: u64,
557561
},
558562

quiche/src/cid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1461,7 +1461,7 @@ impl ConnectionIdentifiers {
14611461

14621462
/// When a MAX_PATHS frame has been sent.
14631463
#[inline]
1464-
pub fn on_max_paths_sent(&mut self) {
1464+
pub fn on_max_path_id_sent(&mut self) {
14651465
self.advertise_local_max_path_id = false;
14661466
}
14671467

quiche/src/frame.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ pub enum Frame {
186186
},
187187

188188
MPACK {
189-
space_identifier: u64,
189+
path_identifier: u64,
190190
ack_delay: u64,
191191
ranges: ranges::RangeSet,
192192
ecn_counts: Option<EcnCounts>,
@@ -221,7 +221,7 @@ pub enum Frame {
221221
seq_num: u64,
222222
},
223223

224-
MaxPaths {
224+
MaxPathId {
225225
max_path_id: u64,
226226
},
227227
}
@@ -371,7 +371,7 @@ impl Frame {
371371

372372
0x30 | 0x31 => parse_datagram_frame(frame_type, b)?,
373373

374-
0x15228c00..=0x15228c01 => parse_ack_mp_frame(frame_type, b)?,
374+
0x15228c00..=0x15228c01 => parse_mp_ack_frame(frame_type, b)?,
375375

376376
0x15228c05 => Frame::PathAbandon {
377377
path_id: b.get_varint()?,
@@ -417,7 +417,7 @@ impl Frame {
417417
seq_num: b.get_varint()?,
418418
},
419419

420-
0x15228c0b => Frame::MaxPaths {
420+
0x15228c0c => Frame::MaxPathId {
421421
max_path_id: b.get_varint()?,
422422
},
423423

@@ -444,7 +444,7 @@ impl Frame {
444444
(packet::Type::ZeroRTT, Frame::PathAvailable { .. }) => false,
445445
(packet::Type::ZeroRTT, Frame::MpNewConnectionId { .. }) => false,
446446
(packet::Type::ZeroRTT, Frame::MpRetireConnectionId { .. }) => false,
447-
(packet::Type::ZeroRTT, Frame::MaxPaths { .. }) => false,
447+
(packet::Type::ZeroRTT, Frame::MaxPathId { .. }) => false,
448448

449449
// ACK, CRYPTO and CONNECTION_CLOSE can be sent on all other packet
450450
// types.
@@ -667,7 +667,7 @@ impl Frame {
667667
Frame::DatagramHeader { .. } => (),
668668

669669
Frame::MPACK {
670-
space_identifier,
670+
path_identifier,
671671
ack_delay,
672672
ranges,
673673
ecn_counts,
@@ -677,7 +677,7 @@ impl Frame {
677677
} else {
678678
b.put_varint(0x15228c01)?;
679679
}
680-
b.put_varint(*space_identifier)?;
680+
b.put_varint(*path_identifier)?;
681681
common_ack_to_bytes(b, ack_delay, ranges, ecn_counts)?;
682682
},
683683

@@ -732,8 +732,8 @@ impl Frame {
732732
b.put_varint(*seq_num)?;
733733
},
734734

735-
Frame::MaxPaths { max_path_id } => {
736-
b.put_varint(0x15228c0b)?;
735+
Frame::MaxPathId { max_path_id } => {
736+
b.put_varint(0x15228c0c)?;
737737

738738
b.put_varint(*max_path_id)?;
739739
},
@@ -926,13 +926,13 @@ impl Frame {
926926
},
927927

928928
Frame::MPACK {
929-
space_identifier,
929+
path_identifier,
930930
ack_delay,
931931
ranges,
932932
ecn_counts,
933933
} => {
934934
4 + // frame_type
935-
octets::varint_len(*space_identifier) + // space_identifier
935+
octets::varint_len(*path_identifier) + // path_identifier
936936
common_ack_wire_len(ack_delay, ranges, ecn_counts)
937937
},
938938

@@ -981,7 +981,7 @@ impl Frame {
981981
octets::varint_len(*path_id) + // path_id
982982
octets::varint_len(*seq_num) // seq_num
983983
},
984-
Frame::MaxPaths { max_path_id } => {
984+
Frame::MaxPathId { max_path_id } => {
985985
4 + // frame type
986986
octets::varint_len(*max_path_id) // path_id
987987
},
@@ -1212,7 +1212,7 @@ impl Frame {
12121212
},
12131213

12141214
Frame::MPACK {
1215-
space_identifier,
1215+
path_identifier,
12161216
ack_delay,
12171217
ranges,
12181218
ecn_counts,
@@ -1231,8 +1231,8 @@ impl Frame {
12311231
None => (None, None, None),
12321232
};
12331233

1234-
QuicFrame::AckMp {
1235-
space_identifier: *space_identifier,
1234+
QuicFrame::MpAck {
1235+
path_identifier: *path_identifier,
12361236
ack_delay: Some(*ack_delay as f32 / 1000.0),
12371237
acked_ranges: Some(ack_ranges),
12381238
ect1,
@@ -1285,7 +1285,7 @@ impl Frame {
12851285
sequence_number: *seq_num,
12861286
},
12871287

1288-
Frame::MaxPaths { max_path_id } => QuicFrame::MaxPaths {
1288+
Frame::MaxPathId { max_path_id } => QuicFrame::MaxPathId {
12891289
max_path_id: *max_path_id,
12901290
},
12911291
}
@@ -1457,15 +1457,15 @@ impl std::fmt::Debug for Frame {
14571457
},
14581458

14591459
Frame::MPACK {
1460-
space_identifier,
1460+
path_identifier,
14611461
ack_delay,
14621462
ranges,
14631463
ecn_counts,
14641464
..
14651465
} => {
14661466
write!(
14671467
f,
1468-
"MP_ACK space_id={space_identifier} delay={ack_delay} blocks={ranges:?} ecn_counts={ecn_counts:?}",
1468+
"MP_ACK path_id={path_identifier} delay={ack_delay} blocks={ranges:?} ecn_counts={ecn_counts:?}",
14691469
)?;
14701470
},
14711471

@@ -1515,8 +1515,8 @@ impl std::fmt::Debug for Frame {
15151515
)?;
15161516
},
15171517

1518-
Frame::MaxPaths { max_path_id } => {
1519-
write!(f, "MAX_PATHS max_path_id={max_path_id}")?;
1518+
Frame::MaxPathId { max_path_id } => {
1519+
write!(f, "MAX_PATH_ID max_path_id={max_path_id}")?;
15201520
},
15211521
}
15221522

@@ -1588,13 +1588,13 @@ fn parse_ack_frame(ty: u64, b: &mut octets::Octets) -> Result<Frame> {
15881588
})
15891589
}
15901590

1591-
fn parse_ack_mp_frame(ty: u64, b: &mut octets::Octets) -> Result<Frame> {
1592-
let space_identifier = b.get_varint()?;
1591+
fn parse_mp_ack_frame(ty: u64, b: &mut octets::Octets) -> Result<Frame> {
1592+
let path_identifier = b.get_varint()?;
15931593
let (ack_delay, ranges, ecn_counts) =
15941594
parse_common_ack_frame(b, ty & 0x01 != 0)?;
15951595

15961596
Ok(Frame::MPACK {
1597-
space_identifier,
1597+
path_identifier,
15981598
ack_delay,
15991599
ranges,
16001600
ecn_counts,
@@ -2572,7 +2572,7 @@ mod tests {
25722572
ranges.insert(3000..5000);
25732573

25742574
let frame = Frame::MPACK {
2575-
space_identifier: 894_994,
2575+
path_identifier: 894_994,
25762576
ack_delay: 874_656_534,
25772577
ranges,
25782578
ecn_counts: None,
@@ -2615,7 +2615,7 @@ mod tests {
26152615
});
26162616

26172617
let frame = Frame::MPACK {
2618-
space_identifier: 894_994,
2618+
path_identifier: 894_994,
26192619
ack_delay: 874_656_534,
26202620
ranges,
26212621
ecn_counts,
@@ -2763,10 +2763,10 @@ mod tests {
27632763
}
27642764

27652765
#[test]
2766-
fn max_paths_frame() {
2766+
fn max_path_id_frame() {
27672767
let mut d = [42; 128];
27682768

2769-
let frame = Frame::MaxPaths { max_path_id: 42 };
2769+
let frame = Frame::MaxPathId { max_path_id: 42 };
27702770

27712771
let wire_len = {
27722772
let mut b = octets::OctetsMut::with_slice(&mut d);

0 commit comments

Comments
 (0)