This document is a work in progress. Last modified: 2011/Oct/07.
An IP address is an address used in order to uniquely identify a device on an IP network (i.e. Internet). The IPv4 address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask.
Subnetting is the practice of dividing a network into subnetworks. A subnetwork, or subnet, is a logically visible subdivision of an IP network. For example, given the 192.168.0.1 /24 IPv4 network with 254 usable IP address, it can be further divided in 4 different subnets (192.168.0.0/26, 192.168.0.64/26, 192.168.0.128/26, 192.168.0.192/26) implementing a Subnet Mask of 255.255.255.192 (/26) for each network.
VLSM stands for Variable Length Subnet Masking. VLSM is a technique that allows network administrators to divide an IP address space into subnets of different sizes, according to the individual needs of each Network, unlike simple same-size Subnetting. Simply put, VLSM is just subnetting a Subnet. For this purpose, the subnet mask (or CIDR notation for that matter) may be variable over contiguous IP space.
CIDR stands for Classless Inter-Domain Routing. CIDR is a methodology for IP address allocation and route aggregation, replacing the previous generation of IP address syntax (classful networks) becoming a classless system. CIDR is a prefix based standard for the interpretation of IP addresses. CIDR allows routers to group routes (IP networks) together as a single, larger entity, to reduce the bulk of routing information carried by the core routers (this process called routing prefix aggregation, supernetting or route summarization). For example, by implementing CIDR, sixteen contiguous /24 networks can be summarized and advertised to a larger network as a single /20 route, if the first 20 bits of their network addresses match. A CIDR notation always has an equivalent Subnet Mask.
|Class||Prefix||Subnet Mask||Subnets||Hosts / Usable IPs||Bits used|
|C||/31||255.255.255.254||128||2 (ppp only)||7 / 1|
|/30||255.255.255.252||64||4 (2)||6 / 2|
|/29||255.255.255.248||32||8 (6)||5 / 3|
|/28||255.255.255.240||16||16 (14)||4 / 4|
|/27||255.255.255.224||8||32 (30)||3 / 5|
|/26||255.255.255.192||4||64 (62)||2 / 6|
|/25||255.255.255.128||2||128 (126)||1 / 7|
|/24||255.255.255.0||0||256 (254)||0 / 8|
|B||/23||255.255.254.0||128||512 (510)||7 / 9|
|/22||255.255.252.0||64||1024 (1022)||6 / 10|
|/21||255.255.248.0||32||2048 (2046)||5 / 11|
|/20||255.255.240.0||16||4096 (4094)||4 / 12|
|/19||255.255.224.0||8||8292 (8290)||3 / 13|
|/18||255.255.192.0||4||16384 (16382)||2 / 14|
|/17||255.255.128.0||2||32768 (32766)||1 / 15|
|/16||255.255.0.0||0||65536 (65534)||0 / 16|
|A||/15||255.254.0.0||128||131072 (- 2)||7 / 17|
|/14||255.252.0.0||64||262144 (- 2)||6 / 18|
|/13||255.248.0.0||32||524288 (- 2)||5 / 19|
|/12||255.240.0.0||16||1048576 (- 2)||4 / 20|
|/11||255.224.0.0||8||2097152 (- 2)||3 / 21|
|/10||255.192.0.0||4||4194304 (- 2)||2 / 22|
|/9||255.128.0.0||2||8388608 (- 2)||1 / 23|
|/8||255.0.0.0||0||16777216 (- 2)||0 / 24|
TODO: Example Table for a VLSM subnetwork?.
TODO: Mask/Binary Chart?
TODO: CIDR/Host range Chart?
Class: Represents the old IPv4 Classful Address Ranges (used just as reference). In old classful addressing the network part of the IP address was identified by using the absolute value of the address (leading bits of the address). Essentially old classful addressing encoded netmask in the IP address. Because of classful addressing there was an exponential growth of routing tables on routers across the Internet, and it was the leading cause of the rapid exhaustion of IPv4 addresses. Classful addressing has become obsolete with the advent of VLSM/CIDR.
|Class||Address Range||Leading Bits||Network / Host||Mask|
|A||126.96.36.199 to 188.8.131.52||0 _ _ _ _ _ _ _||N.H.H.H||255.0.0.0|
|B||184.108.40.206 to 220.127.116.11||1 0 _ _ _ _ _ _||N.N.H.H||255.255.0.0|
|C||18.104.22.168 to 22.214.171.124||1 1 0 _ _ _ _ _||N.N.N.H||255.255.255.0|
Prefix: Represents the routing prefix of the CIDR notation. CIDR notation is the syntax for specifying IP addresses and their associated routing prefix, determined by the network bits of the address. For example, given the CIDR notation of 192.168.0.0/16 -- there's the asigned routing prefix of /16, which represents the 16 bits of the network.
|Powers of two|
Subnet Mask: A 32 bit binary number used to determine what subnet an IPv4 address belongs to. An IP address has two components, the network address and the host address. Initially there was a classful system in which the network portion of the IP address was determined by the first leading bits as I explained above, but now there's a classless system in which the Subnet Mask (which may be variable even across a contiguous network) is what determines the network portion of an IP address. VLSM refers actually to the practice of subnetting with Variable-length Subnet Masks, but there is always an equivalent in CIDR notation.
Subnets: Number of Contiguous Subnets available. This is determined by Powers of Two, of the numbers of bits borrowed to do Subnetting, from the host portion of an IP Address.
Hosts / Usable IPs: Number of total Hosts/IPs, and the actual number of usable IPs (available to allocate) in each Subnet. This is determined by Powers of Two, of the resulting number of bits from the host portion of an IP Address. Usable IPs are determined by substracting the Network Address and the Broadcast Address.
Bits used: The bits used from the network portion and the host portion of an IP Address to calculate both the available Contiguous Subnets and the Available hosts in each of these Subnets. This is done by applying Powers of Two to them.
VLSM vs. CIDR
CIDR uses VLSM techniques to allocate IPv4 addresses to subnetworks according to need rather than class. Both terms are frecuently used to describe the practice of subnetting, but VLSM is actually the "subnetting a subnet" standard while CIDR defines the rules for a classless internetworking system and route summarization.
Both concepts seem to persue the same end, a classless and scalable internetworking system, but you can see a different since VLSM does not defines route summarization. Before CIDR existed, you could still perform VLSM over a network using just the Subnet Mask, but it couldn't be posible to perform classless route summarization (supernetting).
I see VLSM as a negative (subnetting) and CIDR as a positive (supernetting). Both together, again, to make posible a classless internetworking system.