s2n-quic icon indicating copy to clipboard operation
s2n-quic copied to clipboard

Implement Proportional Rate Reduction for Cubic congestion control

Open zz85 opened this issue 1 year ago • 0 comments

Resolved issues:

resolves #1438

Description of changes:

The current cubic loss recovery logic follows RFC 9002 https://www.rfc-editor.org/rfc/rfc9002#section-7.3.2 where congestion window is reduced immediately while allowing a single packet is sent. This appears to be more conservative than RFC 6675 and could result in situations where the sender stops sending for moments after dropping congestion window.

This implementation uses PRR and SSRB (Slow Start Reduction Bound) described in RFC 6937 https://www.rfc-editor.org/rfc/rfc6937 with minor additions from 3 June 2022 bis update https://www.ietf.org/archive/id/draft-ietf-tcpm-prr-rfc6937bis-02.html and adaptions to do byte instead of segment counting.

PRR is currently not enabled but can be tested via a S2N_ENABLE_PRR environmental variable.

Call-outs:

There's a certain condition where the current implementation is sending slightly less than it could - when prr and the existing congestion window both left over bytes not enough to fit by themselves but might be able to send them if the available bytes were combined, however that might require a bigger code change than what's in this current PR and could be left to a future enhancement.

Testing:

  • Unit tests
  • Also a manual check for brokeness via s2n-quic-qns perf server and client

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

zz85 avatar Aug 12 '22 22:08 zz85