Networking and Streams Networking and Packets
Transcript from the "Networking and Packets" Lesson
>> Hello, everyone. So today we're gonna start out with networking, which can mean a lot of things but here, I mean this word in terms of what are clients, and what are servers, and what does TCP look like, and what kinds of protocols do we typically deal with?
[00:00:18] So that will be the first part. So there are a lot of ideas that people might have about what is a server and what is a client in terms of what that physically might manifest as like a server. I think people usually think of a big rack mounted thing with blinky lights and stuff.
[00:00:40] But really, any networked computer can be a server just like any networked computer can be a client. These are more roles that computers play in how we use them. So, Usually, this kind of stuff runs based on little pieces of data, little chunks of data, which is also an important idea for later when we get into streams.
[00:01:14] And these packets are kind of chopped up into little pieces and sent over the network. So you might get them out of order as well. So there's all kinds of different ways, different little sequence numbers that get attached to the packets as they fly over the wire. With TCP you get acknowledgments, so for every packet you sent you get an ACK back from the other side that says, yes, I received this.
[00:01:43] But with UDP you don't. We're mostly gonna be playing around with TCP because it's usually easier to think about if you send something, it's gonna arrive in order and you know whether you get it back or not. You have a question?
>> So you just use UDP cuz it's faster then or why would you ever use it?
>> You would use UDP if, for example, a good use for it is something like a streaming audio or streaming video where you don't wanna resend things that didn't go through okay. You just want it to send the latest version always. That would be a good example. Actually for streaming audio and video, those are mostly done these days with TCP but I think a lot of games still use UDP for reasons.
[00:02:29] But the much more common one is TCP these days. Yeah, everything else is TCP. [LAUGH]