UDP is a connectionless transport protocol that prioritizes speed over reliability, making it well-suited for real-time applications like VoIP, video conferencing, and media streaming. Unlike TCP, UDP does not establish connections, sequence data, or retransmit lost packets.
UDP Protocol
Let's talk about UDP. UDP communication looks quite a bit different than TCP, and UDP, as we saw before, has some certain advantages to it. So let's talk about those advantages, and let's talk about a couple of things around UDP.
What we'll be talking about is first of all the differences between TCP and UDP, some of the weaknesses and the strengths with UDP, some protocols that are associated with UDP, and then we'll wrap this up with taking a look at the UDP header. This will be a pretty quick one that we'll go through, because UDP is actually pretty simplistic. It's not as exciting and doesn't have as many components that TCP has, but it is associated with a lot of cool protocols. So that in itself is kind of cool about UDP, but it doesn't have as much interesting components that are happening within UDP.
We saw where TCP was associated with reliability, versus UDP is all about speed and getting that data over there in a timely manner. For that reason, we have a smaller header within this. We do not resend data. We do not sequence data. So if there is going to be any kind of sequencing, it's got to be an upper layer protocol. Otherwise, it just doesn't matter what order that data comes in. And it's connectionless — with TCP, we talked about how it established a connection, so these connections were established before communication happens.
Some examples of what protocols use UDP are things like voice over IP and video conferencing, which both use the advantages of UDP to get data to its destination in a timely manner.
One of the things about UDP that's its strength is to send or stream that data across. Here our example is we've got these little tiny segments that we're sending over. Before, if you remember, my segments or packets were represented by bigger labels here, but these are going to be really small as it gets sent over, and it's going to be just a continuous stream. Usually it'll be a continuous stream — if you're talking about voice over IP, then it will just continually send the things out.
Now, if that device were to hold on to that data till it became a bigger chunk and then send it over in these bigger chunks, then the person on the other side of the line would get these huge chunks, and the voice either would be kind of garbled or it would be delayed. There could be significant delays between the two sides of the conversation. So it wouldn't be ideal. That's why voice over IP and video conferencing will use these UDP segments, so that it can stream that audio or stream that video across to the other side.
Because of this, it doesn't keep track of things like dropped packets. Usually it doesn't really matter with UDP packets whether it gets to the other side or not, and so if a packet gets dropped, it doesn't do any kind of retransmission. The other thing is there's no sequencing involved in this, so when it gets to the other side, it's just going to play back the data in the sequence it was given.
And so if there are some bad delays or something, that's when you're talking on the phone — if it's voice over IP, and you get some garbled sounds to it, or you see some artifacts that are happening. If you're watching a TV or you're streaming some video or YouTube and you've got a really bad connection, then you'll start seeing some artifacts and some blocks that come up. That's because it's not getting enough data, not enough data is streaming across there.
There are times when you still want some reliability, or you still want some packets or some frames to be resent, some segments to be resent. In those scenarios where you want some sort of reliability but you want to use UDP, then possibly you use some sort of upper layer protocol to help mitigate that issue. But for the most part UDP is not responsible for any of that. It doesn't establish a connection, it doesn't have sequencing, and it doesn't have any kind of mechanism to resend lost data.
There are some examples that use this. Some protocols that use this would be simple network management protocol, TFTP or trivial file transfer protocol, voice over IP, or something like the network time protocol. These are some protocols that all utilize UDP for their protocols.
As I mentioned, UDP headers are pretty basic. There's not a whole lot to it. Remember, each one of these is a bit, and eight of those is a byte. So we've got 32 bits across here, and we see that we still need a source and a destination port, and those operate just the same as they would with a TCP header. We have the length of the data that's involved in here, or the total length of this segment, so that's important information. And then we have the checksum, so that way we can make sure when it gets to the other side that it is truly accurate information and nothing has been altered along the way.
So that was quick and dirty. We ran through it. That's TCP and UDP. We talked about some of the strengths and weaknesses that UDP has, we talked about some of the protocols that are associated with it, and then we took a look at the UDP header.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →