Sometimes speed and simplicity are more important than reliability.

This episode expands on the concepts introduced in the previous episode. If you haven’t already, make sure to listen to episode 159 about TCP.

Both TCP and UDP are based on the internet protocol, or IP. UDP stands for User Datagram Protocol. Going back to the previous example of sending physical envelopes to somebody far away, let’s say that instead of sending a document split into many small envelopes, you instead need to send daily status reports.

Each status report is small and the contents don’t matter much if a few get lost. As long as most of your status reports arrive, then your friend will be happy. Because of this, there’s no need for a complicated system where you number your reports. You’ll be sending reports at a regular interval and if they arrive out of order of go missing, then the receiver can just catch up later.

You both have a lot less work to do. All you have to do is send the reports. You no longer have to wait for any replies or need to be ready to resend missing or damaged reports.

And the receiver no longer needs to send any acks or hold up processing while waiting for a missing or damaged report. It’s still important to know if a report has been damaged along the way. And UDP does provide a way to detect if a message has arrived safely or not. The difference between UDP and TCP though is that if a damaged message arrives with UDP, then it just gets thrown away.

Listen to the full episode for more explanation and examples of when you might want to use UDP.