Week 1 · Lesson 6

Internet Protocol Version 4 (IPv4) — Part 3

An address alone does not tell a device which network it belongs to. For that you need a subnet mask. This lesson introduces the mask, the network and host portions, prefix notation, and the two addresses in every network that can never belong to a host: the network address and the broadcast address.

CCNA 200-301 Domain 1.6 · IPv4 Addressing Verified 2026-10-11
Part 1

What is a subnet mask?

A subnet mask is a 32-bit number, written in the same dotted-decimal form as an IPv4 address, that sits alongside the address and says: these bits are the network, those bits are the host. The mask is built from a run of contiguous 1s starting at the left, followed by 0s to the end. The 1s mark the network portion; the 0s mark the host portion.

Definition — subnet mask. A subnet mask is a 32-bit value of contiguous leading 1s used with an IPv4 address to separate the network portion from the host portion. A device finds its network by logically ANDing the address with the mask (the AND operation is the focus of Lesson 7).

Without a mask, 192.168.10.45 is just a number. With the mask 255.255.255.0, we learn that 192.168.10 identifies the network and 45 identifies the host inside it.

Mask builder · choose a prefix

Part 2

Network portion vs host portion

Look at the mask in binary. Every 1 aligns with a network bit of the address; every 0 aligns with a host bit.

Address: 192.168.10.45      prefix /24
Binary : 11000000.10101000.00001010.00101010
Mask   : 11111111.11111111.11111111.00000000
         [===== network bits (24) =====][ host bits (8) ]

Here the first 24 bits are network and the final 8 bits are host. Because the mask's ones are contiguous, the boundary is easy to see. The number of host bits, usually called h, determines how many devices the network can hold.

192.168.10.45 with prefix /24 192 168 10 45 Network portion (24 bits) Host (8) Subnet mask: 255.255.255.0 · binary 11111111.11111111.11111111.00000000 · 1 = network bit, 0 = host bit
The mask marks the boundary between the network and the host. Here three octets are network and one octet is host, which is why the mask is 255.255.255.0.
Network vs host · type an address and set the prefix

Part 3

Default masks by class

In classful addressing each class came with a default mask that matched its size. These three masks you must know instantly:

ClassDefault maskPrefixNetwork / host split
A255.0.0.0/88 network bits, 24 host bits
B255.255.0.0/1616 network bits, 16 host bits
C255.255.255.0/2424 network bits, 8 host bits
Exam tip. Mask bytes convert to prefix fast: 255 = 8 ones, 0 = 0 ones. So 255.255.255.0 = 8 + 8 + 8 + 0 = /24. Count the ones to get the prefix.
Part 4

Prefix / CIDR notation and host counts

Instead of writing a mask, engineers often write a slash and the number of network bits: 192.168.10.45/24. This is prefix notation, also called CIDR (Classless Inter-Domain Routing) notation. The number after the slash is the count of leading 1s in the mask. Because the address is always 32 bits, host bits = 32 − prefix.

For example, /24 → host bits h = 32 − 24 = 8; /26 → h = 32 − 26 = 6. This is the h you will plug into the host-count formula.

PrefixMaskHost bits hUsable hosts (2h−2)
/8255.0.0.02416,777,214
/16255.255.0.01665,534
/24255.255.255.08254
/25255.255.255.1287126
/26255.255.255.192662
/27255.255.255.224530
/28255.255.255.240414
/29255.255.255.24836
/30255.255.255.25222
Note. A /30 mask (255.255.255.252) leaves only 2 usable addresses — exactly enough for the two ends of a point-to-point link. A /31 is a special case for such links, but the general 2h−2 rule is what the exam expects.
Usable hosts · pick a prefix

Part 5

Network and broadcast addresses

Two addresses in every subnet are reserved and cannot be given to a host.

Every host address sits strictly between these two. That is exactly why the host formula subtracts 2.

Formula. Usable hosts = 2h − 2, where h is the number of host bits (h = 32 − prefix). Subtract 2 because the network address and the broadcast address are not usable.

Example: a /24 has h = 8 host bits, so 28 = 256 total addresses, and 256 − 2 = 254 usable hosts. A /26 has h = 6, so 26 = 64 total, and 64 − 2 = 62 usable hosts.

A full worked example

Take 192.168.10.45 with mask 255.255.255.0 (/24):

  1. Host bits: h = 32 − 24 = 8.
  2. Network address: set all host bits to 0 → 192.168.10.0.
  3. Broadcast address: set all host bits to 1 → 192.168.10.255.
  4. Usable host range: 192.168.10.1 through 192.168.10.254.
  5. Usable hosts: 28 − 2 = 254.
RoleAddressNote
Network192.168.10.0all host bits 0 — not usable
First host192.168.10.1first usable
Given host192.168.10.45inside the range
Last host192.168.10.254last usable
Broadcast192.168.10.255all host bits 1 — not usable
Part 6

Why subnet? (a teaser)

If every device in an organisation shared one huge Class A network, you would waste millions of addresses and every broadcast would interrupt every device. Subnetting splits one network block into smaller logical subnetworks. Each subnet has its own network address, broadcast address, and host range, which:

Reduces broadcast traffic

Broadcasts stay inside a smaller domain instead of reaching every device.

Improves security

Routers and ACLs can control traffic between subnets.

Uses addresses efficiently

Each subnet can be sized to its real need.

This lesson gives you the vocabulary — mask, prefix, network, broadcast, host count. The complete subnetting procedure (finding subnet boundaries across larger blocks and VLSM) is developed in a later week (Week 7). First, Lesson 7 shows the arithmetic that ties it all together: the bitwise AND.

Key terms

Subnet mask

A 32-bit value of contiguous leading 1s that separates the network and host portions of an address.

Network portion

The bits marked by 1s in the mask; identifies the subnet.

Host portion

The bits marked by 0s in the mask; identifies the device within the subnet.

Prefix / CIDR notation

Writing the mask as a slash plus the count of network bits, e.g. /24.

Network address

The address with all host bits 0; names the subnet and is not assigned to a host.

Broadcast address

The address with all host bits 1; reaches every host in the subnet and is not assigned to a host.

Usable hosts

2h − 2, where h = 32 − prefix.

Sources & references

  1. Postel, J. RFC 791: Internet Protocol (1981). Address and subnet structure.
  2. Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989).
  3. Rekhter, Y. et al. RFC 1918: Address Allocation for Private Internets (1996).
  4. Arkko, J., Cotton, M. & Vegoda, L. RFC 5737: IPv4 Address Blocks Reserved for Documentation (2010).
  5. Cotton, M. & Vegoda, L. RFC 5735: Special Use IPv4 Addresses (2010).
  6. Cheshire, S., Aboba, B. & Guttman, E. RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses (2005).
  7. Weil, J. et al. RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space (2012).
  8. IANA. IPv4 Special-Purpose Address Registry.
  9. Cisco. CCNA (200-301) Exam Topics, Network Fundamentals (IP addressing and subnetting).
Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Sources

Sources & references

  1. Postel, J. RFC 791: Internet Protocol (1981). Address and subnet structure. rfc-editor.org/rfc/rfc791.
  2. Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989). rfc-editor.org/rfc/rfc1122.
  3. Rekhter, Y. et al. RFC 1918: Address Allocation for Private Internets (1996). rfc-editor.org/rfc/rfc1918.
  4. Arkko, J., Cotton, M. & Vegoda, L. RFC 5737: IPv4 Address Blocks Reserved for Documentation (2010). rfc-editor.org/rfc/rfc5737.
  5. Cotton, M. & Vegoda, L. RFC 5735: Special Use IPv4 Addresses (2010). rfc-editor.org/rfc/rfc5735.
  6. Cheshire, S., Aboba, B. & Guttman, E. RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses (2005). rfc-editor.org/rfc/rfc3927.
  7. Weil, J. et al. RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space (2012). rfc-editor.org/rfc/rfc6598.
  8. IANA. IPv4 Special-Purpose Address Registry. iana.org.
  9. Cisco. CCNA (200-301) Exam Topics, Network Fundamentals (IP addressing and subnetting). cisco.com.

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.