Menu
Coddy logo textTech

Block Sizes

Lesson 17 of 46 in Coddy's IP Addressing and Subnetting course.

How many addresses does a prefix hold? Two to the power of the host bits: 232-n.

A /30 has 2 host bits, so 4 addresses. A /28 has 4 host bits, so 16. A /25 has 7, so 128. Each step down in the prefix doubles the block; each step up halves it.

Careful: this is the total count, including two addresses you cannot give to machines. The next chapter deals with those two.

challenge icon

Challenge

Beginner

Print the total number of addresses in a /30, a /28, and a /25, one per line, in that order.

Expected output:

4
16
128

Try it yourself

Terminal

All lessons in IP Addressing and Subnetting

Practice on your own: Terminal playground