-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fluffy uTP doesn't acknownledge peer's fin packet, closes before it sends an ack back #1778
Comments
@kdeme ping for review |
The logs makes perfect sense for how it is implemented in Fluffy. After a Regarding the Regarding the |
How we handle
My issue with this is your ST_FIN is being ACKED by our ST_FIN, not an ST_STATE packet, I think in that case our ST_FIN should also be acked. Also uTP is a 2 way stream protocol like TCP meaning both sides could be sending data, which is why a one sided fin close doesn't make sense, because if both sides can send/recieve data, both would want to confirmed they recieved it all so they could send resends if they didn't get some. So both would want to confirmed they are finished. In our usecase we use it only as a one way stream though. But if we were doing a 2 way stream, what if you sent your fin because you were still sending data, but we had more data to send, we would finish sending our data send our fin then you would ack it and the connection would close. Which is why I think us sending a fin back is the right move. Also the spec says ST_FIN is a TCP like flag. (Well uTP is basically TCP anyways) |
I don't disagree with the reasoning regarding the two-way FIN. But I do put higher value currently in following the reference implementation (considering the spec is not clear about this). This part of the code is why I think the ref. implementation also works with only 1-way FIN: https://github.com/bittorrent/libutp/blob/master/utp_internal.cpp#L3372-L3381 and also some references in our code regarding this such as: https://github.com/status-im/nim-eth/blob/master/eth/utp/utp_socket.nim#L1462 It basically looks that as soon as the FIN gets ACK'ed, the socket goes into destroy state. Which basically means, that a FIN send at that point, is no longer ACK'ed on anyhow. And I've actually undone similar behaviour to what you expect in the past, which would still send an FIN after receiving FIN (application reading EOF) because it wouldn't matter due that implementation: 3909675 |
Fair enough, I will look into resolving our reset issue. As that alone should stop wasted packets from being sent. |
I can only find this happening on Fluffy? After we send our Fin we should recieve an ack to acknowledge fluffy got our fin I believe.
This is a picture I took off geeksforgeeks for TCP, but I believe it should be a similar idea?
The text was updated successfully, but these errors were encountered: