-
-
Notifications
You must be signed in to change notification settings - Fork 515
Open
Description
Summary
Add ECN (Explicit Congestion Notification) visibility to the Controller::on_ack callback to enable custom congestion control algorithms to react to per-packet ECN CE marks.
Motivation
Currently, Quinn's Controller trait receives ECN CE information only through on_congestion_event, which is triggered after ECN-based congestion detection. However, custom congestion control algorithms may need finer-grained access to ECN information on a per-ACK basis to:
- Implement ECN-aware algorithms: Custom controllers could implement sophisticated ECN-based congestion control (e.g., DCTCP-like algorithms, L4S, or experimental protocols)
- Early congestion detection: React to ECN CE marks before they accumulate into a congestion event
- Telemetry and monitoring: Track ECN mark rates for debugging and performance analysis
- Research and experimentation: Enable development of novel congestion control mechanisms that leverage ECN
Proposed API Change
Modify the Controller::on_ack method signature to include ECN information:
fn on_ack(
&mut self,
now: Instant,
sent: Instant,
bytes: u64,
app_limited: bool,
rtt: &RttEstimator,
ecn: Option<EcnCodepoint>,
) {
// Default implementation remains unchanged for backward compatibility
}Parameters
ecn: AnOption<EcnCodepoint>indicating the ECN marking on the acknowledged packetSome(EcnCodepoint::Ce): Packet was marked with Congestion ExperiencedSome(EcnCodepoint::Ect0)orSome(EcnCodepoint::Ect1): ECN-capable but not congestedNone: No ECN information available (e.g., peer doesn't support ECN, or network stripped ECN bits)
Example Use Case
impl Controller for CustomController {
fn on_ack(
&mut self,
now: Instant,
sent: Instant,
bytes: u64,
app_limited: bool,
rtt: &RttEstimator,
ecn: Option<EcnCodepoint>,
) {
// Track ECN CE marks for telemetry
if let Some(EcnCodepoint::Ce) = ecn {
self.ce_marks_received += 1;
// React immediately to congestion signal
self.reduce_cwnd_early();
}
// Continue with normal ACK processing
self.handle_ack(bytes, rtt);
}
}Metadata
Metadata
Assignees
Labels
No labels