4.2 Classful IP Addressing & Special Addresses
💡 Core Intuition: The National Telephone Area Code System
🍳 The Everyday Analogy: Country Codes, Area Codes, and Subscriber Numbers
Imagine making a landline telephone call in the 20th century:
- A telephone number had a fixed, hierarchical structure:
+1 (415) 867-5309. - The Country Code (
+1) routes the call to the United States. - The Area Code (
415) routes the call to San Francisco's regional exchange. - The Subscriber Number (
867-5309) identifies the specific home or office telephone within San Francisco.
If you lived in a gigantic metropolis like New York or Tokyo, the phone company gave the city a small 2-digit area code, leaving 8 digits for millions of local subscriber lines. If you lived in a tiny mountain village, the phone company gave the village a long 4-digit area code, leaving only 4 digits for local homes.
This was the exact philosophy behind Classful IP Addressing:
- The world was divided into organizations of different sizes.
- Huge entities (universities, military bases, IBM) were granted Class A blocks (a short Network ID and millions of Host IDs).
- Medium companies were granted Class B blocks.
- Small businesses were granted Class C blocks (a long Network ID and only 254 Host IDs).
💻 Bridging to Computer Science
An IPv4 Address is a 32-bit binary identifier uniquely identifying a machine's connection to an IP network. To make routing scalable across the globe, the 32 bits are split into two logical parts:
Routers in the global core only inspect the NetID to route a datagram to the destination network. Once the datagram arrives at the destination network's local router, that router inspects the HostID to deliver the packet across the local link.
📑Table of Contents
- 🔢 IPv4 Representation & Address Space Architecture
- 🏛️ The Five Classes of IPv4 Addressing
- 📊 Visual Blueprint: Classful Architecture Matrix
- 🏷️ Special IPv4 Addresses & Reserved Blocks
- 🔒 Private IP Address Ranges (RFC 1918)
- 🏭 Real-World Production Context: Why Classful Addressing Failed
- 📐 Numerical Applications & Worked Examples
- 🎯 Exam & Interview Pitfall Check
🔢 IPv4 Representation & Address Space Architecture
The total address space of IPv4 consists of all possible 32-bit combinations:
1. Dual Notation Formats
IPv4 addresses are represented in two standard notations:
| Notation Format | Representation Example (4 Octets) | Structural Characteristics |
|---|---|---|
| Binary Notation | 11000000 . 10101000 . 00000001 . 00001010 | 32 total bits partitioned into four 8-bit octets separated by dots. |
| Dotted-Decimal | 192 . 168 . 1 . 10 | Base-10 integers ranging strictly from to () per octet. |
2. The Conversion Mechanics
Each byte (octet) in dotted-decimal format represents the base-10 integer value of that 8-bit binary slice:
🏛️ The Five Classes of IPv4 Addressing
When the Internet addressing system was standardized in RFC 791 (1981), the 32-bit space was partitioned into five discrete classes (Class A, B, C, D, and E), distinguished by their leading bits:
| Address Class | Leading Bit Signature | Network ID Bits (NetID) | Host ID Bits (HostID) | Default Subnet Mask |
|---|---|---|---|---|
| Class A | 0 | () | 255.0.0.0 (/8) | |
| Class B | 10 | () | 255.255.0.0 (/16) | |
| Class C | 110 | () | 255.255.255.0 (/24) | |
| Class D | 1110 | None (Multicast Group) | None (28-bit Group ID) | None (Multicast) |
| Class E | 1111 | None (Reserved/Exp) | None (28-bit Reserved) | None (Experimental) |
1. Class A (Massive Networks)
- Leading Bit Pattern: Begins with
0. - Partitioning: , .
- First Octet Binary Range:
00000000to01111111( to ). - Total Networks: .
- Network
0.0.0.0/8is reserved (used as default source / this host). - Network
127.0.0.0/8is reserved for Loopback testing. - Usable Networks = ( through ).
- Network
- Hosts per Network: .
- Usable Hosts per Network = .
- Default Subnet Mask:
255.0.0.0(or/8). - Share of IPv4 Space: ().
2. Class B (Mid-Sized Enterprises & Universities)
- Leading Bit Pattern: Begins with
10. - Partitioning: , .
- First Octet Binary Range:
10000000to10111111( to ). - Total Networks: (all usable).
- Hosts per Network: .
- Usable Hosts per Network = .
- Default Subnet Mask:
255.255.0.0(or/16). - Share of IPv4 Space: ().
3. Class C (Small Local Networks)
- Leading Bit Pattern: Begins with
110. - Partitioning: , .
- First Octet Binary Range:
11000000to11011111( to ). - Total Networks: (all usable).
- Hosts per Network: .
- Usable Hosts per Network = .
- Default Subnet Mask:
255.255.255.0(or/24). - Share of IPv4 Space: ().
4. Class D (Multicast Group Addressing)
- Leading Bit Pattern: Begins with
1110. - Partitioning: Zero NetID/HostID division! The entire address specifies a multicast subscriber channel.
- First Octet Binary Range:
11100000to11101111( to ). - Total Multicast Groups: .
- Share of IPv4 Space: .
- Standard Assignments:
224.0.0.1: All systems (hosts and routers) on this subnet.224.0.0.2: All multicast routers on this subnet.224.0.0.5: OSPF Routers.224.0.0.9: RIPv2 Routers.
5. Class E (Reserved / Experimental)
- Leading Bit Pattern: Begins with
1111. - Partitioning: Zero NetID/HostID division. Reserved by IETF for research and future use.
- First Octet Binary Range:
11110000to11111111( to ). - Share of IPv4 Space: ().
📊 Visual Blueprint: Classful Architecture Matrix
Below is the comparative architecture matrix summarizing all five classes of IPv4:
The 5 IPv4 Address Classes Architecture Matrix
Structural comparison of leading bit signatures, network capacities, and address space distribution
Class A (Very Large)
126 Networks • 16.7M Hosts- Leading bit: 0 (Range: 1.0.0.0 to 126.255.255.255)
- 8-bit NetID (7 bits usable) + 24-bit HostID
- Default Mask: 255.0.0.0 (/8)
- 50% of the entire global IPv4 address space
Class B (Medium Scale)
16,384 Networks • 65.5K Hosts- Leading bits: 10 (Range: 128.0.0.0 to 191.255.255.255)
- 16-bit NetID (14 bits usable) + 16-bit HostID
- Default Mask: 255.255.0.0 (/16)
- 25% of the entire global IPv4 address space
Class C (Small Scale)
2.09M Networks • 254 Hosts- Leading bits: 110 (Range: 192.0.0.0 to 223.255.255.255)
- 24-bit NetID (21 bits usable) + 8-bit HostID
- Default Mask: 255.255.255.0 (/24)
- 12.5% of the entire global IPv4 address space
Class D (Multicast)
268M Group Channels- Leading bits: 1110 (Range: 224.0.0.0 to 239.255.255.255)
- Zero NetID / HostID separation
- Used for one-to-many streaming and dynamic routing protocols
- 6.25% of the entire global IPv4 address space
Class E (Experimental)
268M Reserved Addresses- Leading bits: 1111 (Range: 240.0.0.0 to 255.255.255.255)
- Zero NetID / HostID separation
- Reserved by IETF for future research & experimental testing
- Includes Limited Broadcast Address (255.255.255.255)
🏷️ Special IPv4 Addresses & Reserved Blocks
Across the IPv4 address space, certain address combinations possess dedicated operational semantics and can never be assigned to a standard host Network Interface Card (NIC):
| Address Pattern | Standard Name | Scope & Operational Behavior |
|---|---|---|
| NetID + All 0s in HostID | Network ID / Network Address | Identifies the network itself; used in router forwarding tables. |
| NetID + All 1s in HostID | Directed Broadcast (DBA) | Broadcasts to all hosts in remote target network; routed across Internet. |
255.255.255.255 | Limited Broadcast (LBA) | Floods all hosts on local physical LAN only; routers never forward. |
0.0.0.0 | This Host / Default Route | Used as source IP during DHCP bootstrap; default route in routing tables. |
127.0.0.0/8 | Loopback Block (Localhost) | Internal kernel TCP/IP software loop; packets never hit network wire. |
169.254.0.0/16 | APIPA / Link-Local | Auto-assigned link-local IP when DHCP server fails to respond. |
1. The Network ID (HostID = All 0s)
- Structure: The network bits identify the domain; the host bits are all zeroes:
- Function: Used in router forwarding tables to summarize routing reachability. Routers forward packets toward
192.168.1.0/24, not to individual machines.
2. Directed Broadcast Address (HostID = All 1s)
- Structure: The network bits identify the destination network; the host bits are all ones:
- Function: Allows an external machine to transmit a single datagram across the Internet that, upon reaching the destination router, is broadcast to every single machine on that specific destination network.
- Security Note: In modern production networks, routers block incoming Directed Broadcasts at border gateways by default to prevent Distributed Denial of Service (Smurf Amplification Attacks).
3. Limited Broadcast Address (255.255.255.255)
- Structure: All 32 bits are ones (
11111111.11111111.11111111.11111111). - Function: Broadcasts a message to every host residing on the current local physical network segment.
- Router Behavior: Routers NEVER forward a Limited Broadcast. It is strictly confined within the local broadcast domain.
4. This Host / Default Route (0.0.0.0)
- As a Source Address: When a newly powered-on computer connects to a network without an assigned IP, it broadcasts a DHCP Discovery packet using Source IP =
0.0.0.0and Destination IP =255.255.255.255. - As a Routing Table Entry: Represents the Default Gateway Route (
0.0.0.0/0), matching any packet whose destination does not match any specific subnet prefix in the FIB.
5. Loopback Address Block (127.0.0.0/8)
- Range:
127.0.0.1to127.255.255.254(an entire Class A block of 16.7 million addresses wasted on loopback!). - Standard Implementation:
127.0.0.1(localhost). - Hardware Behavior: When an application sends packets to
127.0.0.1, the packets never hit the physical network card or link. The operating system kernel's network stack immediately routes the data buffer back into incoming socket queues. Used for local server testing and IPC.
🔒 Private IP Address Ranges (RFC 1918)
As the commercial Internet expanded rapidly in the early 1990s, the world faced catastrophic IPv4 Address Depletion. To slow down address consumption, the Internet Engineering Task Force (IETF) issued RFC 1918, carving out three private address ranges reserved for internal enterprise and home networks:
| Class | CIDR Block Prefix | IP Address Range | Total Addresses | Networks Count |
|---|---|---|---|---|
| Class A | 10.0.0.0 /8 | 10.0.0.0 to 10.255.255.255 | 1 Class A Net | |
| Class B | 172.16.0.0 /12 | 172.16.0.0 to 172.31.255.255 | 16 Class B Nets | |
| Class C | 192.168.0.0 /16 | 192.168.0.0 to 192.168.255.255 | 256 Class C Nets |
Golden Rules of Private IP Addresses:
- Zero Public Routability: Intermediate Internet Service Provider (ISP) core routers silently drop any packet with a private source or destination IP.
- Infinite Global Reuse: Every home Wi-Fi router on Earth can use
192.168.1.1simultaneously without causing an address collision because private addresses are isolated inside local networks. - Bridge to the Internet: For a private host to communicate with the global Internet, a gateway router must translate its private address into a valid public IP using Network Address Translation (NAT).
🏭 Real-World Production Context: Why Classful Addressing Failed
Classful addressing was structurally elegant in 1981, but by 1993 it brought the global Internet to the brink of collapse:
| Organization Host Demand | Assigned Classful Network | Allocated Hosts | Wasted Unused Addresses | Address Wastage Ratio |
|---|---|---|---|---|
| 300 Workstations Needed | Class B Network | Wasted | ||
| (Exceeds Class C 254 limit) | (Smallest available classful block) | (Dormant addresses locked forever) |
1. The Mid-Size Organization Dilemma (Class B Exhaustion)
- If an organization needed 300 computers:
- A single Class C network was insufficient (maximum 254 hosts).
- The organization was therefore assigned a full Class B network ().
- Result: 65,234 IP addresses sat unused and wasted forever ( waste)!
- By 1993, all Class B networks were nearly exhausted, while millions of addresses sat dormant inside underutilized blocks.
2. The Solution: CIDR and Subnetting
To prevent total Internet exhaustion, the IETF took two emergency measures:
- Subnetting (RFC 950): Allowing organizations to internally subdivide their large Class A and B blocks into smaller sub-networks.
- Classless Inter-Domain Routing (CIDR, RFC 1519): Officially abolishing the rigid Class A/B/C boundaries in favor of arbitrary bit prefixes (
/20,/26,/29).
📐 Numerical Applications & Worked Examples
Example 1: Address Classification & Parameter Extraction
Problem Statement: For each of the following IPv4 addresses, determine its Class, Network ID, Default Subnet Mask, and Directed Broadcast Address:
10.45.67.89130.14.22.9205.100.50.25225.10.20.30245.1.2.3
Step-by-Step Solution:
-
Analyze First Octet Boundaries:
- Class A: (Default Mask
255.0.0.0) - Class B: (Default Mask
255.255.0.0) - Class C: (Default Mask
255.255.255.0) - Class D: (Multicast)
- Class E: (Experimental)
- Class A: (Default Mask
-
Evaluate Each Address:
- 1.
10.45.67.89:- First octet = Class A.
- NetID = 8 bits .
- Default Mask .
- Directed Broadcast (Host bits all 1s) .
- 2.
130.14.22.9:- First octet = Class B.
- NetID = 16 bits .
- Default Mask .
- Directed Broadcast .
- 3.
205.100.50.25:- First octet = Class C.
- NetID = 24 bits .
- Default Mask .
- Directed Broadcast .
- 4.
225.10.20.30:- First octet = Class D (Multicast).
- No NetID or Directed Broadcast exists (Group Channel).
- 5.
245.1.2.3:- First octet = Class E (Experimental/Reserved).
- 1.
Example 2: Maximum Usable Hosts in a Classful World
Problem Statement: An Internet registry grants an enterprise two full Class C network blocks and one full Class B network block. Assuming standard classful operation without custom subnetting, calculate:
- The total number of valid assignable host IP addresses the enterprise can deploy.
- The total number of unassignable overhead IP addresses (Network IDs and Broadcast IDs).
Step-by-Step Solution:
-
Analyze Host Capacity per Network Block:
- Each Class C network has 8 host bits:
- For two Class C networks:
- Each Class B network has 16 host bits:
-
Calculate Total Usable Deployable Hosts:
-
Calculate Unassignable Overhead Addresses:
- Every independent network reserves exactly 2 addresses (1 Network Address + 1 Directed Broadcast Address).
- Total networks = .
Example 3: Private IP Address Validation
Problem Statement: Identify which of the following IP addresses are RFC 1918 private addresses, and for each private address, state its associated class:
- (a)
172.30.100.4 - (b)
172.33.1.5 - (c)
10.200.45.1 - (d)
192.169.1.1 - (e)
192.168.100.254
Step-by-Step Solution:
-
Reference RFC 1918 Boundaries:
- Class A Private:
10.0.0.0to10.255.255.255 - Class B Private:
172.16.0.0to172.31.255.255 - Class C Private:
192.168.0.0to192.168.255.255
- Class A Private:
-
Evaluate Inputs:
- (a)
172.30.100.4: Second octet Private IP (Class B). - (b)
172.33.1.5: Second octet Public IP (Class B). - (c)
10.200.45.1: First octet Private IP (Class A). - (d)
192.169.1.1: Second octet Public IP (Class C). - (e)
192.168.100.254: Second octet Private IP (Class C).
- (a)
🎯 Exam & Interview Pitfall Check
-
Why are there usable hosts in a Class A network rather than ?
Because two host addresses in every IP network are strictly reserved by the IP standard:- The address with all HostID bits set to
0represents the Network Address itself (used in routing tables). - The address with all HostID bits set to
1represents the Directed Broadcast Address (used to transmit to all hosts on that network). Assigning either address to a host NIC results in routing failure or network conflicts.
- The address with all HostID bits set to
-
Can a host on one network communicate directly with a host on another network if they have the same HostID?
Yes. HostIDs are locally scoped. In internetworking, uniqueness is required only for the combination of(NetID + HostID). Two computers can have identical HostIDs (e.g., Host A:10.0.0.5, Host B:192.168.1.5), and routers route between them based on their distinct Network IDs.
-
Trap: Confusing Directed Broadcast with Limited Broadcast.
Debunked: A Limited Broadcast (255.255.255.255) is strictly local to the transmitting LAN; routers never forward it. A Directed Broadcast (e.g.,192.168.1.255) contains a valid remote Network ID in its first octets; it can be routed across the Internet until it reaches the destination router, which then broadcasts it across the destination LAN. -
Trap: Believing
127.0.0.1is the only Loopback address.
Debunked: The entire/8network block127.0.0.0/8(from127.0.0.1to127.255.255.254) is reserved for loopback! Pinging127.1.2.3or127.45.67.89in your terminal will ping your local loopback adapter just like127.0.0.1.