-
Notifications
You must be signed in to change notification settings - Fork 399
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
Implement TCP selective acknowledgement extension (sACK) #256
Comments
A quick update: I have made some progress on this, but am running into blocking issues when creating unit tests. It seems when I write a straightforward case (do a bunch of |
Where is your SACK code located? Is it just in |
I mostly changed This branch contains none of the new feature at all, and just a unit test I am trying to base my tests from. All the test does is:
Even this code, however, gets |
@jhwgh1968 You can't call I think it would be ideal if we replaced all uses of |
I have updated my test branch, and replaced the What else am I missing? |
FWIW, I am still working on this. Life just got really busy for a while. I did get around my |
Great to hear, and thanks for your work and patience! |
Since it didn't get linked to this issue, I have a phase 1 implementation in #266. I will probably work on a phase 1.5 next, where it actually becomes fully "should" compliant with its receiving behavior. |
Unfortunately, I have not had time to work on this. If anyone else wants to take this issue, feel free. Otherwise, I may get to it later in the year. |
@jhwgh1968 what is left to implement? |
I'm glad you asked, @jabedude! I tried to finish this at one point during the year, and didn't get very far. The way I planned it in my mind, there will be several phases. As you will see, the further into the future the plan is, the more vague it is. Sender Side Phase 1This is what I have merged already. To quote myself:
Sender Side Phase 2This finishes the sender side implementation to be "should" compliant with the RFC. In particular, RFC case 3 should be turned into a test. (In addition to several other interesting edge case tests, of course.)
Case 3: The 2nd, 4th, 6th, and 8th (last) segments are
dropped.
The data receiver ACKs the first packet normally. The
The algorithm described in the RFC requires smoltcp to treat the header's contents as a list, which is head-insert only, remove in-place. It is not difficult, but it requires quite a bit of new code. One piece of code I did get a good start on was a new iterator on the
Once this phase is completed, there should be significant performance gains talking to non-smoltcp TCP/IP stacks. Receiver Side Phase 1This is to implement basic header handling when smoltcp is the receiver. Currently, smoltcp completely ignores any sender's header if it sends one, which is legal but not very nice. This straightforward implementation is designed to be simple:
This is only an incremental improvement in practice over completely ignoring the window, but it would get the groundwork into the project. I expect there will be a lot of messy integration work, in addition to testing required. Receiver Side Phase 2This final phase is the big one: generate the correct packet sequences in response to the RFC case above. There are also some questions about timing that need exploration. The RFC states that all information in the header is advisory, and so it is possible for a sender to send us a window that, if we fulfill it, their ACK sequence number still will not move. Such "over-eager senders" will need smoltcp to fall back to its Go-Back-N behavior, rather than sending the So, it's a lot of work, including a lot of testing. I hope you are still interested in the challenge! |
Is anyone currently working on this or planning to pick it up? |
Not as far as I know. |
👍, getting a start on it: #256 |
@loriopatrick I presume you meant to link to #450 |
Oops, yes that's the link |
The TCP extension is described in RFC 2018.
I am opening a tracking issue for this since I didn't see one. If no one else wants to pick this up, I volunteer.
@whitequark previously made some offhanded comments suggesting it would be easy to send sACK records in acknowledgements based on current gaps tracked by the TCP reassembly code. I tend to agree, based on my understanding of the code.
The more difficult part is actually using information in sACK records sent by the remote TCP. While completely ignoring the remote's sACK records is legal -- the ACK field must not advance past the first gap to prevent mismatching state -- it defeats the extension's purpose, and so is highly discouraged.
The text was updated successfully, but these errors were encountered: