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(s2n-quic-transport): only allow GSO of MTU-sized packets #1613

Merged
merged 3 commits into from
Jan 28, 2023

Conversation

camshaft
Copy link
Contributor

@camshaft camshaft commented Jan 27, 2023

Description of changes:

I noticed an issue when determining if a transmission can be included as a GSO segment or not. The current logic is to allow any packet sizes to be considered for GSO, as long we aren't MTU probing. This isn't really ideal, since a previous transmission to the same tuple could have been a small ACK packet. This means we're artificially clamping MTU to the small ACK size, rather than allowing the connection to transmit a full MTU.

This change, instead, only allows GSO on transmissions if the segment size is >= than the path's MTU for the current transmission mode. This results in more connections transmitting correctly, rather than bailing since we may end up deciding to not write a packet if the segment size is too small (initial packets, etc).

Call-outs:

In experimentation, I also noticed the socket buffer queue sizes were somewhat small and will many concurrent connections I was filling it up a lot. This PR includes a default that is double the previous, as well as an unstable configuration of the value via environment variables.

I'm going to be revamping the IO implementation in the next coming weeks, and this environment variable will likely be gone after I'm done.

Testing:

I wrote a handshake fuzzer for this test. I'm planning on submitting a PR and put it under /tools later.

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

@camshaft camshaft marked this pull request as ready for review January 27, 2023 23:01
quic/s2n-quic-transport/src/connection/transmission.rs Outdated Show resolved Hide resolved
@@ -34,7 +34,7 @@ impl Snapshot {
assert!(rss < 30_000, "{rss}");
}
"post-close" => {
assert_eq!(rss, 0, "{rss}");
assert!(rss < 128, "{rss}");
Copy link
Contributor

Choose a reason for hiding this comment

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

why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it has to do with one of our dependencies. It's failing for me in other PRs as well so it doesn't seem related here:

https://github.com/aws/s2n-quic/actions/runs/4028993317/jobs/6926443934

});

if transmit_result.is_ok() {
if queue.has_capacity() {
Copy link
Contributor

Choose a reason for hiding this comment

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

The only error I see that was coming out of this previously was ConnectionOnTransmitError::NoDatagram, just wanted to check that its ok to continue iteration in that case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah the idea is to not rely on if the connection decided to transmit something or not. Instead we want to know what the actual capacity of the queue is and make the decision that way.

@camshaft camshaft enabled auto-merge (squash) January 27, 2023 23:56
@camshaft camshaft merged commit ef0f3db into main Jan 28, 2023
@camshaft camshaft deleted the camshaft/gso-fixes branch January 28, 2023 00:07
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.

2 participants