From the course: Cisco Networking Foundations: IP Addressing

Subnetting practice exercise #2

- [Instructor] In this video, I'm going to challenge you to do your own subnet calculation to meet this design requirement. We're told that your company has been assigned the 172.20.0.0/16 network for use at one of its sites. And I want you to calculate a subnet mask that will accommodate 100 hosts per subnet while maximizing the number of available subnets. In other words, don't use more host bits than you absolutely need because if you use more host bits than you need you're reducing the number of available subnets. The question is what subnet mask will you use? You might want to pause the video now do the calculation on your own, and when you're done return and we will walk through a solution together. (jazz music) All right, how did you do in your calculation? Let's go through a solution together. We're told that we need to determine how many host bits are required to accommodate 100 hosts. Do you recall the formula we used to calculate the number of hosts. It was two raised to the power of H minus two where H was the number of host bits. So again, we might want to write out a table to say if I have this many host bits, how many hosts, in other words how many available IP addresses, does that give me. If I had, for example, two host bits, two raised to the power of two is four, but we have to subtract two because we cannot assign the network address where all the host bits are zeros and we cannot assign the directed broadcast address where all the host bids are ones. So four minus two is two. If I had four host bits, two raised to the power of four is 16. Let's subtract two. That's going to give me 14 supported hosts. But in this case, we're required to accommodate 100 hosts. And as we look through our table we see that six host bits doesn't quite give us enough. Seven gives us more than enough but we have to round up to seven because six is not enough. We're going to be using seven host bits. And we know that an IP version four address has 32 bits total. And if I need seven host bits that means my subnet mask is going to have 25 ones in it. We're going to have a slash 25 subnet mask because 32 minus seven, it gives us 25 subnet mask bits. We've got 25 ones followed by seven zeros in that subnet mask. That means our subnet mask is slash 25. And if you want to write that in dotted decimal that will be 255.255.255.128.

Contents