Acknowledge received data as it arrives - #95
Open
IntellyCode wants to merge 1 commit into
Open
IntellyCode wants to merge 1 commit into
IntellyCode wants to merge 1 commit into
Conversation
In-sequence data is acknowledged on arrival and held in a received queue, which the reader drains through the bounded handoff channel. The advertised window counts both the reassembly buffer and the queue, and a segment is stored only up to the window's right edge. A FIN arriving in sequence is acknowledged where it lands. A closing connection hands the reader every stored byte before end-of-stream.
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.
Long uploads fail. An scp or rsync transfer into ipstack stalls partway or hangs at the end, and the application never learns the transfer finished.
The cause is the acknowledgement lagging behind the bytes actually received. An earlier commit tied acknowledgement to the handoff of data to the reader, so a reader that drains slowly leaves in-sequence data unacknowledged in the reassembly buffer, the advertised window stays closed, and the peer stops sending.
In-sequence data is now acknowledged on arrival and held in a
receivedqueue, which the reader drains through the bounded channel, following RFC 9293. The advertised window counts both the reassembly buffer and that queue, so memory stays bounded and a slow reader still slows the sender. A segment is stored only up to the window's right edge. A FIN arriving in sequence is acknowledged where it lands, and a closing connection hands the reader every stored byte before end-of-stream.Tested with scp and rsync uploads through a TUN device: ten consecutive 5 MB transfers completed with matching checksums.