-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Do CC reaction before largest_acked
#2117
base: main
Are you sure you want to change the base?
Changes from all commits
fb1cec9
032b51b
84a2564
ff66d18
8ae64d4
d1a0f83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -864,12 +864,12 @@ impl LossRecovery { | |
/// When it has, mark a few packets as "lost" for the purposes of having frames | ||
/// regenerated in subsequent packets. The packets aren't truly lost, so | ||
/// we have to clone the `SentPacket` instance. | ||
fn maybe_fire_pto(&mut self, rtt: &RttEstimate, now: Instant, lost: &mut Vec<SentPacket>) { | ||
fn maybe_fire_pto(&mut self, path: &PathRef, now: Instant, lost: &mut Vec<SentPacket>) { | ||
let mut pto_space = None; | ||
// The spaces in which we will allow probing. | ||
let mut allow_probes = PacketNumberSpaceSet::default(); | ||
for pn_space in PacketNumberSpace::iter() { | ||
if let Some(t) = self.pto_time(rtt, *pn_space) { | ||
if let Some(t) = self.pto_time(path.borrow().rtt(), *pn_space) { | ||
allow_probes[*pn_space] = true; | ||
if t <= now { | ||
qdebug!([self], "PTO timer fired for {}", pn_space); | ||
|
@@ -889,6 +889,17 @@ impl LossRecovery { | |
// pto_time to increase which might cause PTO for later packet number spaces to not fire. | ||
if let Some(pn_space) = pto_space { | ||
qtrace!([self], "PTO {}, probing {:?}", pn_space, allow_probes); | ||
// Packets are only declared as lost relative to `largest_acked`. If we hit a PTO while | ||
// we don't have a largest_acked yet, also do a congestion control reaction (because | ||
// otherwise none would happen). | ||
Comment on lines
+892
to
+894
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure that we want to slow down? If we haven't received an ACK, we should be at a low send rate. Do we really want to slow down further? One thing that concerns me here is that a fast PTO (if we ever enable that) will hit this condition more often and that might not be good for performance. The same goes for long RTT connections, which might be OK while we are still retransmitting within the RTT, but once we get an RTT estimate that is long, we'll slow our send rate by a huge amount for the false PTOs we've hit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the argument is that the combination of initial cwnd and initial RTT (= PTO) were made with some sort of safety criteria in mind. A PTO is an indication that either the RTT is much longer than the default assumption, or there is quite a bit of loss. In either of these two cases, we probably want to slow down? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess my main concern is that if we want to be more aggressive about PTO, such as sending another Initial we create a situation where slowing down is not the result of a misunderstanding of the RTT, but a deliberate choice to send more to start with. |
||
if self | ||
.spaces | ||
.get(pn_space) | ||
.is_some_and(|space| space.largest_acked.is_none()) | ||
{ | ||
path.borrow_mut() | ||
.on_congestion_event(lost, &mut self.stats.borrow_mut(), now); | ||
} | ||
self.fire_pto(pn_space, allow_probes, now); | ||
} | ||
} | ||
|
@@ -920,7 +931,7 @@ impl LossRecovery { | |
} | ||
self.stats.borrow_mut().lost += lost_packets.len(); | ||
|
||
self.maybe_fire_pto(primary_path.borrow().rtt(), now, &mut lost_packets); | ||
self.maybe_fire_pto(primary_path, now, &mut lost_packets); | ||
lost_packets | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just a move? It looks like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but from
ClassicCongestionControl
toCongestionControl
.