Repository navigation
Can Homa do unreliable messages? #114
Description
Activity
Homa doesn't support unreliable messages; if that's what you want, can't you just use UDP?
Homa doesn't currently allow applications to specify the priority of messages (Homa computes priorities automatically based on message length) but this is something that could potentially be added in the future.
- I mean, yes I guess? I've been using QUIC which is built on top of UDP.
- Okay so let me give an example of what I"m talking about:
Here's how QUIC can use streams to do unreliable messaging for video calls and other use cases
(taken from the webtransport explainer)
https://github.com/w3c/webtransport/blob/main/explainer.md
6. Sending Video one Stream per Frame or Segment with Send Order
As video frames tend to exceed the size of a datagram, a common way to send video is to use a stream per frame or segment. This ensures frames arrive whole without blocking on previous frames, allowing for frame loss. The streams can be assigned a send order to avoid them competing with one another. In this particular example, earlier frames are given a higher priority to assist decode order.
let sendOrder = 0; for await (const encodedVideoChunk of realtimeEncodedVideoChunks.readable) { const bytes = new Uint8Array(encodedVideoChunk.byteLength); encodedVideoChunk.copyTo(bytes); const writable = await wt.createUnidirectionalStream({ sendOrder: sendOrder-- }); const writer = writable.getWriter(); writer.write(bytes).catch(() => {}); writer.close(); }
Note that sending a video in real-time might require additional effort, such as different priorities for I-frames versus P-frames, sendOrder++ and an age-based aborting scheme.
7. Sending Real-time Game Data per Stream with Send Order
Similar to sending real-time video but without the I-frame/P-frame complexity, is sending real-time game data from a server. Here we use sendOrder++ which sends the latest data with the highest priority, and we age out old data.
let sendOrder = 0; for await (const gameDataChunk of realtimeGameDataChunks.readable) { const writable = await wt.createUnidirectionalStream({ sendOrder: sendOrder++}); const writer = writable.getWriter(); writer.write(gameDataChunk).catch(() => {}); writer.close(); setTimeout(() => writer.abort(), 500); // age-based abort }
Would something like this be in scope for Homa, or is this out of scope?
Hey all!
I'm always curious about new networking protocols, and this one seems pretty interesting.
I have some experience working with QUIC and SCTP, and what I like about those protocols is that there are ways to say that some messages are more important than others.
I do a lot of multiplayer game dev, where some messages you want to send as quickly as possible and don't care if they reach, while others you want to make sure they get sent.
I understand Homa is more interested in internal datacenter stuff, but would Homa in the future support unreliable messages (or some sort of priority header)?
Thanks!