IP

IPv4 Addressing

Classful addressing, subnetting, Variable Length Subnet Masking (VLSM), and CIDR.

IP Addresses and IPv4 Addressing

An IP address is a logical identifier for a network interface and is used to deliver packets between networks. Devices on networks using the Internet Protocol include computers, smartphones, servers, and smart TVs. They use an IP address to communicate and to send and receive data.

IPv4, which stands for Internet Protocol version 4, was the first widely used version and remains the basis of many networks. It provides the logical addressing system that directs traffic across interconnected networks.

The Structure of an IPv4 Address

An IPv4 address is a 32-bit number. In binary notation, it is a sequence of 32 ones and zeros. To make these addresses easier for humans to read and work with, this 32-bit sequence is broken down into four 8-bit sections.

Octets and Dotted-Decimal Notation

  • Bits and Octets: The 32 bits are divided into four groups of eight bits. Each 8-bit group is called an .
  • Dotted-Decimal Notation:Each octet is converted from its binary value to a decimal number (from 0 to 255). These four decimal numbers are then written out, separated by dots. This format is known as "dotted-decimal notation."

Example: From Binary to Decimal

Consider the IP address for a local router: 192.168.1.1.

192→11000000192 \rightarrow 11000000

168→10101000168 \rightarrow 10101000

1→000000011 \rightarrow 00000001

1→000000011 \rightarrow 00000001

The full 32-bit binary representation is: 11000000.10101000.00000001.00000001

Classful Addressing

In the early Internet, the 32-bit IPv4 address space was divided into fixed-size categories called address classes. This classful system supported networks of different sizes. The first bits of the first octet determined the class and therefore the boundary between the network and host portions of the address.

In the classful addressing model, every IP address has two parts:

  • Network ID: The part that identifies the specific network a device belongs to. All devices on the same network share the same network ID.
  • Host ID: The part that identifies a unique device on that network.

Class A: 8-bit Network Prefix

Leading Bits: The first bit of the first octet is always 0.

Address Range: 0.0.0.0 to 127.255.255.255.

Network/Host Split: The first octet is the Network ID, and the last three octets are the Host ID (8 bits network, 24 bits host).

Number of Networks: 27=1282^7 = 128 possible identifiers; networks 0 and 127 are reserved, leaving 126 conventional Class A networks.

Hosts per Network: 224−2=16,777,2142^{24} - 2 = 16,777,214 hosts. One address identifies the network itself and another is the broadcast address.

Default Subnet Mask: 255.0.0.0.

Use Case: Used by large organizations, including technology companies and government bodies. The 9.0.0.0/89.0.0.0/8 block assigned to IBM is a historical example of this type of allocation.

Class B: 16-bit Network Prefix

Leading Bits: The first two bits are always 10.

Address Range: 128.0.0.0 to 191.255.255.255.

Network/Host Split: The first two octets are the Network ID, and the last two are the Host ID (16 bits network, 16 bits host).

Number of Networks: 214=16,3842^{14} = 16,384 networks.

Hosts per Network: 216−2=65,5342^{16} - 2 = 65,534 hosts.

Default Subnet Mask: 255.255.0.0.

Use Case: Designed for universities, large corporations, and ISPs. For example, a large university might have been assigned a Class B network to provide addresses to all its departments and student devices.

Class C: 24-bit Network Prefix

Leading Bits: The first three bits are always 110.

Address Range: 192.0.0.0 to 223.255.255.255.

Network/Host Split: The first three octets are the Network ID, and the final octet is the Host ID (24 bits network, 8 bits host).

Number of Networks: 221≈2 million2^{21} \approx 2 \text{ million} networks.

Hosts per Network: 28−2=2542^8 - 2 = 254 hosts.

Default Subnet Mask: 255.255.255.0.

Use Case: The most common class, intended for small businesses and home networks.

Classes D and E: Multicast and Reserved Range

Class D (Multicast): Range 224.0.0.0 to 239.255.255.255. Leading bits are 1110. These addresses are not assigned to individual hosts but are used for .

Class E (Reserved Range): Range 240.0.0.0 to 255.255.255.255. Leading bits are 1111. Current registries designate this block as reserved, so it is not used for ordinary host unicast addressing.

Limits of Classful Addressing

The rigid structure of classful addressing quickly proved inefficient for the growing internet. The main issues were:

  • Large Address Waste: Fixed block sizes created substantial excess capacity. For example, a company with 300 employees needed more than a Class C network (254 hosts), so it had to be assigned an entire Class B network. This provided 65,534 host addresses, meaning over 65,000 addresses (≈99.5%{\approx 99.5\%}) were unused and unavailable to other organizations.
  • Rapid Address Exhaustion: This inefficiency led to the rapid depletion of available IPv4 addresses, particularly in the most desirable Class A and B ranges. It became clear that the entire IPv4 address space would run out much faster than anticipated.
  • Large Routing Tables: In a classful world, routers on the internet backbone had to maintain a separate entry for every single network. As the number of Class C networks grew rapidly, these routing tables became large and consumed memory and processing power.

Classful addressing became unworkable as a result of its waste and scalability limits. This crisis spurred more flexible addressing and routing techniques that reduced pressure on the IPv4 pool. These solutions, covered in later topics, include subnetting, Variable Length Subnet Masking (VLSM), and later Classless Inter-Domain Routing (CIDR).

Related articles