y Lesson 2: IP networking is losing its class

Lesson 2: IP networking is losing its class

Previous Lesson
Sample Writings


Terms

address classes fixed-length structures for the IP address space, consisting of five classes from Class A to Class E. Only Class A, B, and C addresses were assigned for real networks. This scheme has been replaced by Classless Inter-Domain Routing (CIDR).
Classless Inter-Domain Routing a scheme to use variable-length structures for the IP address space, allowing the core routers to economize on routing entries and preventing the rapid depletion of IP address space due to the poorly-arranged classful IP structure.
subnet a locally-defined network within a larger network, created by designating host bits of an IP address and network bits through the use of a subnet mask.
subnet mask a locally-assigned bit mask that determines which bits of the IP address are used to signify the network number and which are used to signify the host number.

The kind of class that gets you into trouble

As you remember from last lesson, an IP address is a 32-bit number, which results in over 4 billion addresses (if you want to get precise, it's 4,294,967,296 possible addresses). One of the first questions to pop into many people's mind is, "How do they keep track of them all?" This is a remarkably good question, and the answer can be long and difficult, depending on how detailed you want it to be. For now, we'll stick with a more general answer until we get to some of the routing concepts you'll need to understand it in greater detail.

When IP was first developed, it was recognized as fact that TCP/IP would be connecting networks to each other. This, combined with the restriction that all IP addresses must be unique, implies that addresses would be given out to members in blocks, which they then were free to assign to their hosts as they saw fit. However, it was probable that not all needs for IP space would be equal.

The solution was to split the IP address space into address classes. The IP address space was split into 5 classes, A through E, in the following fashion:

We will see later that the maximums are, in fact, much higher than the actual numbers of usable IP addresses. One of the immediate reasons is that the address that corresponds to all host bits set to zero is reserved as the network address, and the all host bits set to one is reserved as the broadcast address (we'll cover their purpose in a later lesson; right now, just remember that these addresses are reserved). So, for a Class A address, X.0.0.0 is reserved, as is X.255.255.255; for a Class B, that's X.Y.0.0 and X.Y.255.255, and for a Class C, it's X.Y.Z.0 and X.Y.Z.255.

Fat Albert to the rescue

In 1992, it was realized that we were rapidly running out of IP address space at the then-current rates of assignment (which were much, much lower than they are today). The proposal that was implemented as an interim solution is now referred to as Classless Inter-Domain Routing (CIDR). CIDR had several advatanges:

As a measure of CIDR's success, only the most modern of operating systems have been modified to work with CIDR. Most still use the classful way of looking at IP addresses. However, CIDR has delayed the depletion of the IP address space by many years, despite even-greater amounts of growth than expected.

Today, in the world of CIDR, the definitions of Class have been loosely expanded. Now, a Class C network is one whose first 24 bits signify the network portion and last 8 bits signify the host portion, regardless of the value of the first several bits. Thus, it is conceivable to be assigned a Class C address in what used to be the Class B address space. And despite your operating system not knowing what is really going on, IP has a built-in mechanism for making it all work.

A place for everything, and everything in its place

Since all IP address assignments come as blocks, it's up to the local network administrators to determine which machine is assigned which IP address from the block. Say that you've been given a Class B netblock, 172.16.0.0 through 172.16.255.255. It is entirely up to you to assign IP addresses from within that block.

Let's complicate your task, however. Let's suppose that you're the network administrator for a large, world-wide corporation with locations in several cities, and you have to get all of these machines speaking TCP/IP. It sure would be nice if you could somehow split this block into smaller portions, and assign one portion to each location, wouldn't it?

Well, you can, and it's called subnetting. Here's how it works.

Each machine, in addition to receiving an IP address, also receives a subnet mask. Like an IP address, this is a 32-bit value. However, its sole purpose is to be used with the IP address to tell you (and the computer) which bits are the network portion and which bits are the host portion. Remember that in our definition of network classes, we automatically assigned certain bits to be the network and host portions. If we were to write out the standard classes as subnet masks, we'd see something like:

Class		Subnet Mask  
A		255.0.0.0    
B		255.255.0.0  
C		255.255.255.0

A subnet mask can only be used (unless your host understands CIDR) to be more restrictive than the class definition, not less. At worst, you define a subnet mask that is equivalent to the class of your netblock.

If you're splitting your network into subnets, then there are a few guidelines to keep in mind:

  1. You will lose two additional addresses per subnet, in much the same fashion as the network address and broadcast address of a classful network are reserved. For example, on the Class C IP network 192.168.0.0 with a subnet mask of 255.255.255.192, you would have the following subnets: subnet 0 of 192.168.0.0 through 192.168.0.63, subnet 1 of 192.168.0.64 through 192.168.0.127, subnet 2 of 192.168.0.128 through 192.168.0.191, and subnet 3 of 192.168.0.192 through 192.168.0.255. The IP addresses 192.168.0.0, 192.168.0.64, 192.168.0.128, and 192.168.0.192 would be reserved as the subnet addresses, while 192.168.0.63, 192.168.0.127, 192.168.0.191, and 192.168.0.255 would be reserved as the subnet broadcast addresses.
  2. Although the RFCs say that you're supposed to be able to use all subnets, there was a lot of broken software out there that can't handle that. Unless you know that all of the equipment assigned to a given subnet can handle it (almost all modern kit can), you will want to avoid using the all-zeroes subnet and the all-ones subnet (subnets 0 and 3 in the previous example). Remember that if you have multiple subnets sharing the same physical network, then all of those hosts must be able to do the right thing. This restriction is actually in large part due to the first restriction and has to do with the potential collision between the classful broadcast address and the subnet broadcast addresses. If all of the machines in the subnet(s) are able to properly handle CIDR, then you can safely ignore this restriction. This is largely the case today, but you should be aware of this if using legacy hardware or operating system versions.

Back to CIDR

You should have a copy of RFC 1878, which kindly lists all of the possible subnet masks and their effects. In actuality, these were developed for use with CIDR. As we said before, CIDR is an extension of existing concepts in IP networking - subnetting. What CIDR allows us to do is go the other way and define supernets that are less restrictive than our classful definitions.

Additionally, CIDR gives us an alternative notation for specifying subnet masks. Although subnet masks are bit masks and do not have to be (according to the RFCs) contiguous bits (i.e., you could in theory have a subnet mask of 255.255.255.170, which looks bitwise like 11111111 11111111 11111111 10101010), in reality these sorts of bitmasks are unwieldy to use and almost never seen in real life (and in fact are highly, highly discouraged, if not outright disallowed by more recent RFCs). Since most bit masks are continguous bitwise, they can be represented in shorthand by a slash, followed by the number of continguous bits. So, a normal Class C would look like 192.168.4.0/24, and a Class B would be 172.16.0.0/16.

An example from real life: one of the private block of IP addresses that is available for use is the 192.168.0.0/16 block. This is a block of 256 Class C addresses, starting with 192.168.0.0 and going through 192.168.255.0. Play with this a bit until you feel comfortable with it.


Previous Lesson
Sample Writings