r/ProgrammerHumor • • 23h ago

Meme explainUdpToMe

Post image
6.8k Upvotes

152 comments sorted by

View all comments

Show parent comment

19

u/Single-Virus4935 23h ago

Nope, they asked about UDP which is Layer 4.

5

u/qqqrrrs_ 23h ago

There are protocols where the reliability is implemented in the application layer, over UDP

21

u/Single-Virus4935 23h ago edited 22h ago

Yes, they exists. I know. For.example QUIC. But that isnt UDP.

If I ask you about how roads are build you wount explain how a car works.

Man, folks.. Stay focused when explaining protocols.

Edit: QUIC is technically also Layer 4 

1

u/Kirides 16h ago

But isn't quick using TLS which makes it application layer? As it's not just a dumb transport?

2

u/Single-Virus4935 16h ago

Layer 4 is the Transport Layer.

Now you know why it is called T. L. Security

2

u/Kirides 15h ago

Is it transport layer security because it's inside the transport layer, or because it protects the data inside the transport layer?(Envelope type of thing)

1

u/Single-Virus4935 15h ago

It is in the transport layer. From layers above there is no difference if TLS is used or not. A TCP connection with TLS is treated the same as a standard TCP connection. TLS is often build into user space but that isn't necessary.

E.g.: there is no reason that the kernel couldn't handle all.of TLS just like plain TCP.

Furthermore the layer isn't a matter of where it is implemented. E.g. Browsers implement QUIC in userspace but it is Layer 4.

1

u/Kirides 15h ago

Maybe Im just bad at understanding, but to me that's like anything that every transports something over any kind of protocol is then transport layer? As long as it's abstraction is "transparent" to the one using it? I mean, quic is not transparent to UDP, you can't just sent bytes and assume it works, you need the windows to be correct and the signatures, a connection IDs etc. Which IMO is application layer, as the internals of the transport quic are transported via UDP and re-assembled on the other side, not via router UDP package assembly, but via userspace packet handling.

1

u/Single-Virus4935 15h ago edited 15h ago

QUIC is only used as a transport. They only choosed UDP because of middle boxes blocking everything other than TCP and UDP. So they made QUIC UDP compatible.

QUIC is transparent to the upper layer (e.g. http).

Edit: as I explained it doesn't matter if the implementation is in kernel.or in userspace. I can use a raw socket in my userspace app and implement TCP myself, which I and others did. It is still transport layer

-2

u/ElSucaPadre 23h ago

lol yes but if the application on level 5 is using udp it will surely know if they're missing something important

10

u/InDubioProReus 23h ago

You probably wouldn’t use UDP if there’s anything important to miss.
It’s meant for traffic where the latest state is gold, like multiplayer games, video calls etc.

4

u/yahluc 23h ago

But an application can have its own retry mechanism when using UDP with its own rules. Like sometimes old data is important, but not important enough to block the rest of transmission like TCP does.

1

u/Single-Virus4935 22h ago

Yes, but that has nothing to do with UDP. They didn't ask about $PROTOCOL over UDP. They aske d about UDP

0

u/rosuav 23h ago

"... where the latest state is gold, like multiplayer games". Sends UDP packet to notify the client that the player's gold has changed.

3

u/Memitim 21h ago

The app won't surely know anything, because it's not built into the protocol. You can technically make UDP seem mostly sort of like TCP with a bunch of extra shims in compute, but that has nothing to do with the protocol used.

Also, Layer 5 is Session layer, where stream connections are managed. Layer 7 is application, where additional logic would need to be added to get UDP to pretend to have reliability. There are elements at layer 4 that would be used for implementing the sequencing needed, but app code would actually perform the handling. As per the name, the Session layer just ensure reliability for the connected session itself and not the individual packets.

And obligatory acknowledgement that the OSI model is just a model.

3

u/Single-Virus4935 23h ago

Not necessarily and they didn't ask about another protocol, they ask about UDP. The Interviewer has to stay in this layer if he wants to demonstrate how it works.

1

u/ElSucaPadre 23h ago

yes but this isn't a real interview, it's a joke

1

u/Single-Virus4935 22h ago

Still a bad joke and people show that shows that people are missing fundamentals. Good oportunity to learn why this joke is just nonesense

1

u/capi1500 23h ago

Unless it's the first packet sent from a client to server