Send immediate ACKs after RMSS bytes of data #1002
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, we let the delayed ACK timer expire and sent an immediate ACK for every other segment received, as described in the following comments:
smoltcp/src/socket/tcp.rs
Lines 2067 to 2073 in 45fa984
I have found this to be a bit aggressive when the MTU is large (for example, the MTU of the loopback device is 65536 bytes). In such scenarios, every other received segment can be significantly different from every two full-size segments. In short, this can result in too many or too frequent ACKs being sent.
Acroding to the latest RFC, RFC 9293 states:
However, note that the RFC above only says "at least 2*RMSS bytes", which is not a hard requirement. In practice, I think that it is reasonable to follow the Linux kernel's empirical value of sending an ACK for every RMSS byte of new data. The Linux kernel implementation can be found here: