Skip to content
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: Path is not app limited if more data is available to transmit #1326

Merged
merged 5 commits into from
May 25, 2022

Conversation

WesleyRosenblum
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum commented May 24, 2022

Description of changes:

When a path is considered "application-limited", meaning the sending rate is constrained by the rate at which the application is providing data to transmit and not constrained by the congestion controller, the CUBIC congestion controller does not grow the congestion window. In the existing implementation, the determination of "application-limited" does not consider whether the application has additional data to transmit and only stopped sending due to the pacer. This results in the possibility of not growing the congestion window when acknowledgements are received after sending is temporarily blocked by the pacer.

This change makes a determination on whether the path is application limited external to the congestion controller. If there is no additional data waiting to be sent and the congestion controller is not blocking further transmission, the path is considered application limited.

Before:
Screen Shot 2022-05-23 at 11 27 36 PM

After:
Screen Shot 2022-05-23 at 11 28 18 PM

Call-outs:

Early in a connection lifetime, there is a possibility of multiple packet spaces writing packets to a single datagram. This means that each packet space might independently be "application-limited", but as a whole, the path is not. To simplify this case, the Initial and Handshake packet spaces do not make a determination of whether they are application-limited.

Ideally we would be able to determine if a path is application-limited based on the total amount of data the application has added to the send buffer, so that we don't allow the congestion window to grow if the application did not have enough data to fully utilize the congestion window, even if sending was paused momentarily due to pacing. This would require an expensive iteration over all streams in a connection, so as a compromise, we consider the path not application-limited if there is -any- data remaining to send while interrupted by pacing. The effect of this is there is some possibility for the congestion window to grow even if the application does not fully utilize the congestion window.

Testing:

Added unit tests and updated the recovery simulations

Is this a refactor change? If so, how have you proved that the intended behavior hasn't changed? -->

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

/// Sending is app limited if the application is not fully utilizing the available
/// congestion window currently and there is no more application data remaining to send.
fn is_app_limited(&self, path: &Path<Config>, bytes_sent: usize) -> bool {
let cwnd = path.congestion_controller.congestion_window();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth moving all of this to Path in something like is_congestio_blocked?

quic/s2n-quic-core/src/recovery/cubic.rs Show resolved Hide resolved
quic/s2n-quic-transport/src/space/application.rs Outdated Show resolved Hide resolved
@WesleyRosenblum WesleyRosenblum marked this pull request as ready for review May 24, 2022 07:02
camshaft
camshaft previously approved these changes May 24, 2022
@toidiu
Copy link
Contributor

toidiu commented May 24, 2022

The effect of this is there is some possibility for the congestion window to grow even if the application does not fully utilize the congestion window.

Is this a major concern or something that is non-ideal? Dont think acquiring more CW than needed is bad but correct me if incorrect.

@WesleyRosenblum
Copy link
Contributor Author

The effect of this is there is some possibility for the congestion window to grow even if the application does not fully utilize the congestion window.

Is this a major concern or something that is non-ideal? Dont think acquiring more CW than needed is bad but correct me if incorrect.

The risk with acquiring more congestion window than what is actually being used is that the network hasn't demonstrated it can sustain that size congestion window. So if you then do actually end up trying to fill this overly large congestion window, you may experience a large amount of loss. The loss will result in the congestion window decreasing though, so it is self-correcting, but ideally we would avoid that loss in the first place. Overall though, we would prefer to ensure the congestion window can grow fast enough, even if there is a slightly greater chance of loss as a result.

@WesleyRosenblum WesleyRosenblum merged commit eb879b8 into main May 25, 2022
@WesleyRosenblum WesleyRosenblum deleted the WesleyRosenblum/applimited branch May 25, 2022 00:02
camshaft added a commit that referenced this pull request Jun 3, 2022
toidiu pushed a commit that referenced this pull request Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants