8

I've been trying to figure out how to divide a network number into particular subjects where one of them require a particular number of hosts.

I have the Computer Networking: A Top Down Approach but it doesn't really specify or show the method of calculating this.

For example I have the question:

A company has the network number 193.1.1.0/24 and wants to have 6 subnets, where the largest one needs to support up to 25 hosts.

From the material I have it says to determine the number of bits required to define 6 subnets but have no idea how/where to go from there and how the bits needed are determined.

I am looking for the method and explanation how to work out these type of questions, I don't want a answer as I want to learn how to apply it myself. :)

Ron Maupin
  • 102,040
  • 26
  • 123
  • 202
orange
  • 263
  • 1
  • 3
  • 6

1 Answers1

14

Remember that everything is binary, so a power of 2. Addresses and masks have 32 bits. You are given 8 bits (2^8 = 256) to work with since your network is /24 (32 - 24 = 8). The required number of subnets is 6, not a power of 2, so you need to pick the next higher power of 2 (8). 8 is 2^3. The 24 bits you already have plus the 3 bits for the subnets is 27 bits. That leaves 5 bits for the number of addresses (2^5 = 32) per subnet.

You must AND the original subnet with the mask to get the first subnet, and the number of addresses per subnet to that to get the next subnet, etc.

That is how you do it without me telling you the answer.

OK. This is the answer:

Network 193.1.1.0 is                    11000001.00000001.00000001.00000000 in binary
Mask /24 is                             11111111.11111111.11111111.00000000 in binary
Mask /27 (with 3 bits for 8 subnets) is 11111111.11111111.11111111.11100000
1st subnet is                           11000001.00000001.00000001.00000000
2nd subnet is                           11000001.00000001.00000001.00100000
3rd subnet is                           11000001.00000001.00000001.01000000
4th subnet is                           11000001.00000001.00000001.01100000
5th subnet is                           11000001.00000001.00000001.10000000
6th subnet is                           11000001.00000001.00000001.10100000
Ron Maupin
  • 102,040
  • 26
  • 123
  • 202