Subnet mask

What is subnetting ?
  • It is a 32 bit address used with an IP in order to identify its network and host portions.
  • It allows us to create multiple logical networks that exist within a single Class A, B, or C network.

Why we use subnet ?
  • It helps in the preservation of address space in other not to waste addresses.
  • It used for security.
  • It helps to control network traffic due to collisions of packets transmitted by other node (host) on the same segment.


The main classes were class A,B,C with the allocation as follows :
  • Class A    network,node,node,node
  • Class B    network,network,node,node
  • Class C    network,network,network,node

Subnetting a Network Address :
For example, given a Class C network of 192.17.5.0 which has a natural mask of 255.255.255.0, we can create subnets in this manner :


192.17.5.0 – 11000000.00010001.00000101.00000000
255.255.255.224 – 11111111.11111111.11111111.11100000

  • By extending the mask to be 255.255.255.224, we have borrowed three bits (indicated by “sub”) from the original host portion of the address and used them to create subnets. 
  • With these three bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can have up to 32 host, addresses, 30 of which can actually be assigned to a device on the same segment.
These subnets have been created.
  • 192.17.5.0 255.255.255.224 host address range 1 to 30
  • 192.17.5.32 255.255.255.224 host address range 33 to 62
  • 192.17.5.64 255.255.255.224 host address range 65 to 94
  • 192.17.5.96 255.255.255.224 host address range 97 to 126
  • 192.17.5.128 255.255.255.224 host address range 129 to 158
  • 192.17.5.160 255.255.255.224 host address range 161 to 190
  • 192.17.5.192 255.255.255.224 host address range 193 to 222
  • 192.17.5.224 255.255.255.224 host address range 225 to 254

A subnet mask also pinpoints the endpoints of the range of IP addresses for a subnet. In any given network, two host addresses are always reserved for special purposes. The "0" address becomes the network address or network identification and the "255" address is assigned as a broadcast address. These cannot be assigned to a host.