Skip to content

Commit

Permalink
remove support for draft-ietf-quic-multipath-04
Browse files Browse the repository at this point in the history
  • Loading branch information
qdeconinck committed Sep 25, 2023
1 parent ca65646 commit f1ba4a6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 455 deletions.
1 change: 0 additions & 1 deletion apps/src/bin/quiche-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ fn main() {
usize::try_from(conn_args.initial_cwnd_packets).unwrap(),
);
config.set_multipath(conn_args.multipath);
config.set_multipath_v4(conn_args.multipath_old);

config.set_max_connection_window(conn_args.max_window);
config.set_max_stream_window(conn_args.max_stream_window);
Expand Down
1 change: 0 additions & 1 deletion apps/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ pub fn connect(
config.set_disable_active_migration(!conn_args.enable_active_migration);
config.set_active_connection_id_limit(conn_args.max_active_cids);
config.set_multipath(conn_args.multipath);
config.set_multipath_v4(conn_args.multipath_old);

config.set_max_connection_window(conn_args.max_window);
config.set_max_stream_window(conn_args.max_stream_window);
Expand Down
208 changes: 11 additions & 197 deletions quiche/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,21 +183,18 @@ pub enum Frame {
ack_delay: u64,
ranges: ranges::RangeSet,
ecn_counts: Option<EcnCounts>,
v5: bool,
},

PathAbandon {
dcid_seq_num: u64,
error_code: u64,
reason: Vec<u8>,
v5: bool,
},

PathStatus {
dcid_seq_num: u64,
seq_num: u64,
status: u64,
v5: bool,
},
}

Expand Down Expand Up @@ -329,21 +326,18 @@ impl Frame {

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

0xbaba00..=0xbaba01 | 0x15228c00..=0x15228c01 =>
parse_ack_mp_frame(frame_type, b)?,
0x15228c00..=0x15228c01 => parse_ack_mp_frame(frame_type, b)?,

0xbaba05 | 0x15228c05 => Frame::PathAbandon {
0x15228c05 => Frame::PathAbandon {
dcid_seq_num: b.get_varint()?,
error_code: b.get_varint()?,
reason: b.get_bytes_with_varint_length()?.to_vec(),
v5: frame_type == 0x15228c05,
},

0xbaba06 | 0x15228c06 => Frame::PathStatus {
0x15228c06 => Frame::PathStatus {
dcid_seq_num: b.get_varint()?,
seq_num: b.get_varint()?,
status: b.get_varint()?,
v5: frame_type == 0x15228c06,
},

_ => return Err(Error::InvalidFrame),
Expand Down Expand Up @@ -592,18 +586,11 @@ impl Frame {
ack_delay,
ranges,
ecn_counts,
v5,
} => {
if ecn_counts.is_none() {
if *v5 {
b.put_varint(0x15228c00)?;
} else {
b.put_varint(0xbaba00)?;
}
} else if *v5 {
b.put_varint(0x15228c01)?;
b.put_varint(0x15228c00)?;
} else {
b.put_varint(0xbaba01)?;
b.put_varint(0x15228c01)?;
}
b.put_varint(*space_identifier)?;
common_ack_to_bytes(b, ack_delay, ranges, ecn_counts)?;
Expand All @@ -613,13 +600,8 @@ impl Frame {
dcid_seq_num,
error_code,
reason,
v5,
} => {
if *v5 {
b.put_varint(0x15228c05)?;
} else {
b.put_varint(0xbaba05)?;
}
b.put_varint(0x15228c05)?;

b.put_varint(*dcid_seq_num)?;
b.put_varint(*error_code)?;
Expand All @@ -631,13 +613,8 @@ impl Frame {
dcid_seq_num,
seq_num,
status,
v5,
} => {
if *v5 {
b.put_varint(0x15228c06)?;
} else {
b.put_varint(0xbaba06)?;
}
b.put_varint(0x15228c06)?;

b.put_varint(*dcid_seq_num)?;
b.put_varint(*seq_num)?;
Expand Down Expand Up @@ -836,7 +813,6 @@ impl Frame {
ack_delay,
ranges,
ecn_counts,
..
} => {
4 + // frame_type
octets::varint_len(*space_identifier) + // space_identifier
Expand All @@ -847,7 +823,6 @@ impl Frame {
dcid_seq_num,
error_code,
reason,
..
} => {
4 + // frame type
octets::varint_len(*dcid_seq_num) +
Expand All @@ -860,7 +835,6 @@ impl Frame {
dcid_seq_num,
seq_num,
status,
..
} => {
4 + // frame size
octets::varint_len(*dcid_seq_num) +
Expand Down Expand Up @@ -1086,7 +1060,6 @@ impl Frame {
ack_delay,
ranges,
ecn_counts,
..
} => {
let ack_ranges = AckedRanges::Double(
ranges.iter().map(|r| (r.start, r.end - 1)).collect(),
Expand Down Expand Up @@ -1116,7 +1089,6 @@ impl Frame {
dcid_seq_num,
error_code,
reason,
..
} => QuicFrame::PathAbandon {
dcid_seq_num: *dcid_seq_num,
error_code: *error_code,
Expand All @@ -1127,7 +1099,6 @@ impl Frame {
dcid_seq_num,
seq_num,
status,
..
} => QuicFrame::PathStatus {
dcid_seq_num: *dcid_seq_num,
seq_num: *seq_num,
Expand Down Expand Up @@ -1417,7 +1388,6 @@ fn parse_ack_mp_frame(ty: u64, b: &mut octets::Octets) -> Result<Frame> {
ack_delay,
ranges,
ecn_counts,
v5: ty & 0x15228c00 == 0x15228c00,
})
}

Expand Down Expand Up @@ -2349,48 +2319,13 @@ mod tests {
}

#[test]
fn path_abandon_v4() {
let mut d = [42; 128];

let frame = Frame::PathAbandon {
dcid_seq_num: 421_124,
error_code: 0xbeef,
reason: vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
v5: false,
};

let wire_len = {
let mut b = octets::OctetsMut::with_slice(&mut d);
frame.to_bytes(&mut b).unwrap()
};

assert_eq!(wire_len, 25);

let mut b = octets::Octets::with_slice(&mut d);
assert_eq!(
Frame::from_bytes(&mut b, packet::Type::Short),
Ok(frame.clone())
);

let mut b = octets::Octets::with_slice(&mut d);
assert!(Frame::from_bytes(&mut b, packet::Type::Initial).is_err());

let mut b = octets::Octets::with_slice(&mut d);
assert!(Frame::from_bytes(&mut b, packet::Type::ZeroRTT).is_err());

let mut b = octets::Octets::with_slice(&mut d);
assert!(Frame::from_bytes(&mut b, packet::Type::Handshake).is_err());
}

#[test]
fn path_abandon_v5() {
fn path_abandon() {
let mut d = [42; 128];

let frame = Frame::PathAbandon {
dcid_seq_num: 421_124,
error_code: 0xbeef,
reason: vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
v5: true,
};

let wire_len = {
Expand All @@ -2417,89 +2352,7 @@ mod tests {
}

#[test]
fn ack_mp_v4() {
let mut d = [42; 128];

let mut ranges = ranges::RangeSet::default();
ranges.insert(4..7);
ranges.insert(9..12);
ranges.insert(15..19);
ranges.insert(3000..5000);

let frame = Frame::ACKMP {
space_identifier: 894_994,
ack_delay: 874_656_534,
ranges,
ecn_counts: None,
v5: false,
};

let wire_len = {
let mut b = octets::OctetsMut::with_slice(&mut d);
frame.to_bytes(&mut b).unwrap()
};

assert_eq!(wire_len, 24);

let mut b = octets::Octets::with_slice(&d);
assert_eq!(Frame::from_bytes(&mut b, packet::Type::Short), Ok(frame));

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::Initial).is_err());

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::ZeroRTT).is_err());

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::Handshake).is_err());
}

#[test]
fn ack_mp_ecn_v4() {
let mut d = [42; 128];

let mut ranges = ranges::RangeSet::default();
ranges.insert(4..7);
ranges.insert(9..12);
ranges.insert(15..19);
ranges.insert(3000..5000);

let ecn_counts = Some(EcnCounts {
ect0_count: 100,
ect1_count: 200,
ecn_ce_count: 300,
});

let frame = Frame::ACKMP {
space_identifier: 894_994,
ack_delay: 874_656_534,
ranges,
ecn_counts,
v5: false,
};

let wire_len = {
let mut b = octets::OctetsMut::with_slice(&mut d);
frame.to_bytes(&mut b).unwrap()
};

assert_eq!(wire_len, 30);

let mut b = octets::Octets::with_slice(&d);
assert_eq!(Frame::from_bytes(&mut b, packet::Type::Short), Ok(frame));

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::Initial).is_err());

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::ZeroRTT).is_err());

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::Handshake).is_err());
}

#[test]
fn ack_mp_v5() {
fn ack_mp() {
let mut d = [42; 128];

let mut ranges = ranges::RangeSet::default();
Expand All @@ -2513,7 +2366,6 @@ mod tests {
ack_delay: 874_656_534,
ranges,
ecn_counts: None,
v5: true,
};

let wire_len = {
Expand All @@ -2537,7 +2389,7 @@ mod tests {
}

#[test]
fn ack_mp_ecn_v5() {
fn ack_mp_ecn() {
let mut d = [42; 128];

let mut ranges = ranges::RangeSet::default();
Expand All @@ -2557,7 +2409,6 @@ mod tests {
ack_delay: 874_656_534,
ranges,
ecn_counts,
v5: true,
};

let wire_len = {
Expand All @@ -2581,43 +2432,7 @@ mod tests {
}

#[test]
fn path_status_v4() {
let mut d = [42; 128];

let dcid_seq_num = 0xabcdef00;
let seq_num = 0x42;
let status = 1;

let frame = Frame::PathStatus {
dcid_seq_num,
seq_num,
status,
v5: false,
};

let wire_len = {
let mut b = octets::OctetsMut::with_slice(&mut d);
frame.to_bytes(&mut b).unwrap()
};

assert_eq!(frame.wire_len(), wire_len);
assert_eq!(wire_len, 15);

let mut b = octets::Octets::with_slice(&d);
assert_eq!(Frame::from_bytes(&mut b, packet::Type::Short), Ok(frame));

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::Initial).is_err());

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::ZeroRTT).is_err());

let mut b = octets::Octets::with_slice(&d);
assert!(Frame::from_bytes(&mut b, packet::Type::Handshake).is_err());
}

#[test]
fn path_status_v5() {
fn path_status() {
let mut d = [42; 128];

let dcid_seq_num = 0xabcdef00;
Expand All @@ -2628,7 +2443,6 @@ mod tests {
dcid_seq_num,
seq_num,
status,
v5: true,
};

let wire_len = {
Expand Down
Loading

0 comments on commit f1ba4a6

Please sign in to comment.