I know how to do the classic "network addressing" when I am allowed to waste IP addresses. For example, if I need to hook up 9 computers, I could use a /28 subnet, which allows 16 hosts to be mapped within it see the Wikipedia article on CIDR for details.

But what if I am asked to minimize the number of wasted IP addresses?

For example in this case:

Imagine, there is a network 6 which has 8 computers. We see that if the IP address wasting was not allowed, then the network 6 would use the unused range: 12.0.2.128 - 12.0.2.255

So, the network 6 would look like this:

3. 1st address of network: 12.0.2.129
4. last address of network: 12.0.2.142

What if there is additional network 7 with only 10 computers?

Am I limited to only one CIDR subnet / network for each free unused range, or am I allowed to "put" as many different subnets as can possibly fit within the free unused address range?

when I am allowed to waste IP address ranges

I'm taking this to mean you are required to pick the smallest subnet that will accomodate the number of nodes you want to put in it

we see that if the IP address wasting was not allowed, then the network number 5 would be different. It would use the unused range: 12.0.2.127 - 12.0.3.0

Network 5, if you really need to conserve addresses in this fashion - that'd be 12.0.2.129 - 12.0.2.254. with 12.0.2.255/25 being the broadcast address.

A network 6 with 10 computers require the "nearest greatest power of 2" bits for each to have an address, which is 16 (0-15). 0-15 wants 4 bits.

12.0.4.128/25 is the next available, so you could do 12.0.4.128/28. 12.0.4.129 is the first available address, and 12.0.4.143/28 is the broadcast address.

• You need seven bits (which provide 128 values) to handle 78 nodes (64 <= 78 <= 128). /25 gives you 7 bits for hosts (32 - 25 = 7). The subnet mask doesn't split on anything more granular than even powers of 2. It's the best you can do, and you always want room for expansion anyway. – LawrenceC Aug 5 '13 at 17:48

I don't know what you mean by IP address space waste. For example, network 3 has 78 machines but 126 usable addresses. If you didn't want to have unused IPs in that subnet, just assign available IPs to new interfaces.

In you example, there is a subnet not being used: 12.0.2.128/25.

Example A: 172.168.204.0/24 24 bits fixed, 8 bits in the subnet address.
Subnet name and first address: 172.168.204.0