 We've spent some time talking about general networking concepts. We first went through switching to deliver data across a network. We saw that there's circuit and packet switching and in packet switching, datagram and virtual circuit packet switching ways to deliver data via intermediate nodes, intermediate switches. And we'll come back to that today. We saw routing. To do switching, we need to know which switches to send via, which paths to take, and routing involves usually discovering information about the network, the link cost, the topology, calculating least cost routes, and then creating routing tables, which are stored at the switching nodes to say where to send to next. And the previous topics were about LANs and WANs, local area and wide area networks and other classifications of networks. But a very broad classification of the many types of networks, we can say some are local area, some are wide area networks. Now that's very broad because local area may cover centimetres, it may cover a whole campus and there may be many different technologies. What we want to do now is assuming that across the world, there are many different network technologies in use. Inside SIT, we have both wired LAN ethernet and Wi-Fi wireless LAN. Inside the factory next to us, maybe they're using an old LAN technology. They used it in the factory and there's no need to upgrade, a different technology. And in other locations, they have different technologies to suit their requirements. And again, for wide area networks, some wide area networks may be using satellite, optical fiber, an entire network across the country. There are different technologies available for both LANs and WANs. What we want to do is to be able to allow anyone on any network to communicate with anyone else and we'll see that's what the internet allows us to do. So today we'll introduce this concept of how do we join networks together and maybe finish with one or two examples. So we just said that different types of LAN technologies available. The one that an organization will choose will depend upon what their requirements are for cost, performance, reliability, ease of access. We know of ethernet and Wi-Fi, two very common ones, but there are many others. We can connect LANs with different technologies together and we do that with an access point. The access point on the wall back there, it connects the wireless LAN. When my laptop talks to the access point, it's using Wi-Fi, but the access point also has a LAN cable plugged into it, so it's using wired LAN on the other side. So that access point is sometimes what we call a bridge. It bridges two different LAN technologies together, so we can do that. But bridges usually need to be specific to the technologies and only work for some technologies, so we often would like a more generic approach to allow people using different LAN technologies to communicate with each other. I'm using Bluetooth to talk to some device. You're using an old token ring LAN technology. I want to be able to send to you, even though we're using different technologies. We know wide area networks connect across a large distance. Usually they're used inside the core or backbone networks. The access networks, the local area networks where the end user accesses the network, then the wide area networks connect those access networks together. The end user doesn't necessarily directly connect to a wide area network. And again, different technologies available, wide and wireless for wide area network. It may be a single link or it may be an entire network itself. We haven't discussed too many of the technologies, but some of the names are listed here and we mentioned a few in the previous topic. What we would like is to be able to connect a device from any LAN technology and allow it to communicate with a device on any other network. That's our aim. We want to be able to connect multiple LANs and wide area networks together, allow any computer to communicate with any other computer, independent of what technology they use. And that's important. And we'll say that the process for doing this, we'll call internet working. So we'll spend some time through an example showing that. Let's consider a small example where we have maybe two LANs. Maybe one LAN could represent here at our bunk at eCampus and another one at Runxit. And we want to connect them together via a single wide area network. Let me draw that and we'll look at the issues involved with communicating across those two LANs. So we'll start with a LAN, our first LAN with a few computers attached. There will be five computers in this LAN. So we're going to have a LAN, we have five computers, I'll call them, so we can refer to them, one, two, three, four, five. And we want to use, let's say that's four in one location. And we want to use wired LAN technology, Ethernet. Everyone studied Ethernet in the previous topic. How am I going to communicate between these five computers using Ethernet? How is computer one going to talk to computer five, for example? You should have studied Ethernet in the previous topic. What did you learn? If you can't remember, look at your slides now. How do computers communicate using Ethernet, typically? What topology do they use? A star topology? And a star topology involves us having some new central device that they all connect to. And Ethernet called a switch, an Ethernet switch. So we want to use a star topology or sometimes simply called a switch topology where we introduce another device, our switch, and each computer has a point-to-point link, a dedicated link, into the switch. So this is the typical use of Ethernet today. This computer one, if it wants to send to computer five, actually sends to the switch, and the switch must have some way to know to send that on to five. So we'll create an Ethernet frame. Computer one will create an Ethernet frame, send it to the switch. The switch will look at that frame and realize it needs to send that frame on to five. This is the typical way we use Ethernet. How does the switch know when it receives a frame from one to send it on to five? One wants to send data to computer five using Ethernet. One sends an Ethernet frame to the switch. There's no one else. One can send the frame to it. It only has a link to the switch. It sends the frame to the switch. The switch gets the frame and it has four really destinations, two, three, four, or five. It's not going to send back to one. How does the switch know that this frame needs to go to computer five, not two, three, or four? What do we use to tell the switch who to send it to? Look at the destination, I gave the answer. Look at the frame and the slides again. Destination address. Inside the frame we have a header, a field inside the frame that says who is the destination of this frame. So when computer one creates the frame, it puts in some data, it attaches a header. One of the things inside the header is the destination address which will be the address of computer five. So when we send to the switch, the switch should be configured to know, it looks at the frame, destination five, I know that computer five is attached by this port in the switch. The switch has ports where the cables plug into it. So it simply sends the frame out on this link to five. So we need some addresses. Because to indicate who to send to, we need to attach or include the destination address inside the frame header. And when five sends back a response, because usually we communicate in both directions, where does five send to? If five wants to reply, it should send back to computer one. So how does it know this message came from computer one? We'll also include the source address. So computer one creates a frame with a source address to be itself and the destination address to be computer five. Actually while we're here to remind you, this is from the Ethernet lecture slides. So the Ethernet frame, the structure is that the header contains a six byte destination address who we're sending to, who sent it, the source. It contains two bytes saying what type of data is included. Then it includes the data and then an error detecting code to check if there are any errors in the data at the receiver. Of importance, the destination and source address are included in the header. How long is an Ethernet address? Again, you studied Ethernet in the previous topic. How long is an address? How many bits or how many bytes? Again? 48. The source address is on the screen, six bytes. If we include the address in the header, how big is that field? All the picture shows us that the destination address is six bytes or 48 bits. The source address is the same. So Ethernet uses a 48-bit address. So each computer is assigned a 48-bit address. It turns out Wi-Fi uses the same address format. They both use this 48-bit address format. So let's assume that computers 1, 2, 3, 4 and 5 all have 48-bit addresses. The normal assumption with addresses is that they should be unique amongst a set of computers. We can't have two computers with the same address because then we can't identify who's the destination. Let's write down a 48-bit address. Well, that's going to be too hard to write down. Then rather than representing addresses in binary, for humans we convert it into a little bit simpler form. 48 bits is hard to write down, hard to read. It's easy for a computer to deal with, but with addresses we convert them into different easier forms. So as an example, let's look at the address of my laptop. How many network interfaces does my laptop have? How many network interfaces do you think my laptop has? What are the network interfaces of my laptop? First one, how does my laptop connect to networks? What technologies does it use? Wired LAN, Wi-Fi, any others you think? Bluetooth. It does have Bluetooth. So Bluetooth is another way to connect to a network. Even if the network is quite simple of containing just one other device, it's still a network. So I can think that the interfaces to networks that my laptop has are Ethernet or Wired LAN, Wi-Fi or wireless LAN, Bluetooth, which is sometimes a wireless personal area network technology, and that's all my laptop has. I can see the network interfaces and the configuration of those interfaces running IF config. I'll do it on my Ethernet wired interface and I'll also do it for the wireless LAN interface. If we zoom in, my wired Ethernet interface has a hardware address. This is the address used by or given to my computer when I communicate inside a wired LAN. If I plug the LAN cable in and it's connected to a switch and some other computers, when those other computers want to send something to mine, they would set the destination to this hardware address. This is a 48-bit address, but it's shown in a human-friendly form of hexadecimal values. Instead of 48 bits, which would take up a lot of space, the computer converts it into 12 hexadecimal digits. Hex goes from 0 to 15, we need 4 bits per 1 hex digit, so 12 hex digits is 48 bits. Both wired LAN and wireless LAN use the same address format, so if I look at my wireless LAN interface, it also has a hardware address, 12 hex digits, 48 bits, it's a different value. Our devices should have different addresses. You can convert that to binary if you want, just convert 8 into a 4-bit value, C into a 4-bit value and so on, you'll get 48 bits. What's the structure of these, let's think of it in hexadecimal now, what's the structure of these 12 hex values? Where do they come from? Why does my computer have this address? That's the hardware address, where did it get this value? Who gave it to it? The brand or the company that manufactured the network device assigned the address. So when some company manufactured my LAN card or the chip inside my computer, when they created it, they assigned this 48-bit address. In fact, the structure is that the first six hex digits are assigned to the company, the manufacturer, so every device created by that same company will have the first same six hex digits and then the company assigns the last six hex digits to be unique. So the company makes a million devices, the first six hex digits will be the same, the last will be different, maybe they'll just increment for each device they manufacture. So that's the way that the addresses are managed and are assigned by the manufacturer. We can think that it's fixed for your device. There are ways to change it but we'll assume that once you buy your device it's fixed and we'll assume it's unique, no one else has this address. It's not necessarily true. So where are we? Each of these five computers have such a hardware address and I'll not write them down because it's hard to write down even 12 hex digits. Instead of writing down, I'll just label them as a hardware address. That is computer one has hardware address one, computer two has a 48-bit hardware address. Instead of writing the actual address I'll just label it as HW2 and so on for the others. We refer to it as a hardware address because it's assigned to that specific hardware or sometimes a MAC address or an Ethernet address. That's a four. So each have a 48-bit address. When one wants to send to five, one creates a frame. It sets the destination address field to be the hardware address of computer five and sets the source address field to be the hardware address of computer one. The frame is sent to the switch and the switch is pre-configured to know that the computer plugged into this port has hardware address five. So when it receives a frame with destination hardware address five it simply sends that frame to computer five. You know all this because this was the topic about Ethernet. What we want to know is let's add in another LAN and how can we communicate between these other LANs. So we'll draw another LAN in this case. Maybe we have a different LAN with four computers and maybe it uses an older bus topology. It's not a switched Ethernet, it's a wired network using a bus topology. Let's give them numbers and let's say that they also have hardware addresses. So we have two LANs now. Importantly, two different LANs may use a different protocol to communicate and may have different types of addresses. So my first LAN, maybe that has the 48 bit Ethernet addresses, maybe this older network uses a different type of address, 16 bit addresses, I don't know. But they can be different because they may use a different technology inside here. This is in one organization, this is in another organization. We assume the devices can talk to each other inside the LAN. What we want to allow them to do is to talk to people in the other LAN, even though they use different technologies. I want to allow a computer one to send to computer eight. Well, we need another link, currently we have no link. So let's introduce another few devices, which will play a special role in this. Let's add a third network, in this case assume it's a wide area network that connects, we're going to connect two devices, let's say by a single link and this will be a wide area network and be across a large distance and let's call them AMB. And these devices are going to have the role of a switch in switching. Remember in switching, we send to an intermediate device, which then sends on to another intermediate device and then to the destination, AMB are going to be these types of switches. And in the internet, they are datagram packet switches. So these devices are actually connected to two networks at the same time, A is connected to the first LAN via the switch and B is connected to the second LAN via the bus. So really what we have in this case is three different networks and let's label them before we give the hardware addresses. We think we have a LAN here, let's draw it and let's group them together and common way we group them together is some form of cloud. And similar we have a second LAN here, this cloud and let's label this one as LAN1 and this is LAN2 and we have a third network, which is our wide area network connecting them. It's a very simple network with just two devices attached but still we can call it a network. So now we have three smaller networks connected together and our aim is to allow anyone to communicate with anyone else. For example, one should be able to send to eight. Let's complete the addressing. Note that computer A is attached to LAN1, so it also needs a hardware address. It's another computer on that first LAN. So let's denote the hardware address of A, A1 and B has a hardware address. I'll call it A1 and B1 because we'll see that computer A is connected to two networks. It has two interfaces in use at the same time. It has a hardware address on this LAN and another hardware address for the connection to the wide area network. So we'll label them as well. So here we have hardware address A2 and hardware address B2. There are different values, maybe even different formats. In each of the component networks, LAN1, LAN2, the wide area network, we use some technology to communicate inside that network and that may specify the type of addresses, maybe a 48-bit address in LAN1. Maybe in the wide area network, the addresses are just zero and one. There's just two devices. Just a one-bit address to identify, even they may not have an address if it's a point-to-point link. And in the LAN2, maybe different types of addresses. If B wants to send to A, B needs to know the destination is HWA. If 5 wants to send to A, it needs to know the destination is HWA1, the address of computer A on that LAN. We want to allow, for example, Computer 1 to communicate with Computer 8. With Ethernet, when we create an Ethernet frame, where would Computer 1 send to to get to Computer 8? One wants to send to 8. It's going to use Ethernet to send the data. What's the source address of that Ethernet frame? The source address first. Who's sending it? The address of one is HW1. We can refer to Computer 1, but the address, let's say, is the value HW1. We want to create an Ethernet frame from 1. We want to get the data to 8. To get the data to 8, who should we send to? What path are we going to take to get to 8? There's only one possible path, isn't there? We're going to send via the switch to A, and then A should send to B, and then B should send to 8. That's the path we're going to take. Let's look at the addressing. When A, Computer 1, the source creates an Ethernet frame, Ethernet is only used internally on this LAN. The source address is HW1. The destination address is not that of Computer 8, because Computer 1 may not know what technology 8 is using. It knows nothing about HW8. It knows it wants to send to Computer 8, but the type of address that Computer 8 is using, it doesn't know. They're on separate networks, different locations. So we'll actually send to Computer A. That is, the destination will be HWA1. And then Computer A will act as a packet switch, a datagram packet switch. It'll take that, send it on to B, HWB2, and when B gets it, it'll take it and send it on to HW8, to Computer 8. On the individual networks, Computer 1 knows the address, needs to know the address of A, HWA1. When A gets the data, it needs to know the address of B, HWB2. And when B gets the data, it needs to know the address of 8, HW8. The source doesn't need to know the LAN address of 8. We can't assume it will, because it's maybe on the other side of the world. We know nothing about that computer, other than we want to get data to it. So even though we can connect the networks together physically, to get data from Computer 1 to Computer 8, we need some other form of address, and some other way to deliver the data, rather than just Ethernet and the LAN and WAN technologies. We need some way to specify a Computer 1, the destination is Computer 8, and 1 will send it to A, A will see the destination is 8, send it to B, and then B will send it to 8. But we cannot use the LAN and WAN address formats, because they are different across different technologies. So what we do is we introduce a second address for the devices. We'll assume every device has two addresses. The second one is sometimes called a network or a logical address. We will simply refer to it by the common technology used, an IP address. So every device will give it not just a hardware address for communicating locally inside its network, but an IP address for communicating globally across multiple networks. Think of hardware addresses of internal communications, IP addresses are for across networks, across an Internet. So before we see how that's used, let's write down some IP addresses. Maybe not all of them, but we'll get some in. All of our devices will give an IP address. IP. Instead of, I won't necessarily start at 1, we'll start at some other number, just to be different, 20, for example, meaning that's not the actual value, but just a variable we indicate this is an IP address, and this one may be an IP address 21, and these may be other IP addresses, I will not write them down. This one down here may have IP address 57, just making up some random numbers. There will be some structure we'll see later, but let's think every device has an IP address. Even these devices connected to both sides, on both interfaces, that's a three. Don't worry about the values, just be aware that each network interface has an address of the same format. Here we're calling an IP address. For example, computer nine may be IP 56, and six and seven, three, four, and five would also have IP addresses, all of the computers. What we do to allow communications across multiple networks ensure that every device has an address of the same format, irrespective of the technology used in the LAN or wide area network, they all have in this case an IP address, and then we use another protocol to communicate across the set of networks. We use what we call an internet working protocol to create a packet at the source, specify the source and destination, and send that via our path to the destination. Let's try and draw that. The packet created by computer one has some data and a header. Inside the header will at least include a source address and a destination address, where the source address will be the source IP address, IP 20, and the destination address will be the destination IP address, the final destination, IP 57, that's 57 down there. Everyone can read the picture, maybe the next two quizzes should be in class, so make sure you can read and draw these pictures, because it's very important of how IP works. The bottom, the destination IP address is IP 57, that is the IP address given to computer eight. This is the packet created by computer one, it's not the ethernet frame, it is the packet created by what we call a new protocol, an internet working protocol, a new protocol to get data across multiple networks, and the protocol we use in the internet for internet working is the internet protocol, IP, so an IP address, IP stands for the internet protocol. So we create an IP packet, also called an IP datagram. The source will be that of computer one, IP 20, the destination will be that of computer eight, IP 57, and then where do we send this datagram? Where should computer one send this datagram? Who's going to get it next? Computer one creates this datagram and sends it to A, well via the switch sends to A. How does it know to send to A? How do we know to take this path? What's the process for finding the path? Routing, remember back to routing, we create some routing table that says if the destination is IP 57, the next node is IP 25 or computer A. A routing table would be used by computer A to know, sorry, by computer one to know, to reach eight, send to A. We will send to A and A will look at the destination, destination is 57 and A will have a routing table that says to reach 57, IP address 57, which is computer eight, send to B. It will send this datagram on to B. B will have a routing table that says, all right, computer eight is on this LAN, so send it direct and we'll send it to computer eight and that will receive the data. And the way that computer one sends this datagram to A is using the LAN technology, it creates an ethernet frame. I will not draw it, but there will be an ethernet frame, the source will be HW1, the destination will be HWA1. Sends it to A, A sends a frame to B, B finally sends a frame to eight. This is a, maybe we've gone into too much detail before we look at the formats of addresses, but it's trying to illustrate the concept to connect multiple different networks together. We need one common protocol that they all support. In the internet, that one common protocol is called the internet protocol. And with that common protocol, we also need a common address that each device understands and that is called an IP address. So even though internally we may use different techniques to communicate, we still have a common thing amongst all the computers in this network IP address and they all support the internet protocol. This concept of connecting LANs and WANs together is called internet working. We connect networks together, internet working and when we connect them together, we create an internet work and what's short for an internet work? What is short for an internet work? Internet work, what is a short word for that? Internet. Okay? So the internet is short for an internet work. So we've connected three networks together in this case to create one internet work or one internet. We'll see that terminology is on some later slides. While we're on terminology, computers A and B play a special role. They play a role of forwarding the data between different LANs and WANs. So computer A and B, these two, they actually in the internet use datagram packet switching so they are packet switches but we call them routers. A and B are what we call routers so that's some new terminology. But from our old topic on switching, they are essentially datagram packet switches. They receive a packet, look at it, using the routing table determine who to send it to next. We refer to them as routers. So this is the concept which is the internet is built upon. We have many different LANs and WANs across the globe and they are all connected together via routers and both the routers and the end-users devices support a common protocol called the internet protocol allowing anyone to communicate with anyone else. The last form of terminology, if we call these two routers, what do we call the end-user devices? Hosts. The computers which are not routers are hosts in this case. For example, one, two, three, four, five, six, seven, eight, nine are hosts. So our internet is made up of hosts and routers. In this case, nine hosts, two routers, how many networks? Nine hosts, two routers, how many networks in this picture? Nine hosts, two routers, how many networks? Not one, not three, combine them, not two, how many networks here? Not eleven, not nine. How many networks? How many can you see? How many green clouds? How many networks? Well, yes, there are three of the smaller networks. When we combine them together, we make one big network. So we can say there are the three component networks or sub-networks. When we join them together, we get one large network and internet work or an internet. So we think maybe there are four networks here, the three sub-networks and the one internet work, or we refer to as three sub-nets in this internet. This internet contains three sub-nets. So be careful now when we have networks, there may be a hierarchy. Here we have one network, inside that there are three networks. One internet, three sub-nets. When we study internet working, rather than drawing the details of the links between the computers, inside each sub-net, sometimes we simply draw a cloud, meaning there may be multiple computers in there. We don't care whether it's a switched network or a bus topology or a point-to-point link, there are some devices in there. So let's summarize what we've learned so far. Internet working involves connecting many lands and lands together, with the aim of allowing any computer on any network using any technology to communicate with any other. And the way they do that, they use an internet working protocol. One part of that protocol is to define the address format. There are different internet working protocols, but there's one very popular one, very widely used, the internet protocol, IP. And that's all we're going to study in this course, not any of the others. The others are maybe very old or used in very special cases. We'll see there are actually two versions of the internet protocol available, IP version four and version six. Here's another example where we have how many networks, how many networks in this example, count them, how many hit there on the screen and their slides, how many networks, don't say nine, ten. We have nine subnets, one internet, by joining those subnets together. And those nine subnets are joined together via routers. So in this picture, the routers are these shape devices, these cylinders. So in general, we're not showing the hosts. Land three may have a hundred hosts, I don't know. We're just drawing it as an abstract, saying there's a land here with multiple hosts, and those hosts would send via this router to reach other destinations. So that's the general structure of an internet. We connect different subnets together via routers. The routers in the internet are datagram packet switches. So we know about datagram packet switching. And in terms of a protocol architecture or a layered stack, we think they operate at the third layer, the middle layer called the network layer. What we're going to do, and we'll maybe do it in the next lecture, is talk about how IP works, the internet protocol. But you know the basics already. This is how IP works. Everyone has IP addresses. When we want to create or send someone data, we create a datagram. Inside that datagram, it has an IP header. Two fields inside are the source address and destination address. We send the datagram to routers. Which router will use routing tables to tell us to reach destination IP 57? The next node is A, send it to A. A will get the datagram. To reach 57, the next node is B. B will get the datagram. B will use its routing table to send it to computer 8. And that's how IP works. There are no retransmissions. If something goes wrong and A sends to B, but B has an error and loses the data, there's no retransmissions by computer 1. It's very simple. There's no flow control. There's no concept of window sizes. So you just send. If it gets there, good luck. If it doesn't, then something else will need to deal with that. And one of the reasons why the internet protocol is widely used, and it's been very successful, is because of its simplicity, it means it can be used in many different devices and for many different purposes. So the internet protocol is an internet working protocol used in the internet. We use it every day. And it's implemented in both hosts and routers. Both of them need to use IP. If you look in the source code of my operating system, you'll see the source code for IP in there. Every computer will implement IP. It uses datagram packet switching at the network layer. We'll give an example and we'll spend some time about the addresses. In the example before I said IP57, well, it actually has some structure that we'll look at. And a few other features like it can split data into smaller fragments and reassemble it. Some of these other features we'll talk about, not today, we'll talk about later after we go through IP addresses. In this course, we're going to focus on just one of the two versions, IP version four. IP version four is the most widely used version today. When we use it, the internet, we're most likely using IPv4. There's another version, IPv5 was essentially skipped. It was assigned for some other obscure purpose. There's IP version six. Even though most of our computers support IPv6, our network operators, our internet service providers don't really enable it so that we can use it. So it's not widely used yet, but it's planned to be used in the future. In this topic, we're just going to talk about IP version four. Coming back to my laptop interfaces, my wireless LAN interface. We said it had a hardware address, this 48-bit address. But we said in the concept, in the internet working, our devices need not only a hardware address, but also an IP address. And this shows me my IP address, my internet address, is this value. 10.10.101.7, that's my laptop's IP address for the wireless LAN interface. My laptop also has an IPv6 address, that's the IP version six address. They use different formats of addresses between the two versions. And one of the main enhancements of version six was allowed for more addresses, a larger address space. So we'll see that when we look at the IPv4 address space. But my computer inside the SIT network does not use that IPv6 address. It's not supported inside this LAN. My wired interface has a hardware address, but no IP address. We only, in many practical cases, we only have an IP address when we're actually using that interface. If I plug in a LAN cable, I may get an IP address. But currently, I'm not using that interface, and I have no IP address. So what we'll do to finish today is briefly look at the structure of the IP datagram. That is, this datagram or packet created by one, what does it look like? And then finish with an example of an IP address. So we'll skip some terminology, which we've mainly covered. And we'll go direct to the IP datagram structure. We'll return to those slides I skipped over next week and explain more about the IP datagram next week as well. But let's quickly introduce it. The IP datagram contains a header plus data. By default, the header contains 20 bytes of information. 20 bytes and then a variable length of data. There's an upper limit. The total size is limited to about 65,000 bytes. Usually that's not applied. Usually it's much smaller than that. The header of 20 bytes, this picture shows a common way to draw a packet structure, a packet header. And it shows that we draw the fields in the packet row by row. That is, the header is just a sequence of bits. But rather than drawing 160 bits in a row, we split it across multiple lines. So the way to read this, the first bit, bit 0, bit 1, bit 2, bit 3, bit 4, bit 8, bit 31, bit 32, we wrap around, if we want to visualize, bit 32 would be here. And we go through. So this is just a way to draw the header. When the header is long, we can't draw on one row. We wrap it across multiple rows. That's all. In this picture, each row is 32 bits or four bytes. And there are five rows making 20 bytes. And the names in here give the purpose of the fields. We'll not go through all of them at the moment. A couple we can recognize from the name. The first four bits in the header indicate the version of IP we're using. If we're using IP version 4, it's set to 4. If we're using IP version 6, it's set to 6. Very simple. Move on. The total length field, which is 16 bits long, indicates the total length of this datagram, header plus data. So because we can have a variable amount of data, we need to tell the receiver where does the data end. If we know the header length, which is actually included in an earlier field, and the total length, we know how much data is included. Then the two important ones just for today. The last two fields inside the mandatory header are the source address and the destination IP address. The original source computer and the final destination. How many possible IP addresses are there in theory? Get your calculator out. If you're looking at your phone now, here's a chance to get your calculator open. How many possible IP addresses are there? About. To know that, you need to know how long is an IP address. Look at the picture. It shows you how long an IP address is. The field of the source IP address is how long? 32 bits. So this picture is showing 32 bits per row, or four bytes. First four bytes, 8, 12, 16, 20 bytes of header. It's just a way to show that. So every IP address is 32 bits long. How many possible IP addresses in the world? About. Use your calculator. If there are 32 bits, how many possible values? Has anyone got a phone? And has that phone got a calculator? Yes? How are you going to calculate it? Not 10 to the power of 32. Binary, not decimal. 2 to the power of 32. Plug it into your calculator and see what it tells you. Again, four. Four by 10 to the power of nine. Four billion. Four thousand million. About four billion possible addresses. Now, if every device needs a unique IP address, that means we can have about four billion computers attached to the internet. Now, how many computers do you think attach to the internet every day or every year? More than four billion or less? Right, I'm hard to tell, but getting close to four billion, we have seven billion people in the world. Not everyone has internet access, but many people have multiple devices. And there are many devices that humans don't use, but just also have an IP address, like sensors, servers, routers, and so on. So there are some issues that address space of four billion possible values is not enough for everyone to use. There are some ways around that, but the long-term solution is to move to IP version six. IP version six has addresses of 128 bits. Calculate two to the power of 128. Your calculator may not do it on your phone, but something like billions and billions of addresses per person to the power of 128, so that should be enough. But we're not touching IPv6 in this course, but one reason for it is it gives more possible addresses. So let's look at an IP address. Remember, an IP address is 32 bits long. The IP address given to my laptop for the wireless LAN interface is 10.10.101.7. We don't see 32 bits here. We actually see some decimal numbers. Again, to make it easier for humans, the commuter doesn't normally present to us 32 bits in a row. It presents us in some easier to read form, easier to write form. So same as a hardware address, it's 48 bits, but shown in hexadecimal. An IP address is 32 bits, but shown in what we call dotted decimal notation. Let's do the conversion. From 10.10.101.7 into a 32-bit value. So let's start with our IP address for my laptop, and I'll just spread it out. That's the IP address presented to me, the human-friendly form. Let's convert it to binary, the actual value the computer uses. And it's very simple. We have four decimal numbers separated by dots, and we want to convert to a 32-bit value. Each decimal number is converted to an 8-bit value. So we convert each decimal to an 8-bit value, and we get four by eight or 32 bits. And that's our IP address. So let's just convert 10 in decimal to binary, and an 8-bit binary value. What is 10 in binary? Write it down. 10 in binary. 101.0, that's 10. But we need an 8-bit value, so we'll put four zeros out the front. Didn't line up very well. So that's 10 as an 8-bit value. And the next one's easy. 8-bit value, what's the same? 10 again. 101, try. You'll remember your conversions to binary, 101. And seven, that's an easy one. We now have the actual computer form of this IP address, the actual value that's included in the header, and sent across the network. So the computer always deals in the binary value. It's just that when it presents that value to humans, it converts to the dotted decimal notation, just to make it easier. Easier to write down, easier to tell someone else, easier to type in. And you can convert back, of course, given the 32-bit value, break it into four by eight bits, convert each 8-bit value into a decimal number, separate by dots. Any IP address, any IP version four 32-bit address, can be converted into its dotted decimal notation. So as homework, you'll go home today and record your laptop or even your phone, find their hardware address, find their IP address, and convert your IP address into binary. And if you are really excited, convert your hardware address into binary. So just be aware, especially with the IP address, is how to convert from dotted decimal notation into binary notation. And it's important to know on your phone or on your computer where to find those addresses. Different operating system will present them in different ways. There's some structure in these addresses. That is, your computer doesn't have just a random 32-bit value. There's some structure that the values in this address are related to what subnet I'm in, in the internet. And we'll see in the next topic or in the next lecture, we'll look at what is the structure of the IP address. But it's not simply 32-bits for every computer. There's some split between the subnet and the device in that. That'll be the next lecture. Let's stop there and we'll continue next lecture and go back to IP, go through IP addresses and see some more examples.