Hostwinds Blog

Search results for:


IPv4 Classes: What are They & How are They Used Featured Image

IPv4 Classes: What are They & How are They Used

by: Hostwinds Team  /  May 23, 2024


What is an IP Address?

An IP address, short for Internet Protocol address, is a unique identifier assigned to a device connected to a network. Think of it as a numerical label that allows computers, servers, smartphones, and other devices to locate and communicate with one another within a network. These addresses ensure that data sent over the internet reaches the correct destination.

IPv4 is the original network addressing system, dating back to 1983. Despite the gradual transition to IPv6, IPv4 remains the standard for most internet and network communications today.

IPv4 Address Format

IPv4 addresses are based on the binary system, consisting of 32 binary digits (bits). Each IPv4 address is a 32-bit number, divided into four segments known as octets or bytes. Each octet contains 8 bits, making up the full 32-bit address. The term "octet" comes from the fact that each group contains exactly 8 bits. In their more human-readable form, these octets are separated by periods, a format known as dotted decimal notation.

Each octet can have a decimal value ranging from 0 to 255, derived from the fact that an 8-bit binary number can represent 256 different values (8^2=256).

An example IPv4 address might look like this: 192.168. 43. 241

Binary Representation

Although IPv4 addresses are usually seen in decimal form for human readability, they are processed in binary form by computers. Each octet is converted to an 8-bit binary number. For instance, the address 192.168.1.1 in binary looks like this:

  • 192: 11000000

  • 168: 10101000

  • 43: 00101011

  • 241: 1111001

So, 192.168. 43. 241 in binary is: 11000000.10101000. 00101011. 1111001

ipv4-address-format.webp

Significance of Each Bit

When broken down, each bit within an IPv4 address provides information that helps identify the network and the specific device on that network, as well as guide routing decisions and enable subnetting for network management.

Network and Host: The bits are used to determine the network part and the host part of the address. Depending on the subnet mask, some bits represent the network, and the remaining bits represent the host within that network.

Routing: Routers use the binary form of IP addresses to make routing decisions. The network portion helps determine the destination network, while the host portion identifies the specific device within that network.

Subnetting: The binary representation allows for the creation of subnets. By manipulating bits (using subnet masks), large networks can be divided into smaller, more manageable sub-networks.

IPv4 Address Classes

IPv4 addresses are divided into 5 classes (A, B, C, D, E). Each class is designed to address different sized networks, accommodate specific entities, and ultimately simplify the routing process through a structured address assignment and management approach.

Class A

Usage: Class A IP addresses are typically used by very large organizations due to their extensive address space. Examples include major corporations, and government entities that require a substantial number of IP addresses to accommodate an extensive network.

IP Range: 1.0.0.0 to 127.0.0.0

Default Subnet Mask: 255.0.0.0

  • This subnet mask indicates that the first 8 bits (1 byte) of the address are used for the network portion, while the remaining 24 (3 bytes) bits are used for the host portion.

Hosts Per Network: 16,777,214

Networks: 128

  • Only 126 are available as two networks are reserved for specific cases.

Class B

Usage: Class B IP addresses are commonly utilized by medium to large-sized organizations, such as educational institutions, mid-sized companies, and regional internet service providers (ISPs). These entities benefit from the substantial address space provided by Class B addresses, enabling them to support a considerable number of devices while maintaining efficient network performance.

IP Range: 128.0.0.0 to 191.255.0.0

Default Subnet Mask: 255.255.0.0

  • This subnet mask designates the first 16 bits (1 byte) of the address for the network portion and the remaining 16 bits (1 byte) for the host portion.

Hosts per Network: 65,534

Networks: 16,384

Class C

Usage: Class C IP addresses are commonly utilized for smaller-scale networks due to their ability to support a moderate number of hosts per network while offering a vast number of networks. They are frequently deployed where multiple smaller networks are necessary, such as office environments, educational institutions with multiple departments, and residential networks.

IP Range:192.0.0.0 to 223.255.255.0

Default Subnet Mask: 255.255.255.0.

  • This subnet mask designates the first 24 (3 bytes) bits of the address for the network portion and the remaining 8 bits (1 byte) for the host portion.

Hosts per Network: 254

Networks: 2,097,152

Class D

Usage: Class D addresses are reserved for multicast communication, where a single packet can be sent to multiple recipients simultaneously. This type of communication is commonly used for streaming multimedia content, video conferencing, online gaming, and other applications where data needs to be distributed to multiple recipients across various networks.

IP Range: 224.0.0.0 to 239.255.255.255.

  • These addresses are designated specifically for multicast group communication.

Not Assigned to Individual Devices or Networks: Unlike Class A, B, and C addresses, Class D addresses are not assigned to individual devices or networks. Instead, they are used to identify multicast groups. Multicast addresses are not routable in the same way as unicast addresses, and routers handle them differently to facilitate multicast communication across networks.

Not Limited by Network or Host Numbers: Since Class D addresses are not assigned to individual networks or hosts, there is no concept of the number of networks or hosts associated with Class D addresses. Instead, these addresses are used for specialized communication purposes and are not subject to the same constraints as unicast addresses.

Class E

Usage: Despite being part of the IPv4 address space, Class E addresses are not employed in standard networking configurations or deployments, nor are they allocated for use in public or private networks. Instead, they are reserved as a dedicated space for research and development where network administrators, researchers, and developers can utilize a controlled environment to experiment with new networking concepts or to test emerging technologies.

IP Range: 240.0.0.0 to 255.255.255.255.

Special IP Address Ranges

In addition to the standard classes of IP addresses, there are special IP address ranges that serve unique purposes. Let's explore these ranges in a bit more detail.

Loopback Addresses

Usage: Loopback addresses are used for internal testing and running diagnostics on a local machine. When you ping a loopback address, you are essentially verifying that the IP stack is properly configured and that the network interface is operational.

IP Range: 127.0.0.0 to 127.255.255.255

Specific IP Address: 127.0.0.1

  • While the entire 127.0.0.0/8 range is designated for loopback, 127.0.0.1 is the most commonly used IP address - this is often referred to as "localhost."

Private IP Addresses

Usage: Private IP addresses are reserved for use within private networks, allowing organizations to set up internal networks that are isolated from the public internet.

IP Range: Class A, B, and C IP addresses each have their own range of private addresses:

  • Class A Private Range: 10.0.0.0 to 10.255.255.255

  • Class B Private Range: 172.16.0.0 to 172.31.255.255

  • Class C Private Range: 192.168.0.0 to 192.168.255.255

APIPA (Automatic Private IP Addressing)

Usage: APIPA, or Automatic Private IP Addressing, is a feature that assigns an IP address automatically from the 169.254.0.0/16 range when a device fails to obtain an IP address from a DHCP server. It provides a fallback mechanism that allows the device to still communicate with other devices on the same local network segment.

IP Range: 169.254.0.0/16

Example Usage: If a laptop cannot obtain an IP address from a home router (due to DHCP server issues), it may self-assign an address like 169.254.1.1, allowing it to still connect to other devices using APIPA addresses on the same network.

Transition to IPv6

IPv4, with its limited 32-bit address space, faces significant challenges due to the exhaustion of its 4.3 billion available addresses. This limitation, among other shortcomings, ultimately led to the development of IPv6's 128-bit address system, which can accommodate over 340 undecillion unique addresses.

IPv6 also improves on IPv4s dated functionality capabilities. Enhancements include:

  • More efficient routing

  • Simplified network configuration through auto-configuration features

  • Built-in IPsec support for improved security

  • Multicast and anycast addressing support

When comparing IPv4 and IPv6, it's clear the latter is positioned as the foundation for the next phase of the internet. Until then, the IPv4 address system and its classes will continue to keep us connected.

Written by Hostwinds Team  /  May 23, 2024