Skip to content

Commit

Permalink
fixup! congure_quic: initial import of QUIC congestion control
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Oct 17, 2022
1 parent acfb00f commit 2b7aab2
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions sys/congure/quic/congure_quic.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ static void _update_rtts(congure_quic_snd_t *c, ztimer_now_t msg_send_time,
}
}

static void _reset_cwnd_in_pc(congure_quic_snd_t *c)
{
c->super.cwnd = c->consts->min_wnd;
if (c->ssthresh < c->consts->min_wnd) {
/* See https://github.com/quicwg/base-drafts/issues/4826#issuecomment-776305871
* XXX: this differs from the pseudo-code in
* Appendix B.8, where when `ssthresh` is lower than
* `cwnd` (e.g. because )
*/
c->ssthresh = c->consts->min_wnd;
}
c->recovery_start = 0;
}

static void _reset_cwnd(congure_quic_snd_t *c, congure_snd_msg_t *msgs)
{
/* Reset the congestion window if the loss of these packets indicates
Expand Down Expand Up @@ -140,17 +154,7 @@ static void _reset_cwnd(congure_quic_snd_t *c, congure_snd_msg_t *msgs)
}
if ((latest - earliest) > pc_duration) {
/* in persistent congestion */
c->super.cwnd = c->consts->min_wnd;
if (c->ssthresh < c->consts->min_wnd) {
/* See
* https://github.com/quicwg/base-drafts/issues/4826#issuecomment-776305871
* XXX: this differs from the pseudo-code in
* Appendix B.8, where when `ssthresh` is lower than
* `cwnd` (e.g. because )
*/
c->ssthresh = c->consts->min_wnd;
}
c->recovery_start = 0;
_reset_cwnd_in_pc(c);
}
}
} while ((&ptr->super) != msgs->super.next);
Expand Down

0 comments on commit 2b7aab2

Please sign in to comment.