We can find Network Bits and Host Bits from any below information available.
How to find Network Bits and Host Bits from prefix?
Prefix or CIDR Netmask represents network part of IP address.
So, Network Bits = Prefix #
Network Bits and Host Bits together forms 32 bits binary number(Subnet Mask).NB + HB = 32
HB = 32 - NB
Example:
Network Bits and Hostsbits for /23 network
How to find Network Bits and Host Bits from Subnet Mask?
As mentioned before Subnet Mask is 32 bits binary number. Which consists of Network Bits and Host Bits.
SM = NB + HB
Convert Subnet Mask in binary format Count consicutive '1' fromMSB Number of consicutive '1' is Network Bits. and Number of consicutive '0' is Host Bits.
Example:
Network Bits and Host Bits for Subnet Mask 255.255.255.128
How to find Network Bits and Host Bits from Wildcard Mask?
Wildcard Mask is inverted binary of Subnet Mask.
WM = ~SM
We can say '1' represents Host Bits and '0' represents Network Bits.
Example:
Network Bits and Host Bits from Wildcard Mask 0.0.0.127
How to find Netwokbits and Host Bits from Class information?
Classful IP address allocating scheme were designed on basic of predefined block of IP ranges.
Default Network Bits and Host Bits for classes are as below
Class | Network Bits | Host Bits |
---|---|---|
A | 8 | 24 |
B | 16 | 16 |
C | 24 | 8 |