LPI 101-500 – 109.1: Basics of Internet Protocols part 2
- Subnet masks
We come to the subnet mask. The computer can use the subnet mask to determine which network it is itself in. Because, as already briefly mentioned, a computer can only communicate directly with another computer if they are in the same network segment. If they are not, the computer knows that it has to send the data, data to the router. We have just talked about the network classes, and the subnet masks have always been mentioned here. Without going into more detail, you will notice that we mostly added 255 or a zero in it. There are a few other possibilities, or a few other possible numbers. But the subnet mask does not allow you to freely choose every number between zero and 255.
That is not possible here. A subnet mask can only be filled from left to right if you consider the binary notation. And only these values are possible here. So we have here our zeros, then the first one, two, ones, three, one. Every time a new one. And these are the numbers we can use. Zero, 128, 192, 224, 200 and 4248, 252, 254 and 255. Again, only these numbers are possible. So you can’t use 50 or 99 in a subnet mask. That does not work. By the way, this is another good reason to practice the binary notation. In order to determine which network segment a computer is in, it consults both the IP address and the subnet mask and uses a logical and link here. So we take a look at our IP address from before.
192, 168 and 110. The subnet mask here is 255, 255, 255 and zero. We have to write both addresses in binary notation, one below the other. So let’s start with the IP address. I don’t explain how you convert these numbers here in binary notation if you didn’t understand it yet. Please take another look at the last video and practice, practice, practice, and then you will understand it. So I just write down the binary notation here. That is 100 and 9268, 10. And now we come to the subnet mask, and that is the IP address. Now we have to compare the numbers that are directly below each other. So this one with this one, the second one here with this second one, and so on, the one and one.
So two times one means one in the result. We have one here. Two times one means one in the result. Two times zero here. Zero and zero means zero, of course. And one and zero also mean zero. Remember, binary notation only knows one and zero on or off. Two times on remain on. Two times off stays off. And once on and once off is off. Make sure to remember that, okay? One and zero is zero. Here we have 101010. So we have only zeros here. At the rest here we have one. Then we have a zero, a 10, a one and three times zero, zero, zero and here we have one, and here we only have zeros because we have no one below each other.
So that’s the result. In decimal notation, it means 192 168 10. 192 168 10 is the network in which the computer is located. Since the address of the Subnet mask contains 24 filled in bits, so the last eight bits are only zero. So we consider them not filled. We know that the first three bytes belong to the network address 255. 255. 255 is virtually the complete reservation for the network address, only the last Octet. So the last byte here here is freely selectable for the host from zero to 255, whereby the zero is not used because it is the network address. And the 255 is also not used because this is the broadcast address. The first three bytes of our IP address match the first three bytes of the network address. So they are in the same network. I know it’s a little awkward and complicated, but once you have done it a few times, it works without any problems. Let’s look at a second example. We use the same IP address again 192, 168, one and ten. This time the Subnet mask should be and this time the Subnet mask should be 255 2550 zero. Let’s note both addresses again in binary form, this is 192, 168, one and ten. And here, in binary rotation, our Subnet mass. Sorry. And it is 255 2550. So let’s do our calculation again. One plus one is one. One plus one is one. And here are zeros. Again, 10101.
And here we have only zeros. So this time it is 192 was 10. Now it is zero. Zero because of the other Subnet mask of 255 2550 zero. So in and so this time the network part of the IP address is 192 168. The two other bytes here are the host part. In this case, that means freely selectable host addresses range from 192, so 192. So the lowest address cannot be selected for the host, as this is the general network address. The highest IP address in this subnet is is 192, 168, 255 255. But this is also not used as this is basically the broadcast address. Take this into account. In your calculation, such a question will surely be asked.
The Subnet mask is mostly written in a different way today. For example, as follows 192, 168, 10 and then 24. For example, in this case, 24 is the Sublet mask. And it is identical to 255, 255 2550.Why? The 24 means that the first 24 bits of the IP address are switched on. So again, in binary rotation 567-812-3456, 781-234-5678, so 816, 24. So again, this 24 is the substant mask. And it means that the first 24 bits of the IP address are switched on. So the first 24 bits are switched on. And that means 255 255 2550 192 168 one and ten means that 192 168 one is the network part of the IP address, and only the last octet is the host part. So as long as the first three octets are the same, they are in the same network.
If one host has 192 168 110 and the other 192 168 00:10, then they are in different networks and cannot communicate directly with each other, and are therefore dependent on a router that takes over the forwarding to the correct network. Okay, here’s another example 192 168 00:20 24 what happens if we turn 24 into 23? So, like this to repeat, what does 23 mean? In this case, write the first 23 bits must be on so one, let’s write it down. 234-5678, 910, 1112, 13, 14, 15, 16, 17, 18, 19, 20, 21-2223 the address of the subnet mask is therefore in decimal notation 255 255 2540. So what does such a subnet mask mean in relation to our IP address? At this point, I would like to present another calculation.
It is quite simple, and you are no longer forced to perform the logical and operation between the IP address and the subnet mask. Let’s take the standard subnet mask of 255, 255, 255 and zero again for the first explanation of this calculation. To do this, the IP address can be 192 168 00:20 we just noticed that the first three architects are the network part of the IP address. So this is fixed. Only the fourth octet is for the host. So how many host addresses can we theoretically assign here? So, not practically, only theoretically. There are 256 from zero to 255. Again, to note, remember that zero and 255 are not available for assignment to host. At this point in practice, we only have 254 addresses to assign in this calculation, however, it is important to look at the theoretical value.
And this is 256. So we do a calculation that is 256. So the number of possible host addresses the value of the previous offset of the subnet mask. So 256 -255 so again the value of the previous octet of the subnet mask. The previous one is this one. Here the result is 1256 -255 is one. That means that only one number is possible in the last bite of the network address. So where we have one, another IP address in the same network must have 192 1680 so that they can communicate directly with each other. A one or a two means that is already a different network. Okay, let’s get back to the subnet mask. From just now we had the IP address 192 168 00:20. And here the subnet mask 23. So the subnet mask is 255 255 2540.
Let us use the above calculation to help. We have 256 possibilities to determine a host address. And the last octet of the network address is 254. So here. Here we have 256 possibilities. The last octet here is 254. So 256 -254 equals two. What does this two mean? Now it means that the number in the last octet extends over two numbers. So that means that the network address 192 are in the same network, because the third octet here, this one and this one extends over two numbers. So in this case zero and one. I know this gets complicated at first, but once you have dealed with it a bit, it’s not as bad. Be prepared that several questions from this topic will even make it into the exam.
Questions about network classes, private address ranges or of course subnet masks could arise. I’ve already mentioned the word broadcast two or three times but haven’t yet explained it. So here is a nutshell a broadcast is a sending of data packets to all computers within a network segment. The broadcast address is always the last IP address in the network segment. So in a private class C network it is 192, 168. One and then 255 would be the last IP address. This is basically reserved for broadcast and therefore cannot be selected for a host. Incidentally, broadcasts are not forwarded by routers. A broadcast therefore only ever takes place within one network segment and is not forwarded beyond it.
- IPv6 addresses
Okay, we have talked a long time about IP Four addresses. At the very beginning I mentioned that the IP Four protocol has a total of 4. 3 billion addresses, not all of which are freely available. This means that the addresses have become increasingly scars, which is why the Internet Protocol IP Six was developed. In contrast to IP Four, IP Six addresses have a length of 128 bits. As a result, the computer world no longer has only 4 billion IP addresses available, but more than 346,000,000,000,000. That’s 41 zeros. IP Six addresses do not have a subtle net mask. The distinction between the individual networks takes place in the first 64 bits of the IP Six address.
The other 64 bits are then available for host addresses accordingly. This means that theoretically 18 trillion addresses could be assigned to hosts per network. So here we will most likely have enough addresses available in the next 1000 years. In contrast to an IP Four address, an IP Six address is represented in hexadezima notation with Haxadesimal notation. We have digits from zero to nine and letters from A to F. The numbers in decimal and hexadecimal notation have the same value. Zero is zero, one is one and nine is nine. The hexadecimal letter A is ten, B is eleven and F is 15.
An IP Six address consists of eight segments of 16 bits each. The individual segments are separated from one another by colons. So let’s take a look at an IP Six address. With IP Six addresses, it now or it is now the case that zeros at the beginning of a segment can be left out. So b eight. F-D-E eight BA. And then here again zero at the beginning we can left it out. Sorry. So we know that if only three hexadesimal numbers can be seen in a segment, as in this case for example, that there is actually an invisible zero. So we see here we have only three hexadecimal numbers. And because of that, we know that at this point there is a zero, and here only three hexadecimal numbers.
And we know that at this point here is a zero two. But there is more segments can consists exclusively of zeros, can also be left out. The address would now look like this and then you can left out these zeros. So just a colon, you can left out these zeros here colon. And you can left out these zeros. Here another colon. And then, since no more than two colons can follow one another, you simply leave out two colons at this point. So just that is our final IP Six address. In short form, this is the long form. Here it is important that these consecutive colons may appear no more than once per IP Six address. Otherwise one would no longer be able to distinguish between what belongs to the network and what belongs to the host addresses.
We know that four segments are reserved for the host and four segments for the network address. So we can conclude that the host address is this one. So the last four segments here. So the host address is the network address is feat. And then we have here, if we had two colons before four, three A here for example, it would no longer be so clear what is what. So be sure to remember never more than two consecutive colons per IP Six address. On this subject. I said at the beginning that there is no longer a subnet mask. That is correct. But there are still subnets in the IP Six area. I won’t go into it in as much detail as I did in IP Four addresses.
Firstly, because I do not believe that such detailed questions about IP Six are to be expected in the exam. And secondly, because you are guaranteed to be able to take them apart yourself with the knowledge of the binary notation from IP four topic. Again, to repeat, the first 64 bits indicate the network area, and the second 64 bits the host area. So let us take our IP Six addresses from just now best written out. So it becomes clearer. Now it can happen that you come across something like this 64. The 64 tells us how many bits of the network address belong to a fixed network. In this case, 64 bit. So the complete 64 bit of the network address.
This would mean that only the first 48 bits belong to a network segment. So basically the first three segments, the fourth segment does not belong to a fixed network segment and can be used to build individual subnets by simply adapting to one. For example, and viewing this as separate network segment, 0002 is another one, and so on. This is of course a very simple example. If there is suddenly seven or a ten after the slash, it is no longer that easy. In this case, you have to rewrite the hexa detrimental notation in binary notation in order to determine exactly where the fixed network portion now extends. Exactly how this works is not going to be discussed here in this course.
As I said, it is most likely too complex for the exam. But if you are interested in looking at this in more detail, you can simply search the Internet for tables on the subject of hexadecimal and binary notation, where it is shown exactly what the binary code A to F looks like. But as I said, you don’t have to know that in the exam. What you have to know earlier are the different address areas. As with IP four keyword, class A, class B network, and so on, there are also different address ranges in IP six. In my opinion, these are only three areas that can be considered important enough. We have the area for the link local unicast addresses.
That would be the address range feat. So this one, these are intended for communication within a network segment. There is no routing here. Then there is an area for the so called Local Unicorn addresses. This would be the following area FC Zero Seven. These are the private addresses in the IP Four area. We had several address areas that were reserved for private addresses. That is the counterpart to it. And last but not least, we have the so called Global Unicorn addresses. There are several different address ranges here, and there is still an argument about which these are exactly. And officially at this point. However, this is irrelevant for the exam.