/24 What is a Subnet?

A subnet divides a larger IP network into smaller segments. Learn subnet masks, CIDR notation, network and broadcast addresses, and usable host ranges.

What is a subnet?

A subnet (subnetwork) is a logical division of an IP network into smaller, isolated segments. Subnetting lets you organise devices into groups, control which devices can communicate directly with each other, and use IP address space efficiently.

Every subnet has three key addresses:

  • Network address — the first address in the range, identifies the subnet itself. Not assignable to a device.
  • Broadcast address — the last address, used to send data to all devices in the subnet simultaneously.
  • Usable host addresses — everything in between. These can be assigned to devices.

Subnet masks

A subnet mask separates the network portion of an IP address from the host portion. It's written as four octets (like an IP address) where all network bits are 1 and all host bits are 0:

255.255.255.0  →  11111111.11111111.11111111.00000000
                   ↑ 24 network bits                ↑ 8 host bits

CIDR notation

CIDR (Classless Inter-Domain Routing) notation is a compact way to write a subnet. The prefix length after the slash tells you how many bits belong to the network:

192.168.1.0/24   ← network 192.168.1.x, 256 addresses
10.0.0.0/8       ← network 10.x.x.x, 16,777,216 addresses
172.16.0.0/16    ← network 172.16.x.x, 65,536 addresses

Common subnet sizes

CIDRSubnet maskTotal addressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/24255.255.255.0256254
/25255.255.255.128128126
/28255.255.255.2401614
/30255.255.255.25242
/32255.255.255.25510 (single host route)

Usable hosts = total addresses − 2 (network address + broadcast address), except /31 and /32 which are special cases.

Worked example

Given: 192.168.10.0/24

Network address192.168.10.0
Subnet mask255.255.255.0
Broadcast address192.168.10.255
First usable host192.168.10.1
Last usable host192.168.10.254
Usable hosts254

Use the subnet calculator to compute these values for any IP and prefix length.

Frequently asked questions

Why subtract 2 from the total addresses to get usable hosts?

The first address in any subnet is the network address (identifies the subnet itself) and the last is the broadcast address (reaches all hosts in the subnet). Neither can be assigned to a device, leaving total − 2 usable addresses.

What is a /32 subnet?

A /32 has exactly one address — it's a host route used to refer to a single specific IP. You'll see /32 routes in firewall rules and routing tables to direct traffic for exactly one IP.

What is the difference between a subnet mask and a wildcard mask?

A subnet mask has 1s in the network portion and 0s in the host portion. A wildcard mask (used in Cisco ACLs and OSPF) is the bitwise inverse — 0s in the network portion and 1s in the host portion. A /24 subnet mask is 255.255.255.0; its wildcard is 0.0.0.255.