Class Of Ip Address And Subnet Mask

7 min read

Understanding how devices communicate across networks begins with mastering two fundamental concepts: the class of IP address and the subnet mask. That said, these elements form the backbone of IPv4 addressing, dictating how networks are identified, how hosts are distinguished, and how traffic is routed efficiently. Whether you are a student preparing for a certification like CCNA or CompTIA Network+, a system administrator managing enterprise infrastructure, or simply a curious tech enthusiast, a deep grasp of these topics is non-negotiable And that's really what it comes down to..

The Anatomy of an IPv4 Address

Before diving into classes and masks, You really need to visualize the structure of an IPv4 address. But 1. An IPv4 address is a 32-bit binary number, typically represented in human-readable dotted-decimal notation (e.168.Still, g. , 192.1). This 32-bit string is divided into four octets (bytes), each containing 8 bits.

Each octet ranges from 0 to 255 in decimal. The address is logically split into two distinct portions:

  1. Network Portion: Identifies the specific network a device belongs to. Day to day, 2. Host Portion: Identifies the specific device (host) within that network.

The boundary between these two portions is not fixed; it is defined by the subnet mask. Historically, this boundary was rigidly defined by address classes.

The Five Classes of IP Addresses (Classful Addressing)

In the early days of the Internet (defined in RFC 791), IP addresses were categorized into five classes (A through E) based on the value of the first octet. This system, known as classful addressing, predetermined the network and host boundaries based solely on the first few bits.

Class A: The Giants

  • First Octet Range: 1 – 126 (Binary starts with 0)
  • Default Subnet Mask: 255.0.0.0 (/8)
  • Network Bits: 8 | Host Bits: 24
  • Networks: 126 (2⁷ - 2)
  • Hosts per Network: ~16.7 Million (2²⁴ - 2)
  • Use Case: Designed for extremely large organizations (e.g., governments, massive ISPs).
  • Note: 127.x.x.x is reserved for loopback/testing (localhost).

Class B: The Middle Ground

  • First Octet Range: 128 – 191 (Binary starts with 10)
  • Default Subnet Mask: 255.255.0.0 (/16)
  • Network Bits: 16 | Host Bits: 16
  • Networks: ~16,384 (2¹⁴)
  • Hosts per Network: ~65,534 (2¹⁶ - 2)
  • Use Case: Medium-to-large enterprises and universities.

Class C: The Small Networks

  • First Octet Range: 192 – 223 (Binary starts with 110)
  • Default Subnet Mask: 255.255.255.0 (/24)
  • Network Bits: 24 | Host Bits: 8
  • Networks: ~2 Million (2²¹)
  • Hosts per Network: 254 (2⁸ - 2)
  • Use Case: Small businesses and home networks. This is the most common class seen in private addressing (192.168.x.x).

Class D: Multicast

  • First Octet Range: 224 – 239 (Binary starts with 1110)
  • Purpose: Reserved for multicasting (one-to-many communication). Used in streaming video, routing protocols (OSPF, EIGRP), and IPTV. No subnet mask applies here; these are not assigned to individual host interfaces.

Class E: Experimental

  • First Octet Range: 240 – 255 (Binary starts with 1111)
  • Purpose: Reserved for future use, research, and experimentation. Not valid for public internet routing.

The Critical Role of the Subnet Mask

While classes defined the default boundaries, the subnet mask is the actual mechanism that tells a device: "These bits represent the network; the remaining bits represent the host."

A subnet mask is also a 32-bit number. It uses a contiguous string of 1s (binary) to mask the network portion and 0s to unmask the host portion. Consider this: * Binary 1 = "This bit belongs to the Network ID. "

  • Binary 0 = "This bit belongs to the Host ID.

Default Masks vs. Custom Masks (Subnetting)

In a classful world, a Class C address always used 255.255.255.0. That said, this led to massive IP address exhaustion. A company needing 500 hosts couldn't fit in a Class C (254 hosts) but would waste ~64,000 addresses in a Class B.

Subnetting (borrowing host bits to create more network bits) solves this. It allows administrators to create custom subnet masks (Variable Length Subnet Masks - VLSM) that break the rigid class boundaries The details matter here. Which is the point..

Example:

  • Address: 192.168.10.0 (Class C Default /24)
  • Need: 4 subnets, ~60 hosts each.
  • Action: Borrow 2 host bits -> New Mask: 255.255.255.192 (/26).
  • Result: 4 Subnets (2²), 62 Hosts each (2⁶ - 2).

This flexibility is the foundation of modern Classless Inter-Domain Routing (CIDR), which rendered strict classful routing obsolete decades ago Small thing, real impact..

CIDR Notation: The Modern Standard

Today, you will rarely see "Class B with a custom mask" in documentation. Instead, engineers use CIDR (Classless Inter-Domain Routing) notation, written as a forward slash followed by the number of network bits (prefix length) Small thing, real impact..

Class Default Mask (Decimal) Default Mask (Binary) CIDR Notation
Class A 255.255.11111111.In practice, 11111111. 00000000 /8
Class B 255.Consider this: 0. 11111111.0 11111111.Practically speaking, 255. Still, 0 11111111. On top of that, 0
Class C 255.0.Think about it: 00000000 /24
Subnetted C 255. 11111111.

Extending the Mask: From /26 to /30 and Beyond

When the binary mask begins with a series of 1 bits followed by 0 bits, each additional 1 reduces the pool of usable host addresses by half. On top of that, for the example mask **255. 255.255 Small thing, real impact..

11111111.11111111.11111111.11000000

Counting the leading 1s yields a prefix length of 26 (the “/26” notation). The remaining six host bits can generate 2⁶ – 2 = 62 valid IP addresses per subnet (the subtraction accounts for the network and broadcast addresses) Simple as that..

If we borrow one more host bit, the mask becomes 255.Practically speaking, 255. Day to day, 255. In real terms, 128 (/27). Now only three host bits remain, providing 2³ – 2 = 6 usable addresses per subnet, and the network count doubles to eight Small thing, real impact. Nothing fancy..

Borrowing a third host bit yields 255.Here's the thing — 255. 255.192 (/28) with two host bits, giving 2² – 2 = 2 usable addresses per subnet and sixteen possible subnets.

Finally, a /30 mask (255.255.255.252) leaves just two host bits, allowing 2² – 2 = 2 addresses per subnet—ideal for point‑to‑point links where only two devices need to communicate.

Summarization and Route Aggregation

One of CIDR’s most powerful features is the ability to aggregate multiple contiguous subnets into a single routing advertisement. Day to day, suppose an organization operates four /28 networks (192. 168.10.Also, 0/28, 192. Think about it: 168. 10.16/28, 192.Plus, 168. Here's the thing — 10. 32/28, 192.168.Consider this: 10. 48/28). But instead of advertising each /28 individually, a router can summarize them as a single 192. 168.10.0/26 entry. This reduces table size, improves convergence speed, and lessens the load on interior routing protocols Still holds up..

Practical Use Cases

  • Enterprise LANs – A company that initially allocated a /24 block can carve it into /26 subnets for each department, then further subdivide those /26s into /28s for individual office floors, achieving a balance between granularity and address conservation.
  • Service Provider Networks – ISPs often allocate a /20 block to a customer and then assign /29 or /30 subnets to each customer edge router, enabling efficient allocation of small, dedicated point‑to‑point circuits.
  • Cloud Infrastructure – Virtual private clouds (VPCs) frequently employ a /16 primary CIDR, then subdivide it into /20 or /22 subnets to isolate workloads while keeping the overall address plan manageable.

Transition Toward IPv6

While IPv4’s 32‑bit address space sufficed when CIDR was introduced, the exponential growth of Internet‑connected devices eventually exhausted the available pools. Even so, the industry’s response has been the deployment of IPv6, which expands the address length to 128 bits and eliminates the need for the class‑based paradigm altogether. Even so, the principles of variable‑length subnetting and route aggregation remain central to IPv6 design, ensuring that the lessons learned from IPv4’s classful era continue to inform modern network architecture It's one of those things that adds up..

Conclusion

The evolution from rigid classful addressing to flexible Classless Inter‑Domain Routing reshaped how networks allocate and manage IP space. By introducing the subnet mask and its CIDR representation, engineers gained the ability to tailor network boundaries, conserve addresses, and aggregate routes for scalability. Subnetting, VLSM, and route summarization are now fundamental practices that underpin both IPv4 and IPv6 deployments.

Currently Live

Current Reads

Readers Also Loved

Familiar Territory, New Reads

Thank you for reading about Class Of Ip Address And Subnet Mask. We hope the information has been useful. Feel free to contact us if you have any questions. See you next time — don't forget to bookmark!
⌂ Back to Home