I wrote this article to discuss IPv4 classes and classless addressing and compare the two. Most companies make use of a classless network (or CIDR), so classful IP is not as important anymore. Because of this I have omitted most of the classful information from the upcoming A+ Exam Cram (to be released in 2019). But I do get questions from time to time on the subject, so if you are interested, read on…
(I also have a video about the differences between classful and classless here. It’s embedded at the end of the article too.)
When working with classful IPv4 addresses, the first number in the IP address dictates what class the address is part of. For example, suppose you use 192.168.0.100. In that case, the first number is 192, which means that the IP address is part of a Class C network.
Table 1 shows the various classes and their associated IP address ranges. Table 2 shows the IP classes and their associated default subnet masks, which, as we mentioned, identify which portion of the IP address is the network portion and which is the host portion.
Take a look at Table 1 and try to get a feel for the different IP classes available. You realize that this classification system was created to appease different organizations of different sizes. If you have a small network at home, it is simplest and most common to use Class C.
Table 1: IP Classifications
IP Class | Range | Number of Networks | Number of Hosts per Network | Who Uses It? |
A | 1 – 126 | 126 | 16,777,214 | Large Corps, ISPs |
B | 128 – 191 | 16,384 | 65,534 | Corps, Universities |
C | 192 – 223 | 2,097,152 | 254 | Small offices/home offices (SOHO) |
Note: Class D (224 – 239) is used for multicast testing, and Class E (240 – 255) is reserved for future use.
APIPA addresses on the 169.254 network are part of Class B.
You probably noticed that the number 127 was skipped. That is because this network number is reserved for loopback testing. Technically, it is part of the Class A range, but it cannot be configured as an IP address within the IP Properties dialog box. As mentioned previously, the built-in loopback address is 127.0.0.1.
You might have also noticed that there are only 254 possible hosts per network in Class C (instead of 256). This is because you can never use the first or the last address in the range; the first is actually the network number and the last is the broadcast address.
The total number of hosts, for all classes combined, is just under four billion—and we have pretty much used up all those addresses. This is one of the reasons for the inception of IPv6.
Table 2: IP Class Ranges and Their Equivalent Binary Values and Subnet Masks
IP Class | Binary Equivalent | Default Subnet Masks |
A: 1 – 126 | 00000001 – 01111110 | 255.0.0.0 Net.node.node.node |
B: 128 – 191 | 10000000 – 10111111 | 255.255.0.0 Net.net.node.node |
C: 192 – 223 | 11000000 – 11011111 | 255.255.255.0 Net.net.net.node |
Notice in Table 2 how the number 255 in a subnet mask coincides with the name net. Also, notice the 0 coincides with the name node. Net is the network portion of the IP address, whereas node is the host or computer portion of the address.
It is also important to know the difference between private and public addresses. A private address is one that is not displayed directly to the Internet and is normally behind a firewall. Typically, these are addresses that a SOHO router would assign automatically to clients. A list of reserved private IP ranges is shown in Table 3. Public addresses are addresses that are displayed directly to the Internet; they are addresses that anyone could possibly connect to around the world. Most addresses, besides the private ones listed in Table 3, are considered public addresses.
Table 3: Private IP Ranges (As Assigned by the IANA)
IP Class | Assigned Range |
A | 10.0.0.0 – 10.255.255.255 |
B | 172.16.0.0 – 172.31.255.255 |
C | 192.168.0.0 – 192.168.255.255 |
Note: The 192.168.0.0 – 192.168.255.255 range is defined by the IETF within RFC 1918 as 192.168/16. While this might appear to be class B mathematically (because of the /16), it is actually a set of 256 contiguous class C networks. As such, it is interpreted by operating systems and routers as a group of Class C networks: 192.168.0, 192.168.1, 192.168.2, and so on…
While classful IP addresses used in Classes A, B, and C are still commonly implemented in SOHO networks, they are not quite as necessary any more in general. In fact, many corporate networks use classless IP addressing exclusively. This means that any network number can use any subnet mask. (Breaking all the rules!) For example, one of my test networks uses the 10.254.254.0 network and the 255.255.255.0 subnet mask, making the network number 10.254.254 instead of just 10. How is this done? By changing the subnet mask to 255.255.255.0 instead of the default 255.0.0.0. This method is known as Classless Inter-Domain Routing (CIDR), often pronounced as “cider.”
You will frequently see CIDR notation; this specifies the individual IP address or IP network along with a routing prefix. An example of this is 192.168.1.100/24. The IP address is 192.168.1.100. The routing prefix is /24 and that defines the subnet mask. It does this by stating the number of masked bits in the subnet mask. In binary, a masked bit is a 1 and an unmasked bit is 0. So /24 means there are 24 masked bits (24 binary ones). Remember that an IPv4 subnet mask has 32 bits in total, so when you see /24, you know there are 24 masked bits and the remaining 8 bits are unmasked:
/24 = 11111111 11111111 11111111 00000000
This equates to a subnet mask of 255.255.255.0, which is normal in a classful network. We can identify the network portion of the address as 192.168.1 and the host portion as .100. Even though it turns out to be a classful address, it (and any other address) can still be expressed in terms of CIDR notation.
Here’s another example of CIDR notation, this time for a true classless IPv4 address: 10.52.128.201/16. In this case, the routing prefix is /16, which means 16 masked bits:
/16 = 11111111 11111111 00000000 00000000
This equates to a subnet mask of 255.255.0.0. That means that the network portion of the IP address is 10.52 and the host portion of the address is 128.201.
Note: The binary masked bits are also known as leading bits.
Hope you enjoyed the article. For some people it’s pure gold, for others, it’s like watching paint dry. Either way, if you have any questions, feel free to contact me!
Here’s that video I mentioned about the differences between classful and classless: