0

In VLSM we usually subnet in descending order from the network with highest number of hosts to the lowest one , but i was reading that "If you allocate subnets in any other order you will not be able to avoid leaving gaps between the subnets."

I tried with simple example and subnetted out of order to understand the meaning of the gap , but i couldn't understand the where the gap is ?

Can someone please explain this with an example ?

Regards

sam
  • 5
  • 1
  • Well, for example if you need a /25 and /28 out of a /24, and you have the /25 at the second half of the /24, there will be a "gap" between the two subnets in the sense that their IP ranges are not contiguous to each other (even when the subnet ID and broadcast address are not considered). – Tom Yan Apr 27 '23 at 04:58
  • But then while it's an unavoidable gap, it's not a necessarily an unusable gap. You can fill more /28s (or even, a /26) into the gap when necessary. The gap can be fully filled, but it depends on what you want to fill into it. (Like, you certainly can't fill another /25 into it because the gap isn't wide enough.) – Tom Yan Apr 27 '23 at 05:00
  • If you don't understand why I said "second half", then you don't really understand how subnetting work yet. – Tom Yan Apr 27 '23 at 05:05
  • @TomYan thanks a lot – sam Apr 27 '23 at 15:03

1 Answers1

0

Technically, there won't be "unavoidable" gaps, but convenience will certainly suffer.

Suppose you start with longest masks, i.e. you allocate first 192.168.1.0/28 (address range 0..15) and then you've decided that you need to allocate /26.

The closest range where you can start it would be 192.168.1.64/0, as /26 can only start at 0, 64, 128 and 192. This leaves you with an unused gap from .16 to .63, that you sure can use for three /28 or one /28 and one /27, or a bunch of smaller networks, but what if you don't have these smaller nets in existence?

Now if you do the reverse, and allocate /26 first, like 192.168.1.0/26, then you can allocate your /28 right away from 192.168.1.64/28 leaving no addresses left unused in between.

To be precise, allocating largest blocks first reduces the fragmentation of address space and increases convenience of managing it.

Peter Zhabin
  • 2,696
  • 9
  • 10