Preloader spinner
Ethernet cables connected to enterprise network switches

Subnetting is the process of dividing an IP network into smaller logical networks called subnets. It helps organisations use IP addresses efficiently, separate different parts of a network, reduce unnecessary broadcast traffic and create clearer boundaries for routing and security.

Subnetting is one of the most important concepts to understand when learning networking. It appears in Cisco CCNA, CompTIA Network+ and many network administration roles because almost every real business network is divided into multiple IP networks rather than operating as one enormous address space.

What is a subnet?

A subnet, short for subnetwork, is a logical section of a larger IP network.

Imagine an organisation with separate networks for:

  • office computers
  • servers
  • wireless users
  • guest Wi-Fi
  • IP phones
  • printers
  • management devices

Each group can be placed in its own subnet. Routers or Layer 3 switches can then move traffic between those networks according to the organisation's routing and security rules.

Why do networks use subnetting?

There are several practical reasons.

1. Better use of IP addresses

Subnetting allows address space to be divided according to the number of devices a network actually needs.

A small branch office does not need the same number of addresses as a large campus network. By choosing appropriate subnet sizes, organisations can avoid wasting large blocks of address space.

2. Smaller broadcast domains

IPv4 networks use broadcasts for some local communication. A broadcast is delivered to all devices in the same broadcast domain.

If thousands of devices were placed in one large network, broadcast traffic could become inefficient. Dividing the environment into smaller subnets limits broadcasts to the relevant local network.

3. Easier organisation

Subnets can reflect how the organisation is structured.

For example:

  • 10.10.10.0/24 - Finance
  • 10.10.20.0/24 - HR
  • 10.10.30.0/24 - Sales
  • 10.10.40.0/24 - Servers

This type of address plan makes troubleshooting, documentation and network management much easier.

4. Security and traffic control

Devices on different subnets normally need a router or Layer 3 switch to communicate. That creates a point where access-control lists, firewalls and other security policies can be applied.

Subnetting alone is not a complete security solution, but it provides useful network boundaries.

5. Routing efficiency

A structured IP addressing plan can make routes easier to summarise and manage, particularly in larger networks.

How does an IPv4 address work?

An IPv4 address contains 32 binary bits and is normally written as four decimal numbers separated by dots.

For example:

192.168.10.25

Each decimal section represents eight bits, giving four octets in total.

The address contains two logical parts:

  • network portion - identifies the IP network
  • host portion - identifies a device or interface within that network

The subnet mask or prefix length tells networking devices where the network portion ends and the host portion begins.

What is a subnet mask?

A subnet mask is a 32-bit value used with an IPv4 address to identify the network and host portions.

A common example is:

255.255.255.0

That mask corresponds to a /24 prefix because the first 24 bits are network bits.

If the address is 192.168.10.25/24, then:

  • network address: 192.168.10.0
  • usable host range: 192.168.10.1 to 192.168.10.254
  • broadcast address: 192.168.10.255

This gives 254 traditional usable IPv4 host addresses.

What is CIDR notation?

CIDR stands for Classless Inter-Domain Routing. CIDR notation expresses the network prefix as a slash followed by the number of network bits.

Examples include:

  • /8
  • /16
  • /24
  • /26
  • /27
  • /30

The larger the prefix number, the more bits are allocated to the network and the fewer remain for host addresses.

Common subnet masks

CIDRSubnet maskTotal addressesTraditional usable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

The table uses the traditional IPv4 rule of excluding the network and broadcast addresses from normal host assignment. Some specialised point-to-point scenarios use different conventions, but the traditional calculation remains the essential starting point for learners.

How do you calculate the number of hosts in a subnet?

IPv4 has 32 bits. Subtract the prefix length from 32 to find the number of host bits.

For a /26:

32 - 26 = 6 host bits

Six binary bits can represent:

2^6 = 64 addresses

Using traditional IPv4 subnetting, subtract the network and broadcast addresses:

64 - 2 = 62 usable host addresses

What is the network address?

The network address identifies the subnet itself.

For 192.168.1.0/24, the network address is:

192.168.1.0

You do not normally assign the network address to an end device.

What is the broadcast address?

The broadcast address represents all hosts in an IPv4 subnet.

For 192.168.1.0/24, the broadcast address is:

192.168.1.255

A broadcast sent to that address can be received by devices within the subnet, subject to network behaviour and controls.

A simple subnetting example

Suppose you have the network:

192.168.10.0/24

You need four similarly sized subnets.

A /24 contains 256 addresses. Dividing it into four equal networks requires borrowing two host bits because two bits provide four combinations.

The new prefix becomes:

/26

The four subnets are:

  • 192.168.10.0/26
  • 192.168.10.64/26
  • 192.168.10.128/26
  • 192.168.10.192/26

Each contains 64 addresses, traditionally providing 62 usable host addresses.

Why do subnet boundaries occur at 64 in a /26?

A /26 mask is:

255.255.255.192

The block size in the final octet can be calculated as:

256 - 192 = 64

That produces network boundaries at:

0, 64, 128 and 192.

This block-size method is a useful shortcut when learning IPv4 subnetting.

What is variable-length subnet masking?

VLSM, or Variable Length Subnet Masking, allows different subnet sizes to be used within the same address plan.

Imagine an organisation needs:

  • 100 addresses for a head office
  • 50 for a branch
  • 20 for another branch
  • 2 for a point-to-point link

Creating four equally sized subnets could waste many addresses. VLSM allows each requirement to receive an appropriately sized prefix.

This is a core skill in practical IP address design.

Private IPv4 address ranges

Many internal networks use private IPv4 addresses. The well-known RFC 1918 private ranges are:

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16

These addresses are not routed across the public internet in the same way as public IP addresses. Organisations commonly use Network Address Translation when private devices need internet access.

Subnetting vs VLANs

Subnetting and VLANs are related but not identical.

A subnet is an IP-layer concept.

A VLAN divides a switched Layer 2 network into separate broadcast domains.

In well-designed enterprise networks, one VLAN is commonly associated with one IP subnet. For example:

  • VLAN 10 → 10.10.10.0/24
  • VLAN 20 → 10.10.20.0/24
  • VLAN 30 → 10.10.30.0/24

Read What Is a VLAN? for a fuller explanation.

Subnetting vs routing

Subnetting defines the network boundaries. Routing is the process of moving packets between different IP networks.

Two devices in the same IP subnet can normally communicate locally. If the destination is in another subnet, the device sends the traffic towards its default gateway, typically a router or Layer 3 switch.

See Router vs Switch for more on the roles of these devices.

Do you still need subnetting with IPv6?

Yes, although IPv6 addressing changes the way networks are planned.

IPv6 provides an enormous address space, so conservation is not the main concern. Subnetting is still used to create logical network boundaries and organise addressing.

A /64 is the standard subnet size for many IPv6 LANs, leaving 64 bits for the interface identifier.

Why is subnetting important for CCNA?

CCNA candidates need to understand how IP networks are structured because subnetting affects routing, switching, VLANs, access control, troubleshooting and network design.

You should be comfortable identifying:

  • network addresses
  • broadcast addresses
  • usable host ranges
  • prefix lengths
  • subnet masks
  • how many addresses a subnet provides
  • whether two devices belong to the same subnet

Subnetting becomes much easier with repeated practice rather than memorising isolated rules.

Common subnetting mistakes

  • Confusing the subnet mask with the default gateway. They perform completely different roles.
  • Assigning the network address to a host.
  • Forgetting the broadcast address in traditional IPv4 calculations.
  • Assuming /24 is the only normal subnet size.
  • Mixing decimal and binary concepts without checking the prefix.
  • Creating overlapping subnets. Address ranges must be planned carefully.
  • Using different IP subnets in the same VLAN without understanding the implications.

How should beginners practise subnetting?

A good progression is:

  1. Learn binary place values: 128, 64, 32, 16, 8, 4, 2, 1.
  2. Memorise the common masks from /24 to /30.
  3. Practise calculating block sizes.
  4. Find network and broadcast addresses.
  5. Calculate usable host ranges.
  6. Practise VLSM scenarios.
  7. Build small routed networks in a lab or simulator.
  8. Use troubleshooting exercises rather than only calculation questions.

Frequently asked questions

What does /24 mean?

It means that 24 of the 32 IPv4 bits are used for the network prefix. The corresponding subnet mask is 255.255.255.0.

How many hosts are in a /24?

A /24 contains 256 total IPv4 addresses. Under traditional subnetting rules, 254 can normally be assigned to hosts.

What does /30 mean?

A /30 contains four IPv4 addresses, traditionally providing two usable host addresses. It has historically been common on point-to-point links.

Is 255.255.255.0 always a /24?

Yes. That subnet mask contains 24 binary 1s followed by eight 0s, so its CIDR prefix is /24.

Is subnetting only used with Cisco?

No. Subnetting is a fundamental IP networking concept used across vendors and platforms.

Do I need to calculate subnetting manually at work?

Network tools and IP address management systems can calculate subnets automatically, but understanding the calculations is still important for design, troubleshooting and certification study.

Develop your networking skills with ExperTrain

ExperTrain offers instructor-led Cisco training covering networking fundamentals through professional-level Cisco technologies.

The Implementing and Administering Cisco Solutions (CCNA) course develops practical skills across IPv4 and IPv6, switching, routing, wireless, security, automation and network management.

You can also use the Cisco Glossary or compare CompTIA Network+ vs CCNA and CCNA vs CCNP.

Further reading

Keep ExperTrain in your Google results

Found this article useful? Add ExperTrain as a Preferred Source on Google to help surface more of our training guides, articles and learning resources.

Join our mailing list

Receive details on our new courses and special offers

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.