Subnetting IP Addresses

dimerusticNetworking and Communications

Oct 23, 2013 (4 years and 8 months ago)


Subnetting IP Addresses
Subnetting is done to break a larger network into smaller networks. For example, if you have a class C
network, you have 254 possible host addresses. However, if you only need to use 28 hosts, the other
addresses would be wasted, as no one else can use them. Subnetting allows for the division of larger
networks into smaller networks.
Key ideas
Remember the binary number progression:
128 64 32 16 8 4 2 1
If you know the subnet mask
1. Subtract Subnet mask from 256
Result is starting network address and block size
2. Figure out network addresses
Add block size to self up to subnet mask
3. Figure out Broadcast addresses
One less than next network address
4. Figure out available addresses
Between Network and Broadcast

Subnetting Chart

In any octet, the number of host bits that can be taken and their corresponding subnet masks are as
Bits Taken Subnet Mask Block Size Binary equivalent
1 128 128 10000000
2 192 64 11000000
3 224 32 11100000
4 240 16 11110000
5 248 8 11111000
6 252 4 11111100
7 254 2 11111110
8 255 1 11111111
Practice writing out this chart. You can use the chart to answer questions about subnets, when you know
the subnet mask.
For example, if you need to figure out the network address for the IP
1. Look up 240 as a subnet mask in the chart.
2. Check the block size associated with that subnet mask.
3. Starting with the original classful address, start counting up bu the block size to find the network
for the IP address you are investigating.
NOTE: The network address is always less than an IP address.
h. etc.
4. In this example, the answer is This is the highest subnetwork address without
going past the IP address.

Choosing the subnet mask
Step 1
Figure out how many hosts or how many networks you need-This will tell you how many bits you will
need in your subnet mask. Use the formula 2
-2, where n is the number of bits you will need.
For example, if you needed 28 addresses while subne tting a class C network, you would need 5 bits for
hosts. 2
You couldnt use only 4 bits because 2
-2= 14, which would not be enough hosts. Now that you know
how many bits you need for hosts, figure out how many are for network. In this case 3 bits are for the
network(because 8-5 is 3).
Step 2
Now that you know how many bits you need (3), calculate the subnet mask. You will be taking bits
from the left hand side of the host portion such that the eight bit binary representation is 1 1 1 0 0 0 0 0.
This is a subnet mask of 224 (128 + 64 + 32).
Step 3
Calculate the network addresses for the networks by subtracting the subnet mask from 256.
256-224= 32. This means your first subnetwork addr ess is 32. You can then calculate the rest of the
subnet addresses by adding this number to the original subnet address:
0+32= 32
32 + 32= 64
64 + 32=96
96 + 32=128
128 + 32=160
160 + 32=192
You cannot use 224, as the subnet mask is 224)
Step 4
Figure out the broadcast address for each network. The broadcast address will be one less than the next
network address.
Subnetwork Address Broadcast Address
0 31
32 63
64 95
96 127
128 159
160 191
192 223

The remaining addresses between the subnetwork address and the broadcast address are the valid host

Internet addresses contain the network portion and the host portion. The network portion precedes the host portion.
For example, in a Class A IP address, the first octet (8 bits) is the Network Address, and the last three octets (24 bits) are the host address:

Other Important Addresses include the Loopback address:
The numbers 0 and 255 can not be used to represent hosts on a network.
The 0 address is used to refer to the network as a whole. For example, if your computer has the address, is your
The 255 address is used for broadcasting messages. The address is used in autoconfiguration protocols like BOOTP an DHCP. On
a particular network, 255 will broadcast to all hosts on that network. For example, if the network portion of your IP address is 192.32.200 and the
host portion is 12, your computer can broadcast messages to all network hosts by using the destination address

Class A Class B Class C
Address Space to to to
Subnet Mask
Addresses to Loopback to to