forked from mozilla/neqo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassic_slow_start.rs
More file actions
43 lines (38 loc) · 1.38 KB
/
classic_slow_start.rs
File metadata and controls
43 lines (38 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use std::{
fmt::{self, Display},
time::Instant,
};
use crate::{cc::classic_cc::SlowStart, packet, rtt::RttEstimate, stats::CongestionControlStats};
/// Classic slow start as described in RFC 9002.
///
/// > While a sender is in slow start, the congestion window increases by the number of bytes
/// > acknowledged when each acknowledgment is processed. This results in exponential growth of the
/// > congestion window.
///
/// <https://datatracker.ietf.org/doc/html/rfc9002#section-7.3.1-2>
#[derive(Debug, Default)]
pub struct ClassicSlowStart {}
impl Display for ClassicSlowStart {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "ClassicSlowStart")
}
}
impl SlowStart for ClassicSlowStart {
fn on_packets_acked(
&mut self,
_rtt_est: &RttEstimate,
_largest_acked: packet::Number,
_curr_cwnd: usize,
_cc_stats: &mut CongestionControlStats,
_now: Instant,
) -> Option<usize> {
// Classic slow start does not have any heuristic for exiting slow start. Always
// returns `None`.
None
}
}