Subnet classes

classIP_addressDefault_Netmaskmeaning
A 16.1.1.1 255.0.0.0 16,581,374 host addresses available
B 132.147.1.1 255.255.0.0 65,024 host addresses available
C 221.138.162.1 255.255.255.0 254 host addresses available

NOTE: For class A 16 is network portion, 1.1.1 is host portion, for class B 132.147 is network portion, 1.1 is host portion and for class C 221.138.162 is network portion, 1 is host portion

Effects of netmasks

classIP_addressNetmaskmeaning
A 16.1.1.1 255.255.0.0 Can now have 254 subnets, 16.1 to 16.254
B 132.147.1.1 255.255.255.0 Can now have 254 subnets, 132.147.1 to 254

Note: Subnets 0 and 255 are not allowed. 255 is the broadcast address and 0 is the same as the netmask.

Class C can be subnetted by dividing up the fourth octet:

(128) (64) (32) (16) (8) (4) (2) (1)
7 6 5 4 3 2 1 0
0 0 0 0 0 0 0 0
network host
From the above table, adding bytes 7,6 & 5 (128+64+32) gives 224 which is the subnet i.e. 255.255.255.224 (or binary 11100000 ) . This masks out bytes 7,6 & 5.

For a C class network with an address 221.138.62.0, a subnet of 255.255.255.224 gives six usable subnets as follows:

subnethostsBroadcast address
221.138.62.32 .33-62 221.138.62.63
221.138.62.64 .65-94 221.138.62.95
221.138.62.96 .97-126 221.138.62.127
221.138.62.128 .129-158 221.138.62.159
221.138.62.160 .161-190 221.138.62.191
221.138.62.192 .193-222 221.138.62.223

The three bytes available for the network segment can give the combinations:

  • 000
  • 001
  • 011
  • 111
  • 010
  • 110
  • 100
  • 101

As 000 and 111 are not allowed, six subnets are available.

A subnet 255.255.255.192 is binary 11000000 (i.e. 128+64=192). The possible combinations are:

  • 00 0
  • 01 64
  • 10 128
  • 11 192

00 & 11 are not allowed so there are 2 usable subnets, 64 & 128, giving for example 194.10.68.65→ and 194.10.68.129→ .

Recommended Class C Subnets
Class C bitsmaskAvailable SubnetsAddresses in each
2 255.255.255.192 2 62
3 255.255.255.224 6 30
4 255.255.255.240 14 14
5 255.255.255.248 30 6
6 255.255.255.252 62 2

How the netmask is used to calculate the network

The logical AND is used to calculate netmask, i.e.

  • 0 AND 0 = 0
  • 0 AND 1 = 0
  • 1 AND 0 = 0
  • 1 AND 1 = 1

Taking class B addresses 204.123.16.4 and 204.123.17.4, with a netmask of 255.255.255.0, mask AND address gives 204.123.16.0 and 204.123.17.0, i.e. they are on different networks.

A netmask of 255.255.0.0 gives 204.123.0.0 and 204.123.0.0 so with this netmask, they are on the same network.

Recent Changes

Contribute to this wiki

Why not help others by sharing your knowledge? Contribute something to this wiki and join out hall of fame!
Contact us for a user name and password