 We're going to finish on IP addresses and on IP, the Internet Protocol, but we'll go through a few more examples for IP and how addresses and some of the special case addresses are used. Just a summary, we know every IP address is 32 bits in length, and those bits we can split into two parts. Some parts identify the subnet within the entire Internet, and other bits represent that device inside that subnet, so there's a hierarchical addressing structure. So we, I'll refer to those as the network portion of the address and the host portion of the address. In the most common cases that we split them, that 32 bits somewhere, not in the middle but somewhere such as the first end bits identify the subnet and the last H bits identify the device. That device, we say device, it's called the host portion, but the device may be a host like a laptop, a PC, it may be any device that needs an IP address, including a router. So any device we attach to our network that needs an IP address, the rules are that inside the Internet, or an Internet, all subnets have a unique subnet portion or network portion for the address. So we think we give addresses to the subnets, and of course each subnet needs a unique address, so we can identify them uniquely in the Internet. And then within one subnet, all devices have a unique host portion and the same network portion. So two devices on the same subnet must have the same network portion and a different host portion. Two devices on two different subnets must have different subnet portions of the address, different network portions. Their host portion may be the same or may not be, it doesn't matter, as long as the network portion is different. We know how to convert, or you need to know how to convert from dot a decimal notation to binary IP address and vice versa. To determine where the split is between the network and host portion, we use a subnet mask, or just a mask. So we now have two different 32-bit values, one is the actual IP address and the other is the mask. And the way that the mask is read is that when we have a bit one in the mask, it tells us the corresponding bit in the IP address identifies the network portion. Bit zero tells us the corresponding bits identify the host portion of that IP address. So now every device that has an IP address also has a corresponding mask or a subnet mask. And there are several special case addresses. These addresses normally are not assigned to devices, so my computer doesn't use these special case addresses for its normal IP address. We have addresses that identify the network or subnet. So we say each subnet in the internet we can give an address. And that is the network portion of the IP address followed by all binary zeroes. We'll see some examples in a moment. That's not, we don't use that to assign to a device, we use that to refer to an entire network. Okay, so if we want to have a routing table that refers to a particular subnet in the internet, then we'd make use of the network address. Two types of broadcast addresses. Broadcast means send to everyone, but they're slightly different. Directed broadcast means send to everyone on one subnet on a particular subnet inside the internet. So the internet is made up of subnets. If I send an IP datagram to a directed broadcast address, the intention is that that datagram will be delivered to everyone on that specified subnet. So a directed broadcast address identifies a subnet. And that one datagram should be delivered to everyone on that subnet. Broadcast means delivered to everyone. The other broadcast address is a local broadcast address. Again, deliver to everyone. But deliver to everyone on the same subnet as you. So the difference may be, okay, my computer, the source is in one subnet. And there's some other subnet. If I want to send to everyone on that other subnet, I must use the directed broadcast address for that other subnet. Because I want to direct my broadcast to that subnet. If I want to send to everyone on my own subnet, I can use either. I can do a directed broadcast to my subnet as the destination. Or simply a local broadcast, which implicitly means send to everyone on my subnet. So local broadcast is only to your current subnet. That's useful. The local broadcast is useful when you don't know your IP address. So in special circumstances, your computer may not have an IP address. It boots up. So when it boots up, if it wants to join the network, it needs an IP address. But if it doesn't have an IP address, there are protocols available to try and discover and find and be automatically assigned an IP address. DHCP is one. And that makes use of the local broadcast address and saying, I don't know my IP address, but I want to send a message to everyone on my subnet. I don't know what my network address is. I know nothing about other computers. But I can still send a message by sending to the local broadcast address, which will deliver to everyone on my subnet. And then hopefully someone will respond. So that's used in special cases. For example, when we want to start our computer and get an IP address assigned to our computer. Related to that is this startup source address. Again, I don't have an IP address yet. Every IP datagram that I send has a destination field and a source field. So if I send a datagram and I don't have an IP address yet, what do I set to the source field to? Well, we can use this special startup address, this all binary zero address. In that case, what I can do, my computer boots up. I want to send a message to everyone on my subnet asking, can you give me an IP address? So what I do is I formulate a packet where the source address is this startup source address, all zeros, all binary zeros. And the destination address is the local broadcast address where all binary ones. I send that packet, it's sent to everyone on my subnet. And if things have set up correctly, there'll be some computer on that subnet that may respond and say, here is an IP address for your computer. And then I can, or the protocol can set the IP address on my computer. So again, special cases not used all the time, just used for some specific purposes. Startup source address when you don't have an address and you need to set the source of a packet. Loop back address, send to yourself. Again, only used for a destination. If I want to test my computer, test the software on my computer, then sometimes I want to communicate with a process which is also on my computer. So my computer is the source and the destination. I don't need to know my real IP address. I can send a datagram to this loop back address. It starts with this sequence of eight bits, zero followed by seven ones. And decimal is 127. If I send a datagram to that address, then my computer receives that datagram. In fact, it doesn't go out of my computer. The local IP software processes it. Loop back, you think there's a cable that comes out of my computer and just comes back into the computer. So what I send to this loop back address, I actually receive. So that are the common special cases that you'll see. There's a lot more about IP addresses that we don't get to cover in this course. You may see it in subsequent courses. Next semester, we'll have a lab and you'll do a lot more hands-on with setting IP addresses, discovering IP addresses, and see these five special cases in use. Things like private addresses. There's some ranges of private addresses which we distinguish between an address which is public and unique on the internet, and an address which is private within some organization, within some subnet. For example, SIT uses private addresses inside its network. Other organizations can use the same private addresses, private in that they are not used outside of the organization. And all the complexities that come with that, like network address translation. You see a lot of these private addresses. I think when you look at your computer address inside your home land, inside SIT, you see them in this range. We're not going to try and cover that. We need a lot of time to discuss private addresses. You'll see them next semester in two different courses. For now, for simplicity, we'll assume all IP addresses we deal with are globally unique and public on the internet. There are always exceptions. So let's look at a couple of examples. And hopefully you've done them already. Now from this internet working practice handout, you have it in your election notes. There are several sections. One's about classful addressing. And again, we're not going to talk about classful addressing, the old way that addresses were structured. We're moving straight to the new way called class less. There are no classes. But still, there's concepts of classful addressing we see in practice, but we'll not try and cover that in this course. So skip that section. This is an old handout. Then there's some questions about class less addressing, where I give you some information, like an IP address and a subnet mask, and you need to answer some questions by filling in these boxes, like write the subnet mask in dot a decimal notation. We're given it in slash notation, convert it to dot a decimal notation. And then determine the network and here broadcast means the directive broadcast address. The number of hosts we'll see in another example. You should try these, these conversions and the relationship between the special addresses. I'll show you an example of one of them when we get to our network. These questions were related to that table. Try them. Given this example, internet, we saw this in a previous lecture. Let's assign some addresses to these devices. I think we had 11 subnets in this internet. And there are four subnets with hosts on them. We call this one net one, net two, net three, net four. Net four here. Connect the subnets connected together by routers, A through to F. And the routers have multiple interfaces connecting to each subnet. For example, Router C has an interface connecting to this subnet with H4 on it. Another one connecting to D and another interface connecting to Router A. So I think Router C has three cables plugged into it. Each interface of the router has an IP address. So I've labeled the interfaces C1, C2, C3. And each of them will need an IP address. So we need IP addresses for the hosts and IP addresses for each interface of those routers. The first task here was to assign IP addresses to those routers and hosts. And I gave you a set of tables which is the IP addresses for some of them partially filled in and you need to complete the remainder. So for each of the six hosts, select the IP address. And then for all of the interfaces on each of the routers, assign an IP address. Always considering the rules that each subnet has to have a unique network portion. Each device inside a subnet must have the same network portion and a unique host portion. Where is the network and host portion? Well, it's determined by the subnet mask. The mask tells us where the split is between the network and host portion. I will not go through all of these. Let's select a few examples just to see the idea here. Here's our network. First I'll select which one. So some information is given in these tables. For example, router interface A1, the IP address is 60.45.12.3.28. So that's given, we cannot change that. Then we need to consider, okay, interface A1 is on one subnet. Therefore, every other device on that same subnet must have the same network portion as interface A1. Because that's our rules. Everyone on the same subnet must have the same network portion in the IP address. So from this IP address for A1, we use the subnet mask to identify what is the network portion in binary. And then for the other devices on that same interface, so A1, if we look at our diagram, A1, there's only one other device on the same subnet, H1. So what that tells us is the IP address for host H1 must have the same network portion as the IP address for interface A1. So let's look at that IP address and see what the value is. So that's the IP address for A1, just taken from the table, 60.45.12.3.28. So it's the IP address and the subnet mask. And I've written, I've converted already the IP address to binary. In the binary, we don't include dots. It's just a 32-bit value, but just so I can visually separate those four 8-bit values, I've included the dots there so we can see, okay, this is 60.45.12.3. And slash 28 tells us that the first 28 bits are the network portion of the address. Meaning the last four bits are the host portion. Let's identify the split. So the subnet mask tells us to the left of the red bar is the bits identifying the subnet, the network portion of the address. And the last four bits are the host portion. And our rules are every device on the same subnet must have the same network portion. So we know this is the address for A1. The address for H1 must start with the same 28 bits because that's the network portion. And the address for H1, the last four bits must be different than 0011. First, how many values have we got for the host portion? How many possible values in total for the host portion? In total for the host portion, okay, we have four bits, so we have two to the power of four possible values, 16 possible values, but we'll go through and see which ones we can use and which ones we cannot. So with 16 possible values or four bits, I will not list them all, 16 possible values for a combination of four bits, one of them is used. So if we look at our current subnet, and our subnet had, we have our router A with interface A1, which has an IP address, and we need to select the IP address for host H1. We've got 16 possible values for the host portion, but we cannot use any of them. One of them's already in use. Of course 0011, that's our router, okay, in this case. So if I want thinking of assigning an IP address to H1, I cannot set the host value to be 0011, because that's already in use. We have to have unique host portions. And then we have two of those 16 values, which are special cases. The first one is the host portion is all zeros. Let's call it our network address. We said the special case address of the network address is when we have the host portion of all binary zeros. And the other special case is the directive broadcast. I'll just write broadcast, broad, all ones in that case. That is, I'm not allowed to assign an IP address to a device which has all zeros in the host portion, or all ones in the host portion, because those two are reserved for special purposes. One is reserved to identify that subnet, and the other is reserved as the broadcast if we want to send to everyone in the subnet. So actually of the 16 addresses, there are only 14 that I could use for devices on this subnet. And of course one's already in use, so there's 13 remaining to choose from. And in this question, choose any of those 13. There's no way to select the right one there, as long as it's one of those 13 values. For example, the first one. So if I choose this value for my host H1, then the address of H1, the first 28 bits are the same for A1, and the last four bits will be 0001, and convert to dot a decimal. The first eight bits are going to be the same, so we're going to get 60. The next eight bits are the same, so we'll get 45. The next eight bits will be the same as well. We'll get 12. Then the last eight bits, again, will have 0000, followed by 0001, that is these four bits, which is simply one. Same subnet mass, slash 28. There's a possible IP address for H1, host H1. It didn't have to be 0001, it could be 0010, and any of these other values. It could not have been all zeros or all ones. So now, we know given a particular subnet mask, how many, what's the maximum number of devices that can be assigned an IP address on that subnet? With this subnet mask of slash 28, there are four bits in the host portion, giving us two to the power of four or 16 possible values, but two of them are reserved. So leaving us with 14 possible devices on that one subnet. We can have no more than 14 devices on that subnet at any one time. 13 other, 14 devices in total. I mean, the router is a device. So in EDS, in this question, if it was how many other devices, 13, how many in total, 14? I think you see if you did the other questions and do the other questions in the internet work and practice before this one, there'll be some questions like that. How many devices can you fit on this network? What size subnet mask do you need to fit a thousand devices or some number of devices? Any questions before we move on? About the split, yeah? The slash 28 is the subnet mask. Slash 28 is not slash notation, tells us the subnet mask is, in fact, I'm not trying to draw it. The subnet mask is a 32-bit value, same as an IP address. Slash 28 means that that 32-bit value is 28 ones, followed by four zeros. And what that mask tells us is that the first 28 bits of our IP address represent the network portion, before the last four bits identify the host, because every IP address is split into two parts, part that identifies that subnet and the part that identifies that device on that subnet. And if you check the IP addresses for H1 and A1 in binary, they've got the same first 28 bits and the different last four bits. Any other questions in preparation for your quiz? Next lecture. Easy so far? No? What's hard? Converting decimal to binary? Is that hard? No? Just need to remember the rules for the structure of the addresses. Okay, let's look at another example, another portion of the network. So that was... We were given the IP address for A1, so the question gave us that value, and we need to select an IP address for H1. Select any value so long as those rules are met. Same network portion, different host portion. What about with this subnet here? We have three devices. H2, H3, and A4. They're all in one subnet. This is a LAN switch. We don't give it an IP address. We think this is a cloud here that encompasses those three devices. The details inside there we're not concerned with from the perspective of the internet protocol. So we have A4, H2, and H3 all on the same subnet. If we go to those tables that give some of the addresses, does it give us any useful information? H2 and H3, in dot a decimal notation, the first two values are missing, but then 13.1, 14.1, no subnet mask. A4, the first two missing, 12.1, and a subnet mask of slash 22. First thing that we can answer. The subnet mask for A4 is slash 24. What's the subnet mask for H2 and H3? Slash 22. Same subnet. Same subnet mask. So that's easy. We know that the slash 22, slash 22 here. Let's have a look. Slash 22, the first 22 bits must be the same for those three IP addresses. The first, I will not try, I will not list all 22 bits. So the first 22 bits, if we think in dot a decimal notation, the first eight bits, the second eight bits, which is 16 bits, plus another six bits to bring us to 22. All right, let's try and draw to make it this clear. 16 bits. I just draw the dots to separate. There's our subnet mask, slash 22 in binary. 22 bits, 12 zeros. 22 bits, 10 zeros. What that means is that A4, H2, and H3 must have the same first 22 bits. What values can you use? There's H2 and H3. Well, let's look at 13, 14, and the other one for the A4 was 12. The third value in here. 13 in binary, 12, 13, and 14. So 13 is 12, 13, and 14, which were for those three given values. They all finished with one in the last value. Where's the split between network and host portion? Oh, here. You need to select the first 16 bits. You're given the value shown here, which is 12.1, 13.1, 14.1 for those three different interfaces on that same subnet. The first 16 bits must be the same across those three IP addresses. What values? What should they be? Go, have an attempt. Okay, let's forget about any special cases and assume that... Yeah, so forget about any private addresses. 190, could it be 189? 187. The first bits could be almost any value. The almost is an important part, but there's no information in these questions saying exactly what values they need to fit. The questions force you to choose specific values. You can select from a range of values here. Two conditions. The values across these three different IP addresses must be the same. That's the first one. The second one is they must not conflict with other addresses in the Internet. Recall that the bits that we choose there, those first 16 bits, plus these next six bits, would be our network portion. That must be unique in the set of subnets in our example Internet. That's the other condition. And I think that's enough for this. There may be some special cases of addresses we cannot use, but keeping things simple we can choose any value as long as it doesn't conflict with values used in other subnets. Because our subnet network addresses must be unique. So many values to choose from there. And the same, I think, in some of the other addresses in that question, you can choose values. So long as the conditions are met, no conflicts, no unique subnet or network portions across the subnets and unique host portions across the devices in one subnet. Any other questions about those IP addresses? Yep. All right, I said any value except those that conflict with other subnets and let's say also an exception and special case addresses. Don't use special case addresses. Okay. And in fact, there are a range of them and some that we haven't mentioned. In theory, I don't think it has to be. In a real internet, in the real internet maybe, but in our general internet, I think we could choose any values. But you're right that when we move into the real internet and how we assign these IP addresses, we don't just choose any value for any subnet. Some subnets have related IP addresses. So there's a relationship between, say, two different subnets. They don't have completely random IP addresses. There's some structure between the subnets as well. So they need to maintain that structure. But we're not going to cover that in this course. I assume for simplicity, so long as all subnets have a different network portion, our conditions have been met. But you're right that we need to have, for least prefix matching an appropriate address. Everyone can do conversions between the different formats, slash notation, dot a decimal notation, binary, and recall the rules about no conflicts, uniqueness, and so on. And I think if you do that, you can answer the rest of the question. We don't need any more examples for that one. So if you're struggling or you don't understand or can't remember all the details, then with IP addresses, think always convert them to binary. Convert to binary, whether on paper in your head, convert to binary and convert the mask to binary to find out where the split is in those bits. And then consider the rules, like what is the network portion, what is the host portion, and then, if necessary, convert the binary address back to a dot a decimal notation. After a bit of practice, you'll start to see there are some shortcuts. For example, a subnet mask of slash 24 means the split is after the 24th bit, which is in the dot a decimal notation at the third dot. If a subnet mask is slash 24, it makes the conversions from binary to... from dot a decimal to binary, and then the operation is much, much easier. But if you don't understand those shortcuts, then quite simply just convert to binary, find the split, and then answer the question based on that address. Let's go back to H1, A1. What is the network address for this subnet in dot a decimal notation? For the subnet contains A1 and H1, what is the network address? In dot a decimal notation, the network address for this subnet. We just take the same first 28 bits, and the last four bits are this special case of four zeros, and then convert it to dot a decimal, and you get the special case network address, what would it be? 60.45.12.0, the network address. And the broadcast or directed broadcast address, you take the first 28 bits and set the last four bits to all ones. And convert, you'll get 60.45.12.15. The last four bits only, because that's where the split was, remember? These four bits are set to all ones. So we get the last decimal number is 00000111115. Often we see the split is here, here or here, but it doesn't have to be. So don't think a broadcast address is always dot 255. Some people make that mistake. It's not. Think about where the split is in the binary value. Any further questions on these IP addresses? Yes. Okay, let's look at this one. It's a good example. Let's say we choose some of those first 16 values. Since I chose for this question those first 16 values and the same for the other three addresses, in dot a decimal, what do we get? That's 193, correct? Dot one. And this is 12.1. That's the top IP address there. Slash 22. So I chose the first 16 bits in that case. You could have chosen other values. Another valid address on that same subnet, we must have the same first 22 bits, and we could have another address which is 00 and then 8 ones. The same first 22 bits, 2 zeros and then 8 ones. In dot a decimal, what does that give us? If you have the same first 16 bits, then the next 6 bits are the same, followed by 2 zeros, so there's 12 here. And the last 8 bits are all ones, giving us decimal 255. That is a valid IP address in this case for a device. It is not a broadcast address. So don't always assume 255 means broadcast. Because here the broadcast address would have to have 2 ones here and another 8 ones here, 10 ones at the right. Which would be plus 15, is it? 193.1.15.255 would be the directed broadcast in that case. So always look at the, the best way to be correct, always look at the binary form and see where the split is based upon the subnet mask. Any other questions before we move on from this example? Clear? Okay, how many computers could we use in this example? We look at the number of bits in the host portion. So on that one subnet, every device must have the same network portion. That is the same first 22 bits. So we have 10 bits that we can vary because every device must have a unique value amongst those 10 bits. With 10 bits we have 2 to the power of 10 possible values, 1,024 possible values in binary. But 2 of those values are reserved for our special cases. The values of 10 zeros and the values of 10 ones, we have 1,024 minus those two so we have 1,022 possible devices. So that subnet with a slash 22 subnet mask is limited to 1,022 possible devices at one time. Let's say we use that subnet mask inside SIT and just that network for all our devices. What happens when we have 1,022 devices? Well, using the same subnet mask, we cannot add more devices. There's not enough IP addresses available. So we need to select the subnet mask and correspondingly the network portion appropriately such that we'll have enough addresses to allocate with the computers we want to attach to that internal network. So that's where the subnet mask becomes important because it determines the size of your network. Now in practice it becomes, there are many more details that we hide about how to use choose the subnet mask, who gives you the subnet mask and the network portion or there are some schemes for allocating them from an international organisation down to regional and national organisations and then national organisations allocate them to the network portions to different internet service providers and different companies and organisations. So there's some hierarchy in how they're allocated so that A, they remain unique and B, that they are allocated to make efficient use of the address space and make sure everyone gets large enough networks for what they need. You should be able to fill in the remaining entries in these tables. 2.2, find the least cost paths. Not so much about IP addressing, this is back to our topic on routing this one. You can manually do that or you could use some software to do it for you. It's not so important for this task. Then once you know the IP addresses for all your interfaces and you know the least cost paths, fill in the routing tables and I define some notation that you can use there. So for the routing table, note what is the destination and what is the next router, the address of the next router. So the star means any value, a wildcard in this case. In the destination column, star means any value, the wildcard character meaning if our destination is any value send to the next router 60.45.12.3 with the subnet mask 28 slash 28. Then do that for the other hosts. The hosts are easy and then do it for the routers. So then do it for the routers but consider just those four networks with hosts, net one through to net four. A prior question asked, what are the network addresses for those four subnets? So determine them. For example, net four 200.10.5.0 slash 24. And do it for net one, two and three. And for the routing table of the routers, the destination is one of those network addresses. Remember in the routing tables we normally don't have routes to individual hosts. We have routes to an entire network. And the way that we indicate an entire network is using the special case network address. So what this row says that if the destination is on this network, send to router 130.10.0.2. And you can do that for the remaining entries. And one, in the case that the destination is on the same subnet as you're attached to, then you don't send to another router. You send direct to the destination. So I just wrote direct in this column. You can use that to fill out the remaining columns. I will not go through that. Try that. So once you can do that and those steps, you know pretty much all that needs to be known about IP addresses and how they're used in IP routing tables. Any questions on that practice? Try and do it before Wednesday. We'll have a quiz about IP addresses and basics of IP, the internet protocol. So this is good practice. And the answers are online. So you can check the answers. That's the answer sheet there. You can check your own answers. From memory, I think there's an error in there somewhere. If someone finds it, tell me. I'll inform everyone. I can't remember if I fixed it or not from last year. I'll try and check. But the answers, in some cases, you can choose value. So I chose some value. You may choose different values, but still be correct. So it's just one possible set of answers. Back to our lecture notes. Finish on IP. View the IP address on your own computer. You have an IP address. You can view the IP address on your own computer using the software on your operating system. So on Windows, if you click on the icons about network connections, you can see properties or details of the connection and it will show you the IP address. So mine, IP address, the internet address, 10.10.100.184. The net mask, in dot a decimal notation, is 255.255.240.0 slash 20. I think if you work that out. There are 20 bits, 21s, followed by 12 zeros. And the corresponding directed broadcast address is given here as well. Which you could determine from the other two. It's the first 20 bits are the same and the last 12 bits are all ones. And you could determine the network address as well if you wanted to. This is an example we've seen enough examples. There's a few notes on classful addresses, the oldest style. And the concepts are still used. I'll leave it for you to have a look through them. I'm not going to test you on those classful addresses. We've got limited time. Where do you get an IP address from? There's some structure. So in practice, and again we won't go in the details, but there's some way in which IP addresses are allocated. There's an organisation called Assigned Numbers Authority, IANA. They define the IP address space. 32 bit addresses and split it up essentially. And they delegate of those, in theory 2 to the power of 32 possible addresses, they split them up and delegate authority to regional organisations to manage parts of that address space. So there's the Asia Pacific Network Information Centre and then within there there's the Thai Network Information Centre. They have an office in Science Park at Runcy. And then within the country, this organisation allocates the IP address space for Thailand to different organisations, companies, universities, government organisations. And what they normally do is they assign from some portion of addresses network addresses, the corresponding subnet mask, to those organisations that want to connect to the internet. Typically large organisations, large companies, internet service providers, you and I, as the end user, don't go to this organisation to get an IP address. Our internet service provider does that and assigns us one of their IP addresses when I connect from home for example. Same as SIT, SIT's public IP addresses come from Thomas Art University and TU got an assignment most likely from the Thai Network Information Centre. So there's some arrangement in how you get IP addresses. Within an organisation, once they've been assigned a network address, they're free to use that network address for their individual devices in whatever way they wish. And they can do that manually, go to every computer and type in the IP address, or more commonly use protocols to dynamically assign IP addresses to the devices. DHCP is an example. You'll see DHCP in use in the lab next semester. IP is the core protocol used in the internet. It's part of the network layer. There are other things that need to be done in the network layer. Error reporting uses a protocol called ICMP. Mapping IP addresses to Ethernet addresses uses something else called ARP. There's IP version 6 and then many extra features that are either add-ons to IP version 4 or built into IP version 6. So we do not cover them. But it's much bigger than what we've covered. I keep saying it. Next semester you'll see some more detail. Same again. Next semester you'll see ICMP and ARP in detail, both in a lab with me and in another lecture, another course. Data communications and networking is a large topic. We cannot cover it all in one semester, so we split it across several courses. Let's just introduce the next topic, just the last 15 minutes. Two topics remaining this semester. The last or the top two layers in our protocol stack. The transport layer and looking at transport protocols and the last topic is about the application layer, internet applications. And these two we go through quite quickly. Again, we focus more on the lower layers but over the next semester and even beyond you'll see more applications or more examples of transport protocols and internet applications. Next topic. This is just a taster. Transport protocols are used end to end between our end devices, laptop to server for example. The intermediate devices don't play a role in those transport protocols. Let's look at some general concepts of transport protocols today. You can think of the internet protocol as delivering data across a network from one computer to another. That's its role. We have a source computer. More precisely we have an interface on the source computer. So my laptop has multiple interfaces. We send from one interface to the interface of another computer. But often we think about the source computer sends to some destination computer on the network or IP is about getting data from that source computer to the destination computer. But on computers we may run many applications at the same time. On my laptop I run an email client, an instant messaging client, Skype, I run a web browser. Many different internet applications are running at the same time. IP is about getting data to and from my computer. Moving up to the transport protocols they're now about getting data to a specific application on my computer. And doing so in an efficient manner. So now we're about sending data between applications or if we look at the software an application process. So some process running on your computer. On the source and destination hosts. So my laptop communicating with a Facebook web server. My laptop may be the source host. The Facebook web server is the destination host. My Firefox web browser is the application process which is communicating with the Apache web server on the Facebook destination host. So now we're talking about not computers communicating but applications on those computers communicating. And as I said transport layer and above is between the end hosts. The intermediate devices, the routers, the switches do not have a role in the transport protocol. So we talk about end to end or host to host communications. There are several different transport protocols used in the internet. The most commonly used one is TCP. We're going to spend some time looking at TCP. So that's, I don't know the split but maybe 80 or 90% of the data sent across the internet using TCP, it varies. The next one or the next oldest one is UDP. And then there are others, not just these four but there are other smaller ones which are used for very very specific domains like SCTP, DCCP and there are a few others used say in mobile phone networks for very special cases. But the main two transport protocols are TCP and UDP. There are others who will focus mainly on TCP because that's the main one used in the internet. They do different things. Transport protocol, the transmission control protocol, TCP notice the transmission control protocol not the transport control protocol. TCP does many of those things that the IP doesn't that we often need for our data transfer. I want to get data reliably from one application to another. IP doesn't provide any form of reliability. IP, we just send a datagram. If it gets to the destination host, that's great. If it doesn't, IP doesn't care. It will not try again. But we know for effective data communications we often want reliability. If I download a file, I need to receive 100% of that file for it to be effective. If I download and there are errors in the received file then I may not be able to open it. It's of no use to me. So TCP provides some features that provide that reliability by having connections. Before we transfer data we set up a connection between source and destination and negotiate some parameters in preparation for the data transfer. We have error control. In TCP we send some data. We wait for an act. If we receive the act we send more data. If we don't receive an act we may retransmit the old data. So we have some ARQ mechanism. We have flow control. Remember stop and wait, flow control. Sliding window flow control. Those mechanisms are also implemented in TCP. And again the idea is to make sure that the sender doesn't send too fast such that we overflow the receiver. We have an old computer communicating with a very fast server. It's possible that that fast server sends data very fast and the old computer when it receives takes a long time to process and eventually fills up the memory of the old computer and we start to lose data. So we implement flow control in TCP to avoid that. And congestion control. Don't overflow the internet. Don't cause congestion at the routers in the network. That's what TCP tries to do. So that if many people are sending at the same time what TCP will do is try and make the sources to slow down. So that we don't get congestion in the network. Each of those features each of those four features are quite complex. In this course we'll introduce how to set up a connection. A little bit about error control the others we will not cover. They're very important and they impact upon how TCP performs but they need three or four lectures to cover them. You may see them in internet technologies and applications. So TCP is quite complex. The alternative of the other common one UDP user data-gram protocol doesn't do any of that that TCP does. It does almost the same as IP in that there's no connection there's no reliability, no retransmissions no flow control, no congestion control. We just send the data. So it's very very simple. We just take the data put it in a UDP data-gram and then send it. If it gets there good, if it doesn't, too bad. One common thing about all of these transport protocols is they use the same addressing mechanism. And the addresses that we introduce are called ports or port numbers. So let's just today introduce ports give a few examples of port numbers to finish this lecture. Think of IP addresses. IP addresses identify computers on the internet. If someone wants to send to my laptop they need to know my IP address. So assuming they know my IP address they can send an IP data-gram to my laptop. But on my laptop I'm running several applications. My web browser, my email client, my instant messaging client. When someone wants to send they don't want to just send to my laptop they want to send to one of those applications. How do I identify which application the data must go to? A port number. So port numbers are used to identify applications on computers. IP addresses identify computers in the internet. Port numbers identify applications on computers. An example, let's go direct to an example to explain some concepts. I'll open my browser and in my browser visit a website, my favorite website, type correctly and your favorite website. I hope. Visit a website on the browser. So what happened is that my I'll just refresh to make sure it wasn't in the case. So what happened is my browser the application on my computer communicated with an application on some other computer. That other computer is identified by the domain name ICT.sit. In fact with some magic that domain name actually corresponds to an IP address. Now let's see some information about what just happened. Let's zoom out a bit. It's a bit nicer and focus on I'll explain why in a moment, this line. This shows this program next that shows the recent connections that my computer has made to service. In particular this is showing recent TCP connections. TCP is the transport protocol that my web browser used. So my laptop communicated with the ICT server. My laptop IP address is 10.10.100.184 we saw that before. I know because I set up the ICT web server. I know that the ICT web server's IP address is 203.131.209.82 you could find that out other ways but that's trust me that's the IP address of the ICT server. A computer which is down on the third floor. I rent Firefox on my computer and it communicated with a web server application on the ICT server. The web server application is called Apache. It's just a piece of software running. Now how did the application communicate application on my laptop communicate with the application on the server? Well they use port numbers to identify which application they want to communicate with. And the port number in this program is shown after the IP address. So my browser used port number 39380 and Apache web server software used port number 80. So these are addresses that identify applications. Some of them are common or well known numbers. I think you would have seen port number 80 in a number of examples. Port number 80 is the number normally used by web servers. So when I want to contact a web server I would set the destination IP address to be that of the actual computer 203.82 and I would also indicate the destination port number saying I want to communicate with this computer and specifically with the web server application on that computer. Because port number 80 identifies a web server. We see I have made some other recent connections. What's port 443? It's secure web browsing. So HTTPS in the address. The server uses port number 443. So common servers use common port numbers. Port 80 for web server 443 for a secure web server port 22 for secure logins, email as port 23 and so on. There are many different port numbers. We'll see more examples. But port numbers identify applications now. What port number does my web browser use? 39380. Where did that come from? It's a port number. Where did it come from? What about this one then? I connected to a web server different port number 48362. No, in this case the port number for my web browser is chosen by my operating system. It may change each time I connect. So what we have available is a range of port numbers that are fixed or well-known ports like port 80 443. They are assigned to specific services. Then there's another range of port numbers which are dynamic in that your operating system on the computer that's running the application will choose a port number that's unused by any other application. My OS knows which port numbers are used by Firefox, by my instant messaging client and by my email client. So it chooses one that no one else is using and selects that. So in this case it selected 48362. Communicated with some other web server. I know it's a web server because port 80 is the IP address. And when it communicated see the line above, the same web server same IP address, same port number it actually used a different port number for my source application, Firefox in that sense. Yes it would. In all cases a port number is assigned and especially for clients it's chosen by the operating system and it may vary. If I connect again it will have a different port number. No. For servers normally the port numbers are fixed like 80, 443. For the client my web browser is the client in this communications. The port number is usually dynamically chosen. So we see all of these values, these high values of 40,000 up to almost 50,000 50,000 at the top are chosen by my operating system. And in five minutes when I connect to another website my operating system may use a different port number. Port numbers identify applications. IP addresses identify computers. Specifically interfaces of computers on the internet. We need both. Because we don't just want to communicate with a computer we want to communicate with another application on another computer. So we need to know its port number. Let's stop there and what we'll do after our quiz on Wednesday is look at how TCP uses port numbers. We'll see a few more examples of port numbers and go into how TCP works.