Publicly assignable #IPv4 Address are divided into 5 classes to accommodate the increasing demands. See the table below:
Classes | First Octet Range | Network Bits | Host Bits |
---|---|---|---|
A | 1-126 | 8 | 24 |
B | 128-191 | 16 | 16 |
C | 192-223 | 24 | 8 |
D | 224-239 | ||
E | 240-255 |
Note: Class D is utilised for multicast, so there is no need to distinguish between network bits and host bits.
Note: Class E is reserved for research and development (R&D).
Note: Octet 127 can’t be seen in the table with a reason: it is reserved for local addressing. In fact, your local machine will have an address of 127.0.0.1 by default.
The network usually reserve the first address and last address of the octet for network identification (which network is it) and broadcast (local) respectively. From here, we can know the total number of assignable hosts in the network by the formula \(2^{BL} - 2\) where \(BL\) denoted the number of assigned host bits (\(2^{BL}\) is the total number of hosts including the network address and broadcast address). The total number of hosts calculation can be more sophisticated with the introduction of #Subnetting. We also get a magic number by dividing \(2^{BL}\) by 256 until there is a remainder, which will be the gap between assignable subnets.