# Subnetting a Class C Network Using Binary

#### Andrey Volkov

System, network administration + DBA. And a little programmer!)) See Author profile.

You have an address of `192.168.100.0 /24`. You need nine subnets. What is the IP plan of network numbers, broadcast numbers, and valid host numbers? What is the subnet mask needed for this plan?

You cannot use `N` bits, only `H` bits. Therefore, ignore 192.168.100. These numbers cannot change. You only work with host bits. You need to borrow some host bits and turn them into network bits (or in this case, subnetwork bits; I use the variable `N` to refer to both network and subnetwork bits).

Step 1. Determine how many H bits you need to borrow to create nine valid subnets.

2N ≥ 9

N = 4, so you need to borrow 4 H bits and turn them into N bits.

Step 2. Determine the first subnet in binary.

 0000HHHH 00000000 All 0s in host portion = subnetwork number 00000001 First valid host number 00000010 Second valid host number 00000011 Third valid host number … 00001110 Last valid host number 00001111 All 1s in host portion = broadcast number

Step 3. Convert binary to decimal.

 00000000 = 0 Subnetwork number 00000001 = 1 First valid host number 00000010 = 2 Second valid host number 00000011 = 3 Third valid host number . … 00001110 = 14 Last valid host number 00001111 = 15 All 1s in host portion = broadcast number

Step 4. Determine the second subnet in binary.

 0001HHHH 00010000 All 0s in host portion = subnetwork number 00010001 First valid host number 00010010 Second valid host number … 00011110 Last valid host number 00011111 All 1s in host portion = broadcast number

Step 5. Convert binary to decimal.

 00010000 = 16 Subnetwork number 00010001 = 17 First valid host number … 00011110 = 30 Last valid host number 00011111 = 31 All 1s in host portion = broadcast number

Step 6. Create an IP plan table.

 Subnet Network Number Range of Valid Hosts Broadcast Number 1 0 1–14 15 2 16 17–30 31 3 32 33–46 47

Notice a pattern? Counting by 16.

Step 7. Verify the pattern in binary. (The third subnet in binary is used here.)

 0010HHHH Third subnet 00100000 = 32 Subnetwork number 00100001 = 33 First valid host number 00100010 = 34 Second valid host number … 00101110 = 46 Last valid host number 00101111 = 47 Broadcast number

Step 8. Finish the IP plan table.

 Subnet Network Address (0000) Range of Valid Hosts (0001–1110) Broadcast Address (1111) 1 (0000) 192.168.100.0 192.168.100.1–192.168.100.14 192.168.100.15 2 (0001) 192.168.100.16 192.168.100.17–192.168.100.30 192.168.100.31 3 (0010) 192.168.100.32 192.168.100.33–192.168.100.46 192.168.100.47 4 (0011) 192.168.100.48 192.168.100.49–192.168.100.62 192.168.100.63 5 (0100) 192.168.100.64 192.168.100.65–192.168.100.78 192.168.100.79 6 (0101) 192.168.100.80 192.168.100.81–192.168.100.94 192.168.100.95 7 (0110) 192.168.100.96 192.168.100.97–192.168.100.110 192.168.100.111 8 (0111) 192.168.100.112 192.168.100.113–192.168.100.126 192.168.100.127 9 (1000) 192.168.100.128 192.168.100.129–192.168.100.142 192.168.100.143 10 (1001) 192.168.100.144 192.168.100.145–192.168.100.158 192.168.100.159 11 (1010) 192.168.100.160 192.168.100.161–192.168.100.174 192.168.100.175 12 (1011) 192.168.100.176 192.168.100.177–192.168.100.190 192.168.100.191 13 (1100) 192.168.100.192 192.168.100.193–192.168.100.206 192.168.100.207 14 (1101) 192.168.100.208 192.168.100.209–192.168.100.222 192.168.100.223 15 (1110) 192.168.100.224 192.168.100.225–192.168.100.238 192.168.100.239 16 (1111) 192.168.100.240 192.168.100.241–192.168.100.254 192.168.100.255 Quick Check Always an even number First valid host is always an odd #Last valid host is always an even # Always an odd number

Use any nine subnets—the rest are for future growth.

Step 9. Calculate the subnet mask. The default subnet mask for a Class C network is as follows:

 Decimal Binary 255.255.255.0 11111111.11111111.11111111.00000000

1 = Network or subnetwork bit

0 = Host bit

You borrowed 4 bits; therefore, the new subnet mask is the following:

 11111111.11111111.11111111.11110000 255.255.255.240

Note

You subnet a Class B network or a Class A network using exactly the same steps as for a Class C network; the only difference is that you start with more H bits.

## Вас заинтересует / Intresting for you:

636 views Masha Sun, 27 Jan 2019, 12:28:11
280 views Андрей Волков Sun, 14 Feb 2021, 08:11:41
302 views Андрей Волков Sun, 14 Feb 2021, 06:14:12
784 views Максим Николенко Tue, 26 Nov 2019, 05:02:43