A subnet (short for subnetwork) is a smaller network inside a larger IP network: a block of addresses that a device treats as "local" and can reach directly, without going through a router. Your home Wi-Fi is a subnet, usually 192.168.1.0/24, and big networks are cut into many subnets so traffic and access can be managed in smaller pieces.
This article covers the idea itself. For the mask that defines a subnet, see subnet mask explained, and for the slash notation, CIDR notation explained.
A subnet in one picture
An IPv4 address such as 192.168.1.42 has two parts: a network part that says which subnet the device is on, and a host part that says which device it is within that subnet. All devices on one subnet share the same network part. In 192.168.1.0/24, the first 24 bits (192.168.1) are the network part and the last 8 bits are the host part, so the subnet holds 256 addresses, numbered 192.168.1.0 to 192.168.1.255.
RFC 950, the 1985 standard that introduced subnetting, defines a subnet in its glossary as "one or more physical networks forming a subset of an Internet network". In plain terms: one slice of a bigger address space.
How devices use a subnet
A subnet matters because it decides where a packet goes. Before sending, a device compares its own address with the destination under the subnet mask. RFC 950 describes the test: if the results match, the destination is on the local subnet and the datagram is sent directly; if they differ, it goes to a gateway (the router).
- Same subnet:
192.168.1.42to192.168.1.7. Delivered directly on the local network. - Different subnet:
192.168.1.42to192.168.2.7, or to any internet address. Sent to the default gateway, which forwards it.
So devices on different subnets cannot reach each other until a router connects them. That separation is the whole point.
Why networks are split into subnets
RFC 950 gives the original reasons that organisations with several LAN cables needed more than one network: mixed LAN technologies, electrical limits on cable length and number of hosts, congestion from heavy traffic on a single segment, and sites too far apart to share one LAN. Those still explain much of the practice, and modern networks add a few more:
- Separation. Put guests, office computers, cameras and servers in different subnets. Traffic between them has to pass through a router or firewall, where you can allow or block it.
- Smaller local traffic. Each subnet is its own local network, so chatter stays inside it.
- Tidier addressing. Giving each department or site its own block makes routing tables and firewall rules shorter and easier to read.
- Right-sized blocks. A point-to-point link needs 2 addresses, an office floor may need 200. Subnets let each get a block about the right size.
Example: splitting one block into subnets
Suppose a company is given the private block 10.0.0.0/22 (1,024 addresses) and wants four separate networks. Each /24 holds 256 addresses, so the block divides into four /24 subnets:
| Subnet | Address range | Used for |
|---|---|---|
| 10.0.0.0/24 | 10.0.0.0 to 10.0.0.255 | Servers |
| 10.0.1.0/24 | 10.0.1.0 to 10.0.1.255 | Office computers |
| 10.0.2.0/24 | 10.0.2.0 to 10.0.2.255 | Guest Wi-Fi |
| 10.0.3.0/24 | 10.0.3.0 to 10.0.3.255 | Printers and cameras |
The names in the last column are only an example plan. A server at 10.0.0.10 and a laptop at 10.0.1.25 are now in different subnets, so their traffic crosses a router. You can check the split with Python's standard library:
python -c "import ipaddress as i; print(*i.ip_network('10.0.0.0/22').subnets(new_prefix=24), sep='\n')"
Example output:
10.0.0.0/24
10.0.1.0/24
10.0.2.0/24
10.0.3.0/24
Which addresses can live in a subnet
Home and office subnets almost always use private address space. RFC 1918 reserves three blocks for it: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. Addresses there only need to be unique within one organisation, so your 192.168.1.0/24 and a neighbour's can be identical without conflict. How those private ranges reach the internet is covered in public vs private IP addresses.
In each IPv4 subnet, the first address (all host bits 0) names the subnet itself and the last (all host bits 1) is the broadcast address, so a /24 has 254 addresses you can assign to devices.
Find your own subnet
On Windows, run ipconfig and read the IPv4 Address and Subnet Mask lines. On Linux, run ip -4 address; the address is shown with its prefix length, such as 192.168.1.42/24. Setting the host bits to 0 gives your subnet: 192.168.1.0/24. Devices normally receive their address and mask automatically, as explained in what is DHCP.
Common mix-ups
- Subnet vs network. A subnet is a network, just one carved from a larger block. The words overlap in everyday use.
- Subnet vs VLAN. A VLAN separates devices at the switch level; a subnet is an IP address range. They are often matched one to one (one VLAN, one subnet), but they are different things.
- Subnet vs subnet mask. The subnet is the block of addresses. The mask is the rule that defines its size.
Frequently asked questions
- What is a subnet in simple terms?
- A subnet is a group of IP addresses that share the same leading bits and are treated as one local network. Devices inside a subnet talk to each other directly; traffic to any other subnet goes through a router.
- Do I have a subnet at home?
- Yes. Your router creates one subnet for your home network, almost always a private range such as 192.168.1.0/24 or 192.168.0.0/24. Every phone, laptop and TV on it is in the same subnet.
- Why do networks use more than one subnet?
- RFC 950 lists the original reasons: different LAN technologies, limits on cable length and host count, congestion from too much traffic on one segment, and sites that are far apart. Today a common reason is also separating groups of devices, such as guests or servers, so a router can control traffic between them.
- What is the difference between a subnet and a subnet mask?
- The subnet is the network itself, a block of addresses. The subnet mask is the number a device uses to work out which addresses belong to its own subnet, such as 255.255.255.0.