Fundamentals 10 min read

Mastering IP Address Classes, Subnetting, and CIDR Basics

This article explains the evolution from OSI to TCP/IP models, details the structure and allocation ranges of IPv4 class A‑E addresses, compares network and host portions, introduces subnet masks, CIDR notation, and the relationship between IP and hardware (MAC) addresses.

ITPUB
ITPUB
ITPUB
Mastering IP Address Classes, Subnetting, and CIDR Basics

Network Model Overview

The OSI seven‑layer model is conceptually complete but rarely used in practice. The TCP/IP model is widely adopted. A simplified five‑layer architecture, combining advantages of both, is used as the basis for discussing IP addressing.

IPv4 Address Structure and Classes

An IPv4 address is a globally unique 32‑bit identifier consisting of a network number field and a host number field. IPv4 addresses are traditionally divided into five classes (A, B, C, D, E) distinguished by their leading binary prefixes.

Class Allocation Ranges

Class A: prefix 0, 7 bits for the network number (excluding all‑zero and all‑one), yielding 2^7‑2 possible networks.

Class B: prefix 10, 14 bits for the network number, yielding 2^14‑1 possible networks (minimum network address 128.1.0.0).

Class C: prefix 110, 21 bits for the network number, yielding 2^21‑1 possible networks (minimum network address 192.0.1.0).

Host Number Allocation

Class A host field: 24 bits → 2^24‑2 hosts per network.

Class B host field: 16 bits → 2^16‑2 hosts per network.

Class C host field: 8 bits → 2^8‑2 hosts per network.

Total IPv4 Space Distribution

The IPv4 address space contains 2^32 addresses. Approximate distribution:

Class A: (2^7‑2) × (2^24‑2) ≈ 2^31 addresses (~50%).

Class B: (2^14‑1) × (2^16‑2) ≈ 2^30 addresses (~25%).

Class C: (2^21‑1) × (2^8‑2) ≈ 2^29 addresses (~12.5%).

IP Addresses vs. MAC (Hardware) Addresses

MAC addresses operate at the data‑link and physical layers, while IP addresses operate at the network layer and above. Translation between the two is performed by ARP (Address Resolution Protocol) and RARP (Reverse ARP).

Subnetting and Supernetting

Subnetting divides a larger IP network into smaller, manageable segments. A subnet mask is a 32‑bit value with contiguous 1s covering the network (and any subnet) portion and 0s covering the host portion. The network address is obtained by a bitwise AND between the IP address and its mask.

Default Subnet Masks

Class A: 255.0.0.0

Class B: 255.255.0.0

Class C: 255.255.255.0

Classless Inter‑Domain Routing (CIDR)

CIDR removes the traditional class boundaries by using variable‑length subnet masks. An address is expressed as IP/prefixLength, where prefixLength is the number of leading 1 bits in the mask.

Example: 128.14.35.7/20 corresponds to the binary mask 11111111.11111111.11110000.00000000. The address block spans from 128.14.32.0 to 128.14.47.255.

Practical Subnet Mask Example

Consider destination address 145.13.3.10 belonging to subnet 145.13.3.0/24 and a router with address 145.13.0.0. The router applies the subnet mask to determine whether the packet is local (same subnet) or must be forwarded to another subnet.

Key Takeaways

IPv4 provides 2^32 unique addresses, organized historically into classes A‑C for practical allocation.

Network and host portions are defined by class‑specific default masks, but CIDR allows flexible prefix lengths to improve address utilization.

ARP resolves IP addresses to MAC addresses for frame delivery; RARP performs the reverse operation.

Subnetting uses a mask to isolate network segments; supernetting (CIDR) aggregates contiguous networks under a shorter prefix.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

TCP/IPnetwork fundamentalsARPCIDRSubnettingIP addressing
ITPUB
Written by

ITPUB

Official ITPUB account sharing technical insights, community news, and exciting events.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.