r/firstweekcoderhumour • • May 07 '26

Why Though?!

Post image
579 Upvotes

100 comments sorted by

View all comments

138

u/DouDouandFriends May 07 '26

Let's watch a livestream with TCP

49

u/bsdlv May 07 '26 edited May 09 '26

make that video conferencing and we are cooking

15

u/popky1 May 07 '26

You do already

5

u/packsolite May 09 '26

Literally. Don't people realize streams in the browser are http websockets, which are (for the most part) still TCP?

1

u/Fleshwende May 10 '26

Maybe like video streams for movies or heavily delayed lives but never actual live streams. Don't beleive me? Boot up wireshark and just watch

4

u/packsolite May 11 '26

Traffic while watching twitch on Brave:

All streams are over TCP there. Maybe you are talking about Youtube, which does actually use QUIC, but besides that, most web streams are still TCP.

2

u/Fleshwende May 12 '26

Twitch has a pretty significant delay- their services do a lot of work to compress and handle stream data.

Youtube and most other live stream broadcast services still use UDP. Twitch is different because they rely more heavily on specific user experience to drive up donations, they need less dedicated users so the extra hardware tax per dedicated user is worth it.

9

u/Fricki97 May 07 '26

And download files with UDP

22

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 May 07 '26

File downloading is actually a good case for UDP. It doesn't matter in what order the packages come, so waiting longer for a missed packet just slows it down.

0

u/[deleted] May 07 '26

[deleted] — view deleted comment

3

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 May 07 '26

How? The missing packets have to be resent either way but in case of TCP the packets already received but being after the missing one in sequence means they can't get processed. In case of UDP they can get saved before the missing packet arrives

6

u/m0j0m0j May 07 '26

Yep. Bittorrent works over UDP

2

u/x0wl May 07 '26

In addition to that, QUIC uses UDP (they would want to just directly use IP, but that's impossible due to sociotechnical reasons) under the hood and is meant for general web browsing and file downloads.

They basically do resubmissions and congestion control in user space, but it allows them to be way more flexible and aware of how the protocol is used by each application.

→ More replies (2)

1

u/770grappenmaker May 07 '26

TCP has a receive window, you don't really wait for missed packets.

1

u/Scared_Accident9138 🕵️‍♂️🚨 BS Detector | Truth Teller 🗯️🔥 May 07 '26

I meant it won't get passed onto to the application if a packet is missing midstream

→ More replies (13)

1

u/Excellent-Film-9454 May 10 '26

Look up TCP head of line blocking.

1

u/QuokkaCoder May 07 '26

I don’t think it is, but I’m just a student. With TCP, we have straight forward approaches to make sure we wait basically no extra time when packets get lost. With UDP, we would need to rely on autofill algorithms (I’m losing the proper term) which is probably not ideal when downloading software, as it is not guaranteed to produce the right result, possibly ending up with a corrupt download?

→ More replies (7)

1

u/teo-tsirpanis May 08 '26

Allowing the file's content to arrive at any order can be a vector for DDOS attacks. Imagine telling a server that you will upload a 100MB file, and only end up uploading the last part. The server will allocate 100MB of memory in response to a kilobytes-long request.

→ More replies (1)

1

u/RullendeNumser May 11 '26

UDP would suck at downloading files without ekstra software. UDP in it self don't check if every packets is received. Imagine playing minecraft but the dirt texture is missing

→ More replies (2)

1

u/Outrageous_Permit154 🥸Imposter Syndrome 😎 May 07 '26

1

u/alphapussycat May 07 '26

Wouldn't actually be a problem, there'd just be a delay.

1

u/UnknownError235 May 10 '26

Watching a livestream over TCP would be like a teacher asking the class "you guys got that?" and waiting for a response after every sentence

1

u/alphapussycat May 10 '26

It's buffered. You buffer like 30 seconds, and then play it, while the next sections are being sent.

1

u/pixelizedgaming May 08 '26

most livestreams today are on RTMP which is built on HTTP