cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1875
Views
5
Helpful
3
Replies

why subnetting is always done starting from the largest network??

singhankit685
Level 1
Level 1

why subnetting is always done starting from the largest network??

3 Replies 3

Peter Paluch
Cisco Employee
Cisco Employee

Hi,

This is because subnet addresses always start at an integer multiple of their own size. Okay, this sounds difficult but it's really very easy:

  • A subnet of 16 addresses can start at an address of .0, .16, .32, .48, .64, .80, .96, .112, .128, .144, .160, .176, .192, .208, .224, or .240 in the 4th octet. Every one of these sixteen values is a multiple of 16.
  • A subnet of 64 addresses can start at an address of .0, .64, .128, or .192 in the 4th octet. Every one of these four values is a multiple of 64.
  • A subnet of 256 addresses is really a subnet of 1x256 addresses. Because a single octet of an IP address can enumerate up to 256 addresses, having an entire set of 256 addresses means that the network addresses can start at .0.0, .1.0, .2.0, .3.0, ..., .254.0, .255.0 in their 3rd and 4th octet. Each one of these addresses is a multiple of 1 in their 3rd octet.
  • A subnet of 512 addresses is really a subnet of 2x256 addresses. So a subnet of 512 addresses can start at an address of .0.0, .2.0, .4.0, .6.0, ..., .252.0, .254.0 in their 3rd and 4th octet. Each one of these addresses is a multiple of 2 in their 3rd octet.

Also note that the address of every larger network is also a valid address of a smaller network, because, for example

  • 512 = 2x 256 = 4x 128 = 8x 64 = 16x 32 = 32x 16 = 64x 8 = 128x 4 = 256x 2

or in other words, a larger network can always be seen as an integer multiple of smaller networks.

So, when you start from the largest network and go down to smaller networks, you do not need to worry whether the first free IP address is a valid IP address for the next network, because it always will be valid: The next free IP address would be a valid IP address for the network of the same size, so it is also going to be a valid IP address for any smaller IP network size.

Let's do a subnetting of 172.16.48.0/22 into subnetworks of sizes 512, 256, 64, and 16:

  • Size 512 = 2x 256 requires a mask of /23. Note that 172.16.48.0/22 is a valid network IP address for /22 (/22 is a network of 1024 = 4x 256 addresses, and 48 is a multiple of 4, so 172.16.48.0/22 is a valid network address for 1024 addresses). Therefore, 172.16.48.0 is also a valid network IP address for the netmask of /23 (and more).
    • The first network is therefore 172.16.48.0/23, going from 172.16.48.0 through 172.16.49.255, and 172.16.50.0 is the first unused IP address (the next multiple of 2 in the 3rd octet). Note that this would also be a valid IP address for a network of /23.
  • Size 256 = 1x 256 requires a mask of /24. Now, because 172.16.50.0 would be a valid network IP address for a network of /23, it is also going to be a valid IP address for a network of /24.
    • The second network is therefore 172.16.50.0/24, going from 172.16.50.0 through 172.16.50.255, and 172.16.51.0 is the first unused IP address (the next multiple of 1 in the 3rd octet). Note that this would also be a valid IP address for a network of /24.
  • Size 64 requires a mask of /26. Now, because 172.16.51.0 would be a valid network IP address for a network of /24, it is also going to be a valid IP address for a network of /26.
    • The third network is therefore 172.16.51.0/26, going from 172.16.51.0 through 172.16.51.63, and 172.16.51.64 is the first unused IP address (the next multiple of 64 in the 4th octet). Note that this would also be a valid IP address for a network of /26.
  • Size 16 requires a mask of /28. Now, because 172.16.51.64 would be a valid network IP address for a network of /26, it is also going to be a valid IP address for a network of /28.
    • The fourth network is therefore 172.16.51.64/28, going from 172.16.51.64 through 172.16.51.79, and 172.16.51.80 is the first unused IP address (the next multiple of 16 in the 4th octet).

Note that we haven't really computed the network addresses here by any masking or anything. We have simply started from the very first address we had been assigned, and we assigned each network the range it is supposed to have, always identifying the first unused IP address, and claiming that address to be the starting address of a new network. That's why it is so simple to have the networks sorted from the largest to the smallest.

Having the networks sorted in any other order would require us to do gaps in the addressing, otherwise, we would end up with overlapping ranges which is illegal. As an example, think of subnetting 192.168.1.0/24 into networks of 16 and 64 addresses:

  • Size 16 requires a netmask of /28. The 192.168.1.0/24 is a valid IP address of a network of /24, therefore, it is a valid IP address for a network of /28, so 192.168.1.0/28 would be the first network, going from 192.168.1.0 through 192.168.1.15. So far so good.
  • Now, however, the first unused IP address is 192.168.1.16. This is not a valid IP address for a network of 64 addresses (/26), because such a network can only start at an integer multiple of 64 in the last octet, and 16 is not such a multiple. If we blindly said that the second network is going to be 192.168.1.16/26, we would actually create a network 192.168.1.0/26 going from .0 through .63, overlapping the first network entirely. Here, we would need to consciously have to skip the entire space from .16 to .63, and start the network at 192.168.1.64/26. This would add an extra burden when computing the addressing plan, and we would end up with network addresses scattered throughout the original address space, having gaps between them and possibly not being able to reuse that unused space in any reasonable way.

Not an entirely easy topic to be sure, but once you get into it, it really becomes very natural.

Best regards,
Peter

that was meaty!! but finally understood thank you!! i am having one more question 

what is the difference between ospf exchange and loading stages?? from what i kw exchange stage advertises summary and in loading stage database is exchanged.....

Hi,

You're welcome!

I have just answered the OSPF question in the separate thread you have created.

Best regards,
Peter

Review Cisco Networking products for a $25 gift card