For example, a netmask of 255.255.255.0 on a Class B network would indicate that the network is divided into 254 subnet- works of 254 nodes each (0 and 255 are reserved numbers).
128.5.63.28would be host 28 on subnetwork 63 of that network. The network itself would be called 128.5.0.0 (Class B network number 5).
Notice that by using subnet masks, you can define a natural hierarchy in which the addresses themselves indicate how a packet is to be routed. However, all routing devices on an IP network must be using the same subnetting scheme.
Also note that a subnet mask for a given network segment is not part of the address and is not transmitted with every packet. It is simply a value which is known to all the routing devices adjacent to that segment.
Subnets of Class C networks
Since Class C networks are by far the most common, we will take a closer look at subnetting in a Class C network. The following table is a listing of all possible values for the last octet (byte) in a Class C subnet mask.
Mask | Binary | Subnets | Hosts |
128 | 10000000 | 0 | 0 |
192 | 11000000 | 2 | 62 |
224 | 11100000 | 6 | 30 |
240 | 11110000 | 14 | 14 |
248 | 11111000 | 30 | 6 |
252 | 11111100 | 62 | 2 |
254 | 11111110 | 126 | 0 |
|
|
|
|
Class C subnet masks