In this video, I’m gonna introduce you to IPv4 and show you how it works.
IPv4 is really more on Networking and CISCO rather than Windows Server but it is still very useful to know this if you are a Network Administrator.
First I’ll show you the IP Address Classes. There are five of them but only three are commonly used, they are the class A, class B, and class C. Class A has a network ID ranging from 1-126.96.36.199, the zeroes here by the way can be any number ranging from 0-254, the default subnet mask of class A addresses is 255.0.0.0 but that is customizable and I’ll show you later on. For class A addresses you can have a maximum number of 126 networks and more than 16,777,214 hosts. Now for class B IP Addresses the network ID ranges from 128-188.8.131.52 again this zeroes could be any number from 0-255. Its default subnet mask is 255.255.0.0, it has 16 384 networks and 65 534 hosts. And as for class C, it ranges from 192-184.108.40.206 network ID’s. It has a default subnet mask of 255.255.255.0 and it has 2, 097, 152 networks but only has 254 host per network. And as you may noticed as you go down from class A to class C, the number of hosts gets smaller while the number of network gets larger. Also noticed the jump from class A to class B where the 127.0.0.0 range is missing that is because this range is reserve as a loop back address, it is usually referred to as the Local Computer, this also means that any of the addresses from this range, that’s 16 million addresses in the 127.0.0.0 range, and is only used for troubleshooting purposes like pinging your own IP to check if there’s a problem with your network card(hardware/physical) or you just have a problem with the TCP/IP stack. Talk about over provisioning.
Now let’s move on to Private IP Address, this are IP addresses ranging from 192.168.0.0 in class C, 172.16.0.0 – 172.31.255.255 in Class B, and the whole range of 10.0.0.0 of class A. Private IP Addresses are very useful because of the very limited public IP Addresses that we could use, and would really be inefficient to use these public addresses in the internal network. These addresses are not routable on the internet, therefore, it’s not accessible by the public.
Also, these private IP Addresses gives you a lot of flexibility. Because of the assumption that these private address ranges are not directly connected to the internet, the addresses don’t necessarily need to be unique. So, there could be other people in another place in the world using the same IP address as you, and there’s no problem in it.
These addresses are often used for protected networks behind network translation devices or NAT. In a private network, the devices such as Desktops, Laptops, handhelds and etc. only connect to the router, while the router is the one connecting to the internet. So, you’ll only need 1 real IP address for this network’s router. And you can even have multiple routers in your network.
Now let’s move on to APIPA or Automatic Private IP Address, it is a class B range of IP Addresses self-assigns your Windows client if the DHCP server is permanently or temporarily unavailable. Then if the DHCP server becomes available later on, the APIPA address will be replaced by the address from the DHCP server. And also note that these addresses cannot connect to the internet.
Now let’s move on to conversion from dotted decimal notation to binary and vice versa. Now let me show you 1 secret to converting Decimal to Binary. All you need to do is memorize these values here up top 1and 28. The easiest way to do this is to write down 1 and just keep on doubling its value as you go to the left until you reach 128. After that, you just try to deduct these values here to these values here, from left to right. So let’s first work on 192, can you deduct 128 from 192? Yes, so right down 1, then we’re left with 95; so can you deduct 64 from 95? Yes, so right 1, then we got 31; can we deduct 32 from 31? No, so we right down 0, and so on until you reach the right most column. Same goes for the next numbers here. So that’s how we got this Binary string right here.
Now, let’s discuss subnet mask and how computers communicate with each other. So I have here 3 computers, with different IP Addresses. I have determined the subnet mask of these computers but these computers doesn’t know each other’s subnet masks. So this process determines if the computer you are trying to communicate to is in the same network as your computer or not. Cause if it’s not, it’s gonna use the Default Gateway to communicate with the other computer and let the router do the rest of the process.
First I converted first computer’s IP address and converted it to binary. And did the same with the subnet mask. Now for the subnet mask, you just need to write down the number of 1s from the right which in this case is 24 or in other words 255.255.255.0. In the ending process, all you need to do is determine if the binary digits from the IP address match the ones in the subnet mask. If they match, write 1; and if they don’t match write 0.
Now for the destination computers, the source computer doesn’t know the subnet mask of the destination computer. So it’s gonna use its own subnet mask to determine if they’re in the same network. But the process is still the same. Write down the IP address of the destination computer in Binary, then the binary equivalent of the source computer subnet mask. Then determine the 1s and 0s in the ending process.
And if the computer is done with both ending processes, it can now determine whether the destination computer is in the same network by comparing the end process results. Which in this case is a match. Meaning, the destination computer is in the same network as the source. So, the source computer can just communicate directly with this computer and do things like file transfer or something.
Now let’s try the third computer. I’ve already determine the ending process, so we will just compare it right away. Notice that it’s almost exactly the same except for the last 1 right here. So the source computer immediately determines that this computer is in a different network, so it should use the default gateway to communicate with this computer.
So let us now discuss Subnetting, so what if you need 4 networks in your company. And you’re only given 1 Class C network Network ID 192.168.0 with a subnet mask /24 (255.255.255.0) which is only good for 1 network. And suppose you need 50 hosts per subnet, also we need to add 1 more for the broadcast, making it 51.
So to figure how to divide this network ID for our sub networks, lets first convert the given subnet mask to binary. Here we have 24 bits which is equivalent to 24 ones and 8 zeroes. The next step is to determine how many bits is needed to have 51 which is the required number of hosts. The easiest way to do this is to use a programmer calculator, just type in 51, then choose binary which then gives us 6 binary digits. Which means that you only need 6 bits for the host side thus making room for two more network bits. So instead of having a 24 bit subnet mask, we now have a 26 bit subnet mask.
Now to get the maximum hosts per network, you can just look at the final Network bit and determine its bit position, which in this case is 64, then subtract 2, then you get the maximum number of hosts which is 62. Or you can just solve for 2 ^ n and ‘n’ being the host bits, which is 6. You can get 64, then minus 2, you get 62. While for the network side, we are left with 2 bit positions, so 2 ^ 2 = 4. Now we have the maximum host per network which is 62 and the maximum number of subnets in this network which is 4.
Now to get the subnet ID’s, here is what you needed to do: again determine the bit position of the last network bit but remember that the subnet mask has already change from 24 bits to 26 bits so we have 64. And from there you just need to keep incrementing by 64 from 192.168.3.0. So we get 192.168.3.0, then 3.64, then 3.128 and 3.192. And we will use this IP Addresses for each of the 4 networks that we have.
Now, remember that we cannot use 2 Addresses for each range of subnet ID as a Host ID. That’s the first and the last addresses in the range because the first address in the range is for the network ID while the last address in the range is for the broadcast. So for the first subnet the first Usable Host ID would be 192.168.3.1, and the last usable IP address for the first subnet is 192.168.3.62.
Now let’s look at another example over here. What if we have a Class A network, and the priority is no longer the number of hosts but the number of networks. Now first things that you need to remember is that, for Class A networks, by default, the first octet is for the network bits, at the other 3 are for the host bits.
So for this we are required to have 120 subnets for our network. So what we do is we subtract 1 from the required number of networks instead of adding 1, like what we did when the Host side was the priority. So we now have 119, which requires 7 bits to be express in binary. So now we are gonna add 7 additional bits to our original subnet mask, so instead of having an 8 bits subnet mask we have now a 15 bits subnet mask which then gives us 17 host bits. So from here we can get the maximum number of hosts and subnets. So for the maximum hosts per subnet that is 2 to the power of 17 which is the number of host bits minus 2 and that gives us 131 070 hosts per subnet while for the maximum number of subnets that is 2 to the power of 7 which is the additional bits that we added earlier, so our maximum subnets would be 128. As for the subnet ID’s, because the last bit position in the host side is 2 we will have to increment by two’s for the subnet ID’s. So the subnet ID would be 10.0.0.0, followed by 10.2.0.0, then 10.4.0.0 and then10.6.0.0 and lastly 10.254.0.0. And as for host ID ranges, its range would start at 10.0.0.0 and it would end at 10.1.255.254 and for the second range it would start 10.2.0.1 and it would end at 10.3.255.254, as for the third range the first usable IP Address would be 10.4.0.1 and it would end at 10.5.255.254. And as for the 4th range it would start at 10.6.0.1 and end with 10.7.255.254 and son on until the last range which is 10.254.0.1 and it would end at 10.255.255.254.
Now let us proceed with what we call Supernetting or Route Summarization or Route Aggregation. Again, this is really more of a CISCO topic than Windows Server but it still has effects on servers, so we still have to discuss this.
Here, in a network representation that I’ve prepared, I have already determined the Subnet IDs for 4 networks. But then, Router A needs to know about all the things connected to Router B, which is our Network. And Router B might be connected to hundreds or thousands of different routes. So, to slim down the amount of Subnet IDs the router needs to store and send to other routers, we would need a summarized ID. And since all of these are consecutive; you can just convert it to binary, split the addresses of the left most 1 in the 3rd octet, since this is a Class C address. Then, you can now make the left side the Network side and on the right are the Host side. So, from having a 24 bit subnet mask, we now have a 21 bit subnet mask.
And we will just use the first Address as the summarized ID to represent all the addresses in the network which gives us 192.168.1.0 with a 21 subnet mask. This will is also useful if you don’t have enough hosts for your network. For example, we’re still gonna use these subnets with a 24 bits subnet mask. Giving us 254 IP addresses each. But then you’re asked to have 500 hosts on a single subnet.
So how can we do that? Since we can only have 254 host per subnet in a single class scene network. So what we do is to use the summarized ID. So, instead of using the 24 bits subnet mask, we would then use the 21 bits subnet mask. Thus combining multiple Subnet ID’s to a single one, granting more hosts. Although, the addresses should be in consecutive in order for this to work.
And that’s the end of our IPv4 tutorial, thank you for watching and I hope you learned a lot in this video.