How does an IP address work?
IP addresses function like the actual addresses for houses. They’re a way for different devices to identify and communicate with each other across public and private networks. An IP address typically consists of two parts — a network identifier and a host identifier, which essentially works as your “ID” whenever you connect to the internet, another device, or public or private networks. Different types of IP addresses serve different purposes.
Typically, your IP address is assigned by your ISP, but some factors can change it, like your subnet mask, routing table, or the use of a VPN. Certain addresses have unique functions. For instance, network IDs can’t start with 127 because the entire 127.x.x.x range is reserved for loopback. Meaning, it’s used for internal device diagnostics and doesn’t serve as a network identifier.
IPv4 is based on a 32-bit binary system and remains the most widely used core internet protocol. However, when comparing IPv4 and IPv6, it becomes clear that the former has limitations. For instance, it’s unable to accommodate newer devices and security features. As a result, the majority of new devices and networks are now adopting the IPv6 protocol.
What are IP address classes?
If your network or device uses an IPv4 address, it operates within the IPv4 addressing system, which identifies devices on public and private networks. While IP address classes (A, B, C, D, and E) were previously used for categorization, modern networks primarily use classless inter-domain routing (CIDR) for more flexible and efficient address allocation.
All IPv4 addresses follow the “XXX.XXX.XXX.XXX” format, representing a 32-bit address divided into four sections or octets. The subnet mask determines the range of possible addresses within a network and distinguishes the network portion from the device-specific portion of the IP address. The actual IP address assigned to your device comes from your network configuration, either through DHCP or manual assignment.
The five different IP address classes, each with its own IP address range and subnet mask, are as follows:
Class A addresses
Class A addresses are used by networks that accommodate a large number of hosts. It only uses the first octet of your address for your network portion, with the remaining three octets determining your host portion.
- The public IP range is 1.0.0.0 to 126.255.255.255.
- The first octet value ranges from 1 to 126.
- The private IP range is 10.0.0.0 to 10.255.255.255.
- The subnet mask is 255.0.0.0 (8 bits).
- The number of hosts per network is 16,777,214.
- The number of networks is 128, but only 126 are usable. This is because the 127.x.x.x range is reserved for loopback addresses, and 0.0.0.0 is reserved for the default route, leaving 126 available network ranges.
A Class A IP address allows you to connect a vast number of devices to a network, like smartphones, printers, or computers to a single router. Class A addresses are primarily assigned to large organizations rather than individual internet users.
Class B addresses
Class B addresses are used by systems with a moderate number of users in the same network, like an enterprise, university, or company. It uses the first two octets of your address to identify your network portion, while the last two will determine your host portion.
- The public IP range is 128.0.0.0 to 191.255.255.255.
- The first octet value ranges from 128 to 191.
- The private IP range is 172.16.0.0 to 172.31.255.255.
- The subnet mask is 255.255.0.0 (16 bits).
- The number of hosts per network is 65,534.
- The number of networks is 16,382.
A Class B IP address is often used for mid-to-large-sized networks due to its larger address space. However, network segmentation and subnetting are not exclusive to Class B — they are features of subnetting and CIDR, which apply to all IP address classes.
Class C addresses
Class C addresses are used by smaller networks, such as those found in small businesses and private networks. It uses the first three octets of your address for your network portion, with the host portion represented by the last octet.
- The public IP range is 192.0.0.0 to 223.255.255.
- The first octet value ranges from 192 to 223.
- The private IP range is 192.168.0.0 to 192.168.255.255.
- The subnet mask is 255.255.255.0 (24 bits).
- The number of hosts per network is 254.
- The number of networks is 2,097,152.
A Class C IP address is often used for LAN connections or smaller organizations. This type of IP address class works best with users that have multiple devices but don’t require the classifications of Class A and Class B IP addresses.
Class D addresses
Class D addresses are unique because they’re used for multicasting, where a single packet is sent to multiple hosts. These addresses don’t use any subnets because they’re not necessary for the type of communication they do across networks.
- The public IP range is 224.0.0.0 to 239.255.255.255.
- The first octet value ranges from 224 to 239.
Class D IP addresses are often used by any network that mostly streams data from one source to different devices. You’re unlikely to run into this type of IP address unless it's from a network specifically designed to multicast.
Class E addresses
Class E addresses are reserved for research or experimental IP network developments. They cannot connect to the internet and are not routable via the public internet.
- The range is 240.0.0.0 to 255.255.255.255.
- The first octet value ranges from 240 to 255.
To summarize:
Name | Number of networks | Number of hosts | Subnet mask | Description |
---|---|---|---|---|
Class A | 126 | 16,777,214 | 255.0.0.0 (8 bits) | Many hosts per network |
Class B | 16,382 | 65,534 | 255.255.0.0 (16 bits) | Many hosts per network |
Class C | 2,097,152 | 254 | 255.255.255.0 (24 bits) | Many networks with fewer hosts per network |
Class D | N/A | N/A | - | Multicasting |
Class E | N/A | N/A | - | Experimental |
What are the drawbacks of IP address classes?
While useful, IP address classes (and IPv4 in general) have steadily become obsolete because of the limitations of the identification system. Many newer devices and networks use classless inter-domain routing (CIDR), which optimizes address allocation and reduces waste compared to classful addressing.
IP address classes are also prone to address waste, where IP addresses are assigned to hosts/devices in a network but end up never being used. IPv4 addresses have already run out, which is why most users are adopting IPv6 and techniques like network address translation (NAT) to extend IPv4 usability.
With newer devices having different ways to communicate and identify themselves across the internet and networks, more efforts are being made by network administrators to phase out IP address classes in favor of IPv6.
What are private IP addresses?
You can think of private IP addresses as the unique identifiers that your router or network assigns to different devices within the local network. Private IP addresses access the internet via NAT, which is used in most home routers.
Each class has its own private IP range:
- Class A — 10.0.0.0 to 10.255.255.255
- Class B — 172.16.0.0 to 172.31.255.255
- Class C — 192.168.0.0 to 192.168.255.255
So if you’ve connected your smartphone, tablet, laptop, and computer to your router, you’ll notice that each has its own unique private IP address. This setup makes it easier for your devices to communicate with each other in your internal networks. It also facilitates routing for your different devices when they access the internet.
What are special IP address ranges?
Special IP addresses cannot be assigned to individual hosts because they are reserved for specific functions apart from communicating with other devices or networks. Some of these address ranges include:
- Loopback address (127.0.0.0 – 127.255.255.255). These ranges are “loopback ranges,” which are primarily used when you’re trying to test your device’s diagnostics. This range doesn’t send packets across a network. It’s exclusively for the device’s internal use, essentially allowing it to “ping” itself for diagnostics or interactions with network applications.
- Link-local address (169.254.0.0 – 169.254.255.255). These ranges are often referred to as “link local” (or APIPA for Windows users) ranges, where your device tries to communicate with other devices in your network without using DHCP. APIPA (Automatic Private IP Addressing) assigns an IP address in the 169.254.x.x range when a device is unable to acquire an IP address using a DHCP server. It allows local communication but does not enable internet access.
How is subnetting related to IP address classes?
Subnetting is the process of dividing your network into smaller sections. Think of it as a network within your network, which enables efficient traffic management and routing of data within your network. This process is essential for efficient IP address management and routing. It divides a larger network into smaller subnets, helping improve data routing efficiency within and between. Subnetting also allows for efficient IP address allocation, reducing waste. While traditional subnet masks were class-based, CIDR now allows more flexible subnetting beyond predefined class boundaries.
IP address classes for better communications
IP address classes play a crucial role in network communications by enabling efficient data transfer and routing between devices across a network. While CIDR has largely replaced class-based IP addressing, understanding IP address classes remains important for network troubleshooting and legacy systems.
Knowing the basics of IP address classes can help everyday users better diagnose network problems or security issues with connected devices. This knowledge can give you greater flexibility in identifying potential problems, such as detecting unauthorized private addresses on your network or addressing other connectivity concerns.
Online security starts with a click.
Stay safe with the world’s leading VPN