when I asked people to explain how UDP works I got a lot of answers to the effect of "it's spray and pray"

but I'm having trouble thinking of examples of UDP-based protocols that actually work in a "spray and pray" way —

* DNS is "send 1 packet, retry if you don't get a reply”
* QUIC is a sophisticated system for streaming data over UDP
* I'd guess that video protocols correct for packet loss
* maybe statsd is a "spray and pray” system?

(please do not reply to this explaining how UDP works)

@b0rk games are the only thing that comes to mind and even those tend to not do that these days, hm. Video calls are closest I guess?

@Lunaphied @b0rk Early games such as Doom used UDP.

Many early voice transmissions were UDP. Live audio is a good fit since you want low latency and being silent (lost packet) is tolerable. I believe modern synchronized audio transmitter/receivers on the local network are UDP based, but embed timing information so when loss happens, you can keep the audio in sync based on the explicit timing data. The human ear needs delays <30ms.

If you want some simple experiments at the cli, see netcat / nc

@trouble @Lunaphied @b0rk

early voice? The SIP protocol is still used for a lot of phone calls. SIP creates two UDP streams for audio and/or video. One from caller to callee and one from callee to caller. These streams are called RTP in SIP.

Audio stream is cut into ~20ms or 1/50 second worth of data. UDP is great for this application as a lost packet (~ 20ms) can be "back filled" by our brains.