Prefix, network, broadcast and host address

The Prefix Length

Expressing network addresses and host addresses with the dotted decimal subnet mask address is very difficult. So, convert the dotted-decimal representation of the subnet mask to binary and count the number of adjacent 1s bits, starting at the most significant bit in the first octet. The number of 1s in the subnet mask called prefix. The prefix is written in “slash notation”, which is a “/” followed by the number of bits set to 1 in the subnet mask. For example, if the subnet mask is calculate the prefix length.   in binary 11111111.11111111.10000000.00000000, now count the 1s from the left side which is 17, so, the prefix length is /17. We can easily calculate the subnet mask from prefix-length.  For example, if the prefix length is /20, it’s mean that total numbers of 1s in the subnet mask are 20. So write 1 twenty times followed by twelve 0s, 11111111.11111111.11110000.00000000. Now convert the binary number into a decimal dotted notation which is We can manage a table for all possible prefixes.

The table below illustrates all possible prefixes for 32-bit addresses including its subnet mask both in binary and decimal. The first column lists all possible prefixes. The second column displays the binary value of the prefix and the last column displays the resulting subnet mask.

Prefix-length Binary value for the prefix-length The Subnet Mask
/8 11111111.00000000.00000000.00000000
/9 11111111.10000000.00000000.00000000
/10 11111111.11000000.00000000.00000000
/11 11111111.1110000.00000000.00000000
/12 11111111.11110000.00000000.00000000
/13 11111111.11111000.00000000.00000000
/14 11111111.11111100.00000000.00000000
/15 11111111.11111110.00000000.00000000
/16 11111111.11111111.00000000.00000000
/17 11111111.11111111.10000000.00000000
/18 11111111.11111111.11000000.00000000
/19 11111111.11111111.11100000.00000000
/20 11111111.11111111.11110000.00000000
/21 11111111.11111111.11111000.00000000
/22 11111111.11111111.11111100.00000000
/23 11111111.11111111.11111110.00000000
/24 11111111.11111111.11111111.00000000
/25 11111111.11111111.11111111.00000000
/26 11111111.11111111.11111111.11000000
/27 11111111.11111111.11111111.11100000
/28 11111111.11111111.11111111.11110000
/29 11111111.11111111.11111111.11111000
/30 11111111.11111111.11111111.11111100

Network Address

A network address is the first logical address of the network that uniquely identifies a network or a subnet. An IP address is the combination of two separate addresses, the network address and host address. But if we eliminate the host address from the IP address, the remaining address will be the network address. In other words, a network address is an IP address without a host address or an IP address in which all host bits are turned 0s.

We can find the network address applying the logical AND process between the binary representation of the IP address and subnet mask. Align the bits in both addresses, and perform a logical AND on each pair of the respective bits. Then convert the individual octets of the result back to decimal. For example, if we have a host IP address and the subnet mask is calculate the network address for the IP address. The figure below illustrates the solution to the above example.


Broadcast Address

The broadcast address is the last logical address in the network or a subnet, and it is used for addressing all the nodes in the network at the same time. This is a special address communicates with all hosts in a network. For example, when a host sends a packet to the network broadcast address, all hosts in the network will receive the packet. The broadcast address uses the highest address in the network range. The broadcast address has all 1s in the host portion. For example, if the IP address and the subnet mask is find the broadcast address. The figure below illustrates the solution to the above example.


Host Address

The host address uniquely identifies the host in the network. The host portion always contains various 0s and 1s but never all 0s or all 1s.

First Host Address

The first available host IP addresses in that network which has all 0s and end with a 1 in the host portion. It is also called the first usable IP address.


Dotted Decimal Notation Binary
Network IP Address 10101100.01100100.00000000.00000000
First Usable IP address 10101100.01100100.00000000.00000001

Last Host Address

The last available host IP address in that network which has 1s and ends with a 0 in the host portion. It is also called the last usable IP address.


Dotted Decimal Notation Binary
Last Usable IP Address 10101100.01100100.01111111.11111110
Broadcast IP Address 10101100.01100100.01111111.11111111