Subnetting and Variable-Length Subnet Masks

Understand VLSMs and get a handle on your organization's IP address setup.

Gary C. Kessler

May 8, 2000

3 Min Read
ITPro Today logo in a gray background | ITPro Today

IP addresses are 32 bits long. The length of the network identifier (NET_ID) part of the address determines an IP address classification. Class A, B, and C addresses have 8-, 16-, and 24-bit NET_IDs, respectively. For routing purposes, IP devices such as hosts or routers must separate the NET_ID from the host identifier (HOST_ID) portion of the address. Subnet masks perform this separation.

Subnet masks are usually a string of 1s that denote the number of bits of the address that forms the NET_ID. A Class A address, for example, has an 8-bit subnet mask, which is written 255.0.0.0. Class B and Class C addresses use the subnet masks 255.255.0.0 and 255.255.255.0, respectively. Subnet masks can also segment the HOST_ID. Some sites use the HOST_ID to create a subnetwork identifier and smaller host identifier.

In the past several years, IP address depletion has become a problem. Address depletion occurs not only because so many new networks exist but also because IP address authorities are inefficiently assigning classful IP addresses. A site requiring 500 addresses, for example, might receive an entire Class B block of more than 65,000 addresses.

To solve this problem, Internet address administrators have adopted variable-length subnet masks. VLSMs allow NET_IDs of lengths between 8 and 30 bits. (Subnet masks don't allow lengths of 9, 15, 17, 23, or 25 bits because they look like single-bit subnets.) VLSMs build flexibility into the IP addressing system, and ISPs can efficiently assign address space.

For example, suppose the U.S. Cable Networks, a consortium of US cable TV companies, receives the Class A address 24.0.0.0. Because 24.0.0.0 is a Class A address, you can denote it as 24.0.0.0/8 (the /8 is a shorthand notation for the 8-bit subnet mask 255.0.0.0). Several cable TV company ISPs share the 24-block address. Adelphia Cable Communications (whose ISP service was formerly Hyperion) receives the NET_ID block 24.48.0.0. This block is equivalent to a Class B address, denoted as 24.48.0.0/16. Adelphia's ISP customers, in turn, receive IP addresses from the 24.48.0.0 space and, using VLSM, usually get something smaller than a Class C address space.

For example, Pizzagalli Construction in Burlington, Vermont, receives a block of 64 addresses with the NET_ID 24.48.165.0/26 (i.e., subnet mask 255.255.255.192). The host addresses (the final digit set in the NET_ID) range from 0 to 63. Pizzagalli can't use 0 or 63 because addresses that contain all 0s or all 1s are invalid host addresses. In a final example, Pension Works in Colchester, Vermont, receives a block of 32 addresses. The company's NET_ID is 24.48.165.64/27 (i.e., subnet mask 255.255.255.224), and the company's host address range is 64 to 95. Usable host addresses are 65 to 94.

Because sub-Class C addresses are common today, you need to understand how subnet masking works. Table A shows the subnet masks that you might use with a Class C address. Assigning sub-Class C addresses preserves address space, but VLSMs are also beneficial because they enable Classless Inter-Domain Routing (CIDR). The American Registry for Internet Numbers (ARIN) introduced CIDR several years ago to reduce the size of Internet routing tables. Customers used to receive assigned IP addresses sequentially. Now ISPs assign IP addresses from a block of addresses. Now our example company, Adelphia Cable Communications, can get all its packets from the 24.48.0.0/16 network. The hundreds or thousands of networks can reference one line in a routing table. After the packets get to Adelphia, the company's routers have to deliver the packets to the correct destination network, but that detail is transparent to the rest of the Internet.

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like