IPv4 β the mask, the borrow, the block, and where the boundaries fall.
The borrow. The bits the prefix takes past the octet boundary are worth 128, 64, 32 β¦ in that octet, which is where every mask value comes from β and the block size is 256 minus that.
/31 has 2 usable addresses, not 0. RFC 3021: on a point-to-point link there is nobody to broadcast to, so both addresses go to the two ends. This is what router-to-router links are numbered with, so it is the common case, not an edge case.
/32 has 1, not β1. It is a single host route β a loopback, a
/32 in a routing table β not a network at all.
2Β³Β²β»α΅ β 2 gives 0 and β1 for those two. A calculator that prints them has not been used on real equipment.
The 172.16.0.0/12 one catches people: it runs to 172.31.255.255, not to 172.16.255.255 and not to 172.255.255.255. The dotted notation hides where a /12 ends.