IPv4 classes

Note: Much of the information discussed in this document is largely historical. Classes have much less impact these days, but some industry certification examinations have been known to ask about these. At the time of this writing, it is believed that some of these tests may still ask about the concept.

Previously, one half of all IPv4 addresses were handed out to less than 130 organizations. With the IPv4 depletion situation causing widespread shortage, this subsequently seemed like a very wasteful decision.

However, handing out such large groups of addresses was probably not a bad decision at the time that was happening. The Internet was rather experimental back in those days. IETF BCP 4: An Appeal to the Internet Community to Return Unused IP Networks (Prefixes) to the IANA notes, “The Internet of today is a dramatically different network than the original designers ever envisioned.” It is entirely reasonable to believe that the network was likely viewed as a prototype, created so that leading technology experts could learn about the possible uses of a widespread network that covered multiple locations within the United States of America. The plan was probably not to build a world-wide network. Instead, the designers of the Internet would probably have envisioned that a world-wide network would have been a new network. When people built that new world-wide network, people would have used lessons that were learned based on the experimental network that became known as the Interenet.

The problem is summarized by a description of the Internet, made by Hurricane Electric's Owen DeLong: The Internet is the lab experiment which escaped the lab more magnificently than any other. (That is not quoted, because this is simply based on a person remembering the reference. This is not necessarily an exact quotation that was meticulously recorded for perfect word-for-word accuracy.) When politicians decided to start funding a nationwide network, the existing Internet became utilized in ways that were not previously expected. Eventually, IPv6 would be a network protocol that was designed with the intention of being worldwide. In the meanwhile, though, IPv4 became popular.

Historically, a single organization could obtain an available /8 block from the first half of the IPv4 address space. This was called a “Class A” network. “Medium-sized” organizations may be given an entire /16 from the next half of the remaining space. This was called a “Class B” network. Smaller organizations may be given an entire /24 from the next half of the remaining space. This was called a “Class C” network.

The difference in sizes between these classes may be easiest to comprehend visually, by seeing this chart.

Name Size Block Binary Start End Number of bits used
to identify the network
Number of addresses
in each network
Intended Use
Class A128 (0 to 127)0/4000000000.^24 = 16,777,216Large organizations
Class B64 (128 to 191)128/410000000128.0.0.0143.255.255.255162^16=65536Medium Organizations
Class C32 (192 to 223)192/411000000192.0.0.0207.255.255.255242^8=256Small organizations
Class D16 (224 to 239)224/411100000224.0.0.0239.255.255.2558-24Varies: see IETF BCP 51Multicast
Class E16 (240 to 255)240/411110000240.0.0.0255.255.255.255N/AN/AReserved/“Future Use”/Experimental
Name Size Block Binary Start End Number of bits used
to identify the network
Number of addresses
in each network
Intended Use
Understanding the chart

The “Binary” column shows the first octet of the first address, written in binary. For example, has a first octet of 160 which, written in binary, is 1011000.

Information about the classes
Class sizes

The column labelled “Size” describes how big the class is. The number shown indicates how many “IPv4 /8” blocks can fit into that class.

The next thing discussed here is the column labeled “Block”.

The entire IPv4 address range can be split up into sixteen equal-sized groups of addresses. Each one of these groups can be accurately described as a /4 group of IPv4 addresses. Discussing IPv4/4” networks is actually far less common than discussing some other network sizes like IPv4/8” networks. However, having the “Block” column show every IPv4/8” networks would have quadrupled the size of that chart, which is why the chart showed “/4” networks in that column.

The primary things to notice right away, which might be easiest to see by looking at the information in the “Block” column of the chart (and, specifically, by counting the number of rows in the “Block” column), are that “class A” contains twice as many Internet addresses as “class B”, and “class B” contains twice as many Internet addresses as “class C”, and “class C” contains twice as many Internet addresses as the later classes. The easiest way to see this may be to look at the rows in the “Block” column of that chart.

Another way to split up the available IPv4 addresses is to create 256 equal-sized parts. When doing this, each group of addresses is the size of an “/8” network. Looking at “/8” networks is far more common.

As seen in the “Size” column of this chart, class A has 128 of the 256 /8 ranges of IPv4 Internet. This does mean that class A consists of one half of all IPv4 addresses. Class B consists of one half of the remaining addresses, so class B has 64 of the 256 /8 ranges of addresses. Class C consists of one half of the remaining addresses, so class C has only 32 of the /4 ranges of IPv4 addresses. Class D consists of one half of the remaining addresses. The remaining addresses are all in one class called “class E”, so class D and class E are the same size.

Unicast: Classes A through C

All Class A addresses start with the first bit cleared to zero. All of the Class B addresses start with the first two bits being set to “10”. All of the Class C addresses start with the first three bits being set to “110”. The Class D addresses start with the first nibble being “1110”. Class E addresses start with the first nibble being “1111”. This can all be seen in the “Binary” column: Notice how all Class A addresses have the same first bit, and all Class B addresses have the same first two bits, and all Class C addresses have the same first three bits. (All later addresses use the same nibble.) So, the first bit can determine whether an address is part of class A, and a person can figure out which class an address belongs to simply from the first four bits of the address.

A lot of people try to remember the address ranges: Class A goes from 0 through 127, Class B goes from 128 through 191, Class C goes from 192 to 223, Class D goes from 224 through 239, and class E goes from 240 to 255. This is all true, and can be reasonably memorized.

However, people who are learning lots of other networking details (like common TCP port numbers) may have plenty of other numbers to try to memorize first. If the above patterns can be remembered (with class A being twice as large as the size of the next class), then the address ranges can be calculated fairly easily (rather than memorized).

The number of addresses within the Class A, Class B, and Class C networks can be obtained by raising 2 to a number. That number is 32 minus the number of bits that are used to identify the host. The number 32 comes from the fact that there are 32 bits in an IPv4 address.

Class D
Class E

This class used to have a name/title called “Experimental” (just like Class D was also known as “Multicast”). However, it seems that name has now changed to “Future Use” or “Reserved”. The term “Future Use” seems to suggest a plan, although some people have speculated that it is unlikely those addresses will be used.

Today, Classless Inter-Domain Routing (CIDR) has made these classes far less important. The big difference between an address in the class B range, compared to an address in the class C range, is just the assumed/guessed default subnet size. That affects the values for the prefix length and subnet mask. However, since the “default” subnet size is just a “default” value that can typically be customized, the only real difference between a class B address or a class C address (or a class A address) does not typically have any tremendous impact.

Related Topic(s)

Some of the following topics may be of interest for people who wish to read further about related material.

  • IPv4 usage discusses standard uses of some specific address ranges