Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Subnetting  ›  Lesson

CIDR — Prefixes and Block Sizes

CIDR 16 minA CIDR prefix counts the network bits, and the block size of 256 minus the mask octet tells you where each subnet starts and ends.

CIDR — Prefixes and Block Sizes

Writing 255.255.255.192 every time is slow, and reading it is slower. Engineers write 192.168.10.64/26 instead. That slash number is CIDR notation, and with one small trick it lets you find any address's subnet, broadcast and host range in your head — the core skill of a subnet plan.

The rule

The slash counts the network bits; the block size is 256 minus the mask octet.

CIDR (Classless Inter-Domain Routing) writes a network as an address plus a prefix length: the number of 1s in the mask. /24 = 255.255.255.0, /26 = 255.255.255.192, /16 = 255.255.0.0. Host bits = 32 − prefix. It replaced the old fixed "class A, B, C" sizes, so a network can be any size that is a power of two.

The prefixes worth knowing by heart for the last octet:

Prefix Mask Block size Usable hosts
/24 255.255.255.0 256 254
/25 255.255.255.128 128 126
/26 255.255.255.192 64 62
/27 255.255.255.224 32 30
/28 255.255.255.240 16 14
/29 255.255.255.248 8 6
/30 255.255.255.252 4 2

The block size is how far apart the subnets start. Subnets always begin at multiples of it: for /26, at .0, .64, .128 and .192.

The shortcut

To place any address:

  1. Block = 256 − the interesting mask octet.
  2. Network = round the address's interesting octet down to a multiple of the block.
  3. Broadcast = network + block − 1.
  4. Hosts = everything strictly between them.
Where does `192.168.10.100/26` live?Step 1 of 4
  1. Block size

    /26 is 255.255.255.192. 256 − 192 = 64.

It works in any octet. For 172.16.37.9/20, the mask is 255.255.240.0, so the block is 16 in the third octet: 37 rounds down to 32, giving network 172.16.32.0 and broadcast 172.16.47.255.

The trap is rounding to the nearest multiple instead of down. .100 is nearer to 128 than 64, but it lives in the .64 block.

Drills

Answer fast — trust the rule.

Usable hosts in a /27:

What's the answer?
232−27−2= ?2^{32-27} - 2 = \,?
quick drill

What is the network address of 192.168.10.77/27?

quick drill

What is the broadcast address of 192.168.10.200/28?

quick drill

Which mask matches /29?

quick drill

Is 192.168.10.130 a usable host in 192.168.10.128/26?

Remember

  • The slash counts the network bits; the block size is 256 minus the mask octet.
  • Round the address down to a multiple of the block; broadcast = network + block − 1.
  • /26 = 64, /27 = 32, /28 = 16, /29 = 8, /30 = 4.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainPlace an address

For 192.168.10.77/27, find the mask, block size, network address, broadcast address and usable host range, and explain the rounding step.