In this article, I’ll discuss the IP address space, and the different classes (A-E) as well as the difference between public & private address. I’ll focus on IPv4, as it’s still the primary version the US uses (and all I use at work). Therefore whenever I discuss “IP” below, I’m referencing IPv4.
What is an IP?
First, an IP address is a series of 4 numbers ranging from 0-255, separated by dots. A few IPs are 172.31.9.12, or 8.7.6.5, or 192.168.1.11. Each number is a decimal representation of a single byte, which is a series of 8 bits that are either a 0 or a 1. So a byte, written in binary, may be 11001001, which is 201 in decimal. See the Wikipedia article on binary for more details on binary. The basic purpose is that a computer can only understand numbers – in this case, 0 or 1, which correspond to “an electrical signal is present (1) or not (0)”.
So, an IP address is a series of numbers used to indicate the network address for a device (which may be hosting a webpage, or an app, or a database, or something else).
Public vs Private Ranges
Each IP space within a class is designated public or private. Public IPs are used for internet-facing devices, while private IPs are used within internal networks and cannot be routed over the internet.
Subnet Masks
The “size” of a network is determined by its subnet mask (references in an earlier blog post). This is another 4-digit number, like IP addresses, although it’s used differently as it must be an uninterrupted series of 1’s before an uninterrupted series of 0’s finishes it.
The first three Classes of networks (see below) have different subnet masks. Each subnet is a tradeoff between network size (how many devices can be on this network) and how many networks there can be. Class A has the largest number of hosts per network available (about 17 million) but the fewest possible number of networks (126). Class C has the smallest number of hosts per network (254) but the largest number of networks available (about 2.1 million). Class B is in the middle with about 66,000 hosts per each of the 16.3 thousand networks.
IP Address Classes
The IP address space ranges from 1.0.0.0 – 255.255.255.255. Not that 0.0.0.0 could technically be used, I suppose, but would have routing issues since it’s all 0’s. The space is then divided into 5 “classes”, which have different purposes. Additionally, in general usage, each subsequent space is smaller than the ones preceding it. So a Class A space will be the largest networks, while class C-E are the smallest.
Classes A, B, and C have designated private scopes, which each subsequent class having a smaller number of IPs available to the private network.
- Class A – 1.0.0.0.-127.0.0.0 (first Octet [number] ranges from 1-127)
- The private range of this class is 10.0.0.0-10.255.255.255. This is the largest class available for private/non-internet facing networks.
- Class B – 128.0.0.0 – 191.255.0.0 (first octet is 128-191)
- The private range in this class is 172.16.0.0-172.31.255.255.
- Class C – 192.0.0.0-223.255.255.0 (first octet 192-223)
- The private range in this class is 192.168.0.0-192.168.255.255. This is the most common private IP range in home networks, and is probably what your home computer is using now.
- Class D – 224.0.0.0-239.255.255.255 (first octet 224-239)
- This is a special range – it’s used for multicasting, wherein a host broadcasts data to a bunch of other hosts over the internet.
- Class E – 240.0.0.0-255.255.255.255
- This is another special range and is not used (aside from personal experimentation or research).
You may notice that Class A ends with 127.0.0.0, but class B starts at 128.0.0.0. The range in between those – 127.0.0.1-127.255.255.255 – is used for internal network testing. The prime example of this is 127.0.0.1 which is usually interpret by a computer as referring to itself. This is the “localhost”.
Recent Comments