[MUSIC] This lecture we'll talk about protocol stack, the Internet standard protocol stack which involves TCP/IP and I'll talk a little bit, give a little bit of an example about an application layer protocol, what that would look like. We're not going in again, not into too much detail, but you should know what this protocol stack looks like, because anytime you want to use the internet. So, if you want to write code that accesses the internet, you're going to be using this stack, this protocol stack. So, you want to know something about how it works. So, typically, when you're using the Internet, this is sort of a standard protocol stack that you see right here. This is not the same as the OSI protocol stack. The OSI protocol stack has seven layers, and it's more complicated. This is simplified, this has four layers in it. Top layer is the application layer, below that is the transport layer where you see TCP/UDP. That's transport layer. Then below that you see IP which is, that's called the network layer, and that's the Internet protocol is there. And then below that is what's called the data link layer. Actually, there's really two layers merged there, data link and physical. So, the very bottom layer that you don't see there, is merged in is physical, where it actually drives it onto the wires, drives the signal onto the wires or onto the radio. And actually, if we look at these layers there's code associated with each layer, right? They're typically library functions. So, in practice in this specialization when you write network code and you will later. When you work on network code, we'll be talking about. You'll be calling application layer library functions. Only top layer, right? You don't have to worry about the lower layers at all, almost at all, right? Just the top layer is what you're really going to be dealing with but this whole stack has already been implemented and it will be given to you. So you'll download a free stack that looks like this but the functions that you'll be calling will be all top layer application layer. But just to say a little bit about some of these layers, there's IP, we already talked about that, TCP/UDP, and the data links of physical application layer. These are the protocols that directly interact with the applications. So whatever kind of application it is you're writing, if it's a network application it will have some kind of a network protocol and application layer protocol that it works with. So, for instance, naming some application protocols. SMTP, simple mail transfer protocol. That is a protocol used by mail clients. Right? If you've got an email client, it might be using SMTP to communicate with the mail server. HTTP, hypertext transfer protocol. You've heard of that, HTTP:. You've seen this in your URLs, right, and your addresses on the web, http:// whatever. So, anything that's HTTP, that's web interaction, which is most likely what you, which is most commonly used for, actually, in this class that's what we'll be using later on. And then, LPD, it's another one. Line Printer Daemon, printers talk to each other using that protocol. But there are a lot of these protocols. File transfer protocols, a bunch of them. If you want to transfer files, maybe you will use file transfer protocol. Hopefully you use SFTP, secure file transfer protocol, because it's better than FTP. But the idea is that every network application has its own protocol at the application layer that it uses. So, to give you an example what one of these protocols looks like, let's look a little bit at HTTP. This is HTTP, this is a typical request on the web. Little hard to see, but if you look at the, actually the one we're looking at right here, this is the response message. So, it has several lines. Actually, that code right there has six lines. The top three lines, the ones in green, those are the header. And the bottom lines in white, those are the body, or the data, right, the payload. Whatever term you want to use. So the header are gonna be basically those top three lines. Now, the header information, it gives information about the message but it's not the actual content. So for instance, we look at the first line, it gives you the protocol version, also the message type. 200 OK is if you look at HTTP protocol which you can Google it and get a very large protocol document. 200 OK has a particular meaning. Every response message is gonna have a particular code. 200 OK is sort of your standard response, right? So then the next line there has a date, the date they were transmitted and so on. The next line has a content length, so that's how big the data is. That's inaccurate, but that's an example. It'll have the content length, and there are a lot of different pieces of header information you could stick in the header. And then the body, the data that you see there, that's the actual body, the context of the message. Now in this example which is very common, if this is a web, your asking for a webpage what happens is your machine, your IOT device let's say, sends a request out to a web server and the server sends back the contents of the webpage right? And so that your IOT device can render the page and draw it for you on the screen. And so that, what you see there, is HTML code, which is the content of a webpage. So, you know, this is summarized, but you can see it starts with HTML, ends with HTML and has a bunch of HTML tags, if you're familiar with those, but that would describe a web page. So if you had a web browser on your IOT device, it would read that data and then draw the webpage represented that it's supposed to be represented for you. But you can see here that this protocol, this HTTP protocol, is application specific. It's for web transfers. It's got header. There's some header lines which may or may not be useful to you, but the data is actually what you wanna send. Thank you. [MUSIC]