Variable Length Subnet Mask (VLSM)

I see, thank you for the explanation @lagapidis

1 Like

here Gabriel did not mention the free space.
After subnet 4 (size 30) . AT subnet 5(size 2) becomes 10.0.5.158 and then free space becomes 10.0.5.160

Hello Pavan

Iā€™m not sure what you mean when you say ā€œfree space.ā€ Based on his original Subnet 5 is indeed what he has stated, with the following elements:

  • network address: 10.0.5.160/30
  • netmask: 255.255.255.252
  • first host: 10.0.5.161
  • last host: 10.0.5.162
  • broadcast address: 10.0.5.163

In the above subnet, the network is a /30 network with four addresses. One broadcast, one network, and two host addresses, as stated.

Can you clarify what your question is? Thanks!

Laz

In Your example you mentioned free space. So I meant after size 128 you should add size 32 in subnet 5. Then size 2 becomes free space

Hello Pavan

Ah, I see what you mean. Yes, in the original post that you are referring to, the free space was not calculated. The poster only determined the subnets to be used. However, if we want to do that we can achieve it like so:

Subnet 6 (free space) has 4 addresses:

  • network address:10.0.5.164
  • first host: 10.0.5.165
  • last host: 10.0.5.166
  • broadcast address: 10.0.5.167

Subnet 7 (free space) has 8 addresses:

  • network address:10.0.5.168
  • first host: 10.0.5.169
  • last host: 10.0.5.174
  • broadcast address: 10.0.5.175

Subnet 8 (free space) has 16 addresses:

  • network address:10.0.5.176
  • first host: 10.0.5.177
  • last host: 10.0.5.190
  • broadcast address: 10.0.5.191

Subnet 9 (free space) has 32 addresses:

  • network address:10.0.5.192
  • first host: 10.0.5.193
  • last host: 10.0.5.222
  • broadcast address: 10.0.5.223

Subnet 10 (free space) has 32 addresses:

  • network address:10.0.5.224
  • first host: 10.0.5.225
  • last host: 10.0.5.254
  • broadcast address: 10.0.5.255

Of course, we can keep going because the original poster said that weā€™re looking at the 10.0.0.0/8 network to be subnetted. Thereā€™s a lot of free space there, but thereā€™s no reason to continue, since weā€™d just be getting bigger and bigger subnets (with 512, 1024, or more hosts), which would be unusable anyway. The good thing is that we have determined the sizes of the next networks so these can be set aside for future use.

I hope this has been helpful!

Laz

Hello.

If I use CIDR, can I go below the default maskā€™s boundary? So would for example a 196.0.0.0/6 be a possible subnet? Or does the default mask determine the lower bound in CIDR as well, and not just in classful subnetting?

Based on the output of some subnet calculators I tried, the answer should be yes, and this is what I think is implied by the materials that Iā€™ve studied, but I just wanted to confirm if I didnā€™t jump to conclusions and that the calculators arenā€™t poorly programmed. This wasnā€™t explicitly stated in any material I covered, so Iā€™m not completely sure.

The only exception seems to be Wendell Odomā€™s book, where he heavily implies what I wrote above:
ā€œClassless addressing: The concept that an IPv4 address has two partsā€”the prefix part plus the host partā€”as defined by the mask, with no consideration of the class (A, B, or C)
Classful addressing: The concept that an IPv4 address has three partsā€”network, subnet, and hostā€”as defined by the mask and Class A, B, and C rules.ā€

What he calls ā€œnetworkā€ seems to be the range of the default mask, but I just want to double-check this with someone else as well.
Thanks.

EDIT: Sorry, I made a mistake! Originally, I thought you could somehow subnet networks backwards. For example, for some bizarre reason that I canā€™t understand, I thought that if you had, say the 192.168.0.0/16 network, you could turn it into something like a 192.0.0.0/6, based on this calculator: https://www.calculator.net/ip-subnet-calculator.html?cclass=any&csubnet=6&cip=192.168.0.0&ctype=ipv4&printit=0&x=66&y=17

But that is clearly wrong, because with 192.168.0.0/16, the very first IP in the list of all IPs that belong to that subnet IS 192.168.0.0, so the list canā€™t go backwards (ie I canā€™t subnet 192.168.0.0 into a 192.168.0.0/6, because then Iā€™d have to use IPs that werenā€™t in my original list of IPs). The calculator is correct though, but what itā€™s saying is ā€œhypothetically speaking if you had control of every single IPv4 address in existence, hereā€™s the /6s you could have.ā€ So I misunderstood its output. Itā€™s using the 0.0.0.0/0 network, not 192.168.0.0/16.

Iā€™ll leave this post here, for the whole world to see my mistake, in the hope that someone else might have this exact (or a similar) misunderstanding about this topic, and hopefully my mistake helps them see correctly.

Hello Attila

Yes you can. Just like the quote you stated says, classless addressing pays no regard to classful rules. So you can split the address between the network and host portions anywhere you like.
For your example, if we take 196.0.0.0/6 and change it to binary:

11000100.00000000.00000000.00000000

A /6 means that the first six bits define the network address like so:

11000100.00000000.00000000.00000000

So we have:

  • network address 196.0.0.0 (11000100.00000000.00000000.00000000)
  • 1st host address 196.0.0.1 (11000100.00000000.00000000.00000001)
  • last host address 199.255.255.254 (11000111.11111111.11111111.11111110)
  • broadcast address 199.255.255.255 (11000111.11111111.11111111.11111111)

That gives us 67,108,863 host addresses within this subnet.

I hope this has been helpful!

Laz

1 Like

Hi Laz,

Thank you.

So if Iā€™m configuring my own private network, Iā€™m allowed to use almost any IP addresses in the class A, B, and C ranges (exceptions are 0.0.0.0, and the 127.0.0.0/8 loopback range), as long as Iā€™m not connecting hosts that Iā€™m assigning those IPs to the Internet (or Iā€™m using NAT or PAT to translate those IPs)? So I could use a 196.0.0.0/6 address range, but only within my own autonomous system.

And only ICANN (or specifically, IANA) is allowed to allocate the 196.0.0.0/6 network for using those IPs as individual host addresses on the public IPv4 Internet, correct?

Thank you again for all of your help.
Attila

Hello Atilla

If you are creating your own network that will not interface with any other networks or with the Internet, you can use any IP address in class A, B, C, D, or E with the exceptions that you mention. Indeed you could use the 196.0.0.0/6 address range within your own independent and separate network.

Allocation of public range IP addresses are assigned to individuals and businesses by the local Regional Internet Registry (RIR), depending upon the region of the world you are in.

IPv4 addresses are very difficult to register, especially larger ranges of addresses because of IPv4 exhaustion, however, IPv6 addresses are available in abundance.

I hope this has been helpful!

Laz

1 Like

hi rene
in the second example we played with the class b neetwork 176.16.0.0. when you write down the subnets with them network addresses, in subnet 2 we need a block of 256 and you write the network address as 176.16.2.0. what is the meaning of the number 2 in the thirt octet ?
thank you

Hello Diego

In the second example, the requirements are what determine what network address will be used for each subnet. Initially, we are given the class B network of 172.16.0.0, and we are told that we need a block of addresses to serve 340 hosts. For 340 hosts, we need a subnet mask large enough to accommodate those addresses.

A subnet mask of 255.255.255.0 gives us 256 addresses, and that is too small. The next largest subnet mask is 255.255.254.0 which gives us 512 addresses, which is large enough. So, our first subnet will have:

  • a network address of 172.16.0.0
  • a subnet mask of 255.255.254.0

This gives us the following elements of this particular subnet:

  • network address 172.16.0.0
  • first host address 172.16.0.1
  • last host address 172.16.1.254
  • broadcast address 172.16.1.255

Once you get these elements of the subnet, youā€™re finished, and you go on to the next subnet. The network address of the next subnet is the broadcast address of the previous subnet plus 1.

The broadcast address of the first subnet is 172.16.1.255. To get the network address of the next subnet, we add 1 to this to get 172.16.2.0. So the network address of subnet 2 is 172.16.2.0.

So what is the meaning of the ā€œ2ā€ in the third octet? Well it has no special meaning, other than the fact that it just happens to be the network address of the very next subnet that we are using.
Does that make sense?

I hope this has been helpful!

Laz