Hacker News new | ask | show | jobs
by lambdaloop 164 days ago
Does streaming compression work if some packets are lost or arrive in a different order? Seems like the compression context may end up different on the encoding/decoding side.. or is that handled somehow?
3 comments

WebSockets [1] run over TCP, and the messages are ordered.

There is RFC 9220 [2] that makes WebSockets go over QUIC (which is UDP-based). But that's still expected to expose a stream of bytes to the WebSocket, which still keeps the ordering guarantee.

[1]: https://datatracker.ietf.org/doc/html/rfc6455

[2]: https://datatracker.ietf.org/doc/rfc9220/

I think the underlying protocol would have to guarantee in order delivery - either via tcp (for http1, 2, or spdy), or in http3, within a single stream.
It sounds as though the data is being transferred over HTTP, so packet loss/reordering is all handled by TCP.
Yes, or by http3's in order guarantees on the individual streams (as http3 is udp)