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
BeginnerPrint the total number of addresses in a /30, a /28, and a /25, one per line, in that order.
Expected output:
4
16
128Try it yourself
All lessons in IP Addressing and Subnetting
10Capstone - The Office
The Floor PlanSizing Each TeamCarving the BlockThe Router's ViewRecap - Ship the PlanPractice on your own: Terminal playground