Copied!
Sign In
Access your IPWhois.net account
No account? Create one
Home / FAQ / What Is a Subnet?

What Is a Subnet?

Understand subnetting, subnet masks, CIDR notation, and how to calculate network addresses, broadcast addresses, and host ranges.

What Is Subnetting?

Subnetting is the practice of dividing a larger network into smaller, logical sub-networks (subnets). Each subnet functions as its own independent network segment, which improves performance, security, and address management.

Think of it like dividing a large office building into separate departments - each department has its own space, but they are all part of the same building. Similarly, subnets divide an IP network into manageable segments while remaining part of the same overall network.

Why Subnet? Subnetting reduces broadcast traffic (broadcasts stay within the subnet), improves security (you can apply different rules to different subnets), and makes IP address management more efficient.

Understanding Subnet Masks

A subnet mask determines which portion of an IP address identifies the network and which portion identifies the host. It is a 32-bit number, just like an IPv4 address.

For example, the subnet mask 255.255.255.0 in binary is:

11111111.11111111.11111111.00000000

The 1s represent the network portion, and the 0s represent the host portion. With this mask applied to 192.168.1.100:

  • Network address: 192.168.1.0 (the first 24 bits)
  • Host portion: .100 (the last 8 bits)
Subnet MaskCIDRBinaryUsable Hosts
255.0.0.0/811111111.00000000.00000000.0000000016,777,214
255.255.0.0/1611111111.11111111.00000000.0000000065,534
255.255.255.0/2411111111.11111111.11111111.00000000254
255.255.255.128/2511111111.11111111.11111111.10000000126
255.255.255.192/2611111111.11111111.11111111.1100000062
255.255.255.240/2811111111.11111111.11111111.1111000014

CIDR Notation

CIDR (Classless Inter-Domain Routing) notation is a compact way to express an IP address and its subnet mask. Instead of writing both the IP and mask separately, CIDR appends a slash followed by the number of network bits:

192.168.1.0/24 is equivalent to the network 192.168.1.0 with mask 255.255.255.0.

The number after the slash (the prefix length) indicates how many of the 32 bits belong to the network portion. The remaining bits are for host addresses.

Calculating Network, Broadcast, and Host Range

Let's work through an example with the IP 192.168.1.100/24:

  1. Subnet mask: /24 = 255.255.255.0
  2. Network address: Perform a bitwise AND between the IP and mask → 192.168.1.0
  3. Broadcast address: Set all host bits to 1 → 192.168.1.255
  4. First usable host: Network address + 1 → 192.168.1.1
  5. Last usable host: Broadcast address − 1 → 192.168.1.254
  6. Total usable hosts: 28 − 2 = 254

The formula for usable hosts is: 2(32 − prefix) − 2. You subtract 2 because the network address and broadcast address cannot be assigned to devices.

Practical Subnetting Example

Suppose you have the network 10.0.0.0/24 (254 hosts) and need to divide it into 4 equal subnets:

SubnetNetwork AddressHost RangeBroadcastUsable Hosts
110.0.0.0/2610.0.0.1 – 10.0.0.6210.0.0.6362
210.0.0.64/2610.0.0.65 – 10.0.0.12610.0.0.12762
310.0.0.128/2610.0.0.129 – 10.0.0.19010.0.0.19162
410.0.0.192/2610.0.0.193 – 10.0.0.25410.0.0.25562

By changing the prefix from /24 to /26, we borrowed 2 extra bits from the host portion (creating 22 = 4 subnets), each with 26 − 2 = 62 usable addresses.

Pro Tip: Use our Subnet Calculator to instantly calculate network addresses, host ranges, and broadcast addresses for any CIDR block - no manual binary math required.
Subnet Calculator
Use our free online tool - no signup required