CIDR improves the allocation of IP addresses. VLSM allows to define a subnet as we wish. Can CIDR used without using VLSM?
Subnet – Differences Between CIDR and VLSM
subnet
Related Solutions
There is no possibility of an overlap with FLSM. There can only be an overlap with VLSM. To that end, it will be much easier to "find" an overlap in FLSM, since there never is one. Whereas "finding" a overlap in VLSM will involve some binary math. Let me explain.
FLSM, or fixed-length subnet mask implies every mask is the same across multiple subnets.
For example, breaking up a Class C network (aka, /24) into FLSM sub-networks of /27 would yield ONLY these results:
- x.x.x.0/27
- x.x.x.32/27
- x.x.x.64/27
- x.x.x.96/27
- x.x.x.128/27
- x.x.x.160/27
- x.x.x.192/27
- x.x.x.224/27
These are the only 8 possible /27's within a /24. Every NetID listed above represents a subnetwork that includes addresses of the NetID itself, and the following 31 addresses.
There is no such thing as a x.x.x.150/27 address, the NetID and mask do not pair, so there is no way to have a /27 range represent 150-181 (and would therefore introduce an overlap possibility).
As a result, in FLSM, there is no possibility of an overlap if you are using NetID's and Masks that pair properly.
VLSM, or variable-length subnet mask implies every mask is not necessarily the same across multiple subnets.
For example, there are countless ways to break up a /24 into multiple subnetworks, one of which might be...
- x.x.x.0/27
- x.x.x.32/28
- x.x.x.48/29
- x.x.x.56/29
- x.x.x.60/30
- x.x.x.64/27
- x.x.x.96/28
- x.x.x.112/28
- x.x.x.128/26
- x.x.x.192/28
- x.x.x.208/28
- x.x.x.224/27
To find overlaps, you would have to calculate the IP range for each subnet, and ensure that no IP addresses are "counted" twice. That involves doing the traditional subnetting math.
Since the masks differ for each subnetwork, in VLSM, there is absolutely a possibility that an overlap exists.
To close, I pose the question to you. Every NetworkID and SubnetMask above pair properly, which is to say they represent a valid subnetwork and subnet mask combination.
As we learned, with properly paired FLSM, there is no overlap. With properly paired VLSM, there might be an overlap.
In the Ssb-network list above, there is an overlap in the VLSM range above. Can you find which it is? How easy was it, comparatively?
For your example of 172.16.0.0/16
, the 172.16.0.0
is both the IPv4 network address and a host address, but not a usable host address. It could be the network address, and it may be a usable host address with a different mask length (for example, it is a usable host address with a /11
or shorter mask length). It could even be both a network address and a usable host address if the mask length is /31
. The /16
tells you the length of the mask (number of consecutive 1
bits), and I call it the mask length (can be called the prefix length, depending on the context).
An IPv4 address is a 32-bit unsigned integer (a binary cardinal number from 00000000000000000000000000000000
to 11111111111111111111111111111111
, or 0
to 4294967295
in decimal). Don't read anything into the fact that it is expressed as four decimal octets; that is simply to make it easier for humans to read; network devices deal with the binary number, not the text representation.
A network mask for IPv4 is also a 32-bit unsigned integer, but it consists of consecutive bits set to 1
, followed by any other bits set to 0
. The mask determines which part of the IP address is the network, and which part is the host number in the network.
If you do a bitwise AND
of the IP address and the mask, you will get the network address. You need to do IP math in binary; trying to use decimal will lead to stupid errors.
IPv4 address 172.16.0.0 -> 10101100000100000000000000000000
Mask length 16 -> 11111111111111110000000000000000
Bitwise AND -> ================================
IPv4 network address -> 10101100000100000000000000000000
If you have an address and mask, you have everything you need to calculate everything about the IPv4 address. See the question, How do you calculate the prefix, network, subnet, and host numbers? for how to do IP math.
IPv6 addressing works the same way, except that IPv6 addresses are 128 bits instead of the IPv4 32 bits, and all IPv6 addresses in a network are usable host addresses because IPv6 does not have broadcast.
Best Answer
VLSM from the classful era (RFC 950) predates CIDR (RFC 1518) but essentially they mean the same thing.
Strictly speaking, VLSM allows subnetting a classful network. With CIDR, there are no classes and everything depends on the prefix length.