-
Notifications
You must be signed in to change notification settings - Fork 420
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
Stuck at retransmitting #224
Comments
Actually master stopped working for me, I try to find out if related to the fast retrainsmit code. |
Yes, both endpoints are stuck in retransmitting… |
cc @barskern |
@pothos Do you think you would be able to write a test which mimics this behavior? Or explain me how it happened so that I could write a test? I would think that the desired behavior is to do a saturating addition, and change the condition from |
I'm not sure that this is right. Per my understanding, with the modified code, if e.g. first packet in a burst of 8 gets lost, the other 7 will arrive, and 4 of them will trigger retransmit of the entire burst. Is that correct? |
This is the reason I previously used This is such a edge case though. What is the probablility that we lose a packet and then lose the exact same package again in the retransmit, when all the other packages arrived. I think this is why I can't find a document about it online. |
After some more research, I found that what should happen after three duplicate ACKs is recived is that the socket should enter "Fast recovery" and every following duplicate ACK only increases the congestion window.
Hence since there hasn't been implemented Congestion Control in this library, I think we just have to "ignore" further duplicate ACKs and wait for timeout to retransmit again. |
Hello, In these logs, the client sends data. |
Ah, I applied the proposed patch with a saturating add, btw. So the numbers jumping back again should not be caused by overflows. |
@pothos I found a bug in the fast retransmit code based on your logs! When there is content in a package, one should not count the ACK as a duplicate ACK! New PR incoming 👍 |
@barskern Yes, that's one point, but also the retransmit should only be scheduled if there is data to be sent out. In the tcpdump in the end the packets of both sides just have length 0. |
@pothos yes that is correct. I will look into that. I think I have to move the detection of duplicate ACKs to a different branch of the bigger |
Thanks for debugging this! |
@barskern Maybe a look on this code here can help? https://github.com/google/netstack/blob/master/tcpip/transport/tcp/snd.go e.g. see checkDuplicateAck and the variables saved for fast recovery (except sending rate) |
@pothos Could you run the same test that generated this issue in the first place? I'm excited to see if it works now ⚡ |
Improve detection of duplicate ACKs by checking that the segment does not contain data. Move implementation from the 'reject unacceptable acknowledgements' to later in the process function, because a duplicate ACK is not an 'unacceptable' acknowledgement but rather a condition to update state. Implement more tests to verify the operation of the fast retransmit implementation. Related issue: #224 Closes: #225 Approved by: whitequark
Hi, |
Could you upload debug logs again? |
I've found the issues and fixed it but did not write a test yet: #233 |
This fixes entering a loop when both endpoints are stuck in retransmission. smoltcp-rs#224
Hi, |
This code here https://github.com/m-labs/smoltcp/blob/master/src/socket/tcp.rs#L913 should either reset
local_rx_dup_acks
or let it count from 255 to 0 with a overflowing add or stay at 255 with a saturation. What is the desired behavior?thread 'main' panicked at 'attempt to add with overflow', smoltcp/src/socket/tcp.rs:913:25
The text was updated successfully, but these errors were encountered: