Skip to content

Commit

Permalink
Rewrite congestion and recovery code
Browse files Browse the repository at this point in the history
This is a very large change that replaces most of the congestion
and recovery control implementation with an implementation that
copies google/quiche for the most part. Most importantly cubic and
pacing are copied exactly from google/quiche so we can have a high
confidence in both. This fixes our pacing problems entirely and
also has a much cleaner interface, where every bit is cleanly separated
from the main state.
  • Loading branch information
vkrasnov committed Sep 6, 2023
1 parent 44c940e commit 0ccca19
Show file tree
Hide file tree
Showing 36 changed files with 8,761 additions and 6,003 deletions.
6 changes: 2 additions & 4 deletions apps/src/bin/quiche-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,8 @@ fn main() {
client.loss_rate = loss_rate;
}

let max_send_burst =
client.conn.send_quantum().min(client.max_send_burst) /
client.max_datagram_size *
client.max_datagram_size;
let max_send_burst = client.max_send_burst / client.max_datagram_size *
client.max_datagram_size;
let mut total_write = 0;
let mut dst_info = None;

Expand Down
4 changes: 3 additions & 1 deletion apps/src/sendto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ fn send_to_gso_pacing(
use nix::sys::socket::SockaddrStorage;
use std::io::IoSlice;
use std::os::unix::io::AsRawFd;
use std::time::Instant;

let iov = [IoSlice::new(buf)];
let segment_size = segment_size as u16;
Expand All @@ -69,7 +70,8 @@ fn send_to_gso_pacing(
let cmsg_gso = ControlMessage::UdpGsoSegments(&segment_size);

// Pacing option.
let send_time = std_time_to_u64(&send_info.at);
let now = Instant::now();
let send_time = std_time_to_u64(&send_info.release.time(now).unwrap_or(now));
let cmsg_txtime = ControlMessage::TxTime(&send_time);

match sendmsg(
Expand Down
3 changes: 3 additions & 0 deletions quiche/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"git-blame.gitWebUrl": ""
}
1 change: 1 addition & 0 deletions quiche/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ intrusive-collections = "0.9.5"
qlog = { version = "0.9", path = "../qlog", optional = true }
sfv = { version = "0.9", optional = true }
smallvec = { version = "1.10", features = ["serde", "union"] }
enum_dispatch = "0.3"

[target."cfg(windows)".dependencies]
winapi = { version = "0.3", features = ["wincrypt", "ws2def", "ws2ipdef", "ws2tcpip"] }
Expand Down
Loading

0 comments on commit 0ccca19

Please sign in to comment.