How to Read an IPv4 Address: Octets, Classes, and Structure
A definitive engineering guide to dissecting IPv4 addresses. Learn how 32 binary bits translate into decimal octets, how routers distinguish the network ID from the host ID, and how modern CIDR superseded classful boundaries.
Quick Answer
An IPv4 address is a 32-bit binary number represented for human readability as four decimal octets separated by dots (e.g., 192.0.2.1). Each octet contains exactly 8 bits, with a decimal value between 0 and 255. The address is divided into two distinct components: a Network Prefix (which identifies the subnet) and a Host Identifier (which pinpoints the specific device).
- Total Address Space: Exactly 2^32 = 4,294,967,296 unique binary addresses.
- Octet Boundaries: Each octet corresponds to 1 byte (8 bits), ranging from 00000000 to 11111111 in binary.
- Subnet Mask Dependency: You cannot determine which part of an IPv4 address is the network versus the host without referencing its subnet mask or CIDR prefix length.
1. Anatomy of the 32-Bit Binary Structure
To understand an IPv4 address, you must look underneath the decimal notation to the underlying binary stream. When a computer transmits data across Ethernet or Wi-Fi, it processes raw bits (zeros and ones).
Consider the common address 192.168.1.1. Here is how it is structured at the hardware layer:
Because each position in an 8-bit byte represents a power of two (128, 64, 32, 16, 8, 4, 2, 1), adding the active bits produces the familiar decimal representation:128 + 64 = 192.
2. Network Portion vs. Host Portion
An IPv4 address functions similarly to a traditional telephone number. In a phone number, the country and area codes represent the geographic region, while the remaining digits identify the individual subscriber. Similarly, an IPv4 address contains:
- Network ID: Assigned to the common broadcast domain or router interface. All devices on the same physical or virtual LAN share the exact same network prefix.
- Host ID: Uniquely assigned to an individual network interface card (NIC) within that specific subnet.
The boundary between the Network ID and the Host ID is determined strictly by the Subnet Mask or CIDR Prefix. For example, in 192.168.1.50/24, the /24 indicates that the first 24 bits (192.168.1) represent the network, while the final 8 bits (.50) represent the host.
3. Legacy Classful Addressing vs. Modern CIDR
When RFC 791 was standardized in 1981, IP addresses were categorized into five rigid classes based on their leading bits:
| Address Class | Leading Bits | First Octet Range | Default Mask | Total Usable Networks | Max Hosts per Net |
|---|---|---|---|---|---|
| Class A | 0... | 1 to 126 | 255.0.0.0 (/8) | 126 networks | 16,777,214 hosts |
| Class B | 10... | 128 to 191 | 255.255.0.0 (/16) | 16,384 networks | 65,534 hosts |
| Class C | 110... | 192 to 223 | 255.255.255.0 (/24) | 2,097,152 networks | 254 hosts |
| Class D | 1110... | 224 to 239 | N/A (Multicast) | Reserved for IGMP multicast streams | N/A |
| Class E | 1111... | 240 to 255 | N/A (Experimental) | Reserved by IANA for future/research | N/A |
By the early 1990s, the explosive growth of the web made Class B networks completely exhausted. A company needing 300 IP addresses was forced to obtain a Class B license (wasting 65,000 addresses). This crisis prompted the adoption of Classless Inter-Domain Routing (CIDR) in 1993, allowing variable subnet masking (/23, /25, /29, etc.).
IPv4 Address Octet Analysis Decision Tree
[ Inspecting an IPv4 String ]
|
+---------------+---------------+
| |
[ 4 Numeric Octets ] [ Invalid Format ]
e.g. 192.0.2.1 e.g. 192.168.1.300
| |
Check Range (0-255) Syntax Error (Exceeds 8 bits)
|
+----------+----------+
| |
[ Leading Octet 1-126 ] [ Leading Octet 192-223 ]
Class A Scope (/8) Class C Scope (/24)
Large Enterprise LAN Small Local LAN / Home Router
4. Practical Step-by-Step Command Verification
You can inspect your operating system's active IPv4 configuration using native terminal utilities:
# Windows (PowerShell)
Get-NetIPAddress -AddressFamily IPv4 | Select-Object IPAddress, InterfaceAlias, PrefixLength# Linux (Terminal)
ip -4 -br addr show# macOS (Terminal)
ipconfig getifaddr en0Frequently Asked Questions
Why are IPv4 octets limited to numbers between 0 and 255?
An IPv4 address consists of 32 bits divided into 4 groups of 8 bits each (called octets). Because 1 byte contains 8 bits, the binary values range from 00000000 (0 in decimal) to 11111111 (255 in decimal). Any number outside 0–255 (such as 192.168.1.256) is mathematically impossible in standard IPv4.
What is the practical difference between classful addressing and CIDR?
Classful addressing (RFC 791) historically assigned fixed boundary networks: Class A (/8), Class B (/16), and Class C (/24). This caused massive address waste. In 1993, Classless Inter-Domain Routing (CIDR, RFC 4632) replaced fixed classes with arbitrary prefix lengths (/1 through /32), allowing network engineers to split or aggregate subnets of any size.
How can I inspect my device's IPv4 address from the command line?
On Windows, open PowerShell or Command Prompt and run "ipconfig /all". On Linux, run "ip -4 addr show" or "ifconfig". On macOS, navigate to Terminal and run "ifconfig | grep inet" or inspect Network Settings in System Settings.
Data & Technical Sources
- IETF RFC 791 — Internet Protocol DARPA Internet Program Protocol Specification
- IETF RFC 4632 — Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan
- IANA IPv4 Address Space Registry — Authoritative IPv4 allocation registry