Categories
Internet Networking Hardware

Number of Subnet Bits in an IP Address Subnet Mask

Subnet Masks: The Key to Dividing Networks

Purpose: A subnet mask indicates which parts of an IP address belong to the network portion (the shared part for devices within the same subnet) and which parts are available for individual devices to use (host bits).

Structure: Subnet masks just like regular IP addresses are 32 bits long.

Ones and Zeros: The subnet mask uses a sequence of ones followed by zeros. The 1’s represent the network portion and the 0’s represent the host portion.

Example

Subnet Mask: 255.255.255.0

This means the first 24 bits (255.255.255) are for the network and the last 8 bits (0) are for hosts.

Number of Subnet Bits: In this example there are 24 subnet bits.

Calculating Subnet Bits

To determine the number of subnet bits follow these steps:

Convert to Binary: Take your subnet mask and convert each of the four sections (octets) into their 8 bit binary representation.

Count the Ones: Count the consecutive 1’s from the left. This number equals your subnet bits.

Let’s Practice

Subnet Mask: 255.255.224.0

Binary: 11111111.11111111.11100000.00000000

Consecutive Ones: 19 = Number of Subnet Bits

Important: In standard classful IP addressing masks like the examples above are easy to interpret. But Variable Length Subnet Masking (VLSM) allows for more flexible subnet divisions.

Leave a Reply

Your email address will not be published. Required fields are marked *