DEV Community

Mujahida Joynab
Mujahida Joynab

Posted on

Subnet mask

We understand by subnet mask that which bits are fixed and which bits are changeable (host portion).
Example - 192.168.1.0/24
Here first 24 bits are fixed .
Total Bit = 32
Rest = 32 - 24 = 8
and 2^8 - 2 = 254 are changable

Why 2 are subtracted ?
Because 0 and 255 are researved

0 = Network Address (Reserved )(All host bit 0)
Example: 192.168.1.0

255= Broadcast Address (All host bit 1)
Example: 192.168.1.255

Usable IP range: 192.168.1.1 to 192.168.1.254 (254 addresses)

Top comments (0)