Skip to main content
Glossary

What is a subnet mask?

A subnet mask is a 32-bit number that separates an IP address into its network and host portions. It does the same job as CIDR's prefix-length notation but written in the more verbose dotted-decimal form.

Examples:

  • /24 CIDR ≡ 255.255.255.0 subnet mask — first 24 bits network, last 8 bits host
  • /16 CIDR ≡ 255.255.0.0 — first 16 bits network
  • /8 CIDR ≡ 255.0.0.0 — first 8 bits network (entire Class A)

Usage: when a device wants to send a packet, it ANDs its own IP with its subnet mask to find its network address, then ANDs the destination IP the same way. If the two networks match, the destination is local (send directly); otherwise route via the default gateway.

Modern tools default to CIDR notation (/24) instead of subnet masks (255.255.255.0), but both describe the same thing.

Meer IPv4-termen

Zoek het op in de echte wereld

WorldIP.io volgt elk toegewezen IPv4-adres, ASN, CIDR-blok en organisatie op het internet. Begin met verkennen:

Share