-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ACK problems? #1
Comments
Hi, I've thought about polling each socket individually before. And I think it's possible to do that but maybe I can improve it in the future. About the TCP question:
I'm not 100% sure but I believe And send ACK here to tell peer endpoint how much data we have received. There is So UDP is simpler:
UDP does not provide reliability. If the buffer is full, just drop the packet. Also same for RawSocket
I guess I will make a new branch and make |
https://github.com/spacemeowx2/tokio-smoltcp/tree/latest Not tested yet. PRs are welcome |
Hi, I've been looking at this repo and I was wondering if you thought of my question about the way you poll each socket. I'd love to use this instead of mine because it does not do a second copy of the rx buffer. But it looks to me that this copy is needed. Look:
you are saying that there's no chance the socket will be overwritten before a new poll is made. It looks like smoltcp uses arbitrary socket sizes, so if the socket size is of half a TCP packet size, then I thought it could be that half a packet must be taken out of the socket before a new part emerges and then the ACK is sent. However, I think there's no sense in what I said because smoltcp will always analyze the entire packet before delivering to me. So a ACK will only be sent after the entire packet is received.
But is the ACK sent when
socket.recv_slice
is called? I researched a bit and it looks like not. I think the ACK is sent right after the packet is received in smoltcp and put available tosocket.recv_slice
. So if I don't callrecv_slice
fast enough it would be overwritten by the next packet, because ACK is already sent before I callsocket.rect_slice
. Thesocket.recv_slice
end up calling this:which does not look like it triggers an ACK response. So it looks like ACK is sent before this.
I'm still not convinced for the TCP case, but what about UDP?
UDP has no ACK, so there's no way that the server would know that I already received a packet, so there's the chance that poll does not occur fast enough to grab a packet before it's overwritten. Same for RawSocket.
By the way, will you support the most recent version of smoltcp? I needed it because of some things from there, mostly to do a virtual interface.
Thanks
The text was updated successfully, but these errors were encountered: