Subnetting and Variable-Length Subnet Masks

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 Class B and Class C addresses use the subnet masks and, 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 Because is a Class A address, you can denote it as (the /8 is a shorthand notation for the 8-bit subnet mask Several cable TV company ISPs share the 24-block address. Adelphia Cable Communications (whose ISP service was formerly Hyperion) receives the NET_ID block This block is equivalent to a Class B address, denoted as Adelphia's ISP customers, in turn, receive IP addresses from the 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 (i.e., subnet mask 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 (i.e., subnet mask, 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 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.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.