seegongsik
Networks

How does UDP work

TCP checks whether each piece arrived and resends anything that does not. That makes it accurate, but it also means waiting. In a moment where even 0.1 seconds counts, like a video call, it is better to be fast even if a piece or two goes missing. That is when UDP is used.

01

Skipping the Check

Think back to TCP from the last lesson. Each time a piece arrived, an acknowledgment (ACK) went back. That one word makes it accurate, but every exchange costs time.
UDP changes the thinking: skip the checks and just send fast. Without asking whether anything arrived, it sends the pieces out one after another.

SenderReceiver
1
2
3
4
5
no ACK wait
Tap send to fire a piece

Each press of the send button fires one more piece straight away. Unlike TCP, it does not wait for an acknowledgment (ACK), so all five pieces go out without a pause.

With no waiting for acknowledgments, the pieces go out nonstop. Far more can be sent, far faster, in the same amount of time.
In return, one thing has been given up: UDP does not care what arrived. So what happens when a piece goes missing on the way?

02

Moving On Even When Some Go Missing

TCP would have asked for the missing piece to be sent again. UDP does not. Even if a piece vanishes on the way, it does not stop; it simply moves on to the next.
What is missing stays missing. That may look careless, but there are times when stopping everything to fill in one or two missing pieces costs more.

SenderReceiver
1
2
3
4
5
Tap send to advance a piece

Each press of send moves one piece forward. Two of the five pieces vanish on the way, but UDP does not resend them; it simply carries on to the end.

Several pieces went missing, yet the transfer finished without a break. The receiver ended up with a few holes, but the flow never stopped once.
That is UDP's character: never stopping matters more than being perfect. But is it really all right when something is missing? Looking at where UDP is used gives the answer.

03

When Is It Used?

UDP suits jobs that must never be late. Think of an online game: position data that arrives a beat late is already old news, even if you receive it again.
Video calls and live broadcasts are the same. What matters is this very moment; getting back a piece that went missing a moment ago means nothing.
UDP is also used for exchanging short questions and answers. The name lookups we saw earlier usually ask and answer over UDP.

Tap to pick an example
Tap to pick an example

Tap the online game, video call, and live broadcast cards one by one to see why each must not be late. In all three, being late is worse, so UDP is a good fit.

The three cases have something in common: being late is more damaging than losing a little. A frozen game screen or a voice on a call that cuts out and lags is far more frustrating.
UDP avoids that frustration. Even if it is a bit rough, it chooses not to stop and keeps the present flowing.

04

Comparing TCP and UDP

It is not a question of which one is better; they simply have different aims. TCP puts accuracy first. It acknowledges, resends, and lines things up, and waits a little longer for it.
UDP puts speed first. It sends without acknowledgments and leaves missing pieces alone, so it can be rough. What matters more decides the choice.

arrived
1
2
3
4
all 4 arrived
delay
Accurate, but waits more with check and resend
Tap TCP and UDP to compare

Tap the two buttons to compare TCP and UDP. With TCP all four pieces arrive but it waits longer; with UDP one piece goes missing, but the wait is short.

The comparison makes it clear. Text and files that must arrive complete and exact go to TCP. Games and calls, where this very moment is everything, go to UDP.
The internet has both because the world has both kinds of urgency. Just pick the tool that fits the job.

05

Summing Up

In one line: UDP skips the acknowledgments (ACK), sends pieces out quickly one after another, and moves on without resending even if a few go missing.
So it suits things that must not be late, like games, video calls, and live broadcasts. Accuracy first, TCP; speed first, UDP. Two agreements with different aims.

Tap the key points in order to review

Each press of the button reveals one more key point. (skip the check → fast, one after another → move on even if some go missing → for games, calls, broadcasts) Once all four have appeared, the review is done.

Now you know both TCP and UDP: if accuracy matters, TCP; if speed matters, UDP. The internet picks the agreement that fits the situation.
But a single computer runs a browser, a messenger, and a game all at once. When a piece reaches the computer by its address, which of those programs should it go to? The next lesson answers that.

In one lineTCP sends everything with acknowledgments (ACK) and retransmission, at the cost of waiting. UDP skips those acknowledgments: it sends quickly, one piece after another, without asking whether they arrived, and moves on without stopping even if a few go missing. So it suits things that must not be late, like games, video calls, and live broadcasts, where one or two missing pieces are hardly noticeable. Accuracy first, TCP; speed first, UDP. Both exist because they serve different aims.
← Networks
Was this helpful? Support seegongsik