Subscribe to Windows IT Pro
December 20, 2000 12:00 AM

Hanging Out with the Classless Crowd

Windows IT Pro
InstantDoc ID #16222
Rating: (0)
A couple of tricks can help you subnet your network with classless subnet masks

If your network uses a default subnet mask—255.0.0.0 for Class A, 255.255.0.0 for Class B, or 255.255.255.0 for Class C—you have a classful domain. I like to associate the term classful with mindful—that is, you're mindful that you're working in an open domain with no subnetworks (subnets). Actually, your entire domain is a subnet, but it isn't further divided into sub-subnets.

A classful domain can be a very busy place, with all your network traffic whizzing around the same set of pathways. Switches, which operate at the data-link layer, separate collision domains, but they do nothing to separate broadcast domains because broadcasts happen at the network layer.

If you have a router, you can group portions of your network into subnets to cut down on the number of broadcasts. For example, you might want to group your infrastructure gear (including your server farm and printers) into one subnet, the marketing department into another subnet, and the sales department into another subnet. Subnetting can be a handy tool for busy networks.

If you have subnets, you have a classless domain with a classless subnet mask. A classless subnet mask, also known as a variable-length subnet mask (VLSM), borrows bits from an IP address' host section and gives them to the address' network section. "Classless" and "variable length" stem from the fact that subnet mask addresses don't fit into standard IP's Class A, B, and C format.

The only problem with subnetting is performing the binary calculations necessary to derive the subnet addresses—I prefer to work with decimal numbers when possible. I can teach you a little bit about Classless Inter-Domain Routing (CIDR) and let you in on an easy nonbinary mathematical trick. These two pieces of information will help you decipher the "slash notation" that you see in technical support literature and will make subnetting quick and easy.

CIDR, Anyone?
First, a quick overview of subnetting and CIDR. The Internet Engineering Task Force (IETF) realized early on that IP addresses would run out sooner rather than later. In 1985, Request for Comments (RFC) 950 proposed subnetting to extend the number of available IP addresses. In 1993, RFCs 1517, 1518, 1519, and 1520 described CIDR as a standard for subnetting.

CIDR bought some time for resolving the IP address dilemma and provided a way to limit the growing number of entries in Internet backbone routing tables. Internet backbone routers can handle tens of thousands of entries but eventually become overloaded. Thanks mostly to CIDR, backbone routers today hover at a manageable number of routes in their routing tables.

You can find more information about CIDR at http://public.pacbell.net/ dedicated/cidr.html. In this article, I want to focus on the notation that emanated from the CIDR routing technique. CIDR notation offers an alternative to the old-fashioned Class A, B, and C addressing terminology, but you still must understand the basics of the traditional IP address format.

Traditional Class A, B, and C addresses are made up of four 8-bit bytes. The 8-bit binary numbers are typically represented by their decimal equivalents separated by dots (e.g., 192.24.68.48). Figure 1 shows that Class A addresses use the first 8 bits for the network and the last 24 bits for the host. Class B addresses use the first 16 bits for the network and the last 16 bits for the host, and Class C addresses use the first 24 bits for the network and the last 8 bits for the host. Subnet mask addresses are often represented in the same dotted-decimal format.

CIDR notation uses a slash followed by the number (in decimal) of network bits in the address (e.g., /8, pronounced "slash 8"). Suppose you have a network using the reserved Class A address 10.0.0.0 and a classful subnet. You could say that your network is 10.0.0.0/8, which is the same as a 255.0.0.0 subnet mask. For a reserved Class B address, such as 172.20.0.0, you could use the CIDR notation 172.20.0.0/16 or the subnet mask notation 255.255.0.0 to specify that you're subnetting on the 16th bit. For a Class C address, you might use 192.16.1.0/24 or 255.255.255.0.

An 8-bit byte yields eight possible subnet values: 128, 192, 224, 240, 248, 252, 254, and 255. Table 1, page 110, shows these subnet values in subnet masks for each class and shows their CIDR equivalents. Each subsequent CIDR value borrows one more bit from the host section and moves it to the network section. Thus, if you subnet the Class C address 192.16 .1.0 with a 240 mask (i.e., 255.255.255 .240), you have network 192.16.1.0/28. (Remember that the 0 is a placeholder. Sixteen possible subnets are associated with the /28 CIDR value.) If you subnet 192.16.1.0 with a 248 mask (i.e., 255.255 .255.248), you have network 192.16.1.0/29.

The 255 subnet value identifies a classful subnet, so it isn't relevant to a discussion of classless subnetting. However, the other seven subnet values do permit classless subnetting. With the list of subnet values and Table 1 handy, you're ready to start subnetting.

Magic Number Subnetting
Suppose you have a Class C network address of 192.16.1.0 and you want to apply a subnet mask that will yield four subnets, each with 50 or fewer hosts. Which mask would you use? Well, you could go through the trouble of calculating the subnet value in binary. (For a refresher course about working with the binary numbers used in IP addresses and subnet masks, see the sidebar "Binary Numbers and Subnet Masks," page 108.) Or, you could employ a little trial and error, find what I call the "magic number," and use that number in a few simple calculations to find the appropriate subnet value.

For a Class C address, to find the number of hosts per subnet that a given subnet value will yield, simply subtract the subnet value from 256 (the overall number of hosts). Here's where the trial and error comes in. Pick one of the seven classless subnet values—say, 192—and subtract it from 256 to get a magic number of 64. However, you need to take one more step to find the actual number of hosts you can use per subnet for the Class C 192 subnet value. Because you need the first number in a subnet for the network and the last number for broadcast, subtract 2 from 64. Therefore, the actual number of hosts per subnet from the Class C 192 subnet value is 62.

Related Content:

ARTICLE TOOLS

Comments
  • Jim Loprest
    11 years ago
    Mar 15, 2001



    In "Hanging Out with the Classless Crowd" (January 2001), William Heldman states, "If you have subnets, you have a classless domain with a classless subnet mask." This statement isn't entirely accurate; you can have a subnetted network and not have a classless subnet mask.
    In addition, the author gives the impression that you can simply subnet a network with a classless subnet mask and everything will work. This assumption isn't so.


    What the author didn't mention in the article is the linchpin of classless routing--the routing protocols that you use.


    If a company chooses to use Routing Information Protocol version 1 (RIPv1) or Interior Gateway Routing Protocol (IGRP) as its routing protocols, the subnet mask for the entire network would have to be uniform. These routing protocols don't include the subnet mask information in their routing updates. Because a
    variable-length subnet mask (VLSM)
    lets you subnet a subnet, this informa-tion is necessary. Routing protocols like Enhanced IGRP (EIGRP), Open Shortest Path First (OSPF), and border gateway protocol 4 (BGP-4) let classless routing take place.
    *Jim Loprest

  • Bill Heldman
    11 years ago
    Mar 15, 2001



    The way the sentence is worded sounds as though just having subnets automatically puts you into the classless domain or classless subnet mask genre. Conveying that information wasn't my intent, nor was presenting a primer about classless routing and routing protocols. All I was really going for in the article was to provide information at a fundamental level about how long subnet masks work and what slash notation is all about.

    --Bill Heldman

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.