Hacker News new | ask | show | jobs
by johnsolo1701 2259 days ago
My understanding is that action-oriented multiplayer games in browsers have always suffered because they can't use UDP. How does this achieve multiplayer from a networking perspective?
3 comments

Lots of people use WebRTC DataChannels for this! The real tech here is SCTP, and it is pretty amazing. It runs over UDP, and allows you to send messages larger than MTU. You can also choose ordered/unordered and lossy/non-lossy depending on what you are trying to do.

We worked on a Pure Go implementation[0]. If you are interested in learning more. Most people (all browsers) use libusrsctp the C implementation.

[0] https://github.com/pion/sctp

HTTP/2 with stream prioritization and server push kinda replaces the need for UDP.

We can't allow UDP to be sent directly from browsers because that would enable any random bit of JavaScript you load to launch a DDoS attack.

HTTP/2 doesn’t replace the need for UDP at all, not in the slightest. For latency-sensitive applications, it provides no advantages over HTTP that I can tell.

The problem is with TCP, and the problem with TCP is that it prioritizes in-order delivery, and missed packets cause head of line blocking. HTTP/2 is designed to solve head of line blocking, but since it’s built on top of TCP, it can’t solve the issue in this case.

UDP was never "needed". It's been used in real-time applications because there are latency benefits to datagram protocols.

And browsers can indeed use UDP. WebRTC data channels are SCTP over DTLS, which is UDP based.