Protocols
Saved & recent

IP address and subnet

Also called: subnet, CIDR, prefix length, subnet mask

An IP address identifies a network-layer endpoint; a prefix describes a block of addresses sharing leading bits. In slash notation, the number after the slash counts those shared bits. Subnets use address prefixes to organize local networks and inform forwarding decisions.

For example, 192.0.2.64/26 contains 64 IPv4 addresses, from 192.0.2.64 through 192.0.2.127. There are six remaining address bits because 32 − 26 = 6. That is a block size, not a promise of 64 usable host assignments: reserved addresses and deployment rules affect which addresses can be assigned.

IPv4 addresses in a /p block = 232 − p

Read first
IPv4
Related
IPv4, IPv6, Routing
Further reading
IETF RFC 4632 — Classless Inter-domain Routing (CIDR)
192.0.2.64/26 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 · · · · · · 26 fixed prefix bits 6 variable bits 64 address slots 192.0.2.64 192.0.2.127 documentation range · endpoints included
Documentation block: 26 fixed bits leave six variable bits, giving 64 addresses. Usable-host counts are a separate question.

View in the full Protocols collection