Send incomplete fin packets even if nagle enabled#665
Merged
bors[bot] merged 1 commit intosmoltcp-rs:masterfrom Aug 16, 2022
OxIonics:ignore_nagle_if_want_fin
Merged
Send incomplete fin packets even if nagle enabled#665bors[bot] merged 1 commit intosmoltcp-rs:masterfrom OxIonics:ignore_nagle_if_want_fin
bors[bot] merged 1 commit intosmoltcp-rs:masterfrom
OxIonics:ignore_nagle_if_want_fin
Conversation
If we have an incomplete packet to send and the socket has been closed then send it. Without this change (with nagle enabled) we wait for the penultimate packet in the stream to be acked before sending the final packet even if there's plenty of space in the window.
Dirbaio
approved these changes
Aug 16, 2022
Member
Dirbaio
left a comment
There was a problem hiding this comment.
Thank you! Makes a lot of sense, there's no point in delaying the last packet indeed. Nice find!
bors r+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If we have an incomplete packet to send and the socket has been closed
then send it. Without this change (with nagle enabled) we wait for the
penultimate packet in the stream to be acked before sending the final
packet even if there's plenty of space in the window.
I think this is strictly only an optimisation, but when I wrote the code I thought it was necessary.
If there is no packet loss this change saves you a RTT before sending the final packet in the stream (plus any ack delay). If there is incoming packet loss so that you've missed an ACK, this change might additionally save you from having to do some retransmission. Once the far end has received the FIN/ACK it can drive retransmission if that gets dropped.