633
u/Beneficial-Place-948 May 07 '26
90
u/6apa6ax May 07 '26
Quite some time ago we had chat client in our city lan that used UDP and file transfer trough it was awesome.
35
u/arbeit22 May 07 '26
Was it reliable?
124
30
u/6apa6ax May 07 '26
There was a rare hiccup when file transfer just breaks, but it was easily recognised when "is it not done yet?"
→ More replies (7)→ More replies (4)13
u/pramodhrachuri UwUntu (´ ᴗ`✿) May 07 '26
"City lan"?
18
→ More replies (3)17
u/otakugrey May 07 '26
Cuba has a big LAN that people play games on. Some places are like that. You can't import the Internet but you can import a bunch of Ethernet cables and build a LAN with your bros.
245
u/Mal_Dun M'Fedora May 07 '26
Performance?
→ More replies (1)321
u/Outrageous-Log9238 May 07 '26 edited May 07 '26
And TCP's guarantees are just useless for some applications. In a multiplayer game for example, by the time you figure out a packet was dropped, it's no longer relevant and not worth sending again.
68
u/jondbarrow May 07 '26
You can also just add your own reliability system at the application layer if you really want to. This is what Nintendo used for the Wii U/3DS, games connect to the game server with UDP which has a custom reliability system that lets some packets act more-or-less like TCP, while selectively allowing some packets to remain unreliable
→ More replies (2)33
u/Sexy_McSexypants May 07 '26
even sadder that nintendo's multiplayer is famously super laggy
→ More replies (5)12
u/sup3r_hero May 07 '26
That’s funnily the same case for Radar data in air traffic management systems. All UDP because the data becomes useless very quickly
4
u/drillbit7 May 08 '26
same with streaming video. Just drop the frame (or group of frames), deal with the artifacts. Better than lagging/buffering while waiting for the retransmission.
→ More replies (1)→ More replies (24)4
u/Kevdog824_ May 08 '26
Voice chat is another good example. Not worth replaying the packet for 0.5 seconds of voice
606
u/someoneNicko May 07 '26
Try to make live video feed with TCP 🤡
105
74
u/ImpressiveMaximum377 ⚠️ This incident will be reported May 07 '26
Netflix uses TCP for live video feed
290
88
u/Onakander May 07 '26
When was the last time a few (dozen) seconds of buffer was a dealbreaker when looking at your CCTV recordings or your Netflixes or your Hulus?
Now try the same for, oh I dunno, doing a voice call. Or perchance you're feeling brave and want to communicate with someone over video. TCP MIGHT be able to be coerced into it, but UDP is clearly what you actually want to use there.
Or maybe you want to have a gaming session with the budz, unless your game is literally I dunno chess or something else that could realistically be played through snail-mail (hyperbole, as in there ARE games that are fairly real-time that could be played through TCP... Chess literally CAN and HAS historically been played via letters)... Perhaps you might consider UDP has a place there, as well.
→ More replies (12)12
u/Roblu3 May 07 '26
Live as is not on demand, not live as in as fast as possible.
You can do that with a one way stream, but as soon as it’s bidirectional (for example in a video call) TCP just is to latent.8
u/Lucas_F_A May 07 '26
Netflix does live video? I only know about the shows and movies. Well, and the videogames now.
4
4
u/isabellium May 07 '26
Does it?
Streaming a movie/episode from a tv show is not a live video feed.→ More replies (2)→ More replies (5)4
10
u/stalerok May 07 '26
Minecraft use TCP for multiplayer
25
u/Embarrassed-Rise-685 May 07 '26
Minecraft runs on a fixed 20 hz clock which is very limited compared to competitive titles. And the Minecraft codebase itself is generally considered to be quite subpar in terms of quality like this.
→ More replies (5)→ More replies (7)4
189
u/ImpressiveMaximum377 ⚠️ This incident will be reported May 07 '26
where linux
→ More replies (3)23
u/AutoModerator May 07 '26
"OP's flair changed /u/ImpressiveMaximum377: linux not in meme"
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
76
u/themagicalfire M'Fedora May 07 '26
UDP could be used for sending data without requesting a feedback, like sharing video surveillance to remote screens.
3
u/Otakeb May 08 '26
I've used it for some robotics control stuff that is generally supposed to be best effort and move on type data and reaction. Great for that stuff and very quick.
→ More replies (1)
33
u/cow_fucker_3000 May 07 '26
Tcp is for when the information needs to get to the other side fully intact regardless of how fast it gets there, udp is for when it needs to get there fast regardless of how intact it is
0
May 08 '26
[deleted]
3
u/MattTheKatt May 08 '26
What made it click for me was “watching livestream vs watching a YouTube video” if your connection is temporarily interrupted during a live stream then you just miss that part of the livestream vs if your connection is temporarily interrupted during a YouTube video then it picks up where it left off. That really made the potential use cases make sense in my brain
→ More replies (1)
93
u/Little_Fairy_Begin May 07 '26
linux not in meme
12
u/Yeseylon May 07 '26
It totally is! Only Linux uses UDP and TCP, Windows uses MUDP and MTCP! (joke, although who knows for how much longer)
18
21
u/invalidConsciousness 💋 catgirl Linux user :3 😽 May 07 '26
Because not all use cases need guaranteed delivery of all packets in order.
During a voice call, if a packet doesn't arrive (or arrives late), it's outdated and stops being relevant. You'd much rather have the call cut out for a fraction of a second because one packet went missing, than wait for the missing packet and all following packets to be re-transmitted, causing an interruption and delay in the call.
36
u/Sirlowcruz May 07 '26
Uhm Acktually
UDP means user datagram protocol.
So the idea is not to just throw stuff, the idea is that you can build your own protocol on top of it.
27
22
u/filfner May 07 '26
Counterpoint: I’m too dumb to design a protocol so I’ll just firehose my data and let the front end team deal with it.
12
6
6
u/Laughing_Orange Arch BTW May 07 '26
NASA did that. They don't have the capacity for the full TCP overhead on some of their satellites and probes, so they designed their own lighter TCP like protocol on top of UDP. That protocol still works okay when your bitrate is measured in bits/second and ping in minutes.
→ More replies (1)→ More replies (1)3
u/EnjoyJor May 07 '26
TCP: Please sign this packet. A delivery has been attempted. Sorry we missed you. We will make another attempt.
UDP: Packet.
10
u/SuchIntroduction8388 May 07 '26
The stuff others said. Also this. Two decades ago I worked for a company that made special sensors for electrical grid. They were put in absolute wilderness, where internet signal was at such ridiculously bad quality, that some devices managed to send just a few packets a day. A few packets. Not enough to establish TCP connection and DNS request, but more then enough to send their state in one UDP packet at least.
9
u/MinecraftPlayer799 May 07 '26
They are both UDP. One is User Datagram Protocol. The other is UnDamaged Packets.
→ More replies (1)
16
u/dercrafter2000 May 07 '26
HTTP 3 uses QUIC for better performance, which is based on UDP
→ More replies (1)
7
6
5
u/kubrickfr3 May 07 '26 edited May 07 '26
I think the real question is why TCP still exists? Not in the sense that it’s not good or useful, but why are we so stuck with this 80s tech?
Don’t get me wrong, it’s great in many ways, but we have made a lot of progress in the past 40 years and the idea of having this big state machine in kernel space in every OS is maybe not a design decision we would do again…
→ More replies (1)5
u/Ooops2278 May 07 '26
Stats about http3 usage say that it might not exist for anything but legacy reasons soon. But the common people not actually caring much for underlying tech will probably make tcp jokes for decades still.
5
May 07 '26
UDP is great for certain things. And it's actually becoming more popular with HTTP3, which uses QUIC, which is built on UDP. It will likely one day become the majority of traffic on the web.
Reality is, with modern infrastructure, UDP has a high rate of success, and offers a lot of advantages.
For example packet order often doesn't matter as much. If you're downloading 10 images from a server for a website, do you care which image loads first? And if 1 image is lost, you can't access any images after it until that lost image is resent.
If you're streaming video, an interruption still happens with TCP, but instead of losing a frame, the whole video lags.
More and more, we're going to see protocols built on UDP, dropping live data when we expect that data to be replaced. Not blocking traffic over a lost packet when desired. And integrity and ordering being handled by the application layer.
→ More replies (1)
5
u/Jivsy May 07 '26
We used UDP with added packet loss protection in our game, was actually just faster than relying on mixture of UDP and TCP
5
u/CMDR_Helium7 May 07 '26
Learn some networking and then you'll understand. UDP is for when you need things fast and don't care if a few packets get dropped every so often. Either that, or they shift the responsibility onto a higher layer. TCP on the other hand makes sure everything arrives before handing it to the layer above.
One application where TCP rarely every works well in my experience is VoIP. TCP will literally wait for segments to arrive before handing the data to the layer above, meaning you get really awful sound gaps in your calls if your packets don't travel a perfect route. (there's no real way to control the route, because of so many factors that contribute to routing) Oh, and then there's things like google's QUIC which works a lot like UDP (is based on it too), but is like a lot more advanced.
5
u/dudaladen May 07 '26
Imagine a tcp phone call
3
u/dudaladen May 07 '26
Imagine gaming with tcp, wait actually games do update your local position (lag you back) if they detect a mismatch in local and server player position but its still udp i guess, or something similar
4
4
4
7
u/wrd83 May 07 '26
Performance. Tcp overhead is no joke.
4
u/brandmeist3r Arch BTW May 07 '26
Also latency, thinking about the Deep Space Network and Mars missions for example.
4
u/wrd83 May 07 '26
Performance is mostly about tail latency on packet loss. So 100% true.
And to be clear, optical has almost no noise - so it's all oversubscribed traffic for the bandwidth.
3
u/bruhred May 07 '26
better question is
why does tcp exist?
protocols that implement reliability over udp tend to actually outperform tcp
→ More replies (5)3
u/PeachScary413 May 07 '26
TCP is old as shit and had various hacks to try and improve it while maintaining backwards compatibility...
Due to ossification it's impossible to implement new universal reliable internet protocol so we just have to build shit on top of UDP 🤷
3
3
u/Upper-Release-3484 Webba lebba deb deb! May 07 '26
For video calls, mainly. You don't want the call to stop just to load every pixel right on your screen, am I right?
3
3
u/besi97 May 07 '26
Another case I didn't see mentioned here is VPN tunneling. For a tunnel you almost always want to use UDP, and never TCP, unless some circumstance absolutely prevents UDP. The issue is that TCP packets transferred in a TCP tunnel are not just severely unperformant, but it can easily congest practically any bandwidth with what is called the TCP Meltdown. If traffic gets congested just for a few sec and a packet times out, then both the VPN software and the underlying application will resend it. Great, now 2 packets time out, same happens for both, and now 4 packets time out. Within a few seconds you have such a queue that it will never clear.
3
u/Recipe-Jaded May 07 '26
It is much better for real time data that doesn't need 100% reception, like streaming
3
3
u/arjunshinoj May 08 '26
Streaming/video calls. Doesn't matter if a few packets don't reach thr target we dont need buffering in those scenarios
2
u/LinAGKar May 07 '26
For situations where you can tolerate some data being lost, and don't want add latency by waiting for retransmissions.
2
u/eins_biogurke May 07 '26
From what I know UDP is used for things like telephone communication and other things that need speed but don't care a lot about package loss
2
2
2
u/rotoblade79 May 07 '26
If you are buying 183 tons of styrofoam in blocks of 100 grams, do you really want it to be delivered like in the first picture?
2
u/MyTinyHappyPlace May 07 '26
Most stock exchanges: Meh, just send it twice. One will most likely arrive.
2
u/Sea-Housing-3435 May 07 '26
It's faster. HTTP3 will use UDP instead of TCP because it's faster. All the validation will happen on higher layers.
2
u/Nice_Lengthiness_568 May 07 '26 edited May 07 '26
Well UDP offers better performance over TCP. And its limits can be mitigated with protocols such as QUIC. Actually, HTTP 3 does not use TCP anymore but uses UDP. Also, some protocols that are just request-response do not really need TCP. Some protocols also can't use TCP because TCP does not support broadcast or multicast
Edit: Also, TCP can be too complex for some devices, or you may not really need to know whether the sent data arrived
2
u/Weird_Explorer_8458 ⚠️ This incident will be reported May 07 '26
a) where linux
b) what POSSIBLE use could ANYONE have for a (lossy) data transfer protocol that is faster than TCP
→ More replies (1)
2
u/Fricki97 UwUntu (´ ᴗ`✿) May 07 '26
Lower latence at cost for data integrity
Used for streaming and online games
2
u/Jpporta May 07 '26
if you need fast connection and the fact of loosing package is not the end of the world. Like all live streams
2
u/MrCookieHUN May 07 '26 edited May 07 '26
Simple. TCP is for the packages that need care. Like rendering a still image.
UDP is for the more speed sensitive stuff, where certain losses are not the end of the world.Voice, for example.
You cannot have 100% efficiency, you gotta balance it out between quality and speed.
→ More replies (2)
2
u/I-baLL May 07 '26
UDP gives you the option of not caring whether the packet was received or not whereas TCP doesn't. So if you have streaming video and a few packets get lost then who cares? And if you do care,then the idea is that you can use another protocol to handle error handling. So UDP gives you more options whereas TCP exists for when you don't want to deal with any of that.
2
u/GreeleyRiardon May 07 '26
I mean, you really don't need all those pesky packets. So you dropped one? What's the worst that could happen.
2
u/usernameaIreadytake May 07 '26
near zero latency audio and or video transmission doesn't care about lost or corrupt packages. well it does, but when it happens, its already too late. You need a pretty good infrastructure for that to work.
The event and broadcast industry loves that shit.
2
u/Funkey-Monkey-420 M'Fedora May 07 '26
because if you’re doing a livestream you care more about being able to see it live than you do about losing a couple packets.
2
u/b1urbro May 07 '26
For use cases where you don't need full data integrity, but need speed. Like voice calls fo example.
2
u/orfeo34 May 07 '26
Streamed content doesn't deserve as much care as file and transactions. I you loose a frame or an audio sample it's less inconvenient than getting it all slow.
2
u/ChironXII May 07 '26 edited May 08 '26
Internet used to be very slow and UDP has very little overhead or latency. Enough so that you can often get away with simply resending any missed data and still come out ahead.
In particular things like real time video are ideal use cases for UDP. High throughput, low lag, and any missed data is irrelevant by the time it would catch up anyway.
2
u/keithstellyes Arch BTW May 07 '26
TCP enforces guarantees that might not be worth the cost, or even irrelevant for many use-cases that opt to use UDP. Like ordering of packets or re-sending of packets
2
2
u/codeIMperfect Not in the sudoers file. May 08 '26
The funniest thing being, TCP is kind of in the process of getting replaced by a protocol built over UDP, QUIC.
2
u/saiyan6174 May 08 '26
Because TCP sucks for real-time stuff. Retransmitting a 200ms old game-state packet is like getting traffic updates after reaching home xD
In real-time stuff like gaming or voice calls, old packets are useless. Better to miss one update than pause everything waiting for retransmission. A lost packet in a download corrupts the file. A lost packet in voice chat is usually just half a syllable.
2
2
u/4chanisforbabies May 08 '26
I don't think anyone here gave you the right answer. People mentioned reasons why UDP makes more sense like realtime apps/games and high-speed transmission, but not a reason why it wouldn't work.
The reason UDP exists is broadcast/multicast. It would be impossible to use TCP a a transport protocol when you have multiple independent destinations for a packet.
2
u/Tutorbin76 May 08 '26 edited May 09 '26
You can either get it fast, or get it 100% intact. Pick one. Then realise that use cases exist for both.
2
2
u/Kriss3d May 09 '26
Because when you steam a lot of data for say a movie, or video conference, you dont care if the other end gets all the packages.
2
2
u/bel9708 May 10 '26
Somethings prioritize speed over correctness. Like for instance, voice over IP uses UDP because if any of the packets drop users will provide the robustness by just saying "you cut out can you repeat yourself".
2
2
May 10 '26
sometimes you dont care about ACK when performance is the goal.
See video streaming for example, twitch really doesnt care if all the morbidly obese discord mods get 100% of the packets when usually its enough when 99,98% of packets arrive to finish off to their favorite hottub stream.
2
u/WrongLog May 10 '26
TCP has a lot of protective features (acknowledgements, in-order, etc). UDP gives you a clean slate, so that you can send the data raw - OR - pick and choose (mimic/re-implement) only the TCP features that your data transmission needs (and none of the things it doesn't), allowing your program to prioritize data transmission which is as close to real time as possible, and not so choked up if a connection is inconsistent. A bit like listening to a choppy/noisey radio rather than a radio that gets stuck buffering forever. It's not well suited for data when you need every single packet and need to confirm that it arrived, unless you want to redo all of TCP yourself.
2
u/Arizon_Dread May 10 '26
When throughput is more important than every single packet getting to the destination in order, UDP is superior to TCP.
VoIP and online gaming is often UDP. A slight glitch is better than constant lag.
3
u/Specialist_Fan5866 May 07 '26
UDP is TCP without the handshakes and the headers that make that possible. You can implement TCP over UDP but not the other way around.
3
u/Yama-k Arch BTW May 07 '26
Because a stream of water is faster than checking if each drop is water
2
1
u/UltimatePeace05 🦁 Vim Supremacist 🦖 May 07 '26
udp today (especially on LAN) is deadass top image + individual video game packets can just be dropped*
frommyunderstanding, I rarely do networking
1
u/CdRReddit May 07 '26 edited May 07 '26
because not everything has to stop if a packet gets lost (which is rare) or if they get transmitted out of order
a file transfer protocol over TCP is going to be (slightly) slower than one over UDP in the case of failures, in TCP if packet 6 out of 10k gets lost it has to stop everything until that packet arrives, a UDP protocol for file transfers can instead just send all the packets with a retransmit request packet being sent back when one goes missing, keeping the firehose of new info going instead of needing to negotiate what happened to #6, and just re-sending #6 when convenient, and there are some applications where packet #6 getting lost doesn't matter at all, in a live video stream you don't want to pause the world to find the pixel that belongs to the referee's left nostril on frame #947293, you just render it slightly incorrectly for 1 frame and move on
TCP imparts a bunch of decisions that you may or may not want, UDP does not, it's the .bin of internet streams, your question is like asking "why do we have .bin when .png exists", not everything is an image, and not everything cares about correct order and full reliability enough to incur the costs of TCP
2
u/CdRReddit May 07 '26
to go with the common firehose analogy, if you're putting out a house fire you can either try to fill up a cup of water and pour it onto the fire repeatedly, making sure you don't lose a single drop, but be slow at it, or you can aim a firehose at the general direction of the fire, get most of the water onto the fire, but also have a lot more water
I know which water transportation method I would choose for a house fire, and which one I would choose for a cake recipe that calls for 2 cups of water
1
u/DistinctTrust8063 May 07 '26
In my first networking class my professor described it like this. TCP is good for watching a movie online and UDP is good for watching a livestream. For a movie you want to get every packet, you don’t want to miss anything or have packets show up in a mixed up order. For a livestream it’s more important for you to keep up with the packets being sent, so if you miss a couple it’s fine.
1
u/Drio11 May 07 '26
UDP is system, TCP is basic setting for it when you dont know how to setup protocol.
1
1
u/IncreaseOld7112 May 07 '26
Consider cases like VXLAN or VPN, where you're sending IP traffic over IP. There's a phenomenon called TCP meltdown. Another example is Quic, which uses UDP because it has it's own mechanism, not at the protocol layer for ensuring delivery.
1
1
1
u/TheTybera May 07 '26
UDP is fast and you don't care about some packet loss.
Games all use UDP, I don't care if I miss some movement updates I'll just sort it out later in the server and have a tolerance.
That's where you get lag and rubberbanding from, however if you used TCP you wouldn't even be able to play because it would be so damn slow to acknowledge the thousands of packets spread across multiple clients.
→ More replies (1)
1
u/igormuba May 07 '26
Because it is protocol level. If you choose UDP you can on the application level decide if a packet should be resent or not. If you choose TCP you have no choice.
1
u/Stick_Nout May 07 '26
For DHCP it makes sense because the device literally doesn't have an IP address yet.
NTP also makes sense, I guess. The extra TCP overhead would get in the way of synchronizing your clocks.
Not sure why TFTP and DNS use UDP, though.
1
1
u/Mefist0fel May 07 '26
Because it is the only and the main way to communicate actually. TCP is just some smoke and mirrors with extra durability on top.
But for your app and your data it can be not efficient, slow, or you can not care about guarantees. So you don't need predefined smoke and mirrors
1
u/pasture2future May 07 '26
Because low latency and network overhead is required in certain applications
Also this has nothing to with linux
1
u/Vulpovile May 07 '26
Speed.
Sometimes you don't care if it always gets there, it should just get there as quickly and efficiently possible if it does
1
u/cig-nature May 07 '26
With TCP, for every data packet the recipient needs to reply to the sender saying 'got it'. That's more bandwidth, more latency.
With UDP, it just sends the data. If you miss a bit that's fine, the newest packets are more important.
A sports live stream is a great use for UDP.
1
u/D3xbot May 07 '26
Why does FedEx exist?
(But for real, UDP is good for latency-sensitive situations that don’t require every single packet to get there. Think VoIP and video streaming. A bit of packet loss on a codec designed to deal with it will degrade quality a bit but will keep latency down. That reduces lag for voice and video calls as well as ensuring livestreams don’t sit there and buffer endlessly.)
1
u/tyami94 May 07 '26
everyone who is saying performance is wrong. udp *can* improve throughput, but thats not why people use it. the real answer is latency. tcp requires 3x as many packets to be sent relative to udp to ensure the transmission of the same amount of data, and this obliterates latency. in certain applications, it doesn't matter whether all the packets get there or not, it just matters that *most* of them get there as *soon* as possible. this is where udp shines.
1
May 07 '26
TCP is just outdated. We don't really need it anymore, because networks are far more reliable now and ensuring data delivery can be done at the application layer much faster with modern computers.
The whole internet is moving gradually towards UDP transmission, especially considering that more and more of what we use the internet for is "real time" applications, i.e. if it doesn't arrive on time and in order the first time, it might as well not arrive at all.
1
u/ReggieCorneus May 07 '26
Low latency sequential datastreams where losing a packet is far less destructive than receiving them late or in the wrong order.
1
u/SirMaxikahn May 07 '26
AES67/Dante/AVB, just to name a few protocols for roughly the same application
1
u/adumblittlebaby May 07 '26
windows guy here is the meme linux users don't know anything about networking? idgi
1
1
1
1
u/Saragon4005 May 07 '26
"why would anyone want packages left at the door instead of hand delivered with a signature"
1
1
u/amirreza225 May 07 '26
For streaming use cases and the instant use cases which reciving all of the packets maybe is not very important and you don't want to lose the realtime data because another data is coming after that.
1
1
1
u/RedAndBlack1832 May 07 '26
The reason was explained to me in a class on IoT is it's actually really reasonable to have different standards of service for different kinds of messages (theses being send the message once, send it over and over on a timer until you get an acknowledgement, and do that but in a way that prevents duplicates) because there are physical trade offs. Mainly, power consumption. If a device is meant to last on battery for years waiting for an acknowledgement is a waste of resources when it could be sleeping.
1
1
u/irishcoughy May 07 '26 edited May 07 '26
Editing my comment because I'm an idiot and forgot both my examples in my joke do actually use TCP instead of UDP and I'm going back to the shame closet.
1
1
u/KubeCommander May 08 '26
I mean technically it’s ‘why tcp’ because you can just effectively ‘do’ tcp with udp packets
→ More replies (2)
1
u/Ok-Acadia-1795 May 08 '26
UDP is primarily used for real-time applications such as VoIP or video conferencing. In these contexts, low latency is more critical than the guaranteed delivery of every packet. Since retransmitting lost packets often results in them arriving too late, a continuous data stream without interruptions caused by retransmission mechanisms is preferred.
1
u/betodaviola May 08 '26
I use it in live A/V generative projects and other experimental multimedia projects (no AI) where it needs to be fast and just reliable enough. When I miss a package or two it's unoticeable
1
u/itomeshi May 08 '26
TCP is a minivan with every safety feature imaginable. Lane assist, self parking, self-driving, curtain air bags, excessive crumple zones, anti-lock breaks, the whole shebang. Not the fastest acceleration - and you don't have many ways to fix that - but you'll get there.
UDP is a sports car focused on FAST. Tremendously fast, but even the steering isn't all that safe. You cam bolt on some things to 'fix' it, but each thing you add will slow you down - and at some point, you'd have been better served by the minivan.
HTTP is driving the minivan in a space suit. You'll be even slower and less comfortable, but you're even more safe and 'structured'.
WebSockets are a racing suit. You're still getting a lot of guarantees - this is still TCP, but less overhead than HTTP/QUIC over TCP - but it's designed to make it easier to drive and respond.
TLS (SSL) is tinting bulletproof windows and sticking kevlar plates in the doors. It's even slower, but you maintain your privacy and you probably won't get messed with.
1
1
u/skr_replicator May 09 '26 edited May 09 '26
If you want a serious example. UDP is great if you want to constantly update some data, overriding the previous. If one packet gets lost or corrupted, it doesn't really matter, because the very next one fixes it back. So it could be great to update player positions in multiplayer games. It woudl feel much better when they actually move with pretty good latency, and only rarely glitch and immediately correct. Then, if you used TCP, that might deliver each location correctly, but only at 1 FPS or something.
A player movement over TCP could look like this:
Real location:
1 2 3 4 5 6 7 8 9
Over TCP:
- - 1 - - - - 6 - -
Over UDP:
- 1 2 3 4 - 6 7 2 9
Streaming would be another example, TCP would never give you even 30 FPS, would you rather watch it at 1 FPS but ensuring every image is sent completely perfectly to the pixel, or at 60 FPS, with maybe a little barely visible, slightly glitched frames or a microlag sometimes?
TCP is great if you want to send something once and be sure it arrived perfectly, a totally different use case.
1
1
u/Deep-Art5943 May 09 '26
For various reason where continuous data flow is required like it used in gaming, zoom meets, etc.
1
1
u/lithosza May 09 '26
I can think of a few examples: FPS games, VOIP and live video calls.
If you use TCP for VOIP/video calls then every lost packet delays the stream a bit. Eventually it builds up to seconds of delay. If there are no packets lost then TCP probably could work.
For FPS games you are only interested in the current state of the game, if you lost a few packets then you don't really care. If it was using TCP then you your game client will need to wait for the other lost TCP packets to be resubmitted. Huge delays which are unacceptable for FPS games. Other games do actually use TCP only like Ultima Online, because it makes sense.
1
1
1
1
u/AdAgreeable7691 May 09 '26
What would be faster handling 10k packages holding both hands and reporting each of those back to the sender that you have delivered it Or just yeeting all of them to the destination.
1
1
u/SDG_Den May 09 '26
For speed.
Tcp is much slower, but guarantees all packages arrive (in theory)
Udp is fast, but does zero checking, which makes it perfect for time-sensitive data like for example videogame multiplayer.
If we miss a packet in a lobby, we dont want to wait to receive it again. We just go "oh well, next packet". Whenever that is your preferred handling, you use UDP. Anything where data order and integrity across packets is important, TCP
This naturally makes most types of traffic TCP, with only things like VPNs and game servers using UDP
1
1
u/thriem May 09 '26
If you need an EpiPen in 140min, you don’t want to find a „left at the office“ notice at your mailbox.
1
1
u/psychicesp May 10 '26
Streaming measurement data from an IoT device trying to catch transient spikes.
Better to miss a spike or two due to dropped packets than to miss all of them because you aren't polling fast enough.
Yeah you can send them in bursts with TCP and catch most of them, but those cycles spent on verification still could be clocking additional measurements
1
1
u/Metabolical May 10 '26
Imagine you are streaming a voice call. Between 5 and 20 times a second, you send a packet with a tiny sound chunk for that time period, with a marker in it to say in what order or at what time.
If you use TCP, it will guarantee delivery of every packet in order. In other words, it will have a buffer of received packets and if one got dropped, it will send a message back saying it needs it again. Everything waits for the missing packet to resolve. If your connection is high latency, it will stutter for a long time if you lose a packet.
If you use UDP, you have a small buffer, and you just play them in order. If for some reason one is dropped, you interpolate between the sound clips playing and probably never notice. If it shows up after you've played that far in the buffer, you just throw it away.
1
u/Fmily May 10 '26
Faster.
Also I use it for nextcloud transfers because nextcloud does the tcp style packet verification. Using tcp would be redundant and slower.
1
u/Alara_Kitan May 10 '26
TCP suffers from a number of issues UDP fixes. If you're browsing the web today, you're probably using UDP (HTTP/3 is based on UDP, not TCP). With QUIC, there's no reason for TCP to continue existing any further. That protocol is legacy now.
2
u/eldoran89 May 10 '26
No tcp is not legacy. Its white a lot simpler and straight forward compared to udp...sometimes you want udp sometimes you want tcp sometimes you want a bit of both(quick). None can obsolete the other
→ More replies (3)
1
1
u/Key_Amphibian_1881 May 10 '26
tcp guy travels all the way back to you to tell you it's been delivered or not.
1
u/eldoran89 May 10 '26
When streaming a video you don't care that everything is exactly delivered. You care more for fast delivery and if sth is missing you just fill in the gaps because you won't notice a frame missing but you would notice a video stopping every second because each frame has to do a syn ack shennenigan..
1





1.5k
u/Jak1977 May 07 '26 •
I've got a UDP joke, but I don't care if you get it.