-
Notifications
You must be signed in to change notification settings - Fork 51
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
Lossy protocols utilizing datagrams #168
Comments
I filed #105 as a potential solution for the latter, although I now realize that I should have explained the problem and not a solution. |
The DATAGRAM I-D says:
If the WebTransport API fulfilled this requirement, would your problems be addressed? It seems a shame to require apps to reimplement something that the transport is doing. |
I think that @kixelated described perfectly the main issues for implementing a loosy protocol over quic/datagrams. The datagram ACK/NACK could be solved by exposing the events back to the app as the DATAGRAM i-D recommends. I am much more worried about the interaction between the bandwidth estimation, congestion control and the queueing/frame dropping. Maybe it would be good to split the issue in two for better tracking. |
This was an intentional design decision, see #23. The problem is that even when the QUIC stack has issued an acknowledgement to the peer, it does not mean that the datagram in question will necessarily reach the application, since it still can be dropped if the datagram receive queue is full. This is the similar reason as to why application protocols like QPACK have their own ACKs: processing on lower layer does not imply processing on a higher layer.
This is issue #21. We had some ideas on how to approach this, but did not want to start working on this without any Web developers who are specifically interested in this. |
IMHO having the ACK status of each datagram is interesting even it is not guaranteed that the datagram is processed by the js app layer. Taking webrtc as a model, current NACK mechanism does not ensure that the frame is decoded by the receiver side, it may happen that the cpu is not powerful enough and the frame has to be dropped before decoding even if has been correctly received. So I would foresee having different ACK/backpressure info depending on the application, but I would prefer avoiding to have to duplicate network info that is already available and could be exposed to the js layer. Last, I don't buy the argument of being a footgun, as the whole webtransport datagram is already a footgun if not handled carefully ;) |
It's nice to see that there's been other threads! @vasilvv You make a good point that a QUIC ACK signals that a packet has been received, but not necessarily processed. This would not be sufficient for some protocols (ex. QUIC), although it may still be useful for other protocols (ex. RTP, TCP). This caveat would need to be very explicit if these acknowledgements were exposed. As for datagrams getting dropped prior to reaching the application layer... I'm not sure if that's the right behavior, at least I don't think it matches UDP. As far as I know, UDP packets will be buffered indefinitely while there is buffer space otherwise new packets are dropped. Peter makes it seem like older datagrams should be dropped instead, but I think that's up for discussion. The real issue is the lack of flow control for datagrams which allows this buffer to overflow. |
There's some question as to whether we want to drop from head of the queue or from its tail, and the exact criteria on when to drop. Regardless, even if it behaves identical to the kernel UDP queue, the QUIC ACK signal is not helpful, since all of the datagrams dropped due to the queue being full still have to be acknowledged at the QUIC layer (because (1) packets can contain a mix of DATAGRAMs and reliable frames, and (2) peer will interpret missing ACKs as a loss signal, and throttle the connection). |
Hmm yeah that makes sense. So you would need datagram flow control to expose ACKs, and even then it wouldn't be particularly useful. |
We did look at exposing datagram acknowledgements, but as @vasilvv noted, application layer acknowledgement would be needed anyway. BTW, the same conclusion can be reached with respect to WebRTC data channel and WebSockets "lack of backpressure" - that you need an application-layer acknowledgement so that the sender can throttle back when the receiver is unable to empty the JS event queue fast enough, though the receive window is (deceptively) open. |
Meeting:
|
From RTP over QUIC Section 4.1: " If the used QUIC implementation is not directly incorporated into the |
Hey folks,
We've investigated using QuicTransport datagrams to implement our own protocol for lossy delivery. For simplicity, let's assume that our protocol uses acknowledgements to selectively retransmit packets. Other protocols like RTP will use negative acknowledgements but it's a similar concept.
The first issue is that QUIC datagrams themselves are ack-eliciting. The application needs its own acknowledgement mechanism as these QUIC acknowledgements are not exposed to the application. This doubles the number of packets in the worst case, although any decent QUIC implementation will coalesce multiple frames.
The second issue is that QUIC datagrams are congestion controlled and will be dropped or queued. The application needs its own congestion control algorithm as these limits are not exposed to the application. This limits the maximum throughput to the lower bound of both algorithms, which may interact in non-obvious ways.
The text was updated successfully, but these errors were encountered: