RedTeam Nexus Labs
Module 06 · Lesson 03 // Subnetting

network/host portions

Subnetting · Networking

Freereading · 10 min
On this page
LESSON

Overview

Every subnet reserves certain addresses for special purposes and leaves the rest for hosts. Understanding the network address, the broadcast address, and the usable host range is the practical core of subnetting. This lesson makes those portions concrete.

Learning objectives

  • Identify the network and broadcast addresses of a subnet.
  • Calculate the number of usable host addresses.
  • Explain why two addresses per subnet are reserved.

Core concept

Within any subnet, the host-portion bits define a range of addresses, but two are reserved:

  • Network address — all host bits set to 0; identifies the subnet itself (e.g. 192.168.1.0 in a /24). Not assignable to a host.
  • Broadcast address — all host bits set to 1; used to address every host in the subnet at once (e.g. 192.168.1.255 in a /24). Not assignable to a host.
  • Usable host addresses — everything in between.

The formula for usable hosts is 2^(host bits) − 2 (subtracting the network and broadcast addresses).

How it works

Given a prefix, the host bits are 32 − prefix. For a /24, that is 8 host bits → 2^8 = 256 total addresses → 254 usable hosts (256 − 2). For a /26, host bits = 6 → 2^6 = 64 total → 62 usable. The first address (all-zero host) is the network ID and the last (all-one host) is the broadcast, which is why every subnet "loses" two addresses to overhead.

Practical example

Take 192.168.1.0/24:

  • Network address: 192.168.1.0
  • Broadcast address: 192.168.1.255
  • Usable host range: 192.168.1.1 through 192.168.1.254 (254 hosts)

So a device can be assigned any address from .1 to .254, but never .0 or .255 in this subnet.

Cybersecurity relevance

Knowing a subnet's usable range and boundaries matters for scanning (a tester enumerates the usable range), for spotting anomalies (traffic to/from a broadcast address can indicate certain attacks or scanning), and for correctly scoping firewall rules and monitoring to a subnet.

Common mistakes

  • Forgetting to subtract 2 for the network and broadcast addresses when counting usable hosts.
  • Assigning the network or broadcast address to a host, which will not work.
  • Miscounting host bits from the prefix.

Key takeaways

  • Each subnet reserves the network address (all-zero host bits) and the broadcast address (all-one host bits).
  • Usable hosts = 2^(host bits) − 2; a /24 gives 254 usable, a /26 gives 62.
  • The usable range lies between the network and broadcast addresses (e.g. .1–.254 in a /24).

Check your understanding

  • For 192.168.1.0/24, name the network address, broadcast address, and usable range.
  • How many usable host addresses does a /26 subnet provide, and why subtract 2?
FINISH THIS LESSON

Sign in to save your progress.