 What we covered from the previous example, we went through a case of sending from a web browser to a web server and we saw some different types of addresses. We know of course IP addresses. IP addresses identify interfaces of hosts. You can think to find someone in the internet we need to know their IP address. So they identify the devices in the internet. But on a particular device, on a host, it may be using one of multiple transport protocols. And it may be using one of multiple applications. So we have a protocol number to keep track of the transport protocol being used. So inside the IP header we saw that the protocol number field that says this data inside the IP datagram goes to transport protocol. If the number is 6, goes to TCP. If it's 17, it's UDP. If it's 1, it's ICMP, and there are others. There are just some of the common ones we'll see. You don't need to remember those numbers. For example in an exam I would give you the the list of numbers of relevant values. But over time you'll start to remember at least TCP is 6, UDP is 17. So we have protocol numbers, but once the transport protocol gets the data it needs to send to a particular application. So we have ports that identify applications. Port numbers are 16-bit values and they typically for servers a port number which is fixed is assigned to the server, either a well-known port number or a registered port number, registered port numbers. Whereas typically for clients they get dynamic ports. Whenever the client wants to communicate with a server so the program wants to create a connection to the server or send data, the operating system assigns at that point in time a port number, an unused port number. The next time it wants to communicate it may get a different port number. So clients usually have dynamic port numbers and may change over time. Having fixed port numbers for servers makes it easy for users because the user doesn't need to specify the port number to contact. The application of the user, the client, has it programmed into it. We went through an example where we saw our web browser wanted to talk to the web server. We had IP addresses of our two computers. The transport protocol was number 6, TCP, and the web server uses the standard port 80 and the web browser in my example I assigned 50123. In a different case it may have a different value. The source computer created a packet to send. We'll see in a bit more detail in a moment, but HTTP is used for web browsing and from browser to server it sends a request for a web page. So I said HTTP request is being sent, but it's sent using TCP as the transport protocol. So we say the HTTP request is put inside a TCP segment and the TCP segment has a header. Two fields in the TCP header are the source port and the destination port. 50123 going to destination port 80. They are in the header of the TCP segment and the TCP segment is sent using IP across the internet. So we put that TCP segment inside an IP datagram. So we attach the IP header and there are multiple fields in the IP header, but the three regarding addressing are the source IP address, my host computer, the destination IP address, the server computer I want to contact and the protocol number. We know this came from TCP, so the protocol number will be 6. They are fields in the IP header. That IP datagram is sent across the internet using routing tables. Eventually gets to our destination host, delivered to the IP software in our destination host because of the IP address. IP delivers it to TCP software because of the protocol number 6 and the TCP software delivers it to the web server software because of destination port 80. So that's how the addresses are used to deliver the data from application on the client, web browser, to application on the destination, the web server. So I'll just return to some of the slides and then we'll go through one more example of web browsing. How does TCP work? We're not going to cover that. Okay, so TCP is quite complex. You've had some exposure to it during the assignment, doing some performance tests, but we don't have time in this course to cover how it works in detail. It is very common, so it's very important, because one key feature it provides is reliability. You send data from your application to the server or you're downloading from a server a file, many applications we use need reliable data transfer. If I download a file and I don't get the entire file, that's ineffective communications. So many applications use TCP because TCP tries to provide reliability. But it does some other things. For example, TCP sets up a connection before we transfer data to support the reliability first. Before we send any data, we contact the server saying, we want to transfer data to you and the server sends back a response saying, yes, you can. And there's one final acknowledgement. So there's some connections set up at the start. Once we set up a connection, we can send data in both directions, client to server, server back. There's some flow control, so the client doesn't overflow the server and same in the opposite direction. There's error control, so if I send a packet and it doesn't get to the destination, I will eventually retransmit. And that follows a go back end style scheme for the flow and error control. And there's also congestion control, which is about making sure the sender doesn't send too fast to overflow the routers in the path to cause congestion in the internet. With all these features, it becomes very complex, and that's why you saw in your assignment changing some parameters to TCP. It's sometimes hard to indicate or to predict how the parameters will impact on performance because of the interactions between the different algorithms. Again, we will not cover how it works. That will be covered in a subsequent course. That's the header structure for TCP. There are 20 bytes by default in the header. It contains a source port number, the application where it comes from, a destination port number. It contains sequence numbers with error control and flow control. We send sequence data with sequence number one. And there's an acknowledgement number saying, coming back, I've received sequence number one. The next number I expect is sequence number two. That's the concept of those numbers. And some other fields to support the operation of TCP. For this course, we just need to know that there are two port numbers included in the header. There's a method for setting up a connection. Again, we will not cover how this connection establishment works. Those that sit in the lab next semester with me, we will investigate in detail how TCP connection setups work and some other transport and application protocols. So that's it about TCP. What's the other transport protocol? TCP and the other one is, what's the other transport protocol? You did it in the assignment. UDP. Remember, TCP and UDP are the two main transport protocols. UDP is much simpler. Just send the data. UDP has a smaller header. I don't have a picture of it. But it also includes the source and destination port. So it also uses port numbers. We're almost there. If we think of our layered stack, at the bottom is the physical layer, data link layer, network layer in the middle, which is IP, transport layer, TCP, UDP, and at the top application layer. And application layers has protocols that support the many types of applications we want to use across the internet. And here I just list some. There are maybe hundreds of different protocols, maybe even thousands of application layer protocols. For web browsing, we use HTTP. For file downloads, we sometimes use FTP. Or if you want to download from multiple servers at different parts, BitTorrent is another application layer protocol. For email, there's something called SMTP for sending email between servers. For voice calls, sometimes we make an online voice call, a voice over IP call, SIP is used in some cases there. And there are many, many others here. We don't have a chance to cover those in detail. As well as applications that the human user, you and I use, there are some application layer protocols that support those others. DNS, DHCP, DHCP we briefly mentioned is for discovering an IP address. DNS is for converting domain names to IP addresses. So there are other supporting application layer protocols. So what I'll do, instead of going through these or in any detail, I'll give one last demonstration of using web browsing. We'll see HTTP. What I will do is using my computer, access a website and then we'll look at some of the details of the messages sent between my computer and the web server to see quickly how HTTP works. Before I access the website, I need to, what I'm going to do is I'm going to, with my browser, access a website, but I want to record the packets that my computer sends and receives. So the first thing I'm going to do is tell my computer to record everything that it sends and receives so we can have a look at those packets in a moment. And the software I'm using is called TCP dump. It takes a dump or a record of all the TCP and also UDP packets sent, sent using my wireless LAN interface and I'm going to write them to a file. So just record everything I send and receive so we can look at it later. Now it's recording. It doesn't show any feedback yet, but we'll see later when I do something, we'll see the packets recorded. So I'm going to access a website and I'm going to actually access the ICT server. So my web browser, what do I do to access a page, a file on the ICT server, ICT web server? What do I do in my browser? Tell me how to do, how to use a web browser. Type in what? The domain name. Alright, so what we normally do is in the address bar, we type in a URL and a URL is made up of different components. Usually it starts with HTTP, colon, slash, slash, then a domain name like www.facebook.com, that's the domain name, then usually a slash or sometimes a slash followed by a path or a file name like abc.html. So that's the URL. We don't need to use a domain name, we can use an IP address. If I know the IP address of the server I want to contact, I can type that in directly. You all use the ICT server for your quizzes on a regular basis, what's the IP address? What is the IP address of the ICT server? You've been accessing it all semester. Well, we don't want to have to remember IP addresses and that's what domain names do for us. Domain names are the human-friendly representation of an IP address. Your computer sends a packet to a destination IP address, but instead of having to remember that IP address, we just remember a domain name and then there's a separate protocol that converts that domain name into the corresponding IP address. That separate protocol is related, is DNS, the domain name system. So I'm not going to type in the domain name, even though I know it, I'm going to go to the raw format and write in the IP address. But I need to know the IP address to do that. Let me, let me show you the IP address of the ICT server. I can look it up from a database. That is, if I know the domain name, this software tells me that the domain name for ICT actually corresponds to this IP address. My computer, when it sends packets across the internet, only uses IP addresses, even though the human may type in the domain name. So I'm going to use the, directly the IP address there in my browser. And I know the file I'm looking for. I know there's a file IT.html on there. I should put HTTP at the start. For the destination address, I specify in this case the IP address of the server or alternatively the domain name. The file I want from it. I don't specify the port number of the server because my browser knows if I access a web server, the destination port will be 80. The human user doesn't have to specify port 80. We can. You can put it, the port number here, a colon 80. But we just don't because the browser automatically attaches it. And you can actually change the port number if you want. So I'm going to access, and here we go. Does it work? Okay, so we've accessed a website on the ICT server, and that triggered my browser to send a message to the multiple messages to the ICT server, identified by the 203 IP address, and I got back some responses and eventually it shows this web page. I'll stop my record of the packets. So that should have recorded some packets being sent and received then. I'll stop that. Actually, there were 27,000 packets sent and received by my computer during that time, those couple of minutes. Some of them were sent from my computer to the web server. Before we look at them, what is the web page? If we look at the source, some HTML, very simple HTML. But note that the source HTML references an image. There's an image tag that says the source of that image file is finished.jpeg. That's why the image is displayed. What actually happens is that I requested it.html. When that web page was sent back to my browser, the browser looked through the HTML and found that there's a reference to the finished jpeg. So my browser then asked to download that image from the server as well. So it actually should have downloaded two files, the HTML file and the image file. To see that, let's look at our capture of packets. So I recorded all the packets. I'm going to use a software called Wireshark that gives us a nice graphical interface to look at those packets. And it's a bit hard to see because there are 27,000, but we'll try and zoom in on some of the packets first. What it shows of the 27,000 packets sent and received by my computer, it shows them one per line. It shows the source address of each, the destination, some protocol being used and some other information. I want to focus on just the web browsing packets. So I'm going to actually do a filter so that I can get the packets of interest. First, the IP address, the IP dot, the IP address that I want to look for was this 203 address. I don't want others. What my computer may have been doing in the background is I had another web browser open, it may have been accessing other websites, maybe the operating system was doing an update and other things, maybe my instant messaging client was sending messages. So there are many other packets we don't want to look at. So I'm going to filter out and first look at the ones for accessing that particular web server. We can zoom in on some of those. So here are the ones between my laptop and the web server. My laptop is 10.10.107.40 and the web server is 203 IP address. The one of interest with respect to web browsing is this packet selected. We'll zoom in on the details shortly but it's sent from my computer to the web server and the protocol being used is HTTP web browsing. And some summary information about that is that the message being sent, the format is my browser is saying I want to get the file called it.html. We typed in the URL with it.html so my browser sends a request for that file to the server. And then a couple of messages down, we see the server sending something back to my browser saying everything is okay. And importantly if I look at that individual packet, I zoom in on that particular one, the contents of that one packet contain the web page. So we see the data inside that packet was the actual web page of it.html. So that's it. That's the basics of HTTP. Your browser sends a request for a file, the server if it has that file sends back a message saying everything is okay and here is the file. In this case the HTML. So HTTP is a request response protocol. Send a request, get a response. The other thing we'll notice in this exchange of packets and I'll do another filter and just show HTTP. If I filter and just show the HTTP packets, we see I send a request for it.html, the server sends back the web page in the response. Then I send another request for finish.jpeg. Why? Because that web page I received prior to that referenced an image. So my browser automatically requests the image and then the server sends back the image in the response. And then it's displayed on my browser. My browser requested another file. What's this one? Well, where do you see this? So the favorites icon, in the tab in the window of your browser that little icon that's shown up there is the favorites icon. In your bookmarks or list of favorites, an icon shows up. Well, how do you get that? Your browser automatically requests the favorites icon. It's a special file that servers can have. If a server has it, it sends it back and I see the icon on the browser. Here it is, ICT is our favorites icon for the ICT server. So that's automatically done with some browsers. We'll automatically request it and show it. So web browsing, for every resource we want, usually a file, we send a request for it and it comes back in the response if everything works normal. Let's look at the request. What protocols were involved in sending this request? At the topmost layer, and it's sort of upside down in Wireshark, but in our topmost layer is HTTP. That is sent using the transport layer TCP. Source port was 48677, assigned by my operating system to my browser. Destination port was that for the web server. That is sent using the network layer protocol IP, the internet protocol. Source address is my IP, destination is that of the server. And that was sent using Ethernet across the LAN. Wireshark calls it Ethernet too, but in fact Wireshark interprets both Wi-Fi and a wired LAN as Ethernet. I actually use Wi-Fi to send it, but Wireshark calls it Ethernet or Ethernet too because they're very similar in formats. And that includes my hardware or MAC address as the source address. And in the response, we look at the response again. Again, it's an Ethernet frame, inside that is an IP datagram, inside that is a TCP segment, inside that is our HTTP message includes some data in this case, which is the web page that's coming back. The HTTP message includes some header fields as well. The date when the server sent this, some time stamp, the type of the web server that sent it, the length of the web page and some other parameters regarding the web server and the access. Any questions on HTTP? That's our as fast as possible introduction to HTTP, one application layer protocol. Everything all right at the back? Then what we'll do is we'll finish that homework example that you've been working on, which also refers to HTTP. And for this course, we're not going through the details of TCP, but be aware of port numbers. We've got some examples of using port numbers to identify applications. Similar, we're not going through the details of all the application protocols, but I think it's useful to know that HTTP involves sending a request for a resource, sending back that resource in the response. And it uses TCP as the transport protocol.